System Design Napkin Math
The latency numbers, constants, and powers of ten for back-of-the-envelope estimates.
Napkin math is estimating a system’s size, speed and cost to within a small factor, fast enough to rule designs in or out before anyone writes code. The method rarely changes: start from users or events per day, convert to per second, multiply by bytes per item and by the peak factor, then compare the result with what one machine, disk or link can do.
The numbers are deliberately rounded. What matters is the order of magnitude: a memory read is about 100 nanoseconds and a round trip across an ocean about 100 milliseconds, a million times apart.
Latency numbers every engineer should know
- L1 cache reference
- ~1 ns
- Branch mispredict
- ~3 ns
- L2 cache reference
- ~4 ns
- Mutex lock/unlock
- ~20 ns
- Main memory reference
- ~100 ns
- Send 1 KB over 1 Gbps
- ~10 µs
- SSD random read
- ~16 µs
- Read 1 MB from SSD
- ~0.2–1 ms, sequential (NVMe at 1–5 GB/s)
- Datacenter round trip
- ~0.5 ms
- Cross-AZ round trip
- ~1–2 ms within one cloud region
- Read 1 MB from HDD
- ~5–10 ms, sequential (100–200 MB/s)
- Disk seek (HDD)
- ~10 ms
- US coast-to-coast RTT
- ~70 ms
- CA ↔ Netherlands RTT
- ~150 ms
- Light in fiber
- ~200 km per ms, so 5 µs per km — a hard floor on distance
Throughput
- 1 Gbps link
- ≈ 125 MB/s
- 10 Gbps link
- ≈ 1.25 GB/s
- NVMe SSD, sequential
- ~3–7 GB/s (PCIe 4.0)
- SATA SSD
- ~550 MB/s — capped by the SATA interface
- HDD, sequential
- ~100–250 MB/s; random I/O only ~100–200 operations/s
- Redis, one core
- ~100K simple operations per second
Constants & conversions
- Seconds in a day
- ~86,400 (~10⁵)
- Seconds in a month
- ~2.6 million
- Seconds in a year
- ~31.5 million (~3×10⁷)
- Hours in a month
- ~730 — the unit cloud prices are quoted against
- 1M requests/day
- ≈ 12 per second
- 100M requests/day
- ≈ 1,200 per second
- 1B requests/day
- ≈ 12,000 per second
- Peak-to-average factor
- 2–10× (size for the spike)
- Read:write ratio (typical)
- often 100:1 — read-heavy
Powers of ten & two
- KB / MB / GB
- 10³ / 10⁶ / 10⁹ bytes
- TB / PB
- 10¹² / 10¹⁵ bytes
- 2¹⁰ ≈ 10³
- 1,024 ≈ 1,000, so 2²⁰ ≈ a million and 2³⁰ ≈ a billion
- 2³² ≈ 4.3 billion
- the uint32 limit — and the whole IPv4 address space
- 2⁶³ ≈ 9.2 × 10¹⁸
- the signed int64 limit; a nanosecond counter lasts ~292 years
- char ≈ 1 byte
- ASCII; UTF-8 up to 4
- token ≈ 4 chars
- rough LLM estimate
Data sizes
- int64 · timestamp
- 8 bytes each
- UUID
- 16 bytes binary, 36 characters as text
- IPv4 · IPv6
- 4 bytes · 16 bytes
- SHA-256 hash
- 32 bytes, 64 hex characters
- Embedding, 1536 dims
- ~6 KB as float32; 1M of them ≈ 6 GB before any index
- Phone photo (JPEG)
- a few MB
- 1 min of 1080p video
- ~50–100 MB at common streaming bitrates
Availability (nines) → downtime/year
- 99% (two nines)
- ~3.65 days
- 99.9% (three)
- ~8.8 hours
- 99.95%
- ~4.4 hours
- 99.99% (four)
- ~52 minutes
- 99.999% (five)
- ~5 minutes
- 99.9% per month
- ~43 minutes; 99.99% is ~4.3 minutes a month
- Serial dependencies
- availabilities multiply: 99.9% × 99.9% ≈ 99.8%
- Redundant pair
1 − (1 − a)²: two independent 99% replicas ≈ 99.99%
Capacity rules
- Little’s Law
- in flight = rate × latency: 1,000 req/s × 0.2 s = 200 concurrent requests
- Utilization ceiling
- queueing delay climbs steeply near 100% busy — plan peaks around 60–70%
- Replication
- 3 copies means 3× the raw storage, before indexes and overhead
- Daily growth
- × 365: 10 GB a day ≈ 3.65 TB a year
- Tail at scale
- a request touching 100 servers, each slow 1% of the time, is slow 63% of the time
- Cache hit rate
- 90% → 99% hits cuts backend load 10×, because misses drop from 10% to 1%
Where these numbers lie to you
- Sizing for the average
- The single most common napkin-math mistake — always multiply by the peak-to-average factor above, or your "comfortable" capacity falls over on launch day.
- 10⁵ vs 10⁶ seconds/day
- A day is
~86,400 s ≈ 10⁵, not 10⁶ — an easy off-by-10× if you round in your head. - KB is ambiguous
- Storage vendors mean decimal
10³ = 1,000; OS/memory tools mean binary2¹⁰ = 1,024. The gap compounds: about 7% at GB, 10% at TB and 13% at PB. - Nines don’t add linearly
- Going from 99.9% to 99.99% is not "10% better" — it is 10× less downtime. Each extra nine is an order-of-magnitude harder engineering problem, not an incremental one.
Worked example: a chat app with 10 million daily users
State the assumptions first: 10M daily active users, 40 messages each per day, about 300 bytes per message with metadata, 5 recipients per message on average, each user online 30 minutes a day, and a peak of 5× the average.
Messages: 10M × 40 = 400M/day ÷ 86,400 ≈ 4,600 writes/s (peak ≈ 23,000/s)
Deliveries: 400M × 5 = 2B/day ≈ 23,000/s (peak ≈ 116,000/s)
Storage: 400M × 300 B = 120 GB/day × 365 ≈ 44 TB/year
Replicated: × 3 ≈ 131 TB/year
Egress: 2B × 300 B = 600 GB/day ≈ 56 Mbps average
Online now: Little’s Law, 10M/day × 1,800 s ÷ 86,400 s ≈ 208,000 (peak ≈ 1M)
Now read the numbers, because the point is which resource runs out first:
- Bandwidth is a non-issue. 56 Mbps on average, about 280 Mbps at peak, fits inside one 1 Gbps link.
- Storage is the long-term problem. 131 TB a year means the message store shards from day one, keyed by conversation so a chat’s history lives on one shard.
- Open connections are the operational problem. Up to a million long-lived sockets need their own gateway tier, sized by connections per server, a number you measure under load.
- 23,000 writes a second at peak is the figure to compare with what one database primary sustains on your hardware; sharding by conversation spreads it too.
Then ask which assumption would change the answer most. Photos would: if just 1% of messages carry a 2 MB image, that adds 400M × 1% × 2 MB = 8 TB a day, about 67× the text volume. Media then moves to object storage behind a CDN, and the message rows only hold a link to it.
Recipes
Load and storage for a URL shortener
New links: 100M per month ÷ 2.6M s per month ≈ 40 writes/s (peak ×3 ≈ 120/s)
Reads: 100:1 read-heavy ≈ 4,000 reads/s (peak ≈ 12,000/s)
Row size: ~500 bytes (URL, short code, metadata)
Storage/year: 100M × 12 × 500 B ≈ 600 GB
With 3 copies: ≈ 1.8 TB
Cache: a small hot set takes most reads → cache recent and popular linksOne database node handles the writes easily; the read rate is what calls for a cache, and the data fits on a single large disk even after replication.
Bandwidth for a video feature
Viewers: 1M a day, 20 minutes each
Bitrate: ~5 Mbps for 1080p
Per viewer: 5 Mbps × 1,200 s ÷ 8 = 750 MB
Daily egress: 1M × 750 MB = 750 TB
Average rate: 750 TB ÷ 86,400 s ≈ 8.7 GB/s ≈ 70 Gbps (peak ×3 ≈ 210 Gbps)Egress at this scale belongs on a CDN; even at an assumed 1–2 cents per GB, 750 TB a day costs $7,500–$15,000 daily.
How many servers for 10,000 requests per second?
Load: 10,000 req/s average, peak ×3 = 30,000 req/s
CPU per req: 50 ms (measure this)
Per core: 1 s ÷ 50 ms = 20 req/s
Peak cores: 30,000 ÷ 20 = 1,500 cores
Headroom: run at ~60% → 2,500 cores ≈ 80 servers of 32 coresCPU time per request is the input worth measuring. Little’s Law agrees: 30,000 req/s × 0.05 s means 1,500 requests in flight, one per busy core.
Turn nines into a downtime budget
SLO: 99.9% per month
Budget: 0.1% × 43,200 min = 43 minutes a month
Dependencies: app 99.95% × database 99.95% × cache 99.99% ≈ 99.89%
Verdict: the dependencies alone already exceed the budgetSerial dependencies multiply, so a system is always less available than its weakest part; redundancy or graceful degradation is what buys the nines back.
When to use it, and when not
Use napkin math at the start of a design, in an interview, when reviewing someone else’s proposal, and when a cloud bill looks wrong. It tells you which resource runs out first (CPU, memory, disk or network) and whether you need one machine or a hundred.
Do not stop at napkin math when:
- the answer lands within 2× of a limit: a load test decides, not a rounded constant;
- you need tail latency: averages and Little’s Law say nothing about the slowest 1% of requests;
- money is on the line: use the provider’s current price sheet, not a remembered rate;
- the exact hardware matters: the latency table is order-of-magnitude, and each generation shifts the values.
Trade-offs and limits
| Shortcut | Exact | What it costs |
|---|---|---|
| a day ≈ 10⁵ s | 86,400 s | per-second rates come out 14% low |
| a month ≈ 2.6M s | 2.59M (30 days) to 2.63M (average month) | about 1% |
| 2¹⁰ ≈ 10³ | 1,024 | 2.4% per step: 7% at GB, 10% at TB, 13% at PB |
| peak = 2–10× average | depends on the traffic | a 5× spread, often the biggest uncertainty |
Rounding errors are tens of percent; a wrong guess about users, peak factor or item size is often 10×. Spend your care on the assumptions, write them down where everyone can see them, and round the arithmetic freely.
Common mistakes
- Bits versus bytes. Links are quoted in bits per second, disks and files in bytes. A 1 Gbps link moves 125 MB/s, not 1 GB/s: an 8× error.
- Forgetting replication and overhead. Raw data × 3 replicas, plus indexes, plus free space so disks never run full. The 44 TB a year above is 131 TB before any index.
- Counting one round trip for a new connection. A fresh HTTPS request needs a TCP handshake (1 RTT), a TLS 1.3 handshake (1 more; TLS 1.2 needs 2) and the request itself: 3 round trips, about 450 ms across an ocean.
- Sizing random I/O by throughput. An HDD streams 200 MB/s but manages only ~100–200 random reads a second. A million random 4 KB reads moves just 4 GB, yet takes about 2 hours.
- Counting calls instead of the chain. Five backend calls of 20 ms each cost 100 ms when made one after another, but about 20 ms plus the slowest one’s tail when made in parallel. Latency follows the longest chain of dependent steps, not the number of calls.
- False precision. Writing 4,629.63 requests per second from inputs guessed to one significant figure hides how rough the estimate is. Say “about 5,000” and move on.
Check yourself
50M daily users make 20 requests each, with a 3× peak. What are the average and peak request rates?
50M × 20 = 1B a day ÷ 86,400 ≈ 11,600/s average, about 35,000/s at peak.
How long does copying 2 TB take over a 1 Gbps link, and over 10 Gbps?
1 Gbps ≈ 125 MB/s, so 2e12 ÷ 125e6 = 16,000 s ≈ 4.4 hours. At 10 Gbps, about 27 minutes, assuming the disks on both ends keep up.
A service handles 5,000 requests/s with an average latency of 80 ms. How many requests are in flight?
Little’s Law: 5,000 × 0.08 = 400 concurrent requests, which is what connection pools and thread counts must hold.
You need a million random 4 KB reads. Roughly how long on one HDD, and on one NVMe SSD issuing them one at a time?
HDD at ~150 random reads/s: 1M ÷ 150 ≈ 6,700 s, about 2 hours. NVMe at ~16 µs each: about 16 s, and far less when requests run in parallel.
Questions about System Design Napkin Math Cheat Sheet
What are the latency numbers every programmer should know?
They are a list, popularized by Jeff Dean and Peter Norvig, of how long common operations take, rounded to orders of magnitude: an L1 cache hit about a nanosecond, a main memory reference about 100 nanoseconds, a random SSD read tens of microseconds, a round trip inside a data center about half a millisecond, a disk seek around 10 milliseconds and a round trip across an ocean around 150 milliseconds. Exact values shift with each hardware generation, but the gaps between the tiers barely change, and those gaps are what shape system design.
How do you do back-of-the-envelope calculations in a system design interview?
State your assumptions out loud, round aggressively and work in powers of ten. Start from daily active users and actions per user, divide by roughly 100,000 seconds per day to get average requests per second, then multiply by a peak factor of two to ten. Multiply by bytes per request or record for bandwidth and storage, and by replication and retention for totals. Compare each result with what one server, disk or network link can handle to decide what needs sharding, caching or a CDN. Interviewers care about the reasoning far more than the digits.
How much downtime is 99.99% availability?
About 52.6 minutes per year, or roughly 4.3 minutes per month. Each additional nine cuts the allowed downtime by a factor of ten: 99% allows about 3.65 days a year, 99.9% about 8.8 hours, 99.99% about 53 minutes and 99.999% about 5.3 minutes. Dependencies in series multiply, so a service built on three components that each offer 99.99% can promise at most about 99.97% unless it adds redundancy, and planned maintenance usually counts against the budget too.