Back-of-the-Envelope Estimation
Master the art of quick system capacity estimation. Learn the patterns and formulas that help you calculate QPS, storage, bandwidth, and server requirements in minutes - a crucial skill for system design interviews and real-world planning.
What is Back-of-the-Envelope Estimation?
A method for making quick, rough calculations to estimate system requirements. The name comes from the idea that these calculations are simple enough to do on the back of an envelope.
✓ Good Enough
Aim for order of magnitude accuracy (within 10x)
✓ Fast
Complete estimation in 5-10 minutes
✓ Systematic
Follow repeatable patterns
The Universal Estimation Pipeline
🔄 The Standard Flow
DAU → Operations/Day → QPS → Storage → Bandwidth → Servers
Input: Daily Active Users
Output: Infrastructure Requirements
Essential Constants & Conversions
⏰ Time Constants
💡 Use approximations (100K, 30M) for faster mental math
💾 Storage Units
💡 Use powers of 10, not powers of 2 (1024) for estimation
Common Data Sizes
| Data Type | Size | Example |
|---|---|---|
| Character | 1 byte | 'A', '1', '!' |
| Integer | 4 bytes | user_id (32-bit) |
| Long/BigInt | 8 bytes | timestamp, ID (64-bit) |
| UUID | 16 bytes | session_id |
| 50 bytes | user@example.com | |
| Tweet | 280-500 bytes | text + metadata |
| Photo (compressed) | 1-2 MB | Instagram photo |
| Video (1min, 1080p) | 50-100 MB | TikTok video |
Pattern 1: Calculating QPS (Queries Per Second)
📊 From DAU to QPS
The Formula:
Average QPS = (DAU × Operations per User per Day) / 86,400 seconds
Peak QPS = Average QPS × Peak Factor (2-5x)
Example: Twitter-like System
Read/Write Ratio Patterns
📖 Read-Heavy Systems
- • Social Media: 100:1
- • E-commerce: 10:1
- • News Sites: 1000:1
- • Banking: 5:1
✍️ Write-Heavy Systems
- • Analytics/Logging: 1:10
- • IoT Data: 1:100
- • Time Series: 1:50
- • Chat/Messaging: 1:1
Pattern 2: Storage Estimation
💾 Calculating Storage Requirements
The Formula:
Storage = DAU × Items per User per Day × Item Size × Retention Period
Add: Replication Factor (typically 3x)
Add: Growth Buffer (20-30%)
Example: WhatsApp Storage
Pattern 3: Bandwidth Calculation
🌐 Network Bandwidth Requirements
The Formula:
Bandwidth = QPS × Average Request/Response Size
Inbound = Write QPS × Request Size
Outbound = Read QPS × Response Size
Example: Video Streaming Platform
Pattern 4: Server Estimation
🖥️ Server Requirements
| Server Type | Typical Capacity | Use Case |
|---|---|---|
| Web Server | 1-2K QPS | API endpoints, static content |
| Application Server | 500-1K QPS | Business logic, processing |
| MySQL/PostgreSQL | 1K QPS | ACID transactions |
| NoSQL (Cassandra) | 10K QPS | High throughput writes |
| Cache (Redis) | 100K QPS | Session, hot data |
| CDN Edge | 10-50K QPS | Static assets, media |
Complete Example: Design Twitter
🐦 Full Estimation Walkthrough
Step 1: Define Scale
Step 2: Calculate QPS
Step 3: Estimate Storage
Step 4: Calculate Bandwidth
Step 5: Server Requirements
Quick Reference: Estimation Template
📋 Copy-Paste Template
System: _______________ 1. SCALE DAU: _______ Operations per user: _______ Read/Write ratio: _______ 2. QPS CALCULATION Total operations/day: _______ Average QPS = _______ / 86,400 = _______ Peak QPS (3x) = _______ Read QPS = _______ Write QPS = _______ 3. STORAGE Item size: _______ Daily new data: _______ Retention period: _______ Total storage = _______ With replication (3x) = _______ 4. BANDWIDTH Request size: _______ Response size: _______ Inbound bandwidth = Write QPS × Request = _______ Outbound bandwidth = Read QPS × Response = _______ 5. SERVERS App servers = Peak QPS / 1K = _______ DB servers = Write QPS / 1K = _______ Cache servers = Hot Read QPS / 100K = _______ 6. SANITY CHECK Does _______ sound reasonable for _______?
Common Pitfalls to Avoid
❌ Don't Do This
- • Calculate to 3 decimal places
- • Forget about peak traffic (3-5x)
- • Ignore replication overhead
- • Assume linear growth
- • Use exact numbers (86,400 vs 100K)
- • Forget media storage dominance
- • Ignore geographic distribution
✅ Always Do This
- • Round aggressively (1.7M → 2M)
- • State assumptions clearly
- • Add 20-30% growth buffer
- • Consider cache hit rates
- • Account for indices (1.5-2x data)
- • Include monitoring overhead
- • Sanity check final numbers
Practice Problems
🎯 Try These Yourself
1. Design URL Shortener
100M URLs shortened per day, 100:1 read ratio, 5 year retention
2. Design Instagram
500M DAU, 2 photos per user per day, 2MB per photo
3. Design Uber
10M daily rides, 50 location updates per ride, 100 bytes per update
4. Design Netflix
200M subscribers, 2 hours viewing per day, 3GB per hour
Summary
Back-of-the-envelope estimation is about speed and reasonable accuracy, not precision. Follow the patterns:
- Start with users - Everything flows from DAU
- Convert to operations - What do users do?
- Calculate rates - QPS is operations/86,400
- Estimate storage - Data × Time × Replication
- Derive infrastructure - Servers based on load
Remember: The goal is to be within an order of magnitude (10x) and demonstrate systematic thinking. Practice these patterns and you'll be able to estimate any system in minutes!
💡 Interview Tip: Always state your assumptions out loud. If the interviewer disagrees with an assumption, they'll correct you. This shows clear thinking and gives them a chance to guide you toward their expectations.