01 / 13
System Design Fundamentals

Chapter 2 ·
Back-of-the-Envelope
Estimation

Order-of-magnitude reasoning for capacity, latency, storage and bandwidth — the napkin math every systems engineer needs at their fingertips.

A Visual Primer · 13 Slides
DAU × actions × payload
02 / 13
02 · Motivation

Why estimate at all?

A back-of-the-envelope estimate is not a forecast — it is a feasibility check. It tells you in seconds whether a design is roughly sane, whether you need one box or one thousand, and where the real bottleneck is likely to live.

In interviews

Show your reasoning

Interviewers care less about a precise answer than about whether you can decompose a vague problem into numbers — users, requests, payload, replication — and reach a defensible total without panic.

In production

Right-size the design

Before writing a design doc, a 10-minute estimate prevents both costly over-provisioning and embarrassing under-provisioning. It also surfaces the dimension that will dominate cost: storage, egress, or compute.

In planning

Catch infeasibility early

If a rough sketch already needs 80 petabytes of RAM or 4 Tbps of egress, the design is wrong — not the estimate. Better to learn that in a meeting than three sprints in.

In conversation

Build shared intuition

Numbers anchor arguments. "It feels slow" becomes "p99 is 240 ms but the budget was 80 ms" — and now the team can act on it.

03 / 13
03 · Building blocks

Powers of two — bytes to petabytes

Memorise these once and storage math becomes mental arithmetic. Binary prefixes (KiB, MiB) climb in 1024; decimal prefixes (KB, MB) climb in 1000 — the gap widens as the numbers grow.

210
1,024
Kilobyte · KiB
220
~1.05 M
Megabyte · MiB
230
~1.07 B
Gigabyte · GiB
240
~1.10 T
Terabyte · TiB
250
~1.13 Q
Petabyte · PiB
Binary vs Decimal

The 7 % drift

1 KB (decimal) = 1,000 bytes. 1 KiB (binary) = 1,024 bytes — about 2.4 % more. By the time you hit terabytes, binary units are roughly 10 % larger than their decimal cousins. For envelope work, the two are interchangeable; for billing and disks, they are not.

Working approximations

Round to one decimal

For mental math, treat 210 ≈ 103, 220 ≈ 106, 230 ≈ 109. The cumulative error after multiplying three of these is only a few percent — well inside the noise of a back-of-the-envelope answer.

04 / 13
04 · Speed of things

Latency numbers worth memorising

Commonly-cited orders of magnitude. Use them to spot designs that quietly assume the impossible — like "synchronously fan out to 50 services on the hot path."

OperationTime (approx)In nsRelative scale
L1 cache reference~0.5 ns0.5
Branch mispredict~5 ns5
L2 cache reference~7 ns7
Main memory (RAM) read~100 ns100
Compress 1 KB with a fast codec~3 µs3,000
Send 1 KB over a 10 Gbps NIC~1 µs1,000
SSD random read (NVMe)~100 µs100,000
Round-trip within a datacenter~500 µs500,000
HDD seek~10 ms10,000,000
Cross-region RTT (e.g. EU ↔ US-East)~80 ms80,000,000
Cross-continent RTT (e.g. EU ↔ APAC)~200 ms200,000,000
Mental shortcut

RAM is ~100× faster than SSD; SSD is ~100× faster than spinning disk; same-DC network is between RAM and SSD; cross-region adds tens of milliseconds you cannot optimise away. Light in fibre travels at roughly two-thirds of c — that is the floor for every cross-continent hop.

05 / 13
05 · Reliability

The nines and what they cost you

Each additional nine is roughly 10× harder. Past three nines, most outages come not from hardware but from deploys, config changes and human error — so the marginal investment shifts from redundancy to process.

AvailabilityAnnual downtimeMonthlyDaily
99 %  "two nines"~3.65 days~7.2 hours~14.4 min
99.9 %  "three nines"~8.77 hours~43.8 min~86 sec
99.95 %~4.38 hours~21.9 min~43 sec
99.99 %  "four nines"~52.6 min~4.3 min~8.6 sec
99.999 %  "five nines"~5.26 min~26 sec~0.86 sec
SLA composition

Nines multiply downward

A request that crosses three services each at 99.9 % has an effective ceiling of roughly 99.7 %. Every synchronous dependency taxes your headline number — caches, retries and graceful degradation are how you claw it back.

Watch the error budget

99.95 % monthly leaves ~22 minutes to burn. A single botched 10-minute deploy can consume half of it. Treat the budget as a real resource, not a vanity metric.

06 / 13
06 · Traffic

