Design a Live Streaming Platform
HardSystem design · Media · Meta · TikTok
Design a live video streaming platform: broadcasters push a stream, viewers watch with adaptive bitrate and a few seconds to tens of seconds of latency. Scale: 100K concurrent streams (about 600Gbps of ingest at 6Mbps), up to 2M viewers on one stream (several Tbps of egress). Cover ingest and failover, the transcoding ladder and its cost, segmenting and the CDN, low-latency modes, stream health and moderation controls, and replay. Chat is a separate system.
Requirements
- Ingest at the nearest edge, tolerate reconnects, and transcode once per stream rather than per viewer
- Distribute segments and manifests through a CDN with an origin shield; manifests have very short TTLs
- State the latency target and the mechanism that achieves it (segment length, partial segments, WebRTC)
- Monitor stream health, support a kill switch, and produce a replay from the same segments