Design a system that supports real-time comments for live video streams.
Core features
-
Users can post comments to a specific live stream.
-
Viewers of that stream see new comments appear in near real time.
-
The system must handle “hot” streams with very high QPS (orders of magnitude larger than normal streams).
Requirements to clarify
-
Latency target (e.g., p95 end-to-end publish → visible under 500 ms).
-
Ordering expectations (strict total order vs best-effort vs per-user ordering).
-
Fanout scale (viewers per stream), and whether all viewers must see all comments.
-
Moderation features (spam detection, toxic content filtering, blocklists, slow mode).
-
Retention/replay (store comments for VOD playback and auditing).
Deliverables
-
High-level architecture and major components.
-
Data model and APIs.
-
How you scale ingestion and fanout, especially for hot streams.
-
Justify the choice of streaming/messaging tech (e.g., Kafka vs other MQ/pubsub options).
-
Backpressure, rate limiting, and failure handling.