Skip to content

System design, from one server to staff level

Every big system started as one server.

Then it grew, and it broke in ways that are surprisingly predictable. Learn what breaks, why it breaks and how real engineers fixed it. Then take any problem statement, design the system yourself and defend every trade-off, at work or in an interview.

193 in-depth pages · 55 case studies · 12 real engineering deep dives · free, no sign-up

The story of one app

From 1 user to 100 million

Each step up breaks something new, and each fix is a chapter of this handbook. The user counts are rough; real limits depend on the workload.

  1. 1

    1 user

    What breaksNothing yet. One machine runs the web app and the database.

    The fixLearn what the pieces are and what a request actually does.

  2. 2

    10K users

    What breaksThe app and the database fight over the same CPU, memory and disk.

    The fixMove the database to its own machine and pick the right kind of store.

  3. 3

    100K users

    What breaksOne web server is full, and if it dies the whole site is down.

    The fixRun many stateless servers behind a load balancer.

  4. 4

    1M users

    What breaksThe same hot rows and images are read again and again; the database melts.

    The fixAdd a cache, read replicas and a CDN for static files.

  5. 5

    10M users

    What breaksWrites overflow one primary, and slow work (emails, video) blocks requests.

    The fixShard the data and push slow work onto queues.

  6. 6

    100M users

    What breaksUsers are far away, one region outage is a global outage, and nobody can see why things are slow.

    The fixGo multi-region, design for failure and measure everything.

Think first, then peek

Six questions that sound easy

Each one looks simple and hides a real design problem. Try answering before you open it.

Reads on your database are slow. Is a cache always the answer?

No. Check the query plan first: a missing index is often a 100x fix for free. A cache adds stale data and invalidation work, and helps little when data changes on every read or is rarely read twice.

The network times out after a payment went through. The client retries. How do you avoid charging twice?

Send an idempotency key with the request. The server stores the result under that key and returns the first result for any retry, instead of charging again.

A celebrity with 100 million followers posts. Do you write the post into every follower's feed?

Not for them. Push posts into feeds for normal accounts (cheap, fast reads), but pull huge accounts' posts at read time and merge them in. Most real feeds use this hybrid.

A thousand people press Buy on the last concert seat in the same second. Who gets it?

Exactly one person, if a single atomic step decides: a conditional write or a short-lived hold with a timeout. Everyone else sees the seat as taken. Checking first and writing later sells it twice.

Can a distributed database be always available and always consistent?

Not during a network split: each side must either refuse requests or answer with possibly stale data (CAP). Even with no split, stronger consistency costs latency (PACELC).

Fifty servers create short links at once. How do the codes never collide?

Give each server its own block of numbers from a counter and encode them in base 62. Seven characters already give about 3.5 trillion codes, with no collision checks.

One method for any problem

Four questions behind every design

Whether the prompt is a URL shortener or a payment network, the same four steps get you from a blank page to a design you can defend.

  1. 01 · AskWhat must it do?Turn a vague prompt into features, users and the qualities that matter: latency, availability, consistency.
  2. 02 · EstimateHow big is it?Rough math on traffic, storage and bandwidth tells you which parts will hurt.
  3. 03 · DesignWhat are the boxes?APIs, data model, services and storage, drawn simply, then deepened where the load is.
  4. 04 · DefendWhat did you give up?Every choice costs something. Name the trade-off and when you would choose differently.

Feel the speed

If an L1 cache hit took one second

Every design decision is a bet on these numbers. Stretch them to human time and it is clear why caches exist and why cross-ocean calls hurt.

  • L1 cache hit ~1 ns≈ 1 second
  • RAM read ~100 ns≈ under 2 minutes
  • NVMe SSD random read ~100 µs≈ about a day
  • Round trip in one data center ~0.5 ms≈ about 6 days
  • Round trip US to Europe ~90 ms≈ about 3 years

Bars use a log scale; each step is roughly 10x to 1,000x slower than the one before.

Design something real

Pick a system and build it end to end

Each case study goes from requirements and numbers to diagrams, data models, failure modes and what an interviewer will push on.

See all 55 case studies

How they actually did it

Lessons from real production systems

What did the engineers assume, what did they build, and what did they give up? Each deep dive reads a company's own engineering posts.

Where to begin

Pick a learning path

Every page starts with a plain explanation and an analogy, then goes deep in collapsible Deep Dives. Read as far as you need.

Everything in one place

The full roadmap

18 parts, from the basics to distributed internals, case studies and real company architectures.

  1. 01Start Here4
  2. 02Foundations10
  3. 03Networking & Communication8
  4. 04APIs4
  5. 05Databases & Storage14
  6. 06Scaling Data7
  7. 07Caching5
  8. 08Async, Messaging & Data Processing8
  9. 09Distributed Systems Internals11
  10. 10Architecture Styles8
  11. 11Common Design Patterns8
  12. 12Reliability & Resilience4
  13. 13Security3
  14. 14Observability, Deployment & Cloud7
  15. 15Key Technologies11
  16. 16Design Playbooks & Interviews14
  17. 17Case Studies55
  18. 18Engineering Blog Deep Dives12

Know what you are looking for?

Search every page, or press Ctrl+K anywhere.