System Design Visualized
Chapter 10 · about 40 minutes

Design a Notification System

Notifications deliver important information: breaking news, product updates, events, offers. They're part of daily life. This chapter designs a system that sends over 10 million mobile push notifications, 1 million SMS and 5 million emails a day, with soft real-time delivery.

Start the interactive chapter
  1. 10.1Types of notificationsRequirements: push notifications (iOS, Android), SMS and email; soft real-time (a slight delay is OK under heavy load); triggered by client…
  2. 10.2Gathering contact infoTo send notifications we need device tokens, phone numbers and email addresses. When a user installs the app or signs up for the first…
  3. 10.3A first design, and its problemsA first idea: services 1…N (billing, shopping, a cron job…) call one notification server, which talks to APNS, FCM, Twilio and SendGrid.…
  4. 10.4Improved design: queues per channelFixes: pull the database and cache out into their own servers, run many notification servers that scale out automatically, and add message…
  5. 10.5Reliability: no data loss, no duplicatesHow do we prevent data loss? Notifications can be delayed or re-ordered, but never lost. The system persists them in a notification log…
  6. 10.6Templates, settings, security, tracking, and the final designNotification template: a preformatted notification with parameters, so you don't build each one from scratch. BODY: Good news! [ITEM NAME]…