Turning ink into understanding…
System design · 26 Jul 2026
Design a system that lets millions watch 4K video without buffering.
By Sneha Gupta
Video streaming looks simple on the surface. You press play, and the movie starts. Behind the scenes, a complex system must upload, encode, store, and deliver video to devices all over the world.
This article walks through the classic design: think Netflix, not live TV.
The journey begins when a studio uploads a master video file. That file goes directly into object storage like Amazon S3. Object storage is simple, cheap, and scales to petabytes. You never lose data. You can store the same file in multiple regions.
The original file is huge. You cannot stream a 4K master to a phone. So you transcode it into a ladder of renditions.
A ladder means several copies at different bitrates and resolutions:
Each rendition uses a codec like H.264 or H.265. The encoding step is compute-heavy. Use a queue of worker machines to parallelize the work. Each job reads the source from object storage, encodes a rendition, and writes it back.
Video players do not stream a whole file. They fetch small chunks, typically 2 to 10 seconds long. This is called segmented streaming.
The encoder spits out these segments. For each rendition, you get hundreds or thousands of tiny files. Alongside the segments, you create a manifest file (HLS.m3u8 or DASH.mpd). The manifest lists all renditions. It tells the player: here are the available bitrates, and here are the URLs for each segment.
Now you have thousands of segment files per title. Multiply by thousands of titles. That is a lot of small files. You cannot serve them from a single server to millions of users.
Enter the content delivery network (CDN). A CDN has servers in hundreds of locations (edge nodes). Users fetch segments from the nearest edge. This minimizes latency.
The origin server holds the master copies. The edge nodes cache frequently accessed segments. When a segment is not cached, the edge pulls from the origin. This is a cache miss. To reduce cache misses, you use an origin shield (a middle layer that aggregates requests).
The real magic is adaptive bitrate (ABR). The player watches the network conditions in real time. If bandwidth is high, it requests the 1080p rendition. If bandwidth drops, it switches down to 720p. This happens seamlessly between segments. The user never sees a buffering spinner.
ABR works because the manifest contains all renditions. The player picks the best bitrate for the current network.
You also need a database to store movie titles, descriptions, artwork, user ratings, and watch history. This is a separate system from the video pipeline. A relational database or a NoSQL key-value store works fine. It just needs to be fast for reads. The catalog is small compared to the video storage.
To size the system, start with bitrate, hours, and users.
Assume 100 million active users each watching an average of 1 hour per day. If average bitrate is 5 Mbps, the peak egress is 5 Mbps * 100 million = 500 Tbps. That is a huge number. You need a massive CDN.
Storage: A 4K movie at 15 Mbps for 2 hours is about 13.5 GB. For 10,000 titles, that is 135 TB. But you store multiple renditions, so storage grows. Petabytes are normal.
When a new blockbuster launches, everyone watches at once. This is a spike. To handle it, pre-heat the edge cache. Push popular content to edge nodes before the launch. The first user still gets a fast response. This is called cache warming.
A video streaming system has four main parts:
Every part is designed for scale. Small teams can run this if they use cloud services. Large companies build their own CDN. The principles stay the same.
Want to design a video streaming system from scratch? Try the System Design practice path on Question Better. You can work through streaming scenarios, get feedback, and build confidence. It is free to start.
What is the difference between HLS and DASH? HLS (HTTP Live Streaming) was created by Apple. DASH (Dynamic Adaptive Streaming over HTTP) is an open standard. Both use segmented video and manifest files. The choice depends on your target devices. Most modern systems support both.
Why use an origin shield? An origin shield reduces load on the origin server. It sits between the edge nodes and the origin. When multiple edges request the same segment, the shield fetches it once. This improves cache efficiency and lowers origin traffic.
How do you handle live streaming? Live streaming adds a time constraint. The encoder must produce segments in real time. You still use the same CDN and ABR principles. The main difference is that the content is not stored indefinitely. You may use a lower latency protocol like CMAF.
What is the key metric for video streaming quality? Bitrate matters, but user experience is measured by rebuffering ratio (time spent rebuffering divided by playback time). The goal is below 1% for good quality.
How do you secure video content? Use encryption (AES-128 or Widevine). Encrypt segments and deliver keys only to authorized users. This is digital rights management (DRM). Combine with token authentication on the CDN.
Go further on Question Better
Practice from your own sources, or walk a System Design path with teach-gap lessons.