Bird
Raised Fist0
HLDsystem_design~12 mins

Notification system design in HLD - Architecture Diagram

Choose your learning style9 modes available
System Overview - Notification system design

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
Message Queue  Cache   User Preferences DB
  |          |           |
  v          v           v
Email Service SMS Service Push Service
  |          |           |
  v          v           v
SMTP Server SMS Gateway Push Notification Provider
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 and routes them to Notification Service
Notification Service
service
Processes notification requests and decides delivery channels
Message Queue
queue
Buffers notification tasks for asynchronous processing
Cache
cache
Stores recent notification statuses and user preferences for fast access
User Preferences DB
database
Stores user notification preferences and contact details
Email Service
service
Sends email notifications via SMTP Server
SMS Service
service
Sends SMS notifications via SMS Gateway
Push Service
service
Sends push notifications via Push Notification Provider
SMTP Server
external_service
Delivers emails to user mailboxes
SMS Gateway
external_service
Delivers SMS messages to mobile networks
Push Notification Provider
external_service
Delivers push notifications to user devices
Request Flow - 15 Hops
UserLoad Balancer
Load BalancerAPI Gateway
API GatewayNotification Service
Notification ServiceCache
Notification ServiceUser Preferences DB
Notification ServiceMessage Queue
Message QueueEmail Service
Email ServiceSMTP Server
Message QueueSMS Service
SMS ServiceSMS Gateway
Message QueuePush Service
Push ServicePush Notification Provider
Notification ServiceCache
Notification ServiceAPI Gateway
API GatewayUser
Failure Scenario
Component Fails:Message Queue
Impact:Notification tasks cannot be queued, causing delays or loss of notifications
Mitigation:Use a replicated queue system with failover; buffer notifications temporarily in Notification Service memory
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.