Orientation20 min readยท Topic 0.6

Back-of-envelope estimation basics

Powers of 10, latency numbers every engineer should know, throughput and storage estimates, QPS calculations

๐Ÿ”ขKey Takeaways

  • 1
    Estimation is about getting the right order of magnitude, not exact numbers
  • 2
    Key numbers: 1 day โ‰ˆ 100K seconds, 1 million requests/day โ‰ˆ 12 QPS
  • 3
    Always estimate: QPS, storage, bandwidth, and number of machines needed
  • 4
    Round aggressively โ€” 86,400 seconds becomes 100,000 for mental math

Why Estimation Matters

In system design interviews and real-world architecture, you need to quickly estimate whether a single database can handle the load or if you need sharding, whether data fits in memory or needs disk storage, and how many servers you need.

The goal isn't precision โ€” it's getting within the right power of 10. If you calculate 50K QPS and the real answer is 70K, that's fine. If you calculate 500 QPS when it's really 50K, that's a critical miscalculation.

Numbers Every Engineer Should Know

Latency / throughput reference card
OperationTimeNotes
L1 cache reference~1 nsOn-chip, fastest memory
L2 cache reference~4 nsOn-chip
Main memory reference~100 nsRAM access
SSD random read~16 ยตsNVMe SSD
HDD seek~2 msMechanical disk
Same-datacenter roundtrip~0.5 msNetwork within DC
Cross-datacenter roundtrip~50-150 msDepends on distance
Send 1 MB over network~10 ms1 Gbps network
Read 1 MB from SSD~1 msSequential read
Read 1 MB from HDD~20 msSequential read

Common Estimation Patterns

Formula: DAU ร— actions per user / seconds per day

Shortcut: 1 million requests/day โ‰ˆ 12 QPS (since 86,400 โ‰ˆ 100K seconds โ†’ 1M/100K โ‰ˆ 10-12 QPS)

Peak QPS = Average QPS ร— 2-3x (for most social/content apps)

Example: Twitter โ€” 300M DAU ร— 10 reads/day = 3B reads/day โ‰ˆ 35K QPS avg, ~100K peak

Identify the data objects (posts, users, messages) and estimate size per object.

Example: Each tweet = 280 chars + metadata โ‰ˆ 500 bytes. 500M tweets/day ร— 500 bytes = 250 GB/day โ‰ˆ 90 TB/year.

For images: 200KB average. For videos: 5-50MB depending on quality.

Bandwidth = QPS ร— average response size

Example: 35K QPS ร— 2KB response = 70 MB/s = 560 Mbps (manageable for a cluster)

A typical web server handles 500-1000 concurrent connections and ~10K-50K requests/second depending on complexity.

For CPU-bound: servers = peak QPS / QPS per server

For memory-bound: servers = total memory needed / memory per server

Always add 30-50% overhead for fault tolerance.

Quick Estimation Cheat Sheet
Powers of 2:
  2^10 = 1 KB (thousand)
  2^20 = 1 MB (million)  
  2^30 = 1 GB (billion)
  2^40 = 1 TB (trillion)
  2^50 = 1 PB (quadrillion)

Time conversions:
  1 day   = 86,400 sec โ‰ˆ 100K sec
  1 month = 2.6M sec   โ‰ˆ 2.5M sec
  1 year  = 31.5M sec  โ‰ˆ 30M sec

Quick QPS:
  1M req/day   โ‰ˆ 12 QPS
  10M req/day  โ‰ˆ 120 QPS
  100M req/day โ‰ˆ 1,200 QPS
  1B req/day   โ‰ˆ 12,000 QPS

Typical server capacity:
  Web server:   1K-10K QPS (simple endpoints)
  DB (SQL):     5K-30K QPS (indexed reads)
  Redis:        100K-500K QPS (get/set)
  Kafka:        100K-1M messages/sec (per partition)

Advantages

  • โ€ขLets you make data-driven design decisions in seconds
  • โ€ขImpresses interviewers and shows engineering maturity
  • โ€ขPrevents over-engineering or under-engineering solutions

Disadvantages

  • โ€ขNumbers can vary wildly depending on context
  • โ€ขEasy to get the wrong order of magnitude if assumptions are off
  • โ€ขRequires memorizing key reference numbers

๐Ÿงช Test Your Understanding

Knowledge Check1/3

Approximately how many QPS is 1 billion requests per day?