SysPad › Examples › Design YouTube (upload + playback)
Design YouTube (upload + playback)
Upload → original storage → a transcoding-queue-driven worker pool (multi-stage DAG: codecs, resolutions, thumbnails) → transcoded storage + a completion handler updating metadata, with playback served from CDN.
The upload and transcoding pipeline, plus the CDN-served playback read path - two very different traffic shapes on one system.
- Throughput: 50 req/sec
- First to saturate: Transcoding Workers
- Estimated cost: $1,273k/mo
How it works
- Original Storage
- The raw uploaded file, stored once. Landing it here and returning fast is what lets the slow transcoding happen asynchronously behind a queue.
- Transcoding Workers
- Stands in for a transcoding-server DAG: split audio/video, encode each codec/resolution/bitrate variant, watermark, thumbnail. Fanned out across a large Batch pool because each job is minutes long.
- CDN
- Playback front door. Nearly all watch traffic is served from the edge cache; only cold segments fall through to transcoded storage as the origin.
Request flows
Upload a video
- Content Creator
- DNS
- Load Balancer
- Upload API
- Original Storage
- Transcoding Queue
- Transcoding Workers
- Transcoded Storage
- Completion Queue
- Completion Handler
- Metadata DB
Watch a video
- Viewer
- CDN