0
0
LLDsystem_design~12 mins

Rating and review system in LLD - Architecture Diagram

Choose your learning style9 modes available
System Overview - Rating and review system

This system allows users to submit ratings and reviews for products or services. It must handle high volumes of user requests, store reviews reliably, and provide fast access to aggregated ratings and recent reviews.

Architecture Diagram
User
  |
  v
Load Balancer
  |
  v
API Gateway
  |
  v
Review Service <--> Cache
  |
  v
Database
  |
  v
Message Queue
  |
  v
Analytics Service
Components
User
client
End user submitting or viewing ratings and reviews
Load Balancer
load_balancer
Distributes incoming user requests evenly across API Gateway instances
API Gateway
api_gateway
Handles authentication, routing, and request validation
Review Service
service
Processes rating and review submissions and queries
Cache
cache
Stores frequently accessed reviews and aggregated ratings for fast retrieval
Database
database
Stores all ratings and reviews persistently
Message Queue
message_queue
Queues review data for asynchronous processing like analytics
Analytics Service
service
Processes queued data to generate insights and aggregate statistics
Request Flow - 13 Hops
UserLoad Balancer
Load BalancerAPI Gateway
API GatewayReview Service
Review ServiceCache
CacheReview Service
Review ServiceDatabase
Review ServiceCache
Review ServiceMessage Queue
Message QueueAnalytics Service
Analytics ServiceDatabase
Review ServiceAPI Gateway
API GatewayLoad Balancer
Load BalancerUser
Failure Scenario
Component Fails:Cache
Impact:Cache misses increase, causing more direct database queries and higher latency for users
Mitigation:System continues to function by reading from the database; cache is rebuilt asynchronously
Architecture Quiz - 3 Questions
Test your understanding
Which component handles user authentication and routes requests to the correct service?
ALoad Balancer
BReview Service
CAPI Gateway
DMessage Queue
Design Principle
This design uses caching to speed up read requests and a message queue to handle analytics asynchronously, ensuring the system remains responsive and scalable under high load.