Skip to content

Back-of-the-Envelope Estimation

Estimation is the skill of making reasonable guesses with simple math. You don’t need exact numbers — you need to be within an order of magnitude.


PowerValueApprox
101,0241 Thousand
201,048,5761 Million
301,073,741,8241 Billion
40~1 Trillion1 Trillion
UnitBytes
1 KB10³ (1,000)
1 MB10⁶ (1,000,000)
1 GB10⁹ (1,000,000,000)
1 TB10¹²

Latency Numbers Every Engineer Should Know

Section titled “Latency Numbers Every Engineer Should Know”
OperationTime
L1 cache reference0.5 ns
Branch mispredict5 ns
L2 cache reference7 ns
Mutex lock/unlock100 ns
Main memory reference100 ns
Compress 1 KB with Zippy10,000 ns = 10 μs
Send 2 KB over 1 Gbps network20,000 ns = 20 μs
Read 1 MB sequentially from memory250,000 ns = 250 μs
Round trip within same datacenter500,000 ns = 500 μs
Disk seek10,000,000 ns = 10 ms
Read 1 MB sequentially from network10,000,000 ns = 10 ms
Read 1 MB sequentially from disk30,000,000 ns = 30 ms
Send packet CA → Netherlands → CA150,000,000 ns = 150 ms

Memory is 1000x faster than disk. That’s why caching is so powerful.


Example — Twitter-like system with 500M MAU:

DAU = 50% of MAU = 250M
Assume each user tweets 1/day = 250M tweets/day
QPS = 250,000,000 / 86,400 (seconds in a day)
≈ 2,900 QPS average
Peak QPS = 2,900 × 5 (peak factor) ≈ 14,500 QPS

Example — Storing tweets for 5 years:

Tweet size ≈ 280 chars + metadata ≈ 500 bytes
250M tweets/day × 500 bytes = 125 GB/day
125 GB × 365 × 5 = ~228 TB over 5 years
Ingress = 125 GB/day = ~1.5 MB/s
Egress (serving) = 14,500 QPS peak × 500 bytes = ~7 MB/s peak

MetricRough Value
1 day86,400 seconds
DAU~30-60% of MAU
Peak load2-10× average
Text data per record100-500 bytes
Image per item100-500 KB
Memory cache hit rate90-99% for hot data

  • Estimation guides decisions (do you need 1 server or 100?).
  • Round aggressively — 1.4 → 1, 4.7 → 5.
  • If you can’t estimate a number, state your assumption clearly.

  • Round numbers aggressively — 1.2 million ≈ 1 million.
  • Memory is 1000× faster than disk. Disk is 1000× cheaper.
  • Peak QPS ≈ average QPS × 5 (for most apps).