KatInterview

Scalable Notification Platform for Large-Scale Event Reminders

System DesignModel answer
MediumModel answerSystem Designsystem-designemail-pipelinemessage-queue

Last updated

Design a platform that tracks a million active events and reliably emails every registrant about reminders, changes, cancellations and follow-ups, covering scale, delivery guarantees and compliance.

Problem

You are building the backend for a platform where organizers publish events and attendees sign up. The platform must keep at least 1,000,000 events active at the same time and email every registered attendee of an event when something relevant happens: an upcoming-event reminder, a time or venue change, a cancellation, or a post-event thank-you.

Present an end-to-end design. Your answer should cover:

  1. APIs. Create, modify and cancel an event; register or remove an attendee; schedule an email or send one immediately. Explain how writes stay idempotent.
  2. Architecture. The services and queue/topic layout that convert one event-level trigger into many per-recipient emails.
  3. Data and storage. Schemas, indexes, sharding, retention, and where you would choose relational versus NoSQL stores.
  4. Delivery pipeline. Producers, queues, consumers, fan-out, batching, retries, dedup keys, and handling of bounces and spam complaints reported by an email service provider (ESP).
  5. Capacity math. Request rates, recipients per event, and peak emails per second, with the arithmetic shown.
  6. Scaling. Partitioning, autoscaling workers, and backpressure.
  7. Scheduling. Time-based reminders versus event-driven triggers, a distributed scheduler, and how to avoid load spikes when many reminders share the same instant.
  8. Throttling and quotas. Limits per tenant, per ESP, and per recipient domain.
  9. Delivery semantics. At-least-once versus exactly-once, dead-letter queues, and replay.
  10. Reliability. Backoff, the transactional outbox, and recovery after a regional failure or provider throttling.
  11. Observability. Metrics, SLOs, tracing, alerts.
  12. Compliance and abuse. Unsubscribes, suppression lists, double opt-in, CAN-SPAM and GDPR.
  13. Multi-region and disaster recovery, including the consistency trade-offs.
  14. Cost. A rough estimate and managed versus self-hosted options.

Finish by walking through one concrete failure (for example, a regional outage or the ESP throttling you) and describing how the system degrades and then recovers.

Hints

Hint 1

Start with numbers: events x average registrants x emails per registrant gives monthly volume, then apply a burst multiplier (round-hour reminders, a mass cancellation) to get peak emails per second. The real challenge is bursty fan-out, not storage.

Hint 2

Separate the pipeline into stages joined by durable queues: trigger -> fan-out (paginated reads of registrants with a checkpointed cursor) -> per-recipient send jobs -> ESP. Use a transactional outbox so the event change and its notification trigger are committed atomically.

Hint 3

Accept at-least-once delivery and make consumers idempotent with a deterministic message key (campaign + registration) and a conditional insert into a send log. Treat cancellations as a high-priority path and reminders as latency-tolerant so they can be jittered and throttled.