Numbers

Back-of-Envelope Numbers

Latency Numbers Every Engineer Should Know

OperationTimeNotes
L1 cache reference0.5 nsCPU cache
L2 cache reference7 ns14x L1
Main memory reference100 nsRAM access
SSD random read150 μs~1,500x memory
HDD seek10 ms~100,000x memory
Network round trip (same datacenter)0.5 msWithin AZ
Network round trip (cross-region)50-150 msUS to Europe

📊Throughput & Scale Numbers

Database Reads

  • • Redis: 100K+ ops/sec
  • • PostgreSQL: 10K-50K queries/sec
  • • MongoDB: 20K-80K ops/sec

HTTP Servers

  • • Single server: 1K-10K req/sec
  • • With caching: 50K+ req/sec
  • • CDN edge: 100K+ req/sec

💾Storage Estimation

Common Sizes

  • Tweet: ~300 bytes
  • Photo metadata: ~1 KB
  • Image (compressed): ~200 KB
  • Video (1 min HD): ~50 MB

Quick Math

  • 1 million = 10⁶
  • 1 billion = 10⁹
  • 1 KB = 10³ bytes
  • 1 MB = 10⁶ bytes
  • 1 GB = 10⁹ bytes
  • 1 TB = 10¹² bytes

Time Conversions

  • 1 day = 86,400 sec
  • 1 week = ~600K sec
  • 1 month = ~2.5M sec
  • 1 year = ~31.5M sec

Quick Estimation Formula

Storage: Users × Data per user × Retention period

Bandwidth: Requests per second × Average response size

QPS: Daily active users × Actions per user ÷ 86,400