Book Deep Read · System Design Interview Vol 1 · Ch 2
System Design Interview: An Insider's Guide · Vol 1 · Ch 2 · Alex Xu · 2020
Before a move, you don't weigh each box. You take one look and ask: will all of this fit in a small van? That look costs three seconds, and it decides which phone call you make today. This chapter teaches the engineer's version of that look: before building anything, use a few rough numbers to work out whether the job is a small-van job or a fleet-of-trucks job.
This chapter never produces a precise answer. Every number it computes is guessed, rounded, and shrugged at. And yet it is one of the most useful chapters in the book. Because what shapes an architecture is never "3,512 or 4,108" — it is "three thousand or three million". Those are two different worlds, and they should not be built the same way.
Teams that skip this step reliably fall into two opposite holes.
Overestimating. The product has barely any users, but the team has already built out heavy machinery for the size it imagines it will one day be. Half a year later, most of the effort has gone into maintaining that machinery, and the product itself has hardly moved.
Underestimating. The plan sounds fine, and then it ships — and it turns out the thing you need to store is not "buy a bigger drive" sized, it is "fill a warehouse" sized. By the time anyone notices, the only fixes left are the expensive, painful ones.
Both holes share one cause: nobody spent three minutes writing the rough quantities on paper before starting.
1. Keep a few rulers in your head. A cook doesn't need a measuring cup to know roughly what a pinch of salt is. An engineer needs the same instinct for a few everyday quantities: fetching something from memory is "a blink", walking down to the garage for it is "a trip", and posting it to the far side of the planet and back is "an international parcel". The gaps between those three are enormous — remember the gaps, and many designs can be ruled out without any arithmetic at all.
2. Write your assumptions down. The real output of an estimate is not the number, it is the list underneath it: how many people use this, how often each day, how much each use leaves behind, how long it is kept. Written down, someone else can point at one line and say "I disagree with that one" — and the discussion turns from guesswork into "change that line and run it again".
3. Round hard, and only trust the order of magnitude. Round the awkward numbers to clean ones before you start, and read only which bracket the result lands in. This isn't laziness: your inputs were guesses to begin with, and running guessed inputs through precise arithmetic just gives you a very precise wrong answer.
One step gets skipped more than any other: after the average, always ask what the busiest moment looks like. A restaurant that sets out chairs for its all-day average will collapse at noon. In the real world the busiest instant is often dozens of times the average, not "a bit more".
One honest cost: this method only tells you which bracket you are in. It can never answer "will it actually hold?" — only really pushing load through it can.
Estimation isn't about being right. It's about ruling out the obviously impossible in three minutes. Write the assumptions, round hard, read the order of magnitude — then ask one more question: what about the busiest moment?
Want the mechanisms, the numbers and the diagrams? → Switch to the deep read
You think this chapter teaches you to get the numbers right. What it actually teaches is how to compress an open-ended question into an order of magnitude using a chain of assumptions you say out loud. The deliverable was never the number — it is a chain anyone in the room can knock down on the spot. Being off by 2× costs you nothing; being off by 1000× means your whole architecture rests on a false premise.
99.99%.p99 is the 99th-slowest out of a hundred — how long that unlucky one waited.This is the second chapter of Part I, "the method and the basics", wedged between two others: Ch1 gives you the parts and the order to install them (add a cache, add replicas, shard…), and Ch3 gives you the interview process (clarify → high-level design → deep dive → wrap up). Ch2 supplies the piece in between — how you decide which step you are actually at. It is the shortest chapter in the book, and it is the fixed opening move that all twelve later case studies (rate limiter, URL shortener, YouTube, Google Drive…) re-run from scratch.
An interviewer says "design an X", and the second sentence is almost always "roughly how many users, how much data?". That isn't a trap. It's because architecture is meaningless without a scale attached: the same feature at ten thousand requests a day and at ten billion requests a day has completely different right answers — one machine and a database for the first, sharding and multi-region object storage for the second.
What happens without an estimate? Both directions fail, and both are common. Overshoot: five thousand users, but the team has already sharded the database and gone multi-region, so most of the engineering time goes into infrastructure — and sharding is close to irreversible. Undershoot: the design review says "we'll put it in the database", and after launch it turns out to be 30 TB of new data per day. That isn't a bigger disk; that's rebuilding the storage layer.
The subtler third failure is estimating only the average. A service with 1M DAU and 10 requests per user per day averages about 116 QPS — sounds trivial. But traffic is never flat, and 8pm may be several or several dozen times the mean. A system sized to the average is guaranteed to fail at the exact moment it matters most.
So the chapter builds exactly one skill: given a few assumptions about user behaviour, get QPS, storage and bandwidth right to an order of magnitude — on a whiteboard, in three minutes, without a calculator.
Estimating storage is always the same multiplication: size of one record × records per day × days retained. So the first requirement is converting data units in your head. The book's reference points are plain: an ASCII character is 1 byte; 2^10 ≈ a thousand, i.e. 1 KB; 2^20 ≈ a million, 1 MB; 2^30 ≈ a billion, 1 GB; 2^40 is 1 TB; 2^50 is 1 PB.
Trivial-looking, but it turns straight into judgement. The book breaks a tweet down as: tweet ID 64 bytes + text 140 bytes + media 1 MB. Look at how lopsided that is: the text is two hundred bytes, the media is five thousand times larger. That single ratio hands you the whole storage strategy — text is free, media is the bill. Real systems put text in a database and media in object storage behind a CDN because of this ratio, not because of architectural fashion.
The second table is the soul of the chapter, and it comes from Google's Jeff Dean; the industry knows it as "latency numbers every programmer should know". The point isn't to recite it. The point is that when you hear a design, you immediately feel which order of magnitude it lands in.
The book reads five conclusions straight off this table, each one an actionable design rule: memory is fast, disk is slow; avoid disk seeks where you can; simple compression is cheap (1 KB costs 10 µs); compress before sending over the network; datacenters live in different regions and moving data between them takes real time.
Rules three and four combine into something very practical: compressing 1 KB costs 10 µs, a transcontinental round trip costs 150 ms — a factor of fifteen thousand. "Compress first, then send" is almost always worth it, and that isn't folklore; it's arithmetic you can do by putting two numbers side by side.
The third table converts the adjective "highly available" into concrete downtime. It matters because each additional nine typically costs exponentially more while buying you only a few more minutes a month — and you can only judge that trade once both sides are numbers.
Table 1 · Availability target ↔ allowed downtime (the book's table, four common tiers)
| Availability | Per day | Per month | Per year | Typically |
|---|---|---|---|---|
99% | 14.40 min | 7.31 hours | 3.65 days | Internal tools, non-critical batch |
99.9% | 1.44 min | 43.83 min | 8.77 hours | Default commitment for most SaaS |
99.99% | 8.64 s | 4.38 min | 52.60 min | Region-level SLA of major clouds |
99.999% | 864 ms | 26.30 s | 5.26 min | Telecom / payment core paths |
The insight is in the gap between the middle rows. Going from 99.9% to 99.99% buys you 39 minutes a month. Thirty-nine minutes is not enough for a human to be paged and restart something — which means it has to come from automatic failover, and therefore from redundancy, health checks and drills. The book notes explicitly that the major cloud providers (Amazon, Google, Microsoft) offer SLAs of 99.9% or above, and that an SLA is never 100%.
The book ties the method together with one example, with every assumption stated out loud: 300 million MAU; 50% use it daily; 2 tweets per user per day; 10% of tweets carry media; data retained for 5 years.
Unpacked, the traffic branch is two steps: 300M posts divided by the 86,400 seconds in a day is about 3,500 QPS; times two gives a peak of roughly 7,000 QPS. The storage branch is also two steps: 10% of 300M posts at 1 MB each is 30 TB per day; times five years is about 55 PB.
The value is in the last step — translating numbers into decisions. 7,000 QPS says one database won't do, but it is nowhere near "must shard" territory: a cache and read replicas cover it. And the moment 55 PB appears, "store media in the database" is off the table, object storage plus a CDN becomes the only sane answer, and cost overtakes performance as the binding constraint. Those two sentences are what the chapter exists to deliver.
That "× 2 for peak" step is the link in the chain most deserving of suspicion. Two is a convenient default, but the shape of a traffic curve is set by the business, not by a formula. Twitter's own published numbers show how wide the gap can get.
So the right move is not to swap in a bigger constant. It is to list the multiplier as an explicit assumption with a stated basis — "from our last twelve months of traffic, peak runs about 6× the mean". A justified 6× beats both an unjustified 2× and an unjustified 25×.
The chapter closes with three practical techniques. They look mundane; each blocks a specific class of mistake.
Rounding and approximation. No hard arithmetic on a whiteboard: treat 99987 / 9.1 as 100000 / 10. This is not sloppiness — your inputs were assumptions to begin with, and running low-precision inputs through high-precision arithmetic only produces a precise wrong answer.
Write down your assumptions. This is the most important of the three, because it changes what kind of conversation you are having. With the assumptions on the board, a review moves from trading guesses to "change daily-active from 50% to 20% and run it again". The output of an estimate is a re-runnable chain of reasoning, not a number. Interviews work the same way: interviewers rarely correct your arithmetic, and they almost always challenge your assumptions.
Label your units. Writing 5 means nothing; write 5 MB. The book calls this out separately because unit confusion — MB for Mb, per-day for per-second — is the most common and most lethal error in estimation. A single slip is worth a factor of 8, or of 86,400.
The book also lists the five estimates that come up most: QPS, peak QPS, storage, cache size, and number of servers. Those five cover the opening of essentially every "design an X" question.
The trade-off here isn't "which technology". It is "how precise is precise enough" and "which architecture tier does this magnitude imply".
Table 2 · The five common estimates: how to compute them, and where they go wrong
| Quantity | How to compute | Most common error | Ask this next |
|---|---|---|---|
| QPS | DAU × actions per user per day ÷ 86,400 | Using MAU where DAU belongs | What's the read/write ratio? |
| Peak QPS | QPS × peak multiplier (the book uses 2) | Multiplier far too small; ignoring bursts | What does the worst day look like? |
| Storage | Record size × records per day × retention days | Forgetting replication factor and index overhead | How is hot/cold data tiered? |
| Cache size | Hot fraction × total (often 20%, per the 80/20 rule) | Trying to fit the whole dataset in RAM | What hit rate are we targeting? |
| Server count | Peak QPS ÷ per-server QPS, plus headroom | Sizing at 100% utilisation, no redundancy | Do we survive losing a box? An AZ? |
Table 3 · Magnitude → what to do (tiers are common industry rules of thumb, not from the book; real thresholds vary widely with hardware and workload)
| Peak magnitude | Usually enough | Cost / precondition |
|---|---|---|
| Under ~100 QPS | One app server plus one database | No redundancy — one failure takes the site down |
| ~1,000 QPS | Load balancer + stateless app tier + read replicas | Another layer to operate; replication lag serves stale reads |
| ~10,000 QPS | Add a cache layer and a CDN; push slow work to a queue | Cache consistency window; a cache outage instantly floors the database |
| 100k+ QPS, or data past one machine | Shard; multi-region if needed | Near-irreversible: cross-shard joins, hot keys and resharding all get hard |
What Table 3 is really saying is not these particular numbers — it's that the magnitude → action mapping should exist in your head at all. The most convincing sentence in an interview or a design review is: "on my assumptions peak is around ten thousand, so at this tier a cache and read replicas are enough and I'm not going to shard yet." Whether the conclusion hangs off a number is the clearest line between a novice and someone who has done this.
This method earns its own chapter because it is the only tool that makes an open-ended question converge. Without a magnitude, "design a URL shortener" can run an hour. With one, the discussion collapses onto a few concrete constraints: 100:1 read/write, 10k peak QPS, 3 TB over five years. The items below are not the book's claims — they are what these companies and authors published themselves:
p99 latency of one second, a request that must fan out to 100 servers will exceed one second roughly 63% of the time. Confirms that estimating only the mean systematically understates the pain: the larger the system, the more the tail is what users actually experience.J. Dean & L. A. Barroso, "The Tail at Scale", CACM 56(2), 2013 ↗99.99% per region for EC2 deployed across two or more Availability Zones, with service credits when it is missed. Confirms that "nines" are not an adjective but a checkable, claimable commitment — and your own SLOs should be written the same way.Amazon Compute Service Level Agreement (official SLA page) ↗p99 to its users. The more a request fans out, the more the tail is amplified (see the 63% figure above).55 PB is the raw figure. Real clusters usually keep three replicas, plus indexes, metadata and scratch space — the purchase order tends to be two to three times the raw number. This is the most common and most expensive omission in the whole exercise.86,400. The book devotes a whole technique to labelling units, and it isn't being fussy.10 ms seeks). Today's NVMe SSDs do random reads in the hundreds of microseconds, compressing "disk is slow" by about two orders of magnitude. But the table's real value is the relative ordering — memory ≪ local disk ≪ same-datacenter network ≪ transcontinental network — and that ordering has not changed, because the last gap is set by the speed of light.1. The deliverable is not a number — it is a chain of assumptions anyone can knock down. Write them, and the discussion gains a fulcrum.
2. Aim for the right order of magnitude: round hard, no calculator. Precise arithmetic over guessed inputs just yields a precise wrong answer.
3. Know three tables cold: powers of two (capacity), latency numbers (Jeff Dean's), and the nines (availability).
4. What matters most in the latency table is the relative order: memory ≪ local disk ≪ same-datacenter network ≪ transcontinental (150 ms, floored by the speed of light).
5. A useful corollary: compress before sending across the network — 1 KB costs 10 µs, one transcontinental round trip costs 150 ms, a factor of fifteen thousand.
6. Going from 99.9% to 99.99% buys 39 minutes a month — too little for a human to intervene, so it must come from automatic failover. Each extra nine costs exponentially more.
7. Remember the whole flow via the Twitter example: assumptions → 300M posts/day → 3,500 QPS / peak 7,000 → 30 TB/day → 55 PB over five years.
8. The last step is the point: turn the magnitude into a decision (55 PB ⇒ media must live in object storage behind a CDN, and cost outranks performance).
9. Three disciplines: round, state assumptions, label units. One unit slip is worth a factor of 8 — or of 86,400.
10. Two things to read sceptically: don't copy the 2× peak multiplier (Twitter's was 25×), and don't forget the replication factor in storage.