πŸŽ‰ 75% of content is free forever β€” Unlock Premium from $10/mo β†’
CW
NEWSLIVESearch All Content
πŸ’Ό Servicesℹ️ Aboutβœ‰οΈ ContactView Pricing Plansfrom $10

Design a Notification System

System Design ProblemsNotification Infrastructure🟒 Free Lesson

System Design Problems

Design a Notification System

A notification system delivers messages to users across multiple channels: push notifications (iOS/Android), SMS, and email. Systems like Firebase Cloud Messaging (FCM), Apple Push Notification Service (APNs), and Twilio handle billions of notifications daily.

  • Multi-Channel β€” Push, SMS, email, and in-app notifications
  • High Throughput β€” Process millions of notifications per minute
  • Reliability β€” Guaranteed delivery with retry logic and deduplication

The challenge is not sending a notificationβ€”it's sending the right notification, to the right user, through the right channel, at the right time, without duplicates.

Requirements

Functional Requirements

  • Send push notifications (iOS/Android), SMS, and email
  • Support different notification types (transactional, marketing, alerts)
  • Users can opt-in/opt-out of notification channels
  • Rate limiting per user to prevent notification fatigue
  • Template-based notifications with personalization
  • Support scheduled notifications

Non-Functional Requirements

  • Latency: Push notifications delivered within 1 second
  • Throughput: 10M notifications per minute peak
  • Delivery: At-least-once delivery with deduplication
  • Availability: 99.9% uptime
  • Scalability: Support 500M registered devices

Back-of-the-Envelope Estimation

API Design

Architecture Diagram
POST /api/v1/notifications/send
Request: {
  "user_id": "user_123",
  "type": "push",
  "template": "new_follower",
  "data": { "follower_name": "Alice" },
  "channels": ["push", "email"]
}
Response: { "notification_id": "n_456", "status": "queued" }

POST /api/v1/notifications/bulk
Request: {
  "user_ids": ["u1", "u2", ...],
  "type": "marketing",
  "template": "weekly_digest",
  "scheduled_at": "2026-06-21T09:00:00Z"
}
Response: { "batch_id": "b_789", "total": 100000 }

High-Level Architecture

EventsOrder PlacedNew FollowerPayment RecvSystem AlertNotification ServiceRate LimiterTemplate EngineMessage Queue(Kafka)Push WorkerSMS WorkerEmail WorkerFCMAPNsTwilioVonageSESSendGridPreferences DBNotification System Architecture

Detailed Design

Notification Processing Pipeline

StageResponsibility
IngestionAccept notification requests via API
ValidationCheck user exists, channel preferences
Rate LimitingEnforce per-user and per-type limits
Template RenderingFill templates with user data
DeduplicationPrevent duplicate notifications
Channel RoutingRoute to correct delivery worker
DeliveryCall external provider APIs
TrackingRecord delivery status, opens, clicks

Rate Limiting

Prevent notification fatigue with per-user rate limiting:

Deduplication

Prevent duplicate notifications using idempotency keys:

Multi-Channel Delivery

Route notifications to the appropriate channel based on user preferences:

Architecture Diagram
User Preferences:
{
  user_id: "u_123",
  channels: {
    push: { enabled: true, device_tokens: ["tok1", "tok2"] },
    sms: { enabled: true, phone: "+1234567890" },
    email: { enabled: true, address: "[email protected]" }
  },
  quiet_hours: { start: "22:00", end: "08:00", timezone: "America/New_York" }
}

Retry and Dead Letter Queue

For failed notifications, implement retry logic:

  1. Immediate retry: Retry up to 3 times with exponential backoff
  2. Dead Letter Queue (DLQ): Notifications that fail after all retries
  3. DLQ processing: Manual review, alerting, or bulk retry
  4. Fallback channels: If push fails, try email as fallback

