KatInterview

Design a High-Throughput Notification Platform

System DesignModel answer
MediumModel answerSystem Designqueuesscalabilityrate-limiting

Last updated

Build a system that ingests notification requests with sub-50ms latency, handles 10x traffic spikes, and delivers across multiple channels without overwhelming providers.

Problem

You're building a notification platform that sends messages through multiple channels: push notifications, SMS, and email. The system must handle both routine traffic and sudden spikes during high-volume events like flash sales or promotional campaigns.

Core Requirements

What the System Must Do

  • Accept requests: Receive notification requests specifying recipient, delivery channel, message content, and urgency level
  • Support multiple channels: Deliver through mobile push (iOS/Android), SMS carriers, and email providers
  • Prevent duplicates: Ensure the same notification isn't sent multiple times when clients retry requests
  • Track delivery: Allow clients to query whether their notification was accepted and its current state

Performance and Reliability Constraints

  • Fast acknowledgment: Confirm receipt within 50ms at the 99th percentile
  • Handle bursts: Scale from baseline 10,000 requests/second to 100,000 requests/second within seconds
  • No data loss: Once acknowledged, messages must eventually be delivered
  • Priority handling: Time-sensitive messages (login codes, security alerts) cannot be delayed by bulk marketing sends
  • Respect limits: Stay within third-party provider rate limits to avoid throttling or bans

Traffic Characteristics

  • Baseline: 10,000 requests/sec
  • Burst peak: 100,000 requests/sec
  • Average message size: 2 KB
  • Delivery targets: urgent messages within 5 seconds, routine messages within 2 minutes

Design Scope

Your design should address:

  1. API contract: How clients submit notifications and check status
  2. System architecture: Components and how they interact
  3. Queue design: How to buffer work and scale processing independently
  4. Traffic management: Handling overload without dropping acknowledged messages
  5. Reliability patterns: Deduplication, retries, and failure recovery

Hints

Hint 1

Separate accepting a request from doing the expensive work of actually sending it

Hint 2

Use separate queues for different priority levels so urgent messages aren't blocked by bulk traffic

Hint 3

Think about what happens when downstream providers are slower than your ingestion rate