System Design Concepts

Basic concepts of system design - Part I


Hi there! 👋 After diving into the world of app development and building some basic todo apps, you might find yourself asking, "How do the big boys do it?" Well, that's where System Design comes in.


As you start to admire the likes of Twitter, YouTube, and Uber, you realize there's a whole universe of system design out there, waiting to be explored.


To unravel the secrets, I have started learning the fundamentals of system design. This is the first of the lot to come on this topic. Read, Enjoy and shoot your feedback in the comments below 👇

System Design Basics

An ideal distributed system has 5 key characteristics 🎯

  1. Scalability 🚀
  2. Reliability 🛡️
  3. Availability ✅
  4. Efficiency ⏱️
  5. Manageability 👨‍💻

Scalability 🚀

The ability of a system, network, or service to grow and manage increased demand. 🌐

A system can have to scale due to 2 major reasons:

  1. Increase in the number of requests 📞
  2. Increase in the amount of work done to complete each request 🔄
When to Scale

Ideally for a performant system, it should distribute the tasks across all the participating nodes evenly. But some tasks could not be distributed, either because they are atomic in nature or there is some flaw in the system.

Horizontal vs Vertical Scaling

Horizontal Scaling: Adding more servers and distribute load 🖥️


Vertical Scaling: Add more CPU, RAM, Storage (Power) to the existing server. Has a limit of how far you can scale. Often involves downtime. ⏲️

VerticalVsHorizontal

Reliability 🛡️

If a system keeps delivering its services even when one or more of its software or hardware components fail, by replacing the failing machine or service with a healthy one.

To achieve reliability the system needs to have backup for both its software and data components. which are exact replica of the primary one. This is called redundancy, and it has its own cost. A reliable system has to pay that to achieve such resilience. 💰

Reliability

Availability ✅

Its the measure of the percentage of time that a system remains operational under normal conditions. 🌞

Availability takes into account maintainability, repair time, spares availability, and other logistics considerations. 🛠️

Reliability Vs. Availability 🛡️ vs ✅

If a system is available over time it is considered to be reliable. And for a system to be highly available over time, it has to available irrespective of the conditions, making the system more reliable. 🔄

Hence if a system is reliable, it is available. However, if it is available, it is not necessarily reliable

Consider an example of a car that functions ideally in a normal sunny weather, but breaks down in harsh conditions it would be considered as Available, but if it is functioning irrespective of the weather conditions, it would be a reliable machine.

AvailabilityVsReliability

Efficiency 💻

There are 2 standard parameters to measure efficiency.

  1. Delay to obtain the first item (latency) 🕰️
  2. Number of items delivered per unit time (bandwidth) 🚀

To measure bandwidth with the number of items delivered / second is a oversimplified metric. Since it ignores the impact of a lot of important metrics like network load, its topology and variations and a bunch of other factors. But it is quite difficult to quantify these metrics accurately. Hence we have to live by these rough estimations

Serviceability or Manageability 🛠️

It denotes the simplicity and speed with which a system can be repaired or maintained.

Thank You

Thank you for reading, I am writting more of such articles, keep an eye for those. And leave your questions and feedback in the comments down below 👇