Skip to content

Architecture case: media processing and versioned playback

11 min reading

Separate upload acceptance, asset validation, presentation publication and delivery capacity.

Page details

Optional architecture cases · Lesson 22

Published · Sources · 11 min reading · Last edited:

Know first: Databases in Ten Minutes; Reading Architecture Diagrams.

Editorial correction:

Earlier design notes used unsupported universal performance or reliability claims. This revision explains conditional mechanisms and explicitly hypothetical examples; no author-run benchmark or production incident is asserted.

More
20px

Publish a complete Northwind training presentation

Outcome. After this optional chapter, you can separate upload durability, coherent publication and authorized playback.

Hypothetical scenario. Sam is publishing internal training clips, and a corrected recording must replace an earlier edit without mixing their segments.

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

Upload complete is not playback ready

Hypothetical scenario. An education service accepts recorded lessons. A teacher finishes uploading a file, but students receive a broken player because the interface treats object storage success as evidence that every playable rendition exists. A worker retry later publishes a playlist referencing incomplete segments.

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.

A single worker cannot make the whole journey atomic

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.

Playback also has an independent resource profile. A small number of uploaded lessons can generate large sustained egress. Separating processing from delivery protects readers from a transcoding backlog, but only if they do not share an unbounded bottleneck.

Publish a complete presentation version

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.

Media publication follows validation of versioned assetsAn uploaded original enters processing. Renditions and captions are validated before a presentation pointer is published. Playback reads that complete version through an authorized delivery path.Original versionProcess + verify assetspublish version pointerAuthorized playlistand segmentsFailed partial outputs remain unpublished and recoverable.

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.

Work through publish a complete Northwind training presentation

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.

Calculate duration, bitrate and delivery work

Hypothetical scenario. Choose a ten-minute lesson:10 × 60 = 600 seconds. At a chosen encoded bitrate of 2 megabits per second, media payload is 600 × 2 = 1,200 megabits; dividing by eight gives 150 megabytes. Container, audio choices and protocol overhead are excluded.

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.

In the wild: Publish a complete Northwind training presentation

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

Adaptation, permission and cache policy interact

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.

A retried job publishes an older edit

Hypothetical scenario. A teacher corrects a lesson while an earlier processing job is delayed. The newer presentation becomes ready first. The old job finishes afterward and blindly overwrites the catalogue pointer, restoring the obsolete lesson.

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.

Cleanup must distinguish abandoned partial assets from a presentation still referenced by a player or rollback configuration. Record job ownership and retain recovery evidence. Deleting by object age alone can remove a legitimate long-running job's output.

Three media-design misconceptions

“The storage upload succeeded, so the lesson is ready.” Source validation, processing and presentation publication remain separate stages.

“A delivery cache removes origin capacity planning.” Cold content, purge, rendition diversity and regional misses can expose the origin to much more than average demand.

“More workers always clear the backlog.” Shared source bandwidth, temporary storage and downstream object limits can become the actual bottleneck.

Operate the presentation, not only the workers

Track upload failure, source-validation rejection, processing age, publication failure, missing segments and user-visible playback interruption separately. A worker success ratio can look healthy while published playlists reference the wrong assets.

Start with a small supported rendition set and a versioned on-demand workflow. Isolate retries and backfills from new uploads. Measure useful playback outcomes with the actual player while preserving static or server evidence about asset completeness.

Reject publishing a playlist before its required referenced assets are verified. Reject indefinite retention of every failed output without a recovery and deletion policy. Add live streaming only after defining its different latency, window and outage behavior.

Limits of publish a complete Northwind training presentation

The bitrate example counts decimal media payload only. Original uploads, copies, containers, metadata and delivery overhead add separate costs. The manifest and authorization mechanisms must be checked for the chosen player and serving stack; upload durability alone does not establish playable publication.

Check yourself: review publication

All segment writes succeeded individually. Can the presentation pointer be published?

Verify the complete required set, versions and metadata first. Individual success does not establish that the intended presentation is complete or current.

An older processing job finishes after a corrected lesson. Which result should become current?

The result authorized by the current desired version and conditional publication rule, not whichever worker finishes last.

Average cache hit rate is high. What should origin testing include?

Cold content, coordinated invalidation, popular new lessons and variant diversity. The warm average does not bound miss bursts or origin saturation.

An older transcode finishes after a corrected upload. May it become current because all its segments exist?

No. Completeness of an obsolete presentation is different from authority to publish it. Compare the job’s input and desired presentation revision with the current conditional publication rule. Keep the old artifacts available only under the declared retention and access policy, and publish the corrected manifest after its required segment set is complete.

Northwind decision log

Separate durable upload from playable publication.
Publish only the currently authorized complete presentation version.
Budget cold-origin demand and segment access independently.

Go deeper into media protocols and recovery

Related blog: Why Your RAG App Returns the Wrong Paragraph: A Five-Step Debugging Checklist.