Mahir Shahriar Tamim

AI Researcher · Explainable & Responsible AI · Vision, Language & Agentic Systems

← All posts

A series · started November 2026

Building a Notification Service

Start with Part 1: What a notification service actually does →
payment push SMS · OTP email inbox one event, many channels

TL;DR

  • A notification service decides who hears about something, on which channel, once and in time.
  • Other services publish events. It routes them, fills in templates and queues one job per channel, and workers call the providers.
  • Seven modules: channels, Kafka vs RabbitMQ, OTPs, retries, monitoring and sizing, templates and preferences, campaigns.

Any app that moves money talks to its users all day. A push when money arrives, an SMS with a one-time password when you log in from a new phone, half a million messages for a campaign. Behind it sits a notification service.

I’ve been building one. I honestly thought it would be the easy part, but it’s a small distributed system. An OTP must arrive in seconds even while a campaign clogs the pipes. An SMS must never go out twice, even when the provider times out. Every message costs money, and providers go down on busy Friday nights.

A notification service turns “something happened” into “the right person heard about it, once, on the right channel, in time”.

Right person means contact details and device tokens, once means idempotency, right channel means preferences and routing, and in time means priorities and capacity planning.

I started from the notification chapter in Alex Xu’s System Design Interview and added what I ran into while building. Kafka comes up a lot, and my Learning Kafka series explains how it works. Each module has an in-browser demo, a quick question and a short Q&A.

payments auth / login campaigns notification API validate · prefs rate-limit template Kafka push sms.otp sms.bulk email workers APNs / FCM workers SMS gateway A / B workers workers email provider notification log sent · delivered · failed retry + DLQ backoff, then park status OTPs get their own topic, so a campaign can never block them
The design this series builds, piece by piece.

Roadmap

  1. 1Published · Nov 2026 · 4 min read

    What a notification service actually does

    Four channels and their providers, device tokens and preferences, one queue per channel, and routing each event to the right channels.

  2. 2Published · Nov 2026 · 5 min read

    Why Kafka, and why not RabbitMQ?

    A diary versus a post office: replay and many readers on one side, priorities, delays and per-message retries on the other.

  3. 3Published · Nov 2026 · 5 min read

    OTP: the notification that can’t wait

    Why an OTP must never queue behind a campaign, expiry checks, gateway failover, and treating a code like a password.

  4. 4Published · Nov 2026 · 5 min read

    Retries, duplicates and dead letters

    Timeouts that might have worked, idempotency keys, backoff with jitter, retry and dead-letter topics, and circuit breakers.

  5. 5Published · Nov 2026 · 4 min read

    Watching it run, and sizing it

    The metrics that catch silent failures, tracking a message’s life, what SMS really costs, and a capacity estimate you can play with.

  6. 6Published · Nov 2026 · 7 min read

    Templates, languages and user preferences

    One message in two languages across four channels, why one emoji can double an SMS bill, opt-outs, quiet hours and frequency caps.

  7. 7Published · Nov 2026 · 6 min read

    Campaigns and bulk sends

    Sending to a million users without hurting OTPs, the providers, or the budget: snapshots, chunks, token-bucket throttling, kill switches and unsubscribe.