0
0
HLDsystem_design~12 mins

REST API design for systems in HLD - Architecture Diagram

Choose your learning style9 modes available
System Overview - REST API design for systems

This system provides a REST API to allow users and applications to interact with backend services. It supports scalable, stateless communication using HTTP methods and JSON data format. Key requirements include handling many concurrent requests, ensuring security, and providing fast responses.

Architecture Diagram
User
  |
  v
Load Balancer
  |
  v
API Gateway
  |
  v
Authentication Service <--> Authorization Service
  |
  v
REST API Service
  |
  +--> Cache
  |
  +--> Database
  |
  +--> Message Queue
  |
  v
Response
Components
User
client
Initiates requests to the REST API
Load Balancer
load_balancer
Distributes incoming requests evenly across API Gateway instances
API Gateway
api_gateway
Routes requests, enforces rate limiting, and handles SSL termination
Authentication Service
service
Verifies user identity and issues tokens
Authorization Service
service
Checks user permissions for requested resources
REST API Service
service
Processes API requests, applies business logic, and interacts with data stores
Cache
cache
Stores frequently accessed data to reduce database load and improve response time
Database
database
Stores persistent application data
Message Queue
queue
Handles asynchronous tasks and decouples services
Response
client_response
Delivers processed data back to the user
Request Flow - 14 Hops
UserLoad Balancer
Load BalancerAPI Gateway
API GatewayAuthentication Service
Authentication ServiceAuthorization Service
Authorization ServiceAPI Gateway
API GatewayREST API Service
REST API ServiceCache
CacheREST API Service
REST API ServiceDatabase
DatabaseREST API Service
REST API ServiceMessage Queue
REST API ServiceAPI Gateway
API GatewayLoad Balancer
Load BalancerUser
Failure Scenario
Component Fails:Database
Impact:New data writes fail and cache misses cannot be fulfilled, causing errors or stale data responses
Mitigation:Use database replication for failover; cache serves stale data for reads; queue asynchronous writes for retry
Architecture Quiz - 3 Questions
Test your understanding
Which component is responsible for verifying user identity before processing the request?
AAuthentication Service
BAPI Gateway
CLoad Balancer
DCache
Design Principle
This architecture demonstrates a scalable REST API design using layered components for security, caching, and asynchronous processing. It ensures statelessness, separation of concerns, and efficient request handling to support many users reliably.