Course contentsShow
← System Design
Lesson 1630 of 1,91939. Real-World System: Image and Video HostingFree lesson

Live Streaming Architecture

Extend system to support real-time video ingestion, transcoding, and low-latency distribution for live content.

Live Streaming Architecture

What you'll learn: How to design a system that ingests, processes, and distributes live video content with minimal delay to millions of concurrent viewers.

The Core Challenge

Unlike pre-recorded video hosting, live streaming requires real-time processing: a content creator broadcasts video right now, and viewers watch it within seconds. You need to accept a continuous stream, transcode it on-the-fly into multiple quality levels, and distribute it globally before viewers notice lag.

Architecture Components

Ingestion servers receive the raw stream from the broadcaster (typically using RTMP or WebRTC protocols). They immediately forward this to a transcoding pipeline running on GPU-accelerated workers that generate multiple bitrates simultaneously—no time for asynchronous queues; transcoding must keep pace with the live feed.

Origin servers host the freshly encoded segments (HLS or DASH chunks, typically 2-10 seconds each). These segments are immediately pushed to CDN edge locations using the push model you studied earlier, minimizing propagation delay.

Low-Latency Distribution

Traditional CDN caching won't work—you can't cache something that doesn't exist yet. Instead, use origin shield to prevent overwhelming your origin during viral streams, and chunked transfer encoding to stream segments as they're created rather than waiting for completion.

For sub-second latency (ultra-low latency streaming), use WebRTC for peer-to-peer distribution or HTTP/3 with 200ms chunks, though this increases complexity significantly.

State Management

Track active streams in a distributed state store (like Redis), monitor viewer counts in real-time, and use adaptive bitrate streaming logic identical to on-demand video—viewers still need quality selection based on their bandwidth, but the manifest updates continuously with new segments.

Key Takeaway: Live streaming extends your media hosting architecture with real-time ingestion and GPU-powered transcoding that processes video as fast as it arrives, paired with push-based CDN distribution to minimize viewer latency.