Skip to content

Part 5 · Blueprint 27

Video Streaming Platform Architecture

15 min reading · Sources · Editorial review pending

Uploading bytes does not mean every derived rendition is safe to publish.

More
20px
Reading list
Page details

Published date · Last edited:

Draft edition. Editorial review and supplementary reading recommendations are still being completed.

Format: Architecture walkthrough. Prerequisites: the beginner bootcamp. Chapter prerequisites: Message Queues & Event Streams: Kafka vs. RabbitMQ, CDN Architecture, Anycast & Edge Compute.

Sixty-second mental model

Problem: Uploading bytes does not mean every derived rendition is safe to publish.

Use: Make processing versioned and publish a verified manifest.

Design boundary: Upload, transform, publish and stream video versions. Raw uploads, encoding jobs and published playback manifests have different lifecycles. Publish only manifests whose referenced renditions satisfy the chosen readiness contract; exclude recommendation ranking and live broadcasts initially.

Layer 1 · Intuition

Hypothetical scenario: Northwind is designing video delivery. Maya represents product requirements, Dev implementation and Priya reliability. The team must agree what one segment means and which component owns the media publication manifest.

Think of a factory turning original footage into published packages. Separate the requester from media publication manifest, then identify the retained evidence needed after failure.

Authority
The entitled state owner.
Invariant
A rule preserved across concurrency and failures.

Architecture and worked reasoning

Design boundary: Upload, transform, publish and stream video versions. Raw uploads, encoding jobs and published playback manifests have different lifecycles. Publish only manifests whose referenced renditions satisfy the chosen readiness contract; exclude recommendation ranking and live broadcasts initially.

Responsibilities on the request path

Video delivery: responsibilities and request directionUpload, transform, publish and stream video versions. Raw uploads, encoding jobs and published playback manifests have different lifecycles. Publish only manifests whose referenced renditions satisfy the chosen readiness contract; exclude recommendation ranking and live broadcasts initially.Upload storeTranscode workersPlayback manifestEdge segments
Upload, transform, publish and stream video versions. Raw uploads, encoding jobs and published playback manifests have different lifecycles. Publish only manifests whose referenced renditions satisfy the chosen readiness contract; exclude recommendation ranking and live broadcasts initially.

Domain interface and access patterns

POST /uploads → upload_id, constrained destination; POST /uploads/{id}/complete → pending verification; GET /videos/{id}/manifest → published version

uploads(upload_id, owner_id, source_key, checksum, state); renditions(video_id, source_version, profile, output_key, state); manifests(video_id, version, rendition_refs). Guard the current pointer and retain referenced immutable outputs.

Workload and limiting resource

Choose 10,000 concurrent viewers at an average 4 Mbit/s each: delivery is 40,000 Mbit/s, or 40 Gbit/s. At a selected 95% byte hit ratio, normal origin traffic is 2 Gbit/s. A one-hour rendition at 4 Mbit/s is 4 × 3,600 / 8 = 1,800 MB in decimal units. Additional renditions add storage; viewer count and upload rate are independent workload dimensions.

Keep the units attached to each intermediate result. The assumptions above describe a hypothetical exercise, not observed vendor capacity. A real capacity decision also needs a measured service curve, skew, recovery traffic and an explicit admission policy for overload.

Mutation or publication path

Video delivery: mutation boundaryCreate an upload identity and verify the source object. Then: Produce versioned renditions through restartable jobs. Then: Atomically publish a manifest referencing complete retained output.Step 1
Create an upload identity and verify the source object.
Step 2
Produce versioned renditions through restartable jobs.
Step 3
Atomically publish a manifest referencing complete retained output.
Create an upload identity and verify the source object. Then: Produce versioned renditions through restartable jobs. Then: Atomically publish a manifest referencing complete retained output.
  1. Create an upload identity and verify the source object.
  2. Produce versioned renditions through restartable jobs.
  3. Atomically publish a manifest referencing complete retained output.

Observation and recovery path

Video delivery: observation boundaryAuthorize playback and obtain a specific manifest version. Then: Fetch segments through the CDN. Then: Preserve segment versions for the playback session and declared retention horizon.Step 1
Authorize playback and obtain a specific manifest version.
Step 2
Fetch segments through the CDN.
Step 3
Preserve segment versions for the playback session and declared retention horizon.
Authorize playback and obtain a specific manifest version. Then: Fetch segments through the CDN. Then: Preserve segment versions for the playback session and declared retention horizon.
  1. Authorize playback and obtain a specific manifest version.
  2. Fetch segments through the CDN.
  3. Preserve segment versions for the playback session and declared retention horizon.

Failure that changes the decision

Hypothetical scenario: A stale encoding job finishes after a replacement version and overwrites its manifest. Guard publication by source/version identity and retain each referenced output until collection is safe.

Attempt this decision before reading the explanation

Can a manifest be published as soon as one output segment exists?

