Bird
0
0
LLDsystem_design~12 mins

Notification system in LLD - Architecture Diagram

Choose your learning style9 modes available
System Overview - Notification system

This notification system sends messages to users through multiple channels like email, SMS, and push notifications. It must handle high volumes of notifications reliably and deliver them quickly.

Architecture Diagram
User
  |
  v
Load Balancer
  |
  v
API Gateway
  |
  v
Notification Service
  |          |           |
  v          v           v
Email Service SMS Service Push Service
  |          |           |
  v          v           v
Email Server SMS Gateway Push Server

Database <-> Message Queue <-> Notification Service
Cache <-> Notification Service
Components
User
client
Initiates notification requests
Load Balancer
load_balancer
Distributes incoming requests evenly to API Gateway instances
API Gateway
api_gateway
Handles client requests, routes them to Notification Service
Notification Service
service
Processes notification requests, decides delivery channels
Message Queue
queue
Buffers notification tasks for asynchronous processing
Email Service
service
Sends email notifications
SMS Service
service
Sends SMS notifications
Push Service
service
Sends push notifications
Email Server
external_service
Delivers emails to user inboxes
SMS Gateway
external_service
Delivers SMS messages to mobile networks
Push Server
external_service
Delivers push notifications to devices
Database
database
Stores user preferences and notification history
Cache
cache
Stores frequently accessed user data for quick retrieval
Request Flow - 18 Hops
UserLoad Balancer
Load BalancerAPI Gateway
API GatewayNotification Service
Notification ServiceCache
CacheNotification Service
Notification ServiceDatabase
DatabaseNotification Service
Notification ServiceMessage Queue
Message QueueEmail Service
Email ServiceEmail Server
Message QueueSMS Service
SMS ServiceSMS Gateway
Message QueuePush Service
Push ServicePush Server
Notification ServiceDatabase
Notification ServiceAPI Gateway
API GatewayLoad Balancer
Load BalancerUser
Failure Scenario
Component Fails:Message Queue
Impact:Notification tasks cannot be buffered, causing delays or loss of notifications
Mitigation:Use queue replication and fallback to direct synchronous processing with rate limiting
Architecture Quiz - 3 Questions
Test your understanding
Which component is responsible for distributing incoming user requests evenly?
AAPI Gateway
BLoad Balancer
CNotification Service
DMessage Queue
Design Principle
This design uses asynchronous processing with a message queue to handle high notification volumes reliably. Caching user preferences reduces database load and speeds up processing. Load balancing and API gateway ensure scalability and security.