QPS — from users to per-second load

Start with the user count, then layer on behaviour and peakiness. Average QPS sizes your steady-state fleet; peak QPS sizes your worst-Tuesday-at-9pm capacity.

DAU Daily Active e.g. 5,000,000 × ACTIONS / USER / DAY Behaviour e.g. 20 reads ÷ SECONDS / DAY 86,400 ≈ 1×10⁵ = AVG QPS ~1,160 / s steady state ×3 PEAK ~3.5k/s
Peak-to-average

The 2× – 5× rule

Most consumer products see peak QPS between 2× and 5× the daily average. Pick a sane multiplier based on the traffic shape — a chat app peaks gently, a livestream catastrophically.

Read vs write

Split the verbs

Estimate reads and writes separately. Read:write ratios of 10:1 or 100:1 are common, and they imply very different storage, cache and replication strategies.

Headroom

Plan for 2× growth

Size the design for traffic 12–18 months out, not today's load. The cost of slightly over-provisioning is tiny; the cost of an emergency re-architecture is enormous.

07 / 13
07 · Storage

Storage = items × size × replicas × growth

Four multipliers, in that order. Skip any one and your estimate is off by an order of magnitude.

storage/year = items_per_day × avg_size × 365 × replication_factor × retention_years
Item size

Measure the median, plan for the tail

A "post" might average 400 bytes of text but carry a 2 MB image. Decompose: text, metadata, attachments, indexes. Add 20–30 % for serialization overhead and database internals you cannot see.

Replication

Multiply by 3 (or more)

Most distributed stores keep 3 replicas inside a region. Cross-region disaster-recovery copies push the factor to 4–6×. Erasure coding can claw some back at the cost of CPU and latency.

Growth

Compound, do not extrapolate linearly

If active users grow 20 % yearly and per-user content also grows, total storage grows multiplicatively. Three years of 1.5× growth is 3.4×, not 4.5×.

Hidden tax

Indexes, logs, backups

Indexes can add 30–80 % on top of raw data. Logs and audit trails often exceed the data they describe. Backups, depending on policy, multiply the whole figure again.

08 / 13
08 · Bandwidth

Bandwidth — QPS × payload, both directions

Throughput is the easy part. The catch is that ingress and egress are rarely symmetric, and cloud egress is what shows up on your bill.

egress_Bps = read_QPS × avg_response_size
ingress_Bps = write_QPS × avg_request_size
Convert carefully

Bytes vs bits, peak vs average

A NIC sold as "10 Gbps" delivers ~1.25 GB/s of payload — and far less once protocol overhead, encryption and TCP headroom are accounted for. Plan to use ~60 – 70 % of nominal capacity at peak.

Asymmetry in the wild

Egress dominates reads

A video service might ingest 1 MB per upload but stream 500 MB per view — a 500× asymmetry. A messaging app is closer to symmetric. A search engine is read-heavy but with tiny responses.

Where the bill hides

Cross-AZ and cross-region traffic

Bandwidth inside an availability zone is essentially free; across zones it costs cents per GB; across regions or out to the internet it costs many times more. Estimating egress separately by destination is what turns a sticker shock into a deliberate choice.

Sanity check

If your design implies sustained egress above ~40 Gbps per server, you are probably missing a CDN or an edge cache.

09 / 13
09 · Worked example

A timeline-style social feed

Imagine a microblogging product called Quill. We want to size storage, read QPS and egress for the home timeline.

Step 1 — Inputs
DAU = 40 M · posts/user/day = 0.5 · timeline reads/user/day = 30 · avg post = 350 B text + 80 B metadata
Step 2 — Writes per second
40e6 × 0.5 / 86,400 ≈ 230 posts/s avg. Peak ×3 ≈ 700 posts/s.
Step 3 — Reads per second
40e6 × 30 / 86,400 ≈ 13.9 k reads/s avg. Peak ×3 ≈ ~42 k reads/s.
Step 4 — Storage of raw posts
20 M posts/day × 430 B ≈ 8.6 GB/day · × 365 ≈ 3.1 TB/year.
Step 5 — With 3× replication + indexes
3.1 TB × 3 × 1.5 (indexes) ≈ ~14 TB/year of durable storage.
Step 6 — Timeline response size
Each timeline page = 20 posts × ~600 B (with JSON overhead) ≈ 12 KB/response.
Step 7 — Peak read egress
42 k reads/s × 12 KB ≈ ~500 MB/s ≈ 4 Gbps at peak, before images.
Conclusion
A modest fleet of feed-service nodes plus a hot-set cache for celebrity authors handles this comfortably. Storage grows ~14 TB/year — small. Read fan-out, not storage, is the design driver.
10 / 13
10 · Worked example