Only under a specifically designed partial/live publication protocol. For a complete prerecorded version, validate all required renditions and references first; otherwise playback can fail midstream despite a successful start.

Supporting mechanism analysis

Hypothetical scenario: Northwind. Maya represents product, Dev implementation and Priya reliability. The following workflow develops the underlying mechanism.

In short. Separate durable upload from playable publication. Publish only the currently authorized complete presentation version.

The design separates upload acceptance, validated source, processing, publication and delivery. The initial product is on-demand recorded video with captions and a small set of renditions. Live broadcasting, recommendation training, advertising insertion and rights-management implementation are excluded. Those can change the architecture substantially.

Define readiness as a versioned presentation whose required assets are validated and accessible under the reader's permission. An uploaded byte count is useful evidence at one stage, but cannot establish that the video decodes or that its captions match.

Media processing can outlive one request or worker. It consumes CPU, temporary storage and object bandwidth, and can fail after creating some outputs. Retrying an entire job without identity can create conflicting presentations or overwrite a newer edit.

Object writes and metadata transactions have separate boundaries. A database row can become visible before referenced objects exist, while objects can remain orphaned after metadata fails. Design both publication and cleanup rather than assuming a directory listing is the authoritative catalogue.

Assign an upload identity and preserve the original object version. Validation checks the supported media shape and records the processing specification. Workers produce rendition assets under a job and output version, then verify the required outputs before an atomic metadata transition makes that presentation available.

RFC 8216 describes HTTP Live Streaming playlists, segments and variant presentation. It is an informational specification describing its protocol version, not a guarantee of every current player feature. A client can select among available variants under its implementation and network conditions.

The metadata pointer identifies one complete presentation. An edit produces another version rather than mutating assets that existing players may be fetching. Retire old assets only after the declared cache and playback-retention policy permits it.

The media pipeline has two different completion events: the upload becomes durable, and a complete playable presentation becomes current. Object storage can preserve an original recording while workers generate playback variants. An HLS manifest describes a presentation in terms of referenced media. The application must publish a coherent manifest and segment version rather than allowing whichever worker finishes last to define what is current.

Take a hypothetical ten-minute clip encoded at two megabits per second. Duration is 10 × 60 = 600 seconds. Payload is 600 × 2,000,000 = 1,200,000,000 bits, or 1,200,000,000 / 8 = 150,000,000 bytes. This decimal 150 MB excludes container overhead and protocol traffic. A second one-megabit variant adds 75 MB under the same assumptions, so both payloads total 225 MB before preserving the original upload or extra copies.

Separate media identity from the current-presentation pointer. Each processing job should name its input revision and desired output revision. If a corrected edit supersedes the original, an older job that finishes later must fail the conditional publication decision. The worker's successful local work remains real, but it is no longer authority to become the selected presentation.

Delivery adds another budget. A CDN can reuse a published segment across eligible readers, while a newly popular clip or a broad invalidation can still create origin pressure. An average warm hit ratio cannot bound a synchronized cold burst. Keep the manifest-to-segment references coherent and evaluate the origin behavior when the working set is absent, not only during steady playback.

Access policy must also survive the cache path. Decide whether segments are public, session-bound or protected by another explicit mechanism, and reason about the lifetime of authorization evidence. Removing a listing is not necessarily the same as withdrawing access to already addressable media. Start with a narrow playback contract and test replacement, failed processing and withdrawal as part of the publication design.

Choose three renditions at 1,2 and 4 megabits per second over the same duration. Their combined nominal rate is 1 +2 +4 = 7 megabits per second. Combined payload is 600 × 7 ÷ 8 = 525 MB. This is rendition payload, not a claim that the original has that size or that a real encoder maintains an exact constant rate.

With chosen six-second segments,600 ÷ 6 = 100 segments per rendition and 3 × 100 = 300 segment objects across the selected renditions, before captions, initialization objects and playlists. Shorter segments change request frequency and buffering behavior; they are not a free latency improvement.

Suppose 1,000 concurrent viewers each consume the 2-megabit rendition. Aggregate payload demand is 1,000 × 2 = 2,000 megabits per second, or 2 gigabits per second. A chosen 90% delivery-cache hit fraction would leave roughly 10% of that byte demand at origin only under the stated uniform reuse model. Miss bursts, different variants and object distribution can invalidate it.

For processing, choose ten arriving jobs per minute and twelve successful completions per minute. A backlog of 60 jobs drains at 12 −10 = 2 jobs per minute, requiring 60 ÷ 2 = 30 minutes under constant rates. Job duration and cost vary, so a job-count budget alone may hide an expensive source format.

Primary evidence for publish a complete Northwind training presentation: RFC8216 describes its version of HLS playlists, segments and variants.

A player choosing a lower bitrate can reduce transfer demand, but it cannot repair missing segments or an unauthorized playlist. Validate rendition availability and keep presentation metadata consistent. Captions and alternative audio should follow the same source and version identity.

