Skip to content
BytePatterns

Design a Notification System

System Design Cases: lesson 5 of 20

One event, three channels, and never the same message twice.

Lesson 5 of 20 · 6 min

Design a Notification System

Step 1 of 11

One event, three possible channels, and a user who does not want all three.

The Idea

Turn one event into the right messages on the right channels — push, email, SMS — honouring each user's preferences. Assume 5 million users and bursts of 200 000 notifications a minute after something big happens.

Real-World Example

A school announcing a snow day: one decision, then the app, the text and the phone tree. A parent who gets all three at once is irritated, not better informed, so somebody decides which channels fire.

The Tradeoff

A queue makes third-party outages survivable and makes duplicates possible, so every notification carries an idempotency key. Batching and quiet hours cut the volume people actually feel, and they also delay the one message somebody was waiting up for.

Your turn

Put the steps in the right order.

  1. Hand the payload to the channel provider and record the result
  2. Accept the event and write it to the queue
  3. Look up the user's channel preferences and quiet hours
  4. Skip the job if this idempotency key was already sent

Mini quiz

1 / 3

An idempotency key on each notification prevents:

New lessons land every few weeks

Leave an address and we will tell you when the next one is up. That is the only reason we will use it.

One address, stored so we can email you. Nothing else, ever.