Skip to content
StackDecode
System Design
20. System Design Case StudiesAnimated

Messaging Application (WhatsApp)

Real-time one-to-one and group messaging.

The idea

Persistent connections deliver messages, with a store for offline users and end-to-end encryption.

Watch it work

Press play, pause, or step through. Some animations have settings you can change.

AliceChat gatewaySession storeMessage storeBob
  • client
  • gateway / proxy
  • service
  • cache
  • data store
  • queue / stream

Alice keeps a WebSocket to a gateway.

step:
1/4
at:
Alice
1/9

The green dot is a request moving through the system.

Step by step

  1. 1Sender sends over a socket
  2. 2Server stores and routes
  3. 3Online recipients get it at once
  4. 4Offline ones get it on reconnect

Where it is used

Chat design.

Watch out for

Connection scale and delivery ordering.

Related