System design case study C22 · CDN · Video

Design Live Streaming at Cricket-Final Scale

Tens of millions of people watching the same final over at the same moment. Recorded video can be cached for days; live video is created every two seconds and must reach everyone within seconds. This is CDN engineering at its limits.

What you'll be able to explain
  • Trace a live video from the stadium camera to millions of phones
  • Explain segments, adaptive bitrate and the latency trade-off
  • Design a CDN tier that survives a 25-million-viewer spike
  • Handle concurrency counts, live chat and ads without hurting playback
  • Plan for the moment everyone joins at once

Scope

Functional

  • Stream live matches in multiple qualities and languages (commentary tracks).
  • Viewers can join late, pause briefly and rewind up to a few hours (DVR window).
  • Show a live viewer count; overlay score updates; insert ads in breaks.

Non-functional

  • Peak concurrency: 25–50 million viewers for a final.
  • Glass-to-glass latency under ~10–20 s (lower is better, but stability matters more).
  • Startup time < 2 s; rebuffering ratio < 0.5%.
  • Must not fail at the moment of peak interest (the last over).

Out of scope: video on demand catalogue, payments and subscriptions, recommendations.

Size

  • 25M concurrent viewers × average 2.5 Mbps ≈ 62 Tbps of egress at peak. That is more than any single CDN node, data centre or even one provider comfortably serves; it needs multiple CDNs and ISP-embedded caches.
  • Segments of 4 s at 5 renditions (240p to 1080p) × 3 commentary languages: each rendition produces 1 segment per 4 s, a tiny number of unique objects. The challenge is fan-out, not storage.
  • Manifest requests: each player refreshes its playlist every segment duration → 25M / 4 s ≈ 6M manifest requests/s plus ~6M segment requests/s.
  • Join spike: after a wicket or at the start of the chase, millions join within a minute.

Decision: almost all load must be absorbed by caches close to users. Origin should see each segment requested only a handful of times, no matter how many viewers.

The pipeline

CLIENTStadium feedproduction truckNETWORKIngestredundant, 2 sitesWORKERLive encodersABR ladderWORKERPackagerHLS / DASH segmentsOBJECT STOREOrigin + shieldsegment storeNETWORKCDN ANETWORKCDN B + ISP cachesCLIENTPlayersapps, TVs, webSRT / dedicated links
Live streaming pipeline: contribution → encode → package → origin → multi-CDN → players.
  1. Contribution: the broadcast feed reaches ingest points over redundant, dedicated links (two independent paths, two sites).
  2. Encoding: live encoders produce an adaptive bitrate (ABR) ladder: the same picture at, say, 240p/400 kbps up to 1080p/6 Mbps, with aligned keyframes so players can switch between them.
  3. Packaging: the stream is cut into short segments (2–6 s) with a manifest (playlist) listing the latest segments, in HLS and/or DASH formats. Optionally DRM encryption.
  4. Origin and shield: segments are written to an origin store; a shield cache layer in front of it collapses requests from all CDN edges.
  5. Delivery: multiple CDNs plus caches embedded inside large ISPs serve players.
  6. Player: downloads the manifest, picks a rendition based on measured bandwidth, fetches segments, and adapts continuously.

The 30-second summary

Say it in the interview

"The stadium feed comes in over two independent paths, gets encoded into an ABR ladder by redundant encoders, and is packaged into 2–4-second HLS/DASH segments. Segments are immutable and cached for hours; manifests are cached for about a second. A shield plus regional tiers with request collapsing means the origin sees about one request per segment per rendition, while multiple CDNs and ISP caches serve tens of terabits per second, steered by real-time quality data. The control plane is pre-scaled for the join spike, with cached entitlements and a static fallback, so 'play' keeps working even if everything else degrades."

Follow-up questions the interviewer may ask

  1. How would you get latency under 5 seconds?
  2. How do you count unique viewers precisely?
  3. What if a CDN fails mid-over?

Model answers to each of these are in the book.