KatInterview

Build a scalable alert delivery platform with multi-channel support

System DesignModel answer
MediumModel answerSystem Designdistributed-systemsmessage-queuesreliability

Last updated

Design an event-driven system that ingests alert events, fans out to subscribers, and delivers through push, email, SMS, and in-app channels with reliability and preferences.

You're tasked with architecting a platform that accepts alert events from upstream services and delivers them to end users through multiple channels: push notifications, email, SMS, and in-app messages.

The system must handle:

  • Event ingestion and subscriber resolution: Upstream services publish events (e.g., status updates, promotions, security alerts). The platform determines which users should receive each event based on topic subscriptions or explicit targeting.

  • Multi-channel delivery: Route each notification to the appropriate channels (push, email, SMS, in-app) based on the event type and user preferences.

  • Reliability patterns: Implement retry logic, handle provider failures gracefully, ensure idempotency, prevent duplicate deliveries, and use dead-letter queues for persistent failures.

  • User control: Support per-channel opt-outs, quiet hours (time windows when non-urgent notifications are suppressed), and frequency caps.

  • Priority tiers: Critical events (e.g., security codes, time-sensitive updates) must deliver within seconds, while lower-priority marketing messages can tolerate delays or batching.

  • Observability: Track delivery status, identify bottlenecks, and provide APIs for querying notification history.

Assume:

  • ~10 million events per day, with peaks reaching 2,000 events/second
  • Average fanout of 20 recipients per event, with occasional broadcasts to millions
  • Third-party provider quotas and costs are real constraints

Present your design including APIs, data model, architecture diagram, and how you'd address reliability, deduplication, ordering, and rate limiting. Discuss trade-offs and operational considerations.

Hints

Hint 1

Separate ingestion volume from fanout volume—they have different scaling characteristics and the fanout is typically much larger

Hint 2

Use priority-based message queues or topics to prevent low-priority bulk campaigns from blocking urgent transactional alerts

Hint 3

Deduplication requires a deterministic identifier; consider hashing (alert_id, user_id, channel) to make retries idempotent