System Design: Netflix Video Streaming
Netflix serves 238M subscribers with 15+ petabytes of video. This tests CDNs, encoding pipelines, adaptive bitrate streaming, and distributed storage.
Video Upload and Transcoding
Creator uploads raw video (could be 100GB+)
|
v S3 Raw Bucket
|
v Transcoding Service (FFmpeg workers)
Encode: 4K (2160p) | 1080p | 720p | 480p | 360p
Split each quality into 2-second .ts segments
Generate HLS manifest (.m3u8)
|
v Store segments in S3 + CloudFront CDN
v Notify: video available
Adaptive Bitrate Streaming
Master manifest lists all quality streams:
#EXT-X-STREAM-INF:BANDWIDTH=15000000,RESOLUTION=1920x1080
1080p/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=800000,RESOLUTION=640x360
360p/index.m3u8
Player picks quality by bandwidth:
> 10 Mbps → 1080p
3 Mbps → 720p
500 Kbps → 360p
Switches seamlessly at 2-second segment boundaries
CDN Architecture
Netflix Open Connect Appliances (OCA):
ISP-embedded: servers inside ISPs — fastest, 99% cache hit
IXP: Internet Exchange Points — regional fallback
CloudFront: global fallback
Request: User → Nearest OCA → (cache hit) → segment
→ (miss) → S3 → cache → segment
Q: Why break video into 2-second segments?
Enables adaptive bitrate switching at boundaries, resuming from exact position, parallel download from multiple CDN nodes, independent caching per segment, and DRM per segment. 2 seconds balances seek accuracy against segment overhead.
Comments (0)
No comments yet. Be the first!
Leave a Comment