SD-7 · VIDEO STREAMING · INTERACTIVEBreak it.
Break it.
Then fix it.
Turn up the audience, watch what melts, and add the parts a real video service needs. Every switch is a decision you would defend in an interview.
CHALLENGEStream to 10M concurrent viewers with under 1% rebuffering and the first frame in under 2 seconds.
StatusDOWNAt 1M viewers
Rebuffering0.4%Share of watch time stalled, target under 1%
Start time9.6 sPress play to first frame, target under 2 s
Origin traffic150 Gbit/s5% of all bytes reach the origin
ViewersLIVE
1.0M watching · 72 uploads/min3.0K Gbit/s of video
CDN edgeOK
95% of bytes from the edge2.9K / 60K Gbit/s
Object storageOK
4 s segments, 6 renditions150 / 1.0K Gbit/s
API serversDOWN
Also encoding uploads inline3.3K pages/s + encoding
Metadata DBOK
Videos, channels, manifests3.3K / 10K reads/s
Uploads are encoded on the API servers. 72 uploads a minute each need about 7,200 CPU-seconds to encode, and the API servers are drowning in it, so watch pages time out. Put each upload on a queue and let a separate worker pool encode it.
95%Bytes from the edgeA segment never changes once written, so the CDN can keep it as long as it likes.
4 sSegment lengthShort enough to switch bitrate quickly, long enough to keep requests cheap.
7,200CPU-seconds per uploadA 10-minute video in 6 renditions. Encoding is the expensive part, so it runs on its own pool.
1%Bytes at the originThe edge answers 95%, the shield 80% of what is left.
Want the reasoning behind every switch?Visual walkthroughFull write-up
Was this lab useful?Your vote tells us what to improve next.