Back-of-envelope estimation
Handy constants
- 1 day ≈ 86,400 s → round to ~10⁵ s
- 1M requests/day ≈ ~12 QPS · 100M/day ≈ ~1,200 QPS
- Peak ≈ 2–3× average
- 1 char ≈ 1 byte; a tweet-sized row ≈ ~300 B–1 KB; a photo ≈ ~200 KB–2 MB
Recipe
- DAU × actions per user per day = requests/day
- ÷ 10⁵ = average QPS; × 2–3 = peak
- Writes/day × bytes per write × 365 × years = storage
- Ratio of reads to writes tells you where to spend effort
Worked example: photo sharing app
DAU 10M, each uploads 0.2 photos/day, views 30 photos/day writes: 10M * 0.2 = 2M/day -> ~20 QPS (peak ~60) reads : 10M * 30 = 300M/day -> ~3,000 QPS (peak ~9,000) read:write ≈ 150:1 -> read-heavy: cache + CDN matter most storage: 2M * 1 MB = 2 TB/day -> ~730 TB/yr -> object storage (S3), not a DB metadata: 2M * 500 B = 1 GB/day -> fits easily in a SQL DB for years