Planning how the parts of a software system fit together, so it works for millions of people.
System design is the work of planning how the parts of a software system fit together, so that it works well for many people.
Writing code answers: “How do I build this one feature?” System design answers a bigger question: “How do all the parts of the product work together when millions of people use it?”
A bad design may work for 100 users and fall apart for 100,000. A good design saves time, money and sleep.
You use system design any time many users, much data or many parts are involved.
Most systems are built from the same small set of building blocks. Learn these blocks and you can design almost anything.
| Quality | Easy question it answers |
|---|---|
| Scalability | Can it grow with more users? |
| Availability | Is it up when I need it? |
| Reliability | Does it give correct answers, even when parts fail? |
| Latency | How long does one request take? |
| Consistency | Do all users see the same data? |
| Cost | Can we afford to run it? |
In an interview or at work, you can follow the same steps every time.
| Term | Meaning in easy words |
|---|---|
| Requirement | Something the system must do or be (like “load in under 1 second”) |
| Functional requirement | A feature: what the system does (post a photo, send a message) |
| Non-functional requirement | A quality: how well it does it (fast, always up, secure) |
| Component | One part of the system, like a server or a database |
| Trade-off | Getting one good thing by giving up another |
| Bottleneck | The slowest part, which limits the whole system |
| Load | The amount of work: users, requests, data |
| Architecture | The overall shape of the system and how parts connect |
| HLD / LLD | High-level design (big picture) and low-level design (inside one part) |
| Back-of-the-envelope | A quick rough calculation to get the size of the problem |
These are general ideas about how well-known products think about design. The real details inside each company are more complex.