0
0
LLDsystem_design~12 mins

Separation of concerns in LLD - Architecture Diagram

Choose your learning style9 modes available
System Overview - Separation of concerns

This system demonstrates the principle of separation of concerns by dividing responsibilities into distinct components. Each part handles a specific task, making the system easier to understand, maintain, and scale.

Architecture Diagram
User
  |
  v
Load Balancer
  |
  v
API Gateway
  |
  +-------------------+-------------------+
  |                   |                   |
Auth Service      Business Logic      Data Service
  |                   |                   |
  +-------------------+-------------------+
                      |
                      v
                  Database
                      |
                      v
                    Cache
Components
User
client
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 services and handles authentication
Auth Service
service
Handles user authentication and authorization
Business Logic
service
Processes core application rules and workflows
Data Service
service
Manages data access and communication with the database
Database
database
Stores persistent application data
Cache
cache
Stores frequently accessed data to reduce database load
Request Flow - 14 Hops
UserLoad Balancer
Load BalancerAPI Gateway
API GatewayAuth Service
API GatewayBusiness Logic
Business LogicData Service
Data ServiceCache
CacheData Service
Data ServiceDatabase
DatabaseData Service
Data ServiceCache
Data ServiceBusiness Logic
Business LogicAPI Gateway
API GatewayLoad Balancer
Load BalancerUser
Failure Scenario
Component Fails:Cache
Impact:Cache misses increase, causing more database queries and higher latency
Mitigation:System continues working by querying the database directly; cache can be restored or replaced without downtime
Architecture Quiz - 3 Questions
Test your understanding
Which component is responsible for routing requests to the correct service?
ALoad Balancer
BAPI Gateway
CAuth Service
DCache
Design Principle
This architecture clearly separates concerns by dividing the system into distinct components, each with a focused responsibility. This makes the system easier to maintain, test, and scale independently.