LESSON 08 · Reliability and trust

Plan for failure and removal

Define recovery, observability, and policy enforcement across upload, processing, and playback.

SYSTEM VIEW

The video path

Diagram view
Pending age—
Rebuffering—
Video status—

Watch a stalled queue hide behind healthy playback, then follow a takedown through the API, the edge and URLs already issued.

  1. A dropped upload or a crashed worker resumes or retries, with bounds; a bad source format fails with a clear error. Replicate durable objects and metadata against the availability target, and test restores. Here a new upload waits about 12 minutes to become ready, an example figure.

    Recoverable
    retry, bounded
    Bad source
    fail clearly
    Durable data
    replicate, test restores

    What changed

    • New upload queued
    • Retries are bounded
    • A bad source fails clearly
  2. The task queue stalls, so new uploads wait hours to become ready: 3 in this example. Video 81 and other existing videos keep playing from the CDN edge with rebuffering steady, so a single “service healthy” signal would still pass and hide the stall.

    What changed

    • Task queue stalls
    • Pending age: 12 min → 3 h
    • Playback unchanged
  3. Creator path: upload completion, pending-video age, queue lag, transcode failure. Viewer path: CDN hit rate, time to first frame, rebuffering, egress. Pending age at 3 hours with rebuffering steady points to the creator path. Trace one video ID through publication and one session through playback.

    Creator path
    pending age, queue lag
    Viewer path
    first frame, rebuffering

    What changed

    • Creator-path measures
    • Viewer-path measures
    • Fault on the creator path
  4. A takedown starts in policy: video 81’s status changes to blocked in the Metadata DB. The Watch API reads it, stops returning a manifest and answers 403. Rights work can grow large: YouTube’s Content ID matches uploads against reference files from rights holders.

    Status
    blocked
    Watch API
    no manifest

    What changed

    • Video 81’s status: blocked
    • Watch API returns no manifest
    • 403 for new requests
  5. Blocking the row stops new manifests, but the CDN edge still holds copies of video 81’s segments. A CDN purge clears them by path or tag, here v81/*, so anything the edge serves next must come from Video storage, the origin.

    Purge
    v81/*
    By
    path or tag

    What changed

    • Video storage, the origin
    • v81 segments purged from the edge
  6. A viewer already playing holds a URL signed for five minutes. The edge accepts it but misses after the purge, and Video storage, the origin, refuses the blocked video. Once five minutes pass, the edge refuses the expired URL itself. Short signatures bound how long issued access lasts.

    URL signed for
    5 min
    Origin
    refuses v81
    After 5 min
    edge refuses

    What changed

    • Valid URL, but origin refuses v81
    • Access ends when the URL expires
  7. DRM, encryption and watermarking are different controls. DRM restricts playback to licensed players through systems such as Widevine and FairPlay; a watermark marks a copy so a leak can be traced. DRM adds license servers and per-platform packaging, so a free lecture site would skip it.

    DRM
    licensed players only
    Watermark
    traces a leak

    What changed

    • License server
    • DRM license
    • Watermark on the copy

Space plays · ← → step · Home resets

THE IDEA

How it works

Recoverable upload and worker failures should resume or retry with bounds; bad source formats should fail clearly. Replicate durable objects and metadata against the availability target and test restore paths. A stalled queue delays newly uploaded videos becoming ready while existing videos may still play, so a single “service healthy” signal would hide it.

Measure upload completion, pending-video age, queue lag, transcode failure, CDN hit rate, time to first frame, rebuffering, and egress. Trace one video ID through upload and publication, and one session through playback. If pending-video age climbs to hours while rebuffering holds steady, the creator path has the problem.

Access control, rights claims, malware checks, abuse reports, and takedowns need product policy and operating workflows. YouTube’s Content ID, which matches uploads against reference files from rights holders, shows how large that work can become. Removal must block new access, change metadata, and invalidate or expire cached media. Walk through one takedown: the status changes to blocked, so the watch API stops returning a manifest. A CDN purge clears cached segments by path or tag. A viewer already playing may hold a URL signed for five minutes, so short signatures bound how long issued access lasts, provided origin also refuses the blocked video.

DRM, encryption, and watermarking are different controls with different guarantees. DRM (digital rights management) restricts playback to licensed players through systems such as Widevine and FairPlay; watermarking marks a copy so a leak can be traced. DRM adds license servers and per-platform packaging, so a free lecture site would skip it.

DECISION POINT

A rights holder requests immediate removal of a popular video. Why is hiding its database row insufficient?

Write a sentence or two to unlock the guidance. Committing first is what makes it stick.

Keep in mind

  • Measure the creator path and viewer path independently.
  • Design takedown and recovery as end-to-end flows across storage, metadata, and caches.
CHECK YOUR UNDERSTANDING

Put it into practice.

1 OF 3
DiagnoseQUESTION 01

Time to first frame has doubled in one region, while upload success, queue age, and other regions look normal. Where should you look first?

Choose an answer. You’ll see the explanation once you get it right.

Design a podcast publishing and listening platform

Apply the video pipeline to audio, where files are small, position saves far outnumber plays, and the biggest spike arrives on a published schedule.

The brief

Creators upload episodes to a show and schedule their release. Listeners stream or download episodes in your app, and other podcast apps read a public RSS feed (an XML list of episodes with links to audio files). A listener who stops on one device should be able to resume on another. A popular show releases new episodes at an announced time, and that must not degrade the service. Keep recommendations, search, comments, and transcripts outside this exercise.

  • 2 million daily listeners play 2 episodes a day, for 40 minutes each on average, at 128 kbit/s. Use decimal units and 86,400 seconds per day.
  • Peak traffic is 3 times the daily average. Playing clients save their listening position every 30 seconds.
  • Creators publish 20,000 episodes a day. Each source averages 100 MB, and encoded outputs add 60 MB per episode. Estimate one year of storage, before replicas.
  • A popular show releases an episode at an announced time, and 500,000 listeners start it within 15 minutes, on top of normal traffic.
  • An episode must not appear in feeds until its audio is playable. Position may lag by up to a minute across devices, and listening done offline must sync later without overwriting newer progress.

Reading a design isn’t the same as producing one under a clock. Try it timed: the requirement change stays hidden until partway through.

Loading your draft…

State your scope and assumptions. Estimate play rate, delivery bandwidth, concurrent listeners, position-save rate, one year of storage, and the added load from the launch. Keep units visible.

0 / 4,000 characters

Name the components and what each stores. Trace one publish, one play with resume on a second device, and one fetch by a third-party app reading your feed. An arrow list is enough.

0 / 4,000 characters

Choose a likely bottleneck and the evidence for it. Explain how you prepare for the scheduled launch, and what listeners experience if the position store is unavailable during it.

0 / 4,000 characters

Respond to the per-listener ads change below. Explain what can still be cached, how offline and RSS downloads are handled, and how saved positions stay correct.

The requirement changesAdvertisers now want different ads for different listeners, inserted into episodes at play time, while each episode's content stays the same for everyone. What happens to your caching, offline downloads, RSS-delivered files, and saved positions?

0 / 4,000 characters

Write an initial response in all four sections to unlock the checklist and two worked approaches.

Next chapter: Google Drive

0 of 3 checkpoints answered correctly to complete this lesson.