Amazon Notification Service design
Problem Statement
Design the Low-Level Design (LLD) for a Notification Service similar to what Amazon or large-scale e-commerce systems use.
This service is responsible for sending notifications to users across multiple channels — such as Email, SMS, Push, or In-App alerts — based on system events like order updates, payment success, shipment status, etc.
The goal is to design a modular, extensible, and event-driven notification system.
🎯 Goal
Design a notification service that can:
✅ Functional Requirements
1. Notification Request Handling
2. Channel-Specific Delivery
3. Notification Templates
Example:
1
2"Hello {userName}, your order {orderId} has been shipped!"4. User Preferences
5. Retry and Failure Handling
6. Audit and Tracking
⚙️ Non-Functional Requirements
🧱 Key Classes to Design
ClassResponsibility
Notification
Represents a notification request with metadata.
NotificationChannel (interface)
Defines the sendNotification() contract for all channels.
EmailNotificationService
Sends email notifications.
SMSNotificationService
Sends SMS notifications.
PushNotificationService
Sends push/in-app alerts.
NotificationManager
Core orchestrator that routes notifications to proper channels.
TemplateEngine
Populates dynamic message templates with actual data.
UserPreferenceService
Retrieves user’s preferred notification channels.
RetryPolicy
Handles retry logic for failed notifications.
NotificationRepository
Logs and tracks notification events and delivery status.
🧩 Example Class Relationships
1
2Notification
3 ├── notificationId
4 ├── userId
5 ├── type (ORDER, PAYMENT, PROMOTION)
6 ├── List<ChannelType> (EMAIL, SMS)
7 ├── templateId
8 ├── data (Map<String, String>)
9 ├── status (PENDING, SENT, FAILED)
10
11NotificationManager
12 ├── processNotification(Notification)
13 ├── sendToChannels(List<NotificationChannel>)
14
15NotificationChannel (Interface)
16 ├── send(Notification notification)
17
18EmailNotificationService implements NotificationChannel
19 ├── send(Notification)
20
21SMSNotificationService implements NotificationChannel
22 ├── send(Notification)
23
24TemplateEngine
25 ├── render(templateId, data)🔄 Example Flow
🧾 Order Shipped Event
1
2{
3 "userId": 123,
4 "type": "ORDER_SHIPPED",
5 "templateId": "T001",
6 "channels": ["EMAIL", "SMS"],
7 "data": {"userName": "Sahil", "orderId": "ORD678"}
8}NotificationManager:
2. EmailNotificationService → calls email API.
3. SMSNotificationService → calls SMS provider.
4. NotificationRepository → logs results.
🧪 Example Output
1
2{
3 "notificationId": "N-456",
4 "userId": "123",
5 "channels": ["EMAIL", "SMS"],
6 "status": "SENT",
7 "timestamp": "2025-10-24T12:15:00Z"
8}🔐 Concurrency & Reliability
🧠 Possible Extensions
✅ Final Summary:
Design a Notification Service (LLD) that supports:
Focus on object design, interface-driven structure, and notification orchestration logic, not on scaling or infrastructure.