0
0
LLDsystem_design~12 mins

Anti-patterns to avoid in LLD - Architecture Diagram

Choose your learning style9 modes available
System Overview - Anti-patterns to avoid

This system overview explains common anti-patterns to avoid in system design. These anti-patterns cause poor scalability, reliability, and maintainability. Understanding them helps build better systems.

Architecture Diagram
User
  |
  v
Load Balancer
  |
  v
API Gateway
  |
  +-------------------+-------------------+
  |                   |                   |
Service A          Service B           Service C
  |                   |                   |
Cache A            Cache B             Cache C
  |                   |                   |
Database A         Database B          Database C
Components
User
user
Initiates requests to the system
Load Balancer
load_balancer
Distributes incoming requests evenly to API Gateway instances
API Gateway
api_gateway
Routes requests to appropriate backend services and handles authentication
Service A
service
Handles specific business logic for feature A
Service B
service
Handles specific business logic for feature B
Service C
service
Handles specific business logic for feature C
Cache A
cache
Stores frequently accessed data for Service A to reduce database load
Cache B
cache
Stores frequently accessed data for Service B to reduce database load
Cache C
cache
Stores frequently accessed data for Service C to reduce database load
Database A
database
Stores persistent data for Service A
Database B
database
Stores persistent data for Service B
Database C
database
Stores persistent data for Service C
Request Flow - 11 Hops
UserLoad Balancer
Load BalancerAPI Gateway
API GatewayService A
Service ACache A
Cache AService A
Service ADatabase A
Database AService A
Service ACache A
Service AAPI Gateway
API GatewayLoad Balancer
Load BalancerUser
Failure Scenario
Component Fails:Cache A
Impact:Cache misses increase, causing more database queries and higher latency
Mitigation:System falls back to database queries; add cache replication or fallback caches to reduce impact
Architecture Quiz - 3 Questions
Test your understanding
Which component prevents users from connecting directly to the database?
ACache
BAPI Gateway
CLoad Balancer
DService
Design Principle
This architecture shows how separating concerns with load balancers, API gateways, caches, and services avoids common anti-patterns like direct database access, single points of failure, and tight coupling. Using caches reduces database load and improves response times, while load balancers and API gateways ensure scalability and security.