Live comments are a feature often used in streaming platforms, sports apps, and social media events where users can post and view comments in real time as an event unfolds.
For example, during a live football match or a concert stream, thousands or even millions of viewers may send comments simultaneously, which appear instantly for all participants.
In this chapter, we will aim to design a low-latency, scalable live comment system that allows thousands or even millions of users to exchange messages in real time during a live event.
Three challenges drive the design. Latency means messages must be delivered in near real-time. Fanout means a single message needs to be broadcast to millions of subscribers simultaneously. Ordering means comments should appear in a logical, roughly chronological order.
Let’s begin by clarifying the requirements.