Signed or otherwise scoped delivery access must match the reader contract. A short-lived access mechanism is not a universal revocation guarantee for bytes already delivered or cached. Specify what future requests can be prevented and what remains outside server control.

Cache policy differs for immutable versioned segments and mutable catalogue or publication pointers. HTTP caching rules govern reuse; an application flag saying withdrawn cannot retroactively invalidate arbitrary copies. Keep that limit visible in the product promise.

Use a conditional publication transition bound to the expected source and desired presentation version. Preserve completed outputs for inspection without granting them authority to replace newer content. A worker's successful execution does not mean its result is still the requested result.

Layer 3 · Internals

Trade-offs and limits

ApproachProvidesRequires
Progressive object deliveryStarts with one encoded object and a simple retrieval path.Quality adaptation and access to future bytes follow that format's behavior.
Segmented adaptive streamingLets a player select supported renditions as conditions change.Encoding, manifests and segment publication add versioned state.

Recovery decision

Hypothetical scenario: A stale encoding job finishes after a replacement version and overwrites its manifest. Guard publication by source/version identity and retain each referenced output until collection is safe.

Only under a specifically designed partial/live publication protocol. For a complete prerecorded version, validate all required renditions and references first; otherwise playback can fail midstream despite a successful start.

Write your design before revealing the review

Can a manifest be published as soon as one output segment exists?

Evidence you can explain in your own design

Drafts and self-review are stored only in this browser. They are separate from reading completion.

Compare your decision

Only under a specifically designed partial/live publication protocol. For a complete prerecorded version, validate all required renditions and references first; otherwise playback can fail midstream despite a successful start.

A stale encoding job finishes after a replacement version and overwrites its manifest. Guard publication by source/version identity and retain each referenced output until collection is safe.

Check your understanding

Can a manifest be published as soon as one output segment exists?

Only under a specifically designed partial/live publication protocol. For a complete prerecorded version, validate all required renditions and references first; otherwise playback can fail midstream despite a successful start.

How would you recover from this failure: A stale encoding job finishes after a replacement version and overwrites its manifest. Guard publication by source/version identity and retain each referenced output until collection is safe.

Start with the exact boundary that failed. Create an upload identity and verify the source object. Produce versioned renditions through restartable jobs. Atomically publish a manifest referencing complete retained output. Then recover evidence through the observation path: Authorize playback and obtain a specific manifest version. Fetch segments through the CDN. Preserve segment versions for the playback session and declared retention horizon. Preserve the distinction between a confirmed state change and an unavailable response.

Which assumption in the worked calculation would a burst or concentrated tenant invalidate first?

Choose 10,000 concurrent viewers at an average 4 Mbit/s each: delivery is 40,000 Mbit/s, or 40 Gbit/s. At a selected 95% byte hit ratio, normal origin traffic is 2 Gbit/s. A one-hour rendition at 4 Mbit/s is 4 × 3,600 / 8 = 1,800 MB in decimal units. Additional renditions add storage; viewer count and upload rate are independent workload dimensions. Recompute the affected resource rather than multiplying unrelated storage and network budgets by the same factor. Upload, transform, publish and stream video versions. Raw uploads, encoding jobs and published playback manifests have different lifecycles. Publish only manifests whose referenced renditions satisfy the chosen readiness contract; exclude recommendation ranking and live broadcasts initially.

Which component in this topology could be removed from a smaller first deployment?

Upload store, Transcode workers, Playback manifest, Edge segments name responsibilities, not a requirement for separate processes. Co-locate responsibilities when their transaction, trust and capacity boundaries permit it. Create an upload identity and verify the source object.

What evidence must a caller have before relying on the observation path?

Authorize playback and obtain a specific manifest version. Fetch segments through the CDN. Preserve segment versions for the playback session and declared retention horizon. Only under a specifically designed partial/live publication protocol. For a complete prerecorded version, validate all required renditions and references first; otherwise playback can fail midstream despite a successful start.

45-minute interview rubric

  1. 00–05: scope segment and media publication manifest.
  2. 05–12: identify the limiting resource and derive the domain workload above, retaining units and assumptions.
  3. 12–28: draw media publication manifest, numbered writes and reads.
  4. 28–40: challenge recovery: Make processing versioned and publish a verified manifest.
  5. 40–45: defend asset_id placement, observations and remaining assumptions.

Go deeper

  • RFC 8216: HTTP Live Streaming · Primary document · www.rfc-editor.org. Make processing versioned and publish a verified manifest. Verified 2026-10-26.
  • RFC 9111: HTTP Caching · Primary document · www.rfc-editor.org. Make processing versioned and publish a verified manifest. Verified 2026-10-26.

Decision log

Make processing versioned and publish a verified manifest.

Preserve segment identity and media publication manifest ownership.

Revisit changed workload, observations or recovery objectives.