Netflix's 17,000-Server CDN
Netflix delivers 15% of the world's internet traffic during peak hours. A 2-hour 4K movie is roughly 14GB. You cannot download 14GB before watching. You cannot stream it as one giant file because a 10-second WiFi hiccup would freeze everything. Video Streaming Architecture solves this challenge by breaking video into smaller segments and dynamically delivering the appropriate quality based on network conditions. Netflix solved this by using Open Connect, 17,000 dedicated CDN servers placed inside ISPs worldwide, serving pre-positioned video segments. The technique behind this is adaptive bitrate streaming.
How Adaptive Bitrate Streaming Works
Adaptive Bitrate Streaming Pipeline:
[Original Video File - 14GB]
|
[Encoder/Transcoder]
|
Encode at multiple quality levels:
+------+------+--------+---------+
| 240p | 480p | 720p | 1080p | 4K
| 300 | 750 | 2.5 | 5 | 15 Mbps
| kbps | kbps | Mbps | Mbps |
+------+------+--------+---------+
|
Split each into 2-6 second segments:
seg001.ts, seg002.ts, seg003.ts, ...
|
Generate manifest file (playlist):
manifest.m3u8 (HLS) or manifest.mpd (DASH)
|
[CDN Edge Servers Worldwide]
Total: 1 movie = 5 qualities x 1800 segments = 9000 filesThe Adaptive Algorithm in Action
Player's Adaptive Algorithm:
Time Bandwidth Buffer Quality Selected Experience
------ --------- -------- ---------------- ----------
0:00 10 Mbps 0s 720p (safe start) Loading...
0:05 10 Mbps 15s 1080p (upgrade!) Crisp
0:30 10 Mbps 20s 1080p Smooth
0:45 2 Mbps 12s 480p (WiFi drop!) Slight blur
1:00 2 Mbps 8s 480p No stutter
1:15 8 Mbps 6s 720p (recovering) Getting better
1:30 12 Mbps 18s 1080p (back!) Crisp again
Key insight: quality changes are SEAMLESS.
Each segment is independently decodable.
Switching from 1080p seg047 to 480p seg048
is invisible to the viewer - no buffering wheel.
Buffer target: 30 seconds ahead
Quality rule: pick highest quality that downloads
faster than real-time playback speedHLS vs DASH
Feature HLS (Apple) DASH (MPEG)
-------------- ------------------ ------------------
Manifest .m3u8 playlist .mpd (XML)
Segment format .ts or .fmp4 .m4s (fmp4)
Codecs H.264, H.265, AV1 Any codec
DRM support FairPlay Widevine, PlayReady
Browser support All browsers Chrome, Firefox, Edge
Latency 6-30 seconds 2-10 seconds
Live streaming Yes (LL-HLS) Yes (LL-DASH)
Standard Apple proprietary ISO standard
Netflix uses: DASH on most devices, HLS on Apple devices
YouTube uses: DASH primarily
Twitch uses: HLS for broad compatibilityLive Streaming: The Latency Challenge
Live Streaming Pipeline:
[Camera] -> [Encoder] -> [Origin Server] -> [CDN] -> [Player]
| | |
encode package decode
~1-2s ~1-3s ~1-2s
distribute
~1-5s
Total glass-to-glass latency: 4-12 seconds
Low-Latency Techniques:
- Shorter segments (0.5s instead of 6s)
- Chunked transfer encoding (send partial segments)
- WebRTC for sub-second (Twitch experiments)
Live vs VOD trade-offs:
Feature VOD Live
----------- --------------- ---------------
Segments Pre-encoded Created in RT
CDN warmup Fast (popular) Cold (new segs)
Seeking Any position Edge only
Latency Zero concern Critical metricInterview Tip
When designing a video streaming system, say: 'I would use adaptive bitrate streaming (HLS for broad compatibility). The upload pipeline transcodes video into multiple quality levels (240p to 4K) and splits each into 2-6 second segments. A manifest file lists available qualities and segment URLs. The player's adaptive algorithm measures bandwidth and buffer level every few seconds, selecting the highest quality that downloads faster than playback speed. Segments are served from CDN edge nodes - once a popular video segment is cached at an edge, all local viewers get it without hitting origin. For live streaming, I would use LL-HLS with shorter segments to minimize latency to 3-5 seconds.'
Key Takeaway
HLS and DASH slice video into small segments at multiple quality levels. The player's adaptive algorithm picks quality based on real-time bandwidth measurement. CDNs cache the static segments globally. This combination enables smooth playback for any user on any connection speed.
