Backend system design · about 45 minutes
Chat backend
Design the server side of a chat app with one-to-one and group conversations of up to 500 people. Messages arrive in real time when the user is online, are stored for history, and are delivered when an offline user comes back. Users see whether a message was delivered and read. The app runs on phones and in the browser, often on unreliable networks.
Ask first
- How many daily users, and how many messages a day per user?
- Text only, or images and files as well?
- Must the order be exact within a conversation? Across conversations?
- Do we need typing indicators, online status and read receipts in groups?
- How long is history kept, and must it be searchable?
The outline
Write your own outline for each part first.
The strong answer, the pitfalls and the follow-ups opens with a year in the app. What a year includes