Skip to content

Case study: Chat (WhatsApp, Messenger)

Design a chat system: persistent connections, idempotent sends with client message IDs, per-conversation ordering and delivery to devices that come and go.

40 min9 steps

By the end you can
  • Estimate message rate, storage and the number of connection gateways
  • Use client-generated message IDs and dedup to make retries invisible to users
  • Guarantee per-conversation order with partitioned storage and delivery
  • Predict the effect of lost acknowledgements, a delivery-worker crash and a slow store

Requirements

Features

  • Groups, history, receipts; online push and offline inboxes

Guarantees

  • Per-conversation order; durable sent tick; no duplicate display; regional p99 <200 ms

What exactly does the 'sent' tick promise the user?

Answer this step to continue.