Whole systems / 5 / 7
Design a video streaming site
Creators upload hour-long 4K videos, viewers watch on phones over shaky mobile links, and a premiere brings 200 000 people at once. A video site built step by step: resumable uploads, a transcoding pipeline, HLS with adaptive bitrate, a CDN, view counting and cold storage.
- 16 min
- Advanced
- 12 steps
- Time to first frame
- —
- Rebuffering
- —
- Upload to playable
- —
- Origin traffic
- —
- Storage cost
- 18 000 $/mo
- request
- reply
- redelivery
- duplicate
- lost
Numbers are a model scenario, not measurements
The real request
Creator → Upload APIRequest
POST /v1/videos HTTP/1.1
Content-Type: video/mp4
Content-Length1: 2147483648
Authorization: hidden
-- 1.4 GB sent after 23 minutes, then the hotel Wi-Fi drops2
Response
HTTP/1.1 504 Gateway Timeout3
Content-Length— 2 GB in one body. Any break loses all of it.1.4 GB— Almost three quarters sent, and thrown away.504— The gateway gave up waiting. The creator sees "upload failed".
Build it yourselfCheat sheetCompare lessons
Course: 74 lessons
01 Foundations
02 Scaling
03 Data & storage
04 Communication
05 Reliability
06 Architecture
07 Security
08 Shipping
09 Whole systems
10 Business processes
11 Case studies