How live chat works for a crore viewers: fanout, slow mode, sampling and why your message didn't show (System Design Part 13)
A live chat with a crore viewers can't deliver every message to everyone. How platforms use pub/sub rooms, edge fanout, slow mode, batching, Top chat sampling and moderation, why order isn't guaranteed, and a ready interview answer.
By InternHack Team · · 8 min read · System Design
A wicket falls, the chat scrolls so fast you can't read a single line, and your "DHONI!!!" message never shows up. This is System Design Part 13, and it builds on Part 11 (persistent connections and pub/sub fanout) and Part 12 (live viewer count).
Honesty note: we found no public engineering write-up of JioHotstar's or YouTube's live chat backend. The architecture below comes from what Twitch, Discord and LinkedIn have publicly written. YouTube publishes only the user-facing behaviour (Top chat, slow mode, held for review).
The short answer
Your message goes up the same always-open pipe from Part 11 to a chat service, gets checked by a spam and abuse filter, and is published to that stream's "room". Hundreds of edge servers, each holding about 1 lakh open phone connections, are subscribed to the room and push it down. The real problem is multiplication: every message has to reach every viewer. So platforms deliberately don't show you everything. Speed beats completeness and order.
Sign up free to unlock the full notes
Aage ke sections free InternHack account ke saath khulte hain:
- The core problem: fanout math
- The flow, in order
- The fixes, each answering a felt problem
- Ordering is not guaranteed
- Real failures and fixes
- Why your message didn't show
- Edge cases and limits
- How to answer this in an interview
- The question from the reel
Sources
- Twitch engineering overview (Edge, Pubsub, Clue, 10B messages a day): https://blog.twitch.tv/en/2015/12/18/twitch-engineering-an-introduction-and-overview-a23917b71a25
- Twitch, TwitchPlaysPokemon chat issues: https://blog.twitch.tv/en/2014/02/19/recent-chat-issues-and-twitchplayspokemon-4f8219e479b9
- Twitch API, chat settings (slow mode, delay): https://dev.twitch.tv/docs/api/reference/chat#update-chat-settings
- Twitch IRC limits: https://dev.twitch.tv/docs/irc
- Discord, Maxjourney (quadratic fanout, relays, passive sessions): https://discord.com/blog/maxjourney-pushing-discords-limits-with-a-million-plus-online-users-in-a-single-server
- Discord, how it stores trillions of messages: https://discord.com/blog/how-discord-stores-trillions-of-messages
- LinkedIn live likes, InfoQ talk: https://www.infoq.com/presentations/linkedin-play-akka-distributed-systems
- YouTube help, slow mode, held for review, blocked words: https://support.google.com/youtube/answer/9826490?hl=en
- YouTube help, Top chat vs Live chat: https://support.google.com/youtube/answer/15268877?hl=en
- YouTube Data API, liveChatMessages.list: https://developers.google.com/youtube/v3/live/docs/liveChatMessages/list
- High Scalability, Hotstar emoji swarm: https://highscalability.com/capturing-a-billion-emo-j-i-ons/
- Viewership records: https://deccanherald.com/sports/cricket/india-aus-world-cup-final-match-creates-record-peak-viewership-of-59-cr-on-disneyhotstar-2777180 and https://www.socialsamosa.com/industry-updates/tata-ipl-2025-highest-viewership-across-tv-digital-platforms-jiostar-9379318