๐Ÿงฎ Estimation Cheatsheet (back-of-the-envelope)

Powers & time

  • 2^10 โ‰ˆ 1 thousand (KB), 2^20 โ‰ˆ 1 million (MB), 2^30 โ‰ˆ 1 billion (GB), 2^40 โ‰ˆ 1 trillion (TB)
  • 1 day โ‰ˆ 86,400 s โ‰ˆ 10^5 s. 1 month โ‰ˆ 2.5 ร— 10^6 s. 1 year โ‰ˆ 3 ร— 10^7 s
  • 1M requests/day โ‰ˆ 12 QPS average. Peak โ‰ˆ 2โ€“5ร— average (10ร—+ for flash sales)

Rough capacities (per node, order of magnitude)

ComponentThroughput
Stateless app server (simple API)1kโ€“10k RPS
PostgreSQL (simple indexed reads, good hardware)10kโ€“50k QPS; writes ~5kโ€“20k TPS
Redis100k+ ops/s
Kafka broker100s of MB/s
Single SSD100k+ IOPS
1 Gbps network~125 MB/s

Sizes

  • UUID 16 B ยท long 8 B ยท timestamp 8 B ยท typical row 100 Bโ€“1 KB ยท tweet ~300 B ยท image ~200 KBโ€“2 MB ยท 1 min video (720p) ~50 MB

Availability

SLADowntime/yearDowntime/month
99%3.65 days7.2 h
99.9%8.76 h43.8 min
99.99%52.6 min4.4 min
99.999%5.26 min26 s
Serial dependencies multiply: 99.9% ร— 99.9% = 99.8%.

Template

  1. DAU โ†’ actions/user/day โ†’ requests/day โ†’ รท10^5 โ†’ avg QPS โ†’ ร— peak factor
  2. Read:write ratio
  3. Storage = objects/day ร— size ร— retention (ร— replication factor 3)
  4. Bandwidth = QPS ร— payload
  5. Cache = 20% of hot daily data (80/20 rule)
  6. Servers โ‰ˆ peak QPS รท per-server QPS (+ headroom 30โ€“50%)

Latency numbers: see Optimization Principles.

๐Ÿงช Labs (๐ŸŸข warm-up โ†’ ๐ŸŸก core โ†’ ๐Ÿ”ด hard โ†’ โšซ boss)

  • ๐ŸŸข Daily 5-min Fermi drill (log it in the drill log)
  • ๐ŸŸก Estimate, then measure: Orbitโ€™s DB growth per 1M runs; tokens/day per tenant

๐Ÿง  Cognitive tasks

  • Explain which estimate actually changed a design decision (most donโ€™t!)

๐Ÿ›ฐ๏ธ Orbit integration

Go deeper

๐Ÿง  Cognitive Drills