The numbers you must memorise
Here's an uncomfortable truth: you cannot reason about a system you cannot estimate. If someone asks "will this design handle our traffic?" and you have no feel for how fast memory is versus disk versus the network, you're just guessing with confidence. The good news: you only need to internalise about a dozen numbers, and you need the orders of magnitude, not the exact digits.
Think of these the way you think of everyday distances. You know a walk to the shop is minutes, a drive across the city is an hour, a flight across the country is half a day. You don't know the exact metres — you know the scale, and that's enough to plan a trip. Same idea here.
| L1 cache reference | 1 ns |
| Branch mispredict | 3 ns |
| Main memory reference | 80 ns |
| Send 1 KB over 10 Gbps network | 1 µs |
| Compress 1 KB | 2 µs |
| NVMe SSD random read | 15 µs |
| Read 1 MB sequentially from memory | 20 µs |
| Read 1 MB sequentially from NVMe SSD | 150 µs |
| Round trip within same datacenter | 300 µs |
| Disk seek (spinning) | 5 ms |
| Round trip Mumbai → Virginia | ~180 ms |
To make the units human: a nanosecond (ns) is a billionth of a second, a microsecond (µs) is a millionth, a millisecond (ms) is a thousandth. If a memory read (80 ns) took one second in some slowed-down universe, a flash read would take about three minutes, and a round trip from Mumbai to a server in Virginia would take a month. That's the gap you're designing around.
Three consequences fall straight out of that table
- Memory is a couple of hundred times faster than flash, and flash is thousands of times faster than crossing an ocean. Each step down is a cliff, not a slope. This is why caching works: keeping an answer in memory instead of fetching it from disk or a faraway server isn't a small win, it's a two-orders-of-magnitude win. It's also why geography is a hardware problem — no clever code makes light travel faster. If your users are in India and your server is in Virginia, physics has already decided your minimum latency.
- Sequential beats random, everywhere. Reading data in order (like reading a book page by page) is dramatically faster than jumping around (like flipping to random pages). Disks, SSDs, and even memory all reward sequential access. This single fact explains why log-structured databases exist (Tier 3) and why batch processing is efficient.
- A cross-region round trip inside a request is a design smell. One 180 ms hop is survivable. Three of them in a row is 540 ms, and your user has already given up and switched apps. If your design chains long-distance calls, redesign it.
Estimation shortcuts — the napkin math
Interviews and design reviews both start with "how big is this, roughly?" Here are the shortcuts that let you answer in ten seconds:
- 1 million requests/day ≈ 12 requests/second on average. (There are 86,400 seconds in a day; round it to 100,000 and divide.) But traffic isn't flat — people sleep, lunch breaks spike — so peak is typically 2–5× the average. Design for peak, not average.
- 1 million users × 1 KB per user = 1 GB. Clean and easy. Scale it: 100 million users × 10 KB = 1 TB. Suddenly you can size storage in your head.
- Read:write ratios in consumer products are usually 10:1 to 1000:1. On social media, millions read a post; one person wrote it. Say your assumed ratio out loud, then design for it — a 1000:1 read-heavy system and a 1:1 balanced system need completely different architectures.
Worked example
"Design a photo app for 10 million daily users, each viewing 20 photos of 200 KB." Views: 10M × 20 = 200M/day ≈ 2,000/second average, call it 6,000/second at peak. Bandwidth: 6,000 × 200 KB = 1.2 GB/second at peak. That last number just told you something huge: this system's main cost is bandwidth, not computation, and you'll need a CDN (Tier 4) doing most of the serving. Thirty seconds of arithmetic shaped the entire design. That's the point.
Doing the arithmetic to three decimal places. Nobody cares whether it's 11.6 or 12 requests per second. They care whether it's 12 or 12,000, because those are different architectures. Precision signals you're missing the point; magnitude signals you get it.
The nuance
“Memory is about 100× faster than flash.”
The step-function framing is the useful mental model, but the real gap between a memory reference and an NVMe read is closer to 1000×. The lesson rounds toward the pattern rather than the measurement — quote the pattern, not the multiplier.
Going deeper
- Latency Numbers Every Programmer Should Know Jeff Dean / Peter Norvig
The original list these figures descend from. Worth seeing in its raw form, and worth noticing how much has changed since.