Practice Exercises

  1. Design: How would you implement a notification preference center where users can configure channel preferences, quiet hours, and notification types?

  2. Scale: If the system needs to send 1M push notifications in 1 minute, estimate the number of worker instances needed assuming each worker can process 500 notifications/second.

  3. Reliability: Design a system to guarantee exactly-once notification delivery. What challenges arise from network partitions and provider retries?

  4. Analytics: How would you track notification delivery, open rates, and click-through rates? Design the analytics pipeline.


What to Learn Next

-> Message Queues Kafka, RabbitMQ, and async processing patterns.

-> Event-Driven Architecture Event sourcing, CQRS, and asynchronous communication.

-> Rate Limiting Token bucket, sliding window, and distributed rate limiting.

-> Design Email System Email infrastructure, deliverability, and compliance.

-> Design Chat System Real-time messaging with WebSocket and presence.

-> Microservices Service decomposition, communication, and deployment.


Extended Learning: Beyond the Basics

Key Concepts Summary

This lesson covers fundamental concepts that serve as building blocks for more advanced topics. Master these basics before moving to intermediate and advanced material.

Prerequisite Knowledge

Before studying this topic in depth, ensure you understand:

  • Basic definitions and terminology
  • Core formulas and their derivations
  • Common applications in real-world scenarios
  • Typical pitfalls and misconceptions

Step-by-Step Walkthrough

Let us work through a complete example to solidify understanding:

Step 1: Identify the problem type. Determine which category this problem falls into and which approach is most appropriate.

Step 2: Apply the relevant formula. Substitute known values into the appropriate equation, paying attention to units and constraints.

Step 3: Simplify and solve. Work through the algebra step by step, checking each intermediate result.

Step 4: Verify the answer. Check that the solution satisfies the original conditions and makes logical sense.

Common Mistakes to Avoid

  1. Misidentifying the problem type β€” Always start by categorizing the problem
  2. Incorrect formula application β€” Verify the formula applies to your specific case
  3. Unit errors β€” Always check units are consistent throughout
  4. Sign errors β€” Pay careful attention to positive and negative values
  5. Rounding too early β€” Keep full precision until the final answer
  6. Forgetting constraints β€” Check that solutions satisfy all given conditions

Real-World Applications

Understanding this concept is essential for:

  • Advanced problem solving in examinations
  • Building intuition for more complex topics
  • Developing analytical thinking skills
  • Applying mathematical reasoning to practical situations

Practice Exercises

  1. Basic: Solve 5 problems of increasing difficulty using the core concept.
  2. Intermediate: Apply the concept to word problems with multiple steps.
  3. Advanced: Combine this concept with 2-3 other topics in a comprehensive problem.
  4. Challenge: Create your own problem that requires this concept plus additional knowledge.

Interview and Exam Tips

  • Common question patterns: Identify which exam or interview formats test this topic
  • Time management: Practice completing problems within time constraints
  • Common traps: Know the typical mistakes examiners set as distractors
  • Verification strategy: Develop a quick method to check your answer

Related Topics

Quick Reference Card

ConceptFormula/RuleKey InsightCommon Use
Core DefinitionSee main textUnderstand the intuitionFoundation for all applications
Key FormulaSee main textMemorize the derivationDirect problem solving
Special CaseSee main textRecognize when it appliesSimplifies complex problems
Edge CaseSee main textKnow the limitationsAvoids errors

Further Reading

For students who want to go deeper:

  • Standard textbooks on the subject
  • Research papers applying this concept
  • Online courses with video explanations
  • Practice problem collections with detailed solutions
CW

ChatWhole Learn Editorial Team

Written by experienced data scientists, software engineers, and educators. All content is reviewed by industry professionals to ensure accuracy and relevance.

Last reviewed: 2026-11-14

β€”
β˜†β˜†β˜†β˜†β˜†
0 ratings

Rate & Feedback

Need Expert System Design Help?

Get personalized tutoring, project support, or professional consulting.

Advertisement