📐 Back-of-the-Envelope

Estimation cheat sheet
System Design Interview · Ch.2
DAU daily active users — how many use it in a day
MAU monthly active users — the total user base
QPS queries per second — the request rate
peak the busiest second, ≈ 2–3× the average
RF replication factor — copies of each record stored
KB→PB data volumes, ×1000 at each step

Powers of two the ×1000 ladder

PowerValueUnit
2¹⁰1 ThousandKB
2²⁰1 MillionMB
2³⁰1 BillionGB
2⁴⁰1 TrillionTB
2⁵⁰1 QuadrillionPB

Availability each nine ÷10 the downtime

UptimePer dayPer year
99%14.4 min3.65 days
99.9%1.44 min8.77 hr
99.99%8.64 s52.6 min
99.999%864 ms5.26 min
99.9999%86.4 ms31.6 s

Latency numbers 2020 — memory fast · disk slow · distance is physics

L1 cache reference1 ns
Main memory reference100 ns
Compress 1 KB (Zippy)2 µs
Read 1 MB seq · memory3 µs
SSD random read16 µs
Read 1 MB seq · SSD49 µs
Round trip · same datacenter500 µs
Read 1 MB seq · disk825 µs
Disk seek2 ms
Round trip · CA ⇄ Netherlands150 ms

The equations

DAU= MAU × active%
avg QPS= (DAU × actions/day) ÷ 86,400
peak QPS= avg QPS × 2–3
storage= writes/day × size × 365 × yr × RF
bandwidth= QPS × payload size
cache= 20% × working set
servers= peak QPS ÷ per-box QPS

Shortcuts & traps

  • Seconds/day = 86,40010⁵ for a first pass.
  • 1M/day ≈ 10 QPS. Scale from there.
  • Peak is 2–3× avg, never equal to it.
  • Storage forgets replication — RF 3 triples it.
  • Label every unit. "5" is 5 KB or 5 MB?
  • KB (10³) ≠ KiB (2¹⁰) — know the gap exists.

Worked example Twitter — the book's own

300M MAU × 50% = 150M DAU  ·  ×2 tweets = 300M/day
QPS = 300M ÷ 86,400 = ~3,500  →  peak ×2 = ~7,000
media = 150M × 2 × 10% × 1 MB = 30 TB/day  →  × 365 × 5 yr = ~55 PB
Numbers: System Design Interview – An Insider's Guide, Ch.2 (Alex Xu) github.com/mhayk/system-design

One A4 page. Pin it above your desk; glance at it daily.