No history yet

System Design Fundamentals

What is System Design?

System design is the process of creating a blueprint for a software system. Think of it like an architect designing a house. Before construction begins, the architect creates detailed plans that show where the rooms go, how the plumbing works, and what the electrical layout is. Without this plan, you'd end up with a chaotic, unstable structure.

In the same way, system design maps out the components of a software application and how they interact. It answers questions like: Where will we store data? How will different parts of the system communicate? What happens if one component fails? A good design ensures the final product is reliable, efficient, and easy to maintain.

System design aims to design scalable, reliable and maintainable systems.

People often use the terms system design and software architecture interchangeably, but they have a subtle difference. Software architecture is the high-level, foundational structure of the system. It’s like deciding you're building a two-story colonial house. System design gets into the specifics, like the layout of the kitchen, the type of wiring to use, and the placement of support beams. Architecture is the what, and design is the how.

Measuring Performance

To build a high-performing system, we first need to know how to measure performance. Two of the most important metrics are latency and throughput.

Latency

noun

The time it takes for a single request to travel from a client to the system and back again. It's a measure of delay.

Imagine you’re ordering a pizza online. Latency is the total time from when you click “place order” to when you get the confirmation message. A system with low latency feels snappy and responsive.

Throughput

noun

The number of requests a system can handle in a given amount of time. It's a measure of capacity.

In our pizza example, throughput is the total number of orders the pizza shop can process in an hour. A system with high throughput can serve many users at once without slowing down.

Latency measures how fast a system responds to a single request. Throughput measures how many requests it can handle over time. They are related, but optimizing for one can sometimes negatively impact the other.

Handling Growth

What happens when your small application suddenly becomes a huge hit? If it wasn't designed to handle a massive increase in users, it will slow down or crash. The ability of a system to handle a growing amount of work is called scalability. There are two fundamental ways to scale a system.

Vertical scaling, or scaling up, means making your existing hardware more powerful. It’s like trading in your laptop for a supercomputer. You might add a faster CPU, more RAM, or a larger hard drive to a single server.

Lesson image

Horizontal scaling, or scaling out, means adding more machines to your system. Instead of one supercomputer, you use a network of many regular computers that work together. When traffic increases, you just add more servers to the network.

Key takeaway: Design systems to scale horizontally for long-term growth, and understand that vertical scaling has practical limits.

FeatureVertical Scaling (Up)Horizontal Scaling (Out)
MethodAdd more power (CPU, RAM) to one machineAdd more machines to the system
ComplexityRelatively simple to implementMore complex, requires load balancing
CostCan become very expensive quicklyGenerally more cost-effective at large scale
LimitHits a physical limit; a single machine can only be so powerfulCan scale almost infinitely by adding more machines

The CAP Theorem

When you design a distributed system—one that runs on multiple machines—you have to make some tough trade-offs. The CAP theorem, a fundamental principle in this field, states that it is impossible for a distributed data store to simultaneously provide more than two of the following three guarantees.

  1. Consistency: Every read receives the most recent write or an error. When you ask any machine for a piece of data, you get the same, up-to-date answer.

  2. Availability: Every request receives a (non-error) response, without the guarantee that it contains the most recent write. The system is always up and running, ready to respond.

  3. Partition Tolerance: The system continues to operate despite an arbitrary number of messages being dropped (or delayed) by the network between nodes. This means if the network connecting your servers gets disrupted, the system still functions.

In modern distributed systems, network partitions are a fact of life, so you must design for partition tolerance. This means you are forced to choose between consistency and availability. You can build a CP system (consistent and partition-tolerant) or an AP system (available and partition-tolerant). You can't have all three.

Do you need your system to always have the absolute latest data (consistency), or is it more important that it's always online to answer requests, even if the data is slightly stale (availability)? This is a core trade-off in system design.

Quiz Questions 1/6

What is the primary purpose of system design in software development?

Quiz Questions 2/6

How does system design differ from software architecture?

These fundamental concepts—performance metrics, scaling strategies, and the CAP theorem—form the foundation of good system design. Understanding them is the first step toward building applications that are robust, efficient, and ready for growth.