Back-of-Envelope Estimation
Before diving into architecture, experienced engineers estimate. Not with spreadsheets and precise data — with napkin math. The goal isn't precision; it's knowing whether you need 1 server or 1,000, 1 GB of storage or 1 PB.
Why Estimation Matters
Estimation helps you:
- Choose technologies: SQLite vs. distributed Cassandra cluster
- Plan capacity: How many servers? How much storage?
- Detect impossible requirements: "Store all user data in RAM" — is that even feasible?
- Communicate: Give stakeholders rough timelines and cost estimates
Numbers Every Engineer Should Know
| Operation | Latency | Notes |
|---|---|---|
| L1 cache reference | 0.5 ns | Blazing fast |
| L2 cache reference | 7 ns | 14× L1 |
| RAM access | 100 ns | Main memory |
| SSD random read | 150 μs | 1,500× RAM |
| HDD seek | 10 ms | 100,000× RAM |
| Send 1 KB over network (same DC) | 0.25 ms | Datacenter network |
| Read 1 MB from SSD | 1 ms | Sequential |
| Read 1 MB from network | 10 ms | ~100 MB/s |
| Round trip within same datacenter | 0.5 ms | |
| Round trip CA → Netherlands | 150 ms | Speed of light limit |
The Scale of Data
The Estimation Framework
Follow this step-by-step process for any system:
Step-by-Step Framework
- Total users → How many people use the product?
- Daily Active Users (DAU) → Typically 20-50% of total users
- QPS (Queries Per Second) → DAU × actions per user / 86,400 seconds
- Peak QPS → Usually 2-5× average QPS
- Storage → Size per object × objects per day × retention period
- Bandwidth → QPS × average response size
Real-World Example: YouTube Storage Estimation
Let's estimate storage for a YouTube-like video service:
Assumptions:
• 500 hours of video uploaded per minute
• Average video: 1080p, ~2.5 GB/hour after compression
• Keep 3 resolutions (1080p, 720p, 480p) ≈ 4.5 GB total/hour
Daily uploads:
500 hours/min × 60 min × 24 hours = 720,000 hours/day
Daily storage:
720,000 hours × 4.5 GB/hour = 3,240,000 GB = ~3.2 PB/day
Annual storage:
3.2 PB × 365 = ~1,168 PB ≈ 1.2 EB/year
Bandwidth (serving):
Assume 1B video views/day, avg 5 min at 720p (~300 MB/hour = 25 MB/5 min):
1,000,000,000 × 25 MB = 25,000 PB = ~290 GB/s average
These numbers tell us: we need a distributed object storage system (like Google's Colossus), not a traditional filesystem. And we need a CDN — 290 GB/s can't come from one location.
Estimation Calculator
Input your assumptions and see derived capacity metrics: