"Case Study: Chat System"
A chat system (an app where people send short messages to one person or a group and see replies at once) looks easy until messages must arrive in the right order, once, even when a phone is off. This note builds one design from stated assumptions, not "the" answer. The central trade-off: an open connection for every user gives speed but costs memory. After this note you can size the system, explain WebSocket, find a user's connection, and give every message a fixed place in its conversation.
Topics in this section
- Requirements and scope
- Numbers
- API and data
- The first design
- Keeping millions of connections open
- Delivering messages in order, once, to everyone
- Failures and scaling