Design a messaging service: one-to-one chats delivered in real time, surviving a phone that is offline for a day. Group chats and calls are out of scope.
Requirements
- Send a message and have it arrive within a second
- Deliver to a device that was offline when it was sent
- Show sent / delivered / read state
- Messages survive a server restart
Scale
- Daily active users
- 500M
- Messages
- 40B per day
- Concurrent connections
- ~50M
- Message size
- about 1KB
Draw the design on the board, fill in Your answer, then submit.