System Design
20. System Design Case StudiesAnimated
Distributed Chat Application
Chat rooms across many servers.
The idea
Gateways hold sockets, and pub/sub passes messages between servers.
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
Users connect to any gateway over WebSockets.
- step:
- 1/4
- at:
- Users
1/9
The green dot is a request moving through the system.
Step by step
- 1Client connects to a gateway
- 2Sends a message
- 3Pub/sub routes it to the right gateways
- 4Recipients receive it
Where it is used
Slack-like systems.
Watch out for
Presence and ordering across servers.