Design a Group Chat App (Slack/Discord)
hard 45 minDesign team chat: channels, threads, unread badges, presence and search.
Where it shows up
The same pattern appears across everyday software.
Slack's channel servers
Slack's engineering blog describes in-memory channel servers, chosen by consistent hashing, and gateway servers that subscribe to them.
Slack's message storage
Slack writes that it moved from shards by workspace to Vitess, so that large customers no longer fill one shard.
Support desks
A chat between a customer and several agents needs the same shared log, order and read positions.
Multiplayer lobbies
Game lobbies use short-lived channels: live push matters more and history matters less.
Incident rooms
During an outage a channel becomes the written record. Order, times and search are used afterwards.
Comments beside a document
Comment threads reuse the thread model: a parent item and an ordered list of replies.