Free preview

Standard Numbers Every Designer Should Know

Why this matters: effective planning requires knowing what workloads machines can actually handle. These two tables are the raw material for every estimate in this chapter — and for most estimates you will ever make in an interview.

Key takeaway

Learn the order of magnitude, not the digits. The gap between an L1 cache hit and a cross-country round trip is eight orders of magnitude, and essentially every design decision follows from knowing roughly where an operation sits on that scale.

Important latencies

Latency is the key factor in resource estimation. These are the numbers worth carrying in your head:

ComponentTime (nanoseconds)
L1 cache reference0.9
L2 cache reference2.8
L3 cache reference12.9
Main memory reference100
Compress 1 KB with Snzip3,000 (3 us)
Read 1 MB sequentially from memory9,000 (9 us)
Read 1 MB sequentially from SSD200,000 (200 us)
Round trip within same datacenter500,000 (500 us)
Read 1 MB sequentially from SSD at ~1 GB/sec1,000,000 (1 ms)
Read 1 MB sequentially from disk2,000,000 (2 ms)
Disk seek4,000,000 (4 ms)
Send packet SF to NYC (round trip)71,000,000 (71 ms)

Focus on the order-of-magnitude difference between components rather than the exact numbers. For example, IO-bound work (reading 1 MB sequentially from SSD) is roughly two orders of magnitude slower than CPU-bound work (compressing 1 KB of data).

Reading the table as ratios

The absolute numbers are hard to hold. The ratios are not:

L1 cache        1x
Main memory     ~100x slower than L1
1 MB from SSD   ~200,000x
Same-DC round trip  ~500,000x
Cross-country RT    ~79,000,000x

This is the same lesson as Chapter 1's fallacy of zero latency, now with the reference numbers attached. A cross-country round trip costs about 142x a same-datacenter round trip, which is why geographic placement of data is an architectural decision rather than an operational one.

Important rates

Beyond latency, throughput is measured as the queries per second a single server can handle:

QueriesQPS
QPS handled by MySQL1,000
QPS handled by key-value store10,000
QPS handled by cache server100,000 – 1 M

These are approximations. Real performance varies with query type (a point query versus a range query), machine specifications, database design, indexing, and server load.

Why the three tiers differ by 10x each

The progression MySQL → key-value store → cache is not arbitrary; each step removes work:

SystemTypical QPSWhat it does per requestWhy it's faster than the tier below
MySQL1,000Parse, plan, optimize, execute, possibly hit diskBaseline — query planning is real work
Key-value store10,000Hash the key, fetch the valueSimpler API (put/get) means no query planning
Cache server100,000 – 1 MIn-memory read or writeNo disk at all; read-dominated workloads go higher still

A key-value store serves an order of magnitude more queries because it has a much simpler APIput and get — versus a relational database that must plan a query before executing it. In-memory caches support read and write operations that are simpler still, and a cache used primarily for reading can serve even more requests per second.

Key takeaway

Treat these like the memory hierarchy: fix one number you trust — say 1,000 QPS for a relational database — and derive the rest from the order-of-magnitude relationships. You then only have to remember one number and two ratios instead of three independent facts.

Numbers worth deriving, not memorizing

A few more that fall out of the tables above and appear constantly:

QuantityValueHow to remember it
Seconds in a day86,400 (use 100,000)Rounding up costs ~15% and makes the division trivial
Seconds in a year~31.5 millionAbout pi times 10 million — genuinely close
Bytes to bitsx8Storage is bytes, network is bits. Forgetting this is an 8x error
1 million/day~12 per second1M / 86,400. A useful anchor for scaling any daily figure
1 billion/day~11,600 per second1,000x the row above

Interview signal by level

LevelWhat a strong answer sounds like
L4Knows memory is faster than disk, without magnitudes.
L5Uses the numbers: "a same-DC round trip is about 500 microseconds, so 50 sequential calls is 25 ms of pure network."
Staff+Reasons in ratios and knows the floors: "cross-country is ~71 ms and that's near the speed-of-light limit, so this is a data-placement problem, not a tuning problem. And 2,000 versus 1,000 QPS doesn't change my design — it's the same order of magnitude."

Next: why not all requests cost the same.

Enjoying the preview?

Create a free account to unlock the rest of this course, the in-browser judge, and live AI mock interviews.

Sign up free to continue