| Scale | Users | System Changes |
|---|---|---|
| Small | 100 users | Simple design, single server, direct DB access, minimal caching |
| Medium | 10,000 users | Load balancers added, read replicas for DB, caching introduced, basic monitoring |
| Large | 1,000,000 users | Horizontal scaling of app servers, sharded databases, distributed caching, CDN usage |
| Very Large | 100,000,000 users | Microservices, multi-region deployment, advanced data partitioning, event-driven architecture, autoscaling |
Why advanced concepts handle production systems in LLD - Scalability Evidence
At low scale, the database is the first to struggle because it handles all requests directly. As users grow, a single server cannot process all requests fast enough, causing slow responses and failures. Without caching or load balancing, the system overloads quickly. Advanced concepts prevent this by distributing load and reducing direct pressure on the database.
- Horizontal Scaling: Add more servers to share the load, preventing any single server from becoming a bottleneck.
- Load Balancing: Distribute user requests evenly across servers to optimize resource use.
- Caching: Store frequent data in fast memory to reduce database hits and speed up responses.
- Database Sharding: Split data into smaller parts so each database handles less data, improving performance.
- Content Delivery Networks (CDN): Serve static content from locations closer to users, reducing latency and bandwidth use.
- Microservices: Break the system into smaller, independent services that can scale and update separately.
- At 1,000 users: ~100 requests/sec, 1 GB storage, 10 Mbps bandwidth
- At 10,000 users: ~1,000 requests/sec, 10 GB storage, 100 Mbps bandwidth
- At 1,000,000 users: ~100,000 requests/sec, 1 TB storage, 10 Gbps bandwidth
- At 100,000,000 users: ~10,000,000 requests/sec, 100 TB+ storage, 100+ Gbps bandwidth
Costs rise quickly with scale, so advanced concepts help optimize resource use and control expenses.
Start by describing the current system and its limits. Identify the first bottleneck as users grow. Explain how you would apply advanced concepts step-by-step to handle increased load. Use real numbers to show understanding. Finish by discussing trade-offs and cost implications.
Your database handles 1000 queries per second (QPS). Traffic grows 10 times. What do you do first and why?
Answer: Add read replicas and implement caching to reduce direct load on the database before scaling servers horizontally.