Design a video streaming platform like Netflix. Users browse a catalog, and stream high-quality video content on demand across different devices and network conditions.
Content Team
│
▼
[Transcoding Pipeline]
raw video → encode 10 resolutions → upload to CDN
├── H.264 (broad compatibility)
├── H.265/HEVC (4K efficiency)
└── AV1 (best compression, used for 4K+ on supported devices)
Client
│
├── [API Service] → metadata, catalog, recommendations
│
└── [CDN (Open Connect)] → video chunks
│
CDN edge server fetches from S3 origin on cache miss
Open Connect: Netflix's custom CDN with servers inside ISP data centres. This eliminates most transit costs and reduces latency to <20ms for video chunks.
GET /catalog?genre=action&page=1
GET /titles/{titleId}
GET /titles/{titleId}/manifest → returns MPD/M3U8 playlist
(Adaptive bitrate manifest listing all quality levels)
GET /recommendations?userId={id}
GET /playback/resume?titleId={id}&userId={id}
→ { position: 3601, episodeId: "...", deviceId: "..." }
PUT /playback/position
Body: { titleId, position, episodeId, deviceId }
Content metadata (Cassandra + Elasticsearch)
titles: id, name, description, genres[], cast[], rating
episodes: id, title_id, season, episode_number, duration
encoding_profiles: id, title_id, resolution, bitrate, s3_url
User data (MySQL — strong consistency for billing/subscription)
users: id, email, plan, subscription_status
watchlist: user_id, title_id, added_at
watch_history: user_id, title_id, position, last_watched
Recommendations (offline batch job → Redis pre-computed per user)
REDIS: recommendations:userId → List of titleIds
Video is encoded into 10-second chunks at multiple quality levels. The client player (adaptive bitrate algorithm) monitors download speed and switches quality levels seamlessly.
1080p chunk → downloads in 2s (target 10s TTL) → buffer healthy → stay at 1080p
1080p chunk → downloads in 8s → buffer dropping → switch to 720p
Popular new releases are pre-pushed to all edge CDN servers before release. When 22M subscribers hit play at the same time, they all get it from local CDN — the origin sees zero traffic.