System DesignOct 2, 2026⏱️ 2 min read
Design a Scalable Notification System: Multi-Channel Push, SMS, Email & Priority Queues

Design a Scalable Notification System: Multi-Channel Push, SMS, Email & Priority Queues

More Than Just Calling an Email API

At scale—say 10 million mobile pushes, 1 million SMS messages, and 5 million emails per day—a notification platform cannot synchronously call external providers inside checkout or auth endpoints. Third-party gateways throttle, go offline, and deliver duplicate webhook triggers.
Scalable Notification System Architecture

Scalable Notification System Architecture


1. High-Level Multi-Channel Architecture

[Triggering Services] ──► [Notification Service] ──► [Channel Kafka Topics]
                                  │                     ├── Push Topic ──► Workers ──► APNs / FCM
                         (Auth + Templates +            ├── SMS Topic  ──► Workers ──► Twilio / Vonage
                          User Opt-Out DB)              └── Email Topic──► Workers ──► AWS SES / SendGrid

Separating Channel Queues Prevents Head-of-Line Blocking

If AWS SES experiences a 10-second slowdown, SMS OTPs and iOS Push notifications must never stall behind backed-up marketing emails. Give each channel (and priority tier: Transactional OTP vs. Bulk Promotional) dedicated Kafka topics and autoscaled consumer worker pools.

2. Core Reliability & Safety Mechanisms

1. Preventing Duplicate Alerts (Idempotency Key)

Network retries or upstream Kafka consumer rebalances can emit the same "Order Shipped" event twice.
  • Attach a deterministic event_id (e.g., notif:order_987:shipped) to every request.
  • Before dispatching to Twilio/FCM, workers execute an atomic SET notif:{event_id} 1 NX EX 86400 check in Redis. Duplicates are discarded silently.

2. Retry with Exponential Backoff & Dead-Letter Queues (DLQ)

External providers return 5xx or 429 transient errors:
  • Retry failed messages with exponential backoff + jitter (5s -> 25s -> 125s).
  • After $N$ failed attempts, move the payload to a Dead-Letter Queue and alert on-call engineers for inspection.

3. User Preferences, Opt-Out & Rate Limiting

  • Centralized Opt-Out Check: Store per-user channel preferences (email_marketing: false, sms_transactional: true) cached in Redis. Validate preferences before queueing.
  • Anti-Fatigue Throttling: Enforce per-user frequency caps (e.g., max 3 promotional pushes/day) so users don't mute or uninstall your app.

4. Delivery Tracking & Templates

  • Templates: Store versioned Handlebars/Jinja templates centrally rather than hardcoding copy in microservices.
  • Analytics Callbacks: Track Sent -> Delivered -> Opened -> Clicked via provider webhooks piped into an analytics log to audit deliverability rates.

Share this article

Comments