0
0
HLDsystem_design~10 mins

Back-of-the-envelope estimation in HLD - Scalability & System Analysis

Choose your learning style9 modes available
Scalability Analysis - Back-of-the-envelope estimation
Growth Table: What Changes as Users Increase
UsersRequests per Second (RPS)Data StorageNetwork BandwidthCompute Needs
10010-50 RPSMBsLow (Mbps)Single server
10,0001,000-5,000 RPSGBsModerate (100s Mbps)Multiple servers, load balancer
1,000,000100,000+ RPSTBsHigh (Gbps)Distributed servers, caching, sharding
100,000,00010M+ RPSPetabytesVery High (multiple Gbps)Massive distributed system, CDNs, microservices
First Bottleneck

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.

Scaling Solutions
  • 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.
Back-of-Envelope Cost Analysis

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.
Interview Tip

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.

Self Check Question

Your database handles 1,000 QPS. Traffic grows 10x to 10,000 QPS. What do you do first and why?

Key Result
Back-of-the-envelope estimation helps predict system needs and bottlenecks early, guiding practical scaling steps like caching, read replicas, and sharding as user traffic grows.