| Users | Common Anti-patterns | Impact | Signs to Watch |
|---|---|---|---|
| 100 users | Monolithic design, no caching, tight coupling | System works but slow response under load | Slow page loads, high CPU spikes |
| 10,000 users | Single database instance, no load balancing, synchronous calls | Database overload, server crashes, slow API responses | Timeouts, increased error rates |
| 1,000,000 users | No sharding, no horizontal scaling, ignoring eventual consistency | Database bottleneck, network congestion, data loss risk | High latency, frequent downtime |
| 100,000,000 users | Ignoring microservices, no CDN, no caching layers | Massive delays, huge infrastructure costs, poor user experience | System outages, slow global access |
Anti-patterns to avoid in LLD - Scalability & System Analysis
Start learning this pattern below
Jump into concepts and practice - no test required
At small scale, the database is the first to struggle because it handles all requests directly without caching or replicas.
As users grow, the application server CPU and memory become overloaded due to synchronous processing and lack of load balancing.
At large scale, network bandwidth and data storage become bottlenecks if data partitioning and CDNs are not used.
- Horizontal scaling: Add more servers to distribute load and avoid single points of failure.
- Caching: Use caches to reduce database hits and speed up responses.
- Database sharding: Split data across multiple databases to handle large volumes.
- Load balancing: Distribute incoming traffic evenly across servers.
- Use CDNs: Deliver static content closer to users to reduce latency.
- Microservices: Break monoliths into smaller services for better maintainability and scaling.
- At 10,000 users, expect ~1000 QPS (queries per second).
- Database storage grows with user data; plan for GBs to TBs depending on data size.
- Network bandwidth needs increase; 1 Gbps can handle ~125 MB/s, plan accordingly.
- Adding caching reduces database load by up to 70%, saving costs.
- Horizontal scaling increases server costs linearly but improves availability.
Start by identifying current system limits and bottlenecks.
Discuss how load increases affect each component.
Explain anti-patterns and why they cause problems at scale.
Propose clear, practical solutions matching the bottleneck.
Use real numbers to justify your approach.
Your database handles 1000 QPS. Traffic grows 10x. What do you do first?
Answer: Add read replicas and implement caching to reduce direct database load before scaling vertically or sharding.
Practice
God Object anti-pattern in system design?Solution
Step 1: Understand the God Object concept and compare options
The God Object anti-pattern occurs when one component or class takes on too many responsibilities, leading to complex, hard-to-maintain code. A single component that handles too many responsibilities, making the system hard to maintain. matches this description exactly, while others describe good design practices.Final Answer:
A single component that handles too many responsibilities, making the system hard to maintain. -> Option CQuick Check:
God Object = Single overloaded component [OK]
- Confusing God Object with microservices
- Thinking God Object is a good modular design
- Mixing God Object with event-driven architecture
Solution
Step 1: Identify what hardcoding means and match options
Hardcoding means embedding fixed values directly in the code, making changes difficult and error-prone. Storing configuration values directly inside the source code. shows storing config inside code, which is hardcoding. Others are best practices.Final Answer:
Storing configuration values directly inside the source code. -> Option AQuick Check:
Hardcoding = fixed values in code [OK]
- Confusing hardcoding with using environment variables
- Thinking external config files are hardcoding
- Mixing feature flags with hardcoding
Solution
Step 1: Analyze direct database access and identify the anti-pattern
When modules directly access the database without abstraction, they become tightly coupled to the database schema. Tight Coupling means components depend heavily on each other, reducing flexibility and increasing maintenance difficulty.Final Answer:
Tight Coupling -> Option AQuick Check:
Direct DB access = Tight Coupling [OK]
- Confusing tight coupling with God Object
- Thinking event-driven design fits here
- Mixing spaghetti architecture with tight coupling
Solution
Step 1: Identify the anti-pattern from description and determine the fix
Complex interdependencies causing fragility is typical of Spaghetti Architecture. Refactoring to modular design with clear interfaces reduces dependencies and improves maintainability.Final Answer:
Spaghetti Architecture; refactor to modular design with clear interfaces. -> Option BQuick Check:
Spaghetti Architecture = tangled dependencies [OK]
- Thinking God Object means merging components
- Confusing hardcoding with architecture issues
- Believing removing interfaces reduces coupling
Solution
Step 1: Identify problems in current system and choose best solution to fix anti-patterns
Monolith with hardcoded values and God Object causes poor scalability and maintainability. Refactoring into microservices splits responsibilities, externalizing config removes hardcoding, improving scalability and maintainability.Final Answer:
Refactor into microservices, externalize configuration, and split responsibilities into smaller components. -> Option DQuick Check:
Microservices + external config fix anti-patterns [OK]
- Thinking bigger God Object improves simplicity
- Adding more hardcoding for speed
- Ignoring scalability needs