A photo-sharing service

Now a photo product called Pebble. Photos dominate storage and egress — the opposite shape from Quill.

Step 1 — Inputs
DAU = 8 M · uploads/user/day = 0.4 · views/user/day = 60 · avg photo = 1.8 MB (with thumbnails ×4 sizes, total ~2.4 MB)
Step 2 — Upload rate
8e6 × 0.4 / 86,400 ≈ 37 uploads/s avg. Peak ×4 ≈ ~150 uploads/s.
Step 3 — Daily new bytes
3.2 M uploads/day × 2.4 MB ≈ ~7.7 TB/day of raw + derived photos.
Step 4 — Annual storage, replicated
7.7 TB × 365 × 3 (replicas) ≈ ~8.4 PB/year. Plus ~10 % for metadata and indexes.
Step 5 — View rate
8e6 × 60 / 86,400 ≈ 5.6 k views/s avg. Peak ×4 ≈ ~22 k views/s.
Step 6 — Egress per view
Most views hit a feed-sized thumbnail (~180 KB); ~10 % open the full photo (~1.5 MB). Weighted avg ≈ ~310 KB/view.
Step 7 — Peak egress
22 k × 310 KB ≈ ~6.8 GB/s ≈ 55 Gbps. Way past a single origin — needs a CDN.
Conclusion
Storage is petabyte-scale (object store + tiering). Egress is dominated by reads (CDN with high hit ratio is mandatory). Upload path is small — a few dozen workers suffice.
11 / 13
11 · Pitfalls

Where envelope math goes wrong

1

Mixing up bits and bytes

10 Gbps is not 10 GB/s — it is 1.25 GB/s before overhead. Confusing the two yields answers off by 8×, more than any other single mistake.

2

Sizing for the average, not the peak

If your fleet is barely sufficient at the daily average, it is on fire at peak. Always carry a separate peak number through to the capacity answer.

3

Forgetting replication and indexes

Raw data is rarely what hits the disk. Three replicas, two secondary indexes and a backup easily multiply the raw figure by 8×.

4

Forgetting growth

"Today's storage" is not the design target. Size for the traffic you expect 18–24 months out, then add a comfortable buffer on top.

5

False precision

"4,728,193 QPS" is not more credible than "~5 M QPS" — it is less, because it hides the assumptions. Quote the rounded figure plus the inputs.

6

Ignoring the long tail

A few celebrity users or viral items can generate more load than millions of typical ones combined. Hot-key handling deserves its own line in the estimate.

12 / 13
12 · Discipline

Rules of thumb that keep you honest

Round liberally

One significant figure is plenty

"~50 k QPS" is the right precision for napkin work. Carrying four digits implies an accuracy you do not have and slows the math you need to do in your head.

Prefer ranges

Quote a low and a high

"Between 8 and 12 PB" admits uncertainty honestly and gives reviewers something to push on. A single number invites false debate over the last digit.

Sanity-check end-to-end

Compare to something real

If your answer says one machine handles 10 M QPS or that a region needs 50 PB of RAM, stop. Cross-check against published numbers or your own production telemetry.

Make assumptions visible

Write the inputs down

The estimate's value is the trail of assumptions, not the final number. Anyone should be able to change one input and re-run the math in 30 seconds.

North star

The goal is not the right answer to four decimal places. It is the right answer to within a factor of two, fast enough that you can ask "what if?" five times before lunch.

13 / 13
13 · Recap

Five principles to carry forward

01

Decompose, then multiply

Users × behaviour × payload × replication × growth. Every estimate worth doing is a chain of small, defensible multipliers.

02

Average sizes the fleet, peak sizes the headroom

Carry both numbers all the way through. They answer different questions and they cost very different amounts of money.

03

Memorise the powers of two and the latency ladder

Cache, RAM, SSD, disk, intra-DC, cross-region. Once these orders of magnitude are reflex, the rest of the math becomes fast.

04

Replication, indexes and growth are not optional

They are usually 5–10× the raw data figure. Skipping them is the single most common reason envelope estimates are wrong.

05

Round, range, and write down the assumptions

One significant figure, a low–high band, and a visible list of inputs. That is what makes the estimate useful instead of merely impressive.

Next chapter

Armed with these envelopes, we will start building real systems — load balancers, caches, replicated databases, and the trade-offs between them.

/ SPACE navigate  ·  F fullscreen  ·  HOME/END jump
📖 Read the lesson