Bird
Raised Fist0
HLDsystem_design~7 mins

Notification system design in HLD - System Design Guide

Choose your learning style9 modes available
Problem Statement
When a system needs to inform users about events or updates, sending notifications directly from the main application can cause delays and failures under high load. Without a dedicated notification system, messages may be lost, delayed, or overwhelm the service, leading to poor user experience and unreliable communication.
Solution
A notification system decouples message creation from delivery by using queues and workers. It collects notification requests, processes them asynchronously, and sends them via multiple channels like email, SMS, or push notifications. This design ensures reliable delivery, scalability, and the ability to handle retries and failures without blocking the main application.
Architecture
Application
Service
Notification
Email Server

This diagram shows how the application sends notification requests to a queue, which are then processed by workers that deliver messages through various delivery services like email servers or push gateways.

Trade-offs
✓ Pros
Improves system reliability by decoupling notification sending from main application flow.
Enables handling of high notification volumes through asynchronous processing.
Supports multiple notification channels with flexible delivery logic.
Allows retry mechanisms and failure handling without blocking user requests.
✗ Cons
Adds architectural complexity with additional components like queues and workers.
Introduces eventual consistency; notifications may be delayed under heavy load.
Requires monitoring and maintenance of extra infrastructure components.
Use when the system needs to send notifications to many users or via multiple channels, especially if notification volume exceeds hundreds per second or when delivery reliability and retries are important.
Avoid if the system sends very few notifications (less than 10 per minute) or if immediate synchronous notification is critical and volume is low, as added complexity may not justify benefits.
Real World Examples
Uber
Uber uses a notification system to asynchronously send ride status updates and promotions via SMS and push notifications, ensuring timely delivery without slowing down core ride matching services.
Amazon
Amazon employs notification queues and workers to send order confirmations and shipping updates via email and SMS, handling massive spikes during sales events without losing messages.
LinkedIn
LinkedIn uses a notification system to deliver connection requests, messages, and job alerts through multiple channels, managing retries and user preferences efficiently.
Alternatives
Synchronous notification sending
Notifications are sent directly during user request processing without queues or workers.
Use when: Choose when notification volume is very low and immediate delivery is required without added infrastructure.
Third-party notification services
Outsource notification delivery to external platforms instead of building internal queues and workers.
Use when: Choose when you want to reduce operational overhead and rely on specialized providers for delivery and scaling.
Summary
Notification systems prevent main application slowdowns by handling message delivery asynchronously.
They use queues and workers to process notifications reliably across multiple channels.
This design improves scalability and user experience by managing retries and failures gracefully.