System Design Foundations · Part 1 of 8
System Design 101: From One Server to Millions of Users
“A practical introduction to scaling a simple application into a reliable distributed system.”
System Design 101: From One Server to Millions of Users
System design is the process of deciding how the major pieces of an application work together.
You are not only choosing technologies. You are deciding:
- where data lives,
- how requests move through the system,
- what happens when something fails,
- how the application handles more traffic,
- which parts require strong consistency.
Start Simple
A new application can often begin with one backend and one relational database.
This is not bad architecture.
For an early product, simple architecture is usually easier to build, debug and operate.
Problems start when traffic increases.
The application server may become CPU-bound, the database may receive too many repeated queries, and the single machine can become a single point of failure.
A Typical Evolution
- Add a load balancer.
- Run multiple application instances.
- Keep application servers stateless.
- Add database indexes.
- Cache frequently requested data.
- Move slow work into background jobs.
- Add database replicas if reads become heavy.
- Add metrics, logs and tracing.
Do not add distributed infrastructure simply because large companies use it. Add complexity when a measurable requirement justifies it.
Start With Requirements
| Requirement | Question |
|---|---|
| Traffic | How many requests per second? |
| Storage | How much data will exist? |
| Latency | How quickly should requests respond? |
| Availability | How much downtime is acceptable? |
| Consistency | Can users temporarily see stale data? |
A payment ledger and a social-media feed have very different consistency requirements.
The Main Principle
Good system design is not about creating the largest diagram.
It is about building the simplest system that reliably satisfies the current requirements while leaving a reasonable path to scale later.