algomiBlogs
← All posts

Chat and Notification Systems: Real-Time Delivery at Scale

Algomi Research · Created 2026-09-29 · Updated 2026-10-15 · System Design

Interview Roadmap Deep Dives · Part 14 of 28
Stock Exchange and Broker Design: Order Books, Matching Engines, and RiskNews Feed and Social Graph: Fan-Out, Ranking, and the Celebrity Problem
Page 1 of 1

"Reached home?"

Asha sends her friend Ben a two-word message at 11 pm: "Reached home?" This guide follows that message, and the problems it runs into, through a WhatsApp-style chat app. Then it follows the one-time password (OTP) Ben needs the next morning through a notification system. (Asha, Ben, the app and every number here are made up for teaching.)

Think of the app as a postman who never stops walking. His promise: "I'll hand this note to Ben within a second if he's home, and keep it safe until he is if he's not." The notification system is the postman's cousin. He rings the doorbell, sends a text or emails, depending on what Ben prefers, and takes care not to ring twice.

Both problems are about four things:

  • holding a connection open,
  • routing to the right machine,
  • not losing messages,
  • fan-out.

Here is what goes wrong along the way:

What goes wrong Idea it forces
"My message took ten seconds" Persistent WebSocket connections
"Which of 5,000 servers is Ben on?" The session registry
"Ben got 'Reached home?' twice" Client message IDs and idempotency
"The replies came in the wrong order" Server-assigned sequence IDs
"Ben was on a flight for six hours" Offline sync from the last seen ID
"The college group, and the 200,000-member cricket channel" Group fan-out
"The app drains my battery" Cheap, approximate presence
"My OTP arrived after the Diwali sale emails" The notification platform

This guide continues from Kafka and messaging. It pairs with News feed, which shares the fan-out theme.

1. What the app must do, and at what scale

  • Functional: one-to-one and group messages, delivery and read receipts, online presence, media, and message history across devices.
  • Non-functional: latency well under a second, no lost messages, ordering within a conversation, and working on flaky mobile networks.

Hypothetical scale. 500 million daily users each sending 40 messages is 20 billion messages per day. That averages about 230,000 messages per second, with peaks several times higher.

You've reached the free preview of this post.

Subscribe to the Blogs plan (₹99/mo) — or use any Algomi Suite, Career, Investor, or Trader plan — to keep reading.

See plans

Sources

Interview Roadmap Deep Dives · Part 14 of 28
Stock Exchange and Broker Design: Order Books, Matching Engines, and RiskNews Feed and Social Graph: Fan-Out, Ranking, and the Celebrity Problem