| Users | Infrastructure Focus | Key Changes |
|---|---|---|
| 100 users | Basic setup | Single server, simple network, minimal monitoring |
| 10,000 users | Scaling basics | Load balancers, database replicas, caching introduced |
| 1,000,000 users | Advanced scaling | Multiple data centers, sharding, CDN, automated failover |
| 100,000,000 users | Global infrastructure | Multi-region deployment, microservices, edge computing, extensive monitoring |
Why infrastructure design underpins everything in HLD - Scalability Evidence
Start learning this pattern below
Jump into concepts and practice - no test required
At small scale, the infrastructure is simple and can handle all requests. As users grow, the first bottleneck is usually the network and server capacity. Without proper design, servers get overwhelmed, causing slow responses or downtime. Poor infrastructure design means you can't add more servers easily or balance load well, so the system breaks under higher traffic.
- Horizontal scaling: Add more servers behind load balancers to share traffic.
- Vertical scaling: Upgrade server CPU, RAM, and network capacity.
- Caching: Use in-memory caches to reduce database load and speed responses.
- Sharding: Split databases by user or data type to distribute load.
- Content Delivery Network (CDN): Serve static content closer to users to reduce latency and bandwidth use.
- Automation and monitoring: Detect and respond to failures quickly to maintain uptime.
For 1 million users, assuming 10% active concurrently:
- Requests per second (RPS): ~100,000 (assuming 1 request per second per active user)
- Servers needed: ~20 servers (each handles ~5,000 concurrent connections)
- Database QPS: ~100,000 (may require sharding or replicas)
- Bandwidth: 1 Gbps network supports ~125 MB/s, so multiple 1 Gbps links or 10 Gbps needed
- Storage: Depends on data size, but expect terabytes for logs, user data, backups
Start by describing the current infrastructure and its limits. Then explain what breaks first as users grow. Next, propose specific scaling solutions tied to those bottlenecks. Finally, discuss trade-offs and costs. Use clear examples and relate to real systems to show understanding.
Your database handles 1000 queries per second (QPS). Traffic grows 10x to 10,000 QPS. What do you do first?
Answer: Add read replicas and implement caching to reduce direct database load before considering sharding or hardware upgrades.
Practice
Solution
Step 1: Understand the role of infrastructure design
Infrastructure design sets the base for how all parts of a system work together, affecting reliability and scalability.Step 2: Identify why it matters for system parts
Good infrastructure design supports system growth, performance, and maintenance, unlike options that focus narrowly on UI or hardware only.Final Answer:
Because it ensures the system is reliable, scalable, and maintainable -> Option AQuick Check:
Infrastructure design = foundation for reliability and scalability [OK]
- Confusing infrastructure with just UI design
- Ignoring scalability and future growth
- Thinking infrastructure is only hardware
Solution
Step 1: Review the purpose of infrastructure design
Infrastructure design is about planning system components to ensure performance and scalability.Step 2: Evaluate each option's correctness
Only It helps in making the system scalable and reliable correctly states that infrastructure design helps scalability and reliability; others are false or irrelevant.Final Answer:
It helps in making the system scalable and reliable -> Option AQuick Check:
Infrastructure design = scalability and reliability [OK]
- Thinking infrastructure is a late task
- Ignoring its impact on performance
- Confusing it with UI styling
Solution
Step 1: Analyze effects of poor infrastructure design
Poor planning often leads to unreliable systems with performance issues and failures.Step 2: Match outcomes to options
The system may face frequent failures and slowdowns correctly describes likely failures and slowdowns; other options are unrealistic or incorrect.Final Answer:
The system may face frequent failures and slowdowns -> Option CQuick Check:
Poor infrastructure = failures and slowdowns [OK]
- Assuming system auto-fixes design flaws
- Believing poor design leads to perfect security
- Thinking poor design improves speed
Solution
Step 1: Identify cause of crashes under load
Crashes under load usually happen due to poor scalability and resource planning in infrastructure.Step 2: Evaluate options for relevance
Only They did not plan for scalability and resource management relates to infrastructure and system stability; others are unrelated UI or code style issues.Final Answer:
They did not plan for scalability and resource management -> Option BQuick Check:
Crashes under load = poor scalability planning [OK]
- Blaming UI colors for system crashes
- Confusing code comments with performance
- Ignoring resource management importance
Solution
Step 1: Understand requirements for rapid growth
Rapid growth requires infrastructure that can scale automatically and balance load to maintain performance.Step 2: Evaluate each option against growth needs
Design a scalable architecture with load balancing and auto-scaling supports scalability and reliability; others limit growth or risk failures.Final Answer:
Design a scalable architecture with load balancing and auto-scaling -> Option DQuick Check:
Rapid growth needs scalable, balanced infrastructure [OK]
- Choosing fixed resource servers for growing systems
- Skipping monitoring which helps detect issues
- Using outdated hardware risking failures
