YouTube 00:00:01 Protect the original upload A creator uploads one large video while a viewer on a train wants the next few seconds immediately. An illustrative streaming service gives those two customers very different paths through the same content. The app checks the type and the size before anything is sent. The video has an ID already, so the title can be edited during the upload. Bytes 0 to 8,388,607 go around our API servers. Storage joins the parts. A malware scan and a first decode follow. A bad file goes to quarantine. Pieces become renditions. The encode method shows how. A notice to the app. Better qualities join later. Checking a file in the client makes mistakes easier to catch early. The server still authenticates the upload, verifies the expected object and enforces its own validation before publishing anything. 00:00:55 Play from a nearby edge From a tap to the first picture, and a change of quality on the way. The player opens and shows a spinner. A short text from the edge. 1080p at 5 Mb/s: 1.25 MB for 2 s. The decoder has 2 s to work with. Sent in the background. Counts and statistics come from here. Many such events from one network show where edges are missing. A player needs a manifest and playable bytes. Knowing which segment should come next does not help if the corresponding variant has not been encoded or reached a distributable origin. 00:01:30 Build independent renditions The splitter takes it under a lease, so nobody else starts the same film. Each piece starts with a complete picture and needs no neighbour. For every video, since nearly all devices play it. Each gets a quality score, such as VMAF. A poor one is encoded again. Pieces are put in order, sound is aligned, chapters are kept. Segments are ready for the CDN. Large channels are warmed. Generate aligned renditions and publish only complete outputs. A lower bitrate can buy buffer time on a slow connection, while the original remains available to create a replacement encoding. 00:02:05 One film attracts a crowd Ten times the normal traffic for a page. Clients that fail wait a random, growing time before they try again. 95% and more are repeats of the same segments. Limits by token bucket, answer 429, unimportant calls first. The video service grows, and leaves out the suggestions until it has. One reader fills a missing key, the others wait for it. A popular segment is the same object for many authorized viewers. Caching it at the edge can absorb repeated delivery, provided the cache key and authorization policy match how the content is intended to be shared. 00:02:42 When an edge is cold Each call would wait, and threads would run out. No more calls to Redis for a while. Equal reads are joined. Slightly old titles are fine. The video plays; comments and counts may be hidden. Coordinate cache fills and limit simultaneous origin fetches. Removing one edge's data can create a very different traffic pattern from a normal day with a high hit rate. 00:03:04 A worker disappears mid-encode The worker extends its lease every minute. The machine is gone, and so is the half piece. After 5 minutes the task is visible again. Nothing else stopped. The replacement worker encodes the same input with the same settings and publishes a completed output under the intended object name. Conditional publication can prevent an obsolete worker from replacing that result. A retry should produce an equivalent output and publish through a safe completion boundary. Merely choosing the same filename cannot protect readers from a partial file or an incompatible encoder result. The upload is a recoverable transfer, encoding is reproducible work, and playback is a deadline for the next segment. Trace the problem along the path whose promise is actually failing.