What it is
System design is the work of deciding which components a software system is made of (servers, databases, caches, queues, load balancers), how they talk to each other, and where data lives, so that the system meets its requirements. Code design asks how to structure one program; system design asks how many programs there are, on how many machines, and what happens when one of them is slow or gone.
Why it exists
A single program on a single machine is enough for many products, at first. It stops being enough when the requirements outgrow it: more users than one machine can serve, a promise to stay up when hardware fails, users on other continents who need fast answers, or data too large for one disk. At that point there are many possible architectures, each with different costs. System design is how you choose one deliberately instead of by accident.
How it works
The work tends to follow a loop:
- Clarify requirements. Functional requirements list what the system does (upload a photo, show a feed). Non-functional requirements state how well: latency targets ("P95 under 200 ms"), availability ("99.9%"), expected load and growth, durability, consistency, cost and compliance. The second list drives the architecture.
- Estimate. Rough numbers turn vague goals into constraints: requests per second at peak, data size per year, read/write ratio. They tell you whether one database will do or whether you need to partition.
- Sketch a simple design. Start with the fewest components that meet the functional requirements.
- Find the bottleneck. Ask which component runs out first as load grows or which failure takes everything down.
- Apply a building block. A load balancer and more servers for compute, a cache for repeated reads, replicas for availability and read scale, a queue to absorb bursts, sharding for data that outgrows one machine.
- State the trade-off and repeat. Each block removes one limit and adds a cost; the next bottleneck is somewhere else.
The lesson's simulation runs this loop once: one server saturates, three servers behind a load balancer fix that, the shared database becomes the limit, and a cache relieves it.
When to use it
Any time the system's qualities matter as much as its features: before building something expected to grow, when an existing system is slow or fragile, when adding a feature that changes load patterns (a feed, search, notifications), and in technical interviews, which use it to see how you reason about trade-offs.
When not to
Do not design for scale you do not have. A prototype or an internal tool with a few hundred users is usually best served by one server and one managed database. Every extra component costs money, has failure modes of its own and must be understood by whoever is on call. Design for the next order of magnitude, not the next three, and keep the option to change later.
Trade-offs
| Decision | You gain | You pay |
|---|---|---|
| More servers behind a load balancer | Capacity, tolerance of a server failure | A balancer to run, servers must be stateless |
| A cache in front of the database | Lower latency, less database load | Possibly stale reads, invalidation logic, another component |
| Database replicas | Availability, read capacity | Replication lag, failover complexity |
| A message queue | Absorbs bursts, decouples services | Asynchronous flows are harder to reason about and debug |
| Splitting into services | Independent deploys and scaling | Network calls, partial failures, distributed data |
Alternatives
There is no alternative to designing; there is only designing explicitly or implicitly. The real choice is how much to design up front. Some teams sketch a full target architecture early; others grow one incrementally, refactoring when measurements show a limit. Most do a mix: decide early the things that are expensive to change (data model, partitioning key, consistency guarantees) and defer the cheap ones (number of servers, cache placement).
Failure modes
- Designing for the wrong requirement. Optimising latency when the real problem is availability, or the reverse.
- Over-engineering. Microservices, queues and multi-region setups for a product with no users yet. The complexity slows every change.
- Ignoring the shared component. Scaling the stateless tier while every request still lands on one database.
- No numbers. Without estimates, "it will scale" is a guess.
- Hidden single points of failure. A redundant app tier that depends on one DNS provider, one database or one region.
In production
Real designs are shaped by constraints a whiteboard leaves out: budget, the team's experience, existing systems, compliance, and the operational cost of every component. Managed services (databases, queues, load balancers) remove much of that cost and are usually the right default. Designs are revisited when metrics show a limit approaching, ideally before users feel it, which is why monitoring of latency, error rate and saturation is part of the design, not an afterthought.
Common misconceptions
- "System design is only for huge companies." Any system with users has a design; small ones just have simple designs.
- "There is one correct architecture." There are several reasonable ones; the right one depends on the requirements and the constraints.
- "Adding servers fixes performance." Only when servers are the bottleneck. If the database is saturated, more servers add load to it.
- "A design is finished once it is drawn." Load, features and teams change; the bottleneck moves with them.
Interview angle
Interviewers want to see the loop, not a memorised diagram. Start by asking about requirements and scale, write down a few numbers, sketch a simple design, then improve it by naming bottlenecks and failure modes yourself. For each component you add, say why and what it costs. Saying "this cache means a user may see a profile picture up to 60 seconds old; that is acceptable here" scores better than drawing the cache without comment.
Model assumptions
The simulation is a simplified model, not a benchmark. Each app server has 8 workers and spends about 20 ms per request plus one database query; a worker waiting for the database stays busy. The database has 6 connections and about 25 ms per query (lognormal times). Network hops take a fixed 1–25 ms. The cache answers a fixed 80% of lookups in about 2 ms; there is no staleness or eviction in this model. Arrivals are random (Poisson). Utilisation is the share of busy workers or connections, not CPU. Numbers show behaviour and orders of magnitude only.