KatInterview

Build a Large-Scale Live Video Broadcasting Service

System DesignModel answer
MediumModel answerSystem Designsystem-designlive-streamingcdn

Last updated

Design a platform where creators broadcast live video to millions of viewers with low delay, adaptive quality, real-time chat, stream discovery, and replay after the stream ends.

Problem

Design a platform on which creators can go live and large audiences can watch them within a few seconds. You have about 45 minutes. Treat the discussion as a design review: clarify scope, size the system, sketch the architecture, then go deep on the hardest parts.

What the platform must do

  • A creator starts a broadcast and pushes video to the platform in real time.
  • Viewers watch with near-live delay. Glass-to-glass latency must stay under 10 seconds.
  • Each stream has a live chat that feels instant (sub-second delivery for most users).
  • Viewers can browse and find streams that are currently live.
  • Finished broadcasts are recorded and can be replayed on demand.
  • Playback adapts to the viewer's network, so people on weak connections can still watch.

Quality targets

  • A single popular stream may have millions of concurrent viewers.
  • Broadcasts must not drop mid-stream; the system should be highly available.
  • Every tier should scale horizontally as audience grows.

Assumed scale

  • 50M daily active users, 10M concurrent viewers at peak, 100K concurrent broadcasters at peak.
  • Average broadcast lasts 2 hours; the average stream has about 100 viewers, but the top streams have millions.
  • Typical bitrates: 1080p about 6 Mbps, 720p about 3 Mbps, 480p about 1.5 Mbps, 360p about 0.8 Mbps.
  • VOD retention of 30 days.

Out of scope

Payments and subscriptions (mention only), ML-based moderation, mobile client details, and authentication internals.

What to cover

  1. Clarifying questions and a back-of-the-envelope estimate (ingest, egress, storage, request rates).
  2. A high-level architecture with the main components and APIs.
  3. A deep dive into the video path (ingest, transcoding, packaging, delivery through CDNs).
  4. How chat scales to a very large stream.
  5. How recording/VOD and viewer counts/discovery work.
  6. The key trade-offs and failure scenarios.

Hints

Hint 1

Split the system into three independent paths: video ingest, video delivery, and chat. Ask what happens to each if the others fail.

Hint 2

Compute egress (10M viewers at about 3 Mbps is roughly 30 Tbps) and playlist request rate. Then check the latency budget: classic 6-second HLS segments with a three-segment player buffer cannot meet a 10-second target, so what must change?

Hint 3

For the hottest stream, count chat deliveries per second (viewers times messages per second). Naive fan-out is impossible, so think about gateway-level subscriptions, batching, sampling, and rate limiting.

Hint 4

Think about the thundering herd when a new segment appears: how do edge and mid-tier caches collapse requests so the origin sees hundreds, not millions?