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.
- 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
- 1Sender sends over a socket
- 2Server stores and routes
- 3Online recipients get it at once
- 4Offline ones get it on reconnect
Where it is used
Chat design.
Watch out for
Connection scale and delivery ordering.