Bird
0
0
LLDsystem_design~12 mins

Move validation in LLD - Architecture Diagram

Choose your learning style9 modes available
System Overview - Move validation

This system validates moves in a game to ensure they follow the rules. It checks if a move is legal before updating the game state. The system must be fast and accurate to provide real-time feedback to players.

Architecture Diagram
User
  |
  v
Load Balancer
  |
  v
API Gateway
  |
  v
Move Validation Service
  |        |
  v        v
Cache    Game State Database
  |
  v
Response to User
Components
User
client
Sends move requests and receives validation results
Load Balancer
load_balancer
Distributes incoming requests evenly to API Gateway instances
API Gateway
api_gateway
Receives requests, handles authentication, and routes to Move Validation Service
Move Validation Service
service
Checks if the move is valid according to game rules
Cache
cache
Stores recent game states for quick access to reduce database load
Game State Database
database
Stores the authoritative game state and history
Request Flow - 10 Hops
UserLoad Balancer
Load BalancerAPI Gateway
API GatewayMove Validation Service
Move Validation ServiceCache
CacheMove Validation Service
Move Validation ServiceGame State Database
Game State DatabaseMove Validation Service
Move Validation ServiceCache
Move Validation ServiceAPI Gateway
API GatewayUser
Failure Scenario
Component Fails:Cache
Impact:Move Validation Service must query the database for every request, increasing latency and load on the database.
Mitigation:System continues working by querying the database directly; cache can be restored or replaced without blocking validation.
Architecture Quiz - 3 Questions
Test your understanding
Which component first receives the user's move request?
AMove Validation Service
BAPI Gateway
CLoad Balancer
DCache
Design Principle
This architecture uses caching to reduce database load and improve response time. The separation of concerns with API Gateway and dedicated validation service ensures scalability and maintainability.