| Users | Requests per Second (RPS) | Data Storage | Network Bandwidth | Compute Needs |
|---|---|---|---|---|
| 100 | 10-50 RPS | MBs | Low (Mbps) | Single server |
| 10,000 | 1,000-5,000 RPS | GBs | Moderate (100s Mbps) | Multiple servers, load balancer |
| 1,000,000 | 100,000+ RPS | TBs | High (Gbps) | Distributed servers, caching, sharding |
| 100,000,000 | 10M+ RPS | Petabytes | Very High (multiple Gbps) | Massive distributed system, CDNs, microservices |
Back-of-the-envelope estimation in HLD - Scalability & System Analysis
At small scale (100 users), the server CPU and memory handle all requests easily.
At medium scale (10K users), the database becomes the first bottleneck due to query load.
At large scale (1M users), network bandwidth and database storage I/O limit performance.
At very large scale (100M users), data partitioning and global distribution become critical.
- Vertical scaling: Upgrade server CPU, RAM, and storage for small scale.
- Horizontal scaling: Add more servers behind load balancers to share traffic.
- Caching: Use in-memory caches (like Redis) to reduce database load.
- Database read replicas: Distribute read queries to replicas to reduce master load.
- Sharding: Split database by user or data ranges to scale writes and storage.
- Content Delivery Network (CDN): Cache static content closer to users to reduce bandwidth.
- Asynchronous processing: Offload heavy tasks to background workers.
Example for 10,000 users:
- Assuming 1,000 RPS peak.
- Each request ~100 KB data -> 100 MB/s bandwidth (~800 Mbps).
- Storage: 10 GB user data + logs per day.
- Database QPS: 1,000 queries per second, requiring a powerful DB server or replicas.
- Servers: 3-5 app servers with load balancer for redundancy.
Start by estimating user numbers and request rates.
Calculate rough bandwidth and storage needs.
Identify the first bottleneck logically (usually database).
Suggest scaling solutions step-by-step, explaining why each helps.
Keep numbers simple and explain assumptions clearly.
Your database handles 1,000 QPS. Traffic grows 10x to 10,000 QPS. What do you do first and why?
Practice
Solution
Step 1: Understand the goal of back-of-the-envelope estimation
This method is used to quickly guess system needs without detailed work.Step 2: Compare options to the goal
Only To quickly estimate system requirements using simple calculations matches the quick estimation purpose; others are detailed tasks.Final Answer:
To quickly estimate system requirements using simple calculations -> Option AQuick Check:
Quick estimation = To quickly estimate system requirements using simple calculations [OK]
- Confusing estimation with detailed design
- Thinking it involves coding or testing
- Assuming it requires full diagrams
Solution
Step 1: Identify the starting point for traffic estimation
Back-of-the-envelope estimation uses simple averages, not detailed data.Step 2: Evaluate options for simplicity and relevance
Estimate average users per hour and multiply by 24 uses average users per hour times 24 hours, a simple and effective start.Final Answer:
Estimate average users per hour and multiply by 24 -> Option BQuick Check:
Simple average x time = Estimate average users per hour and multiply by 24 [OK]
- Starting with detailed logs instead of rough estimates
- Jumping to design before estimating traffic
- Confusing estimation with specification writing
Solution
Step 1: Multiply users by requests per user
10,000 users x 5 requests each = 50,000 requests.Step 2: Confirm total requests per day
The total is simply the product of users and requests per user.Final Answer:
50,000 requests -> Option DQuick Check:
Users x requests = 50,000 [OK]
- Adding instead of multiplying
- Mixing up users and requests
- Choosing an option too large or too small
Solution
Step 1: Understand the impact of ignoring peak traffic
Peak traffic is often much higher than average, so ignoring it underestimates load.Step 2: Identify the consequence of underestimation
System may overload during peak times if capacity is based on average only.Final Answer:
Underestimating peak load leading to potential system overload -> Option CQuick Check:
Ignoring peak = underestimation risk [OK]
- Assuming daily average covers peak needs
- Confusing storage with traffic load
- Focusing on unrelated factors like authentication time
Solution
Step 1: Calculate total storage in MB
500,000 photos x 3 MB each = 1,500,000 MB.Step 2: Convert MB to TB
1,500,000 MB ÷ 1024 ≈ 1465 GB ÷ 1024 ≈ 1.43 TB, approximately 1.5 TB.Final Answer:
1.5 TB -> Option AQuick Check:
Uploads x size ≈ 1.5 TB [OK]
- Forgetting to convert MB to GB
- Mixing up MB and GB units
- Using wrong multiplication factors
Ready to prove it?
Pass the test and this pattern moves unknown
