Skip to content
SeeItFlow
System Design · Component Reference · ~30 min read

Architecture Deep Dive

The exact mechanics behind the video platform: upload session identity and multipart completion, durable finalize-to-processing handoff, the processing DAG, safe versioned output publication, manifests and ABR, the CDN/origin hierarchy, playback authorization, view counting, storage lifecycle, and multi-region ownership. This page is the mechanics reference the other pages link back to — it favors precision over narrative pacing.

Mangesh MandlikLast updated:
Mechanics 01

Upload Session

An upload session is a durable, identified record that tracks one creator's attempt to get one video's bytes into the platform.

It carries a stable upload_id, the owning creator/account, a state, a created_at, and an expiration. The client authenticates once to create the session, then uses a scoped credential tied to that session for every subsequent part upload — it never re-proves identity per chunk.

Idempotent session creation

If a client's 'create upload session' call times out and it retries, that retry should not necessarily produce a second, unrelated session for the same intended upload. Where the client can supply a stable idempotency key for the creation request, the server can recognize the retry and return the existing session instead of minting a duplicate. Not every implementation supports this, but it's worth designing for explicitly rather than assuming a lost response is harmless.

Ownership and authorization

Every operation against a session — uploading a part, requesting finalize, aborting — must verify the caller still owns that session. A session identifier alone should not be sufficient if it can be guessed or leaked.

Session state

INITIATED → UPLOADING → FINALIZING → FINALIZED → PROCESSING is one reasonable lifecycle. The important property isn't the exact state names — it's that the session has an explicit state machine at all, so a client (or an operator) can always answer 'what is actually true about this upload right now' instead of inferring it from side effects.

Mechanics 02

Multipart & Resumable Upload

Splitting a large file into independently-uploadable parts is what makes upload resumable — but the mechanics of resuming are more varied than 'restart from the first missing chunk.'

Part identity

Each part has a stable identity — typically a part number and, once accepted, a provider-assigned identifier (such as an ETag) that the client must record and later submit at completion time.

Retry per part

A failed or dropped part is retried on its own; parts that already landed are never re-sent. This is the core resumability win over a single-request whole-file upload.

Not always 'first missing chunk'

Depending on the client and protocol, parts may be uploaded out of order, in parallel across multiple connections, or with gaps that get backfilled later — not strictly sequentially. A resumable-upload design should let the client discover which specific parts are missing or unconfirmed, rather than assuming resumption always means 'continue from the next sequential index.'

Checksum / integrity

Where the object storage provider supports it, attach a checksum per part (and, at completion, for the whole object) so corruption introduced in transit is caught before the object is treated as durable — rather than discovered later during transcoding or playback.

Mechanics 03

Upload Finalization

Finalization is the single most safety-critical moment in the upload path: it's where an unreliable multipart transfer becomes a durable, authoritative source object.

The client's word is not enough

A client claiming 'all my chunks arrived' is a hint, not a fact. Finalize must verify against the object store's own authoritative multipart/session state — the recorded parts and their identifiers — before treating the object as complete. Trusting only client-reported completeness risks finalizing an object that is actually missing or has mismatched parts.

Finalization must be idempotent

A repeated finalize call for the same upload_id — because the first response was lost, or the client retried defensively — must not create a second video record and must not schedule a second, independent processing workflow. It should discover the already-finalized state and return the same logical result as the original call.

What finalization produces

On success: the original becomes a durable object, the upload session moves to FINALIZED, a video/metadata record is created (or updated) in an early lifecycle state, and a processing workflow is durably scheduled — see Durable Processing Handoff next.

Mechanics 04

Durable Processing Handoff

Writing the finalized-video metadata to the database and publishing a processing job to a queue are two different systems. They cannot be assumed to succeed or fail together.

If the metadata write commits but the queue publish fails (or the reverse), a naive implementation either loses the processing job entirely (finalized video that never gets processed) or publishes a job for a video that was never actually durably finalized. Both are correctness bugs, and both are easy to miss in a happy-path demo.

Recommended baseline: transactional outbox / durable job record

Write the finalized metadata and a durable job row (or outbox event) in the same database transaction. A separate dispatcher reads unpublished job rows and publishes them to the processing queue, marking them published once the publish succeeds. If the dispatcher crashes or the publish is duplicated, the worst case is a duplicate delivery of the same job — which the processing side must already tolerate (see Duplicate Processing Job in Failure & Scale).

text
BEGIN TRANSACTION
  UPDATE videos SET state = 'FINALIZED' WHERE upload_id = :upload_id;
  INSERT INTO processing_jobs (job_id, video_id, source_version, attempt, status)
    VALUES (:job_id, :video_id, :source_version, 0, 'PENDING_DISPATCH');
COMMIT;
-- a separate dispatcher polls/streams PENDING_DISPATCH rows and publishes
-- to the processing queue, marking each row DISPATCHED once publish succeeds.
-- consumers are idempotent, so a duplicate dispatch is safe.

Job identity

Every processing workflow has a stable processing_job_id, an attempt counter, and a source_version reference (which finalized object version it's processing). Retries of the same workflow reuse this identity rather than minting a new one — see Processing DAG for how that identity is used downstream.

Mechanics 05

Media Probe

Before choosing what to transcode into, the pipeline needs to know what it's actually transcoding from.

A probe stage inspects the source: duration, resolution, source codec, bitrate, frame rate, audio track(s), orientation, and whether the file is corrupted or in an unsupported format. This runs once, early, and its output feeds every later stage — the rendition ladder decision, the transcode stage's parallelism, and validation's expectations for what a healthy output should look like.

Corrupt or unsupported input

If probing itself fails or reports an unsupported/corrupted source, the workflow should route to a terminal-failure or quarantine path rather than proceeding into a transcode stage doomed to fail — see Corrupt Source and Unsupported Codec in Failure & Scale.

Mechanics 06

Processing DAG

Model processing as a directed acyclic graph of stages with their own state — not one opaque 'transcode' job that's either fully done or fully failed.

A representative pipeline: probe → transcode video representations → transcode/package audio → segment/package → thumbnail generation → validate → publish. Several of these stages can run in parallel — most obviously, each output representation can transcode independently of the others once probing is complete, and thumbnail generation doesn't depend on any representation finishing.

Per-stage, per-representation state

Track state at least at the stage level, and ideally per output representation within the transcode stage — so a failure in the 720p output doesn't require silently guessing whether 1080p also failed, and doesn't require re-running stages that already succeeded.

Why this matters more than one big job

A monolithic 'transcode the video' job conflates unrelated failures (a bad 480p encode profile vs. a genuinely corrupt source), makes partial retry impossible without redoing everything, and makes it much harder to answer 'how much of this video's processing actually succeeded.' See Trade-offs & Decisions -> Monolithic Job vs. Processing DAG for the full comparison.

Mechanics 07

Transcoding & Rendition Ladder

A rendition ladder is the set of output representations produced for a given source — and there is no single universally correct ladder.

Swipe to pan
Transcoding PipelineUpload finalization hands a durable job to the processing queue; renditions transcode in parallel before CDN delivery.CreatorUpload SvcObject Storageoriginal sourceProcessing QueueTranscode Worker ATranscode Worker BTranscode Worker C1080p720p480pObject Storagerenditions + segmentsCDN Edgeplayback
After upload finalization, the Processing Queue fans the original object into parallel Transcode Workers that write multiple renditions and segments back to Object Storage before CDN Edge serves playback.

1080p/720p/480p/360p is a common illustrative example, not a fixed requirement. A ladder can reasonably depend on the source's own quality (no benefit to producing a rendition above what the source can support), the platform's device/network population, codec support across that population, the content's own characteristics (a screen-recording tutorial has very different encode needs than fast-motion sports), and cost.

Never upscale to fill the ladder

Producing a '1080p' rendition from a 480p source by upscaling does not add real detail — it just spends compute and storage to produce a larger file with no quality benefit, and can mislead viewers about the video's actual quality. Only include ladder rungs the source can genuinely support, unless a product deliberately chooses otherwise for a specific reason.

Cost is not linear by rule

Cost generally increases with each additional representation, but the relationship isn't a fixed linear multiplier — codec choice, target resolution, source duration, hardware acceleration, reuse of shared decode work across representations, and available parallelism all affect how much each additional rung actually costs. Treat 'each rendition costs about the same increment' as a simplification, not an engineering fact.

Mechanics 08

Codec, Container, Bitrate & Resolution

These four terms are frequently conflated. They describe different, independent properties of a rendition.

Codec

The compression algorithm used to encode/decode the video (and separately, the audio) data — for example H.264/AVC, H.265/HEVC, AV1, or VP9. Different codecs trade off compression efficiency, encode/decode compute cost, and device/browser support.

Container / package format

The file structure that wraps encoded video/audio streams and their metadata — for example MP4, fragmented MP4 (fMP4), or MPEG-TS. Which container/package format is used often follows from the streaming protocol/packaging pipeline in use, not an independent free choice.

Resolution

The pixel dimensions of the decoded frame — e.g. 1920×1080. Resolution is independent of codec: the same resolution can be encoded in more than one codec.

Bitrate

The target (or actual, for variable encodes) number of bits per second the encoded stream consumes. Two renditions at the same resolution can target different bitrates, trading file size/bandwidth against visual quality.

Mechanics 09

Safe Output Publication

The single most important correctness pattern in the processing pipeline: never let a retry, or a second overlapping worker attempt, write over a rendition object that a viewer might currently be reading.

Overwriting a viewer-visible key in place means a viewer's in-progress playback (or the CDN's cached copy) can be served a half-written or logically inconsistent file mid-request — there is no way to guarantee the overwrite is atomic from the viewer's perspective across every layer between the encoder and the player.

The safer pattern

1) Write every output of a given processing attempt to attempt/version-specific temporary keys, never the final public key. 2) Validate the complete output set. 3) Only once validated, publish immutable, final/versioned keys (new object paths that are never reused or mutated). 4) Atomically update the video's active manifest/metadata pointer to reference the new version. 5) Garbage-collect abandoned attempt artifacts later, once it's safe to do so.

text
-- staging (per attempt, never viewer-visible):
  s3://bucket/staging/{video_id}/{attempt_id}/720p/segment_0001.ts ...

-- after validation, publish immutable versioned keys:
  s3://bucket/media/{video_id}/v{N}/720p/segment_0001.ts ...

-- then, in one atomic metadata update:
  UPDATE videos SET active_version = 'v{N}' WHERE video_id = :video_id
    AND active_version = 'v{N-1}'; -- or appropriate prior-state guard

Object stores generally help, but a rendition is more than one object

Most object stores provide atomic visibility for a single completed object — readers never see a partially-written individual object. That guarantee does not extend across a multi-object rendition set (many segments plus a manifest); the publication boundary above is what makes the whole set appear atomically consistent, not the object store's per-object guarantee alone.

Mechanics 10

Manifest & Packaging

A manifest is what tells a player which representations exist and where to find their segments — and it must never promise something that isn't safely there yet.

Common packaging protocols are HLS and MPEG-DASH; a protocol-level deep dive is out of scope here, but the concepts generalize across both. A master manifest lists the available representations (bitrate/resolution/codec combinations); each representation has its own media playlist/manifest listing its segment URLs in order.

No reference to unavailable segments

A manifest must never be published pointing at segments that haven't finished being written and validated. Publishing the manifest is part of the same publication boundary described in Safe Output Publication — it happens only after the segment set it references is complete and validated, and it references the final versioned keys, not staging keys.

Versioned publication

Because a reprocess can produce a new version (v2) of a video while the previous version (v1) remains playable, the manifest itself is versioned, and the active-version pointer in metadata decides which manifest a new playback request resolves to. See Video Deletion and Multi-Region Ownership for related version-pointer patterns.

Mechanics 11

Segment Alignment

For a player to switch between representations mid-stream without a visible glitch, the representations need compatible segment boundaries and keyframe placement — arbitrary independent cuts are not enough on their own.

If two representations don't align their segment/keyframe boundaries, switching from one to the other mid-playback can require re-buffering, produce a visible skip, or simply not be decodable cleanly at the switch point. Encoding and segmenting every representation against the same time-boundary/keyframe plan is what makes clean switching possible — it's a packaging discipline, not an incidental detail.

Segment duration is illustrative, not a rule

Shorter segments (a few seconds) allow finer-grained quality adaptation and caching at the cost of more requests and per-boundary overhead; longer segments reduce request overhead but adapt more slowly. Any specific duration value is an example for teaching purposes, not a universal standard — real systems tune this per product, and low-latency streaming in particular uses different chunking strategies that are out of scope for this module.

Mechanics 12

Adaptive Bitrate Player

ABR is a collaboration: the server side produces compatible, segmented representations and a manifest; the player side decides, moment to moment, which representation to request next.

Startup representation

The player picks an initial representation using whatever signals it has before playback starts — estimated throughput, device/display constraints, or a conservative default. This is not necessarily the lowest available quality; it's whatever the player's startup heuristic judges sustainable, which can reasonably start higher on a fast, known-good connection.

Ongoing selection signals

Once playing, the player continuously estimates achieved network throughput (typically from recent segment download times), tracks current buffer occupancy, and factors in device/display constraints (no point requesting 4K on a phone-sized player surface). It combines these to choose the representation for the next segment.

Avoiding oscillation

Switching representations too eagerly on every small throughput fluctuation produces a visibly unstable, oscillating quality experience. Smoothing/hysteresis logic — requiring a sustained trend before switching, or biasing toward buffer health over instantaneous throughput — keeps quality changes purposeful rather than jittery. See Failure & Scale -> ABR Oscillation.

Rebuffer prevention over quality maximization

When buffer health is at risk, the player should generally prefer dropping to a lower sustainable representation over continuing to request a rendition that risks a stall — a brief, often unnoticed quality drop is a better outcome than a visible playback stall for most products.

Where switches happen

Representation switches occur at segment/fragment boundaries defined by the packaging format, not at an arbitrary mid-segment point — but the exact mechanics of where a switch is legal vary by streaming technology, so this should be understood as a packaging-defined boundary rule rather than an absolute 'never mid-segment, ever, for every technology' claim.

Mechanics 13

Playback Startup Latency

"Startup latency" is not one number — it's the sum of several sequential steps, and knowing which one is slow tells you what to actually fix.

The decomposition

1) Metadata/authorization request — resolving what the viewer is allowed to play. 2) Manifest fetch — retrieving the master and initial representation manifest. 3) Connection setup where applicable — DNS resolution, TLS handshake, connection establishment to the serving edge. 4) First segment fetch — downloading enough of the first segment to begin decode. 5) Decode and first-frame render.

Mechanics 14

CDN Cache Hierarchy

Viewer traffic doesn't go straight from edge to origin object storage — a well-designed hierarchy adds a layer in between specifically to protect origin.

A representative flow: viewer → CDN edge (closest to the viewer) → an optional regional/tiered cache or origin shield layer → the object storage origin. An edge miss doesn't have to mean an origin request; it can first check the shield/regional tier, which itself may already have the object cached from serving a different edge's earlier miss.

Why a shield layer earns its place

Without it, a viral video creates independent cold misses at every single edge location worldwide, each one making its own trip to origin — origin sees N misses for effectively the same object. A shield/tiered layer collapses that fan-in: many edges' misses resolve against the shield, and only the shield's own (much smaller number of) misses reach origin. See Origin Protection and Failure & Scale -> CDN Cache-Miss Storm.

Mechanics 15

CDN Cache Key

What the CDN treats as 'the same object' is entirely determined by the cache key — get this wrong and either correctness or cache efficiency breaks.

Segment cache key (conceptual)

video/version + representation + segment is the conceptual shape of a segment's cache key; a real implementation typically also folds in content type/format as needed. Because segment objects are immutable once published (see Safe Output Publication), this key can safely carry a very long TTL — the bytes behind it will never change.

Manifests can differ

A manifest may need different TTL/versioning treatment than its segments — for VOD, once a specific version is finalized, that version's manifest can also be treated as immutable, but the active-version pointer the player resolves before fetching a manifest is what actually changes over time (on reprocess, or on a version rollback).

Signed URLs and cache-key fragmentation

If a signed authorization token is carried as a query parameter and the CDN's cache-key configuration naively includes every query parameter, every viewer effectively gets a unique cache key for the same underlying object — destroying the hit ratio. Cache-key configuration needs to strip or normalize the authorization parameter out of the cache key itself while still enforcing it at the authorization layer, so caching stays efficient without leaking access to a different viewer. See Failure & Scale -> Cache-Key Fragmentation.

Mechanics 16

Origin Protection

Origin is a finite resource behind an effectively unbounded number of edges. Protecting it is a deliberate set of controls, not an assumption that the CDN 'just handles it.'

Request coalescing

When multiple concurrent requests miss for the same object at the same cache tier, only one in-flight fetch to the next tier (or origin) should occur; the rest wait on that single fetch's result rather than each triggering their own.

Origin shield

A tiered caching layer between edges and origin specifically to collapse cross-edge miss fan-in — see CDN Cache Hierarchy.

Rate limits and bounded concurrency

Origin should enforce its own request-rate and concurrency limits regardless of what the CDN layer does, so a misconfiguration or an unusually large miss event can't overwhelm it.

CDN-only origin access

Where appropriate, origin should only accept requests from the CDN/shield layer, not directly from arbitrary clients — removing an entire class of traffic that could otherwise bypass the caching hierarchy altogether.

Circuit breakers and load shedding

If origin is genuinely overwhelmed, it's better to shed some requests deliberately (returning a clear, fast failure) than to degrade every request slowly and risk cascading timeouts upstream. See Failure & Scale -> Cascading Failure.

Mechanics 17

Playback Authorization

Public/unlisted/private is a metadata concept until it's connected to how delivery is actually gated — otherwise 'private' is just a label nobody enforces.

A representative flow: viewer requests playback → a metadata/authorization service decides entitlement (is this viewer allowed to watch this video, at this visibility level) → on success, it issues a short-lived signed credential (a signed URL, cookie, or token) → that credential is what actually authorizes the CDN/manifest/segment requests that follow.

For public content

Authorization can be trivial or effectively a no-op — anyone can request playback metadata and receive a credential (or no credential is needed at all if the CDN/origin is intentionally open for public content).

For restricted content, the CDN/origin must enforce it

It is not enough for the metadata API to check entitlement if the underlying CDN or object origin will serve the manifest/segments to anyone who guesses or replays a URL. The delivery layer itself needs to require and validate the short-lived credential — otherwise 'private' is enforced only at one checkpoint that can be bypassed.

Privacy change: public → private

Making a previously public video private requires, together: stop issuing new authorization for it, update its metadata/visibility state, remove it from search/discovery, and revoke or bound the validity of any previously-issued cached access according to the delivery design (a signed credential that's already short-lived limits how long this window can stay open). See Failure & Scale -> Metadata Cache Stale Privacy and Video Deleted, CDN Cached.

Mechanics 18

Metadata Lifecycle

A video's metadata record needs to represent several genuinely different questions, not one flag.

Separate questions, separate states

Has the original been durably uploaded? (uploaded) Are outputs currently being produced? (processing) Does a validated, playable artifact set exist? (ready) Does product policy currently permit discovery/playback? (published/visible) Is access currently restricted for another reason? (blocked/private/deleted). A suggested lifecycle shorthand is UPLOADING → PROCESSING → READY/PUBLISHED → BLOCKED/DELETED, but a real implementation can and often should separate 'is it technically ready' from 'is it currently visible,' since those can change independently (a ready video can be made private without reprocessing anything).

Mechanics 19

Search Indexing

Search indexing mechanics — ranking, tokenization, query serving — are covered by the Search & Autocomplete module; this section only covers how video metadata connects to that system.

Metadata changes propagate to the search index asynchronously, typically via a durable change-event stream or outbox, the same durability pattern used for the finalize-to-processing handoff. The index should reflect only content that's currently eligible for discovery — not merely content that exists in the metadata store.

Not all updates deserve the same urgency

An ordinary title/tag edit can tolerate the platform's normal indexing lag. A deletion or a privacy change to more restrictive (public → private/blocked) is a different category of update — it should propagate with materially higher urgency, because the cost of a stale index entry here isn't 'slightly outdated search result,' it's 'search is showing content the owner no longer wants discoverable.' See Failure & Scale -> Search Index Stale Delete.

Mechanics 20

View Event Semantics

Before aggregating anything, define exactly what a view event is — this is a product decision the architecture implements, not something the architecture decides on its own.

A view event carries

A stable event identity (for deduplication), the video ID, a playback/session identifier, an event timestamp, and whatever 'counted' threshold or policy version produced it (so later analysis knows which counting rule was in effect).

What counts as a countable view is product policy

There is no universal technical definition. An illustrative policy might be 'emit a countable view after playback crosses the platform-defined watch threshold' — but the specific threshold, and whether it's a fixed duration, a percentage watched, or something else entirely, is a product decision this architecture should treat as configurable, not hard-code.

Mechanics 21

View Aggregation

Aggregation turns a high-frequency event stream into periodic per-video counter updates.

Events are typically partitioned by video ID (or another key chosen to spread load evenly), consumed over short aggregation windows, summed per video, and flushed as one batched update per video per window rather than one write per event.

Bounded deduplication, precisely stated

Aggregation workers de-duplicate by the event's stable identity within a bounded, retained dedupe window — this suppresses duplicates that arrive within that window (a very common and sufficient case for retried deliveries). It does not, by itself, guarantee a mathematically exact lifetime count: an event delayed longer than the retained window, or a true dedupe-state loss, can still be double-counted or missed. See Trade-offs & Decisions -> Exact vs. Approximate View Count and Failure & Scale -> View Event Duplicate / View Event Loss.

Mechanics 22

Hot View Counter

A viral video concentrates an enormous share of view events onto a single aggregation key, even though the writes to the underlying counter are already batched.

If one video's events all route to a single reducer/partition, that reducer becomes a hot key regardless of how efficient the batching itself is — it's simply handling far more event volume than any other key.

Approaches

Local or partitioned partial aggregation (each of several parallel workers keeps its own partial sum for the hot key, merged periodically), keyed stream re-partitioning specifically for detected hot keys, sharded counters that get merged on read or on a schedule, or hierarchical aggregation (aggregate locally first, then aggregate the aggregates). The right choice depends on the stream-processing infrastructure already in place.

Mechanics 23

Processing Backpressure

Queue depth alone tells you how many jobs are waiting — it tells you almost nothing about how much work is actually backed up.

A two-hour 4K source encoding into a large rendition ladder is not equivalent to a 20-second 480p clip, even though each is 'one job' in the queue. A queue depth of 500 could mean a healthy backlog of small jobs about to clear, or a serious backlog of long, expensive jobs about to take hours.

Better signals

Oldest job age (how long has the longest-waiting job been waiting), queued media minutes (total source duration still waiting to be processed — a work-weighted measure), estimated compute work (factoring resolution/codec/duration, not just count), per-priority backlog (so a high-priority queue's health isn't hidden by a large low-priority backlog), and measured processing-completion SLO attainment (are jobs actually finishing within the target window, not just 'is the queue draining').

Autoscaling needs more than queue depth

Scaling worker count purely off raw job count can under-provision when the backlog is dominated by a few very expensive jobs, or over-provision when it's dominated by many cheap ones. Feeding a work-weighted estimate (queued media minutes, or estimated compute work) into the autoscaling signal is a meaningfully better fit. See Trade-offs & Decisions -> Fixed vs. Elastic Workers.

Mechanics 24

Storage Lifecycle

Storage cost is not just 'how much is stored today' — it's a function of retention and cleanup policy across several distinct categories of object.

Categories to manage

Original source retention policy (keep indefinitely? for a bounded window? only until derived outputs are confirmed durable?). Derived renditions/segments/thumbnails (these are generally reproducible from the original if it's retained, which is itself a real trade-off — see Trade-offs & Decisions -> Precompute vs. On-Demand Renditions). Cold tiering for rarely-accessed content. Reprocessing artifacts from a superseded version. Orphan cleanup for failed processing attempts' staging objects. Deleted-content cleanup. Abandoned/expired multipart uploads that were never finalized.

Mechanics 25

Video Deletion

Deletion is a distributed workflow with several dependent systems to update, not a single database row flip.

The workflow

Mark the video unavailable in authoritative metadata. Stop issuing new playback authorization for it immediately. Remove it from search/discovery. Purge or invalidate CDN-cached copies as the delivery design requires. Delete or expire derived artifacts (renditions/segments/manifests/thumbnails) according to retention policy. Delete the original according to policy (which may differ from derived-artifact policy). Handle retries for any step that fails. Audit that the workflow actually completed.

Deletion vs. an already-issued ticket to play

Stopping new authorization does not retroactively invalidate a credential a viewer already obtained before the deletion started, unless the delivery design includes active revocation — this is the same reasoning as Playback Authorization's privacy-change discussion, applied to the terminal case of deletion.

Mechanics 26

Multi-Region Ownership

Multi-region is not simply 'each region has its own copy of everything' — it requires an explicit ownership and replication model, or two regions can independently accept conflicting writes.

A workable baseline model

Globally unique video/upload IDs (so identifiers never collide across regions). Each creator's upload is assigned a home/ingest region. Authoritative metadata write ownership belongs to one region per video/partition at a time. Reads elsewhere are served from asynchronously replicated copies, accepting some replication lag for locality. Object replication follows a policy driven by durability requirements, data-residency constraints, popularity, and cost — not 'replicate everything everywhere.' Failover to a different authoritative writer happens only after an explicit ownership/fencing decision — never as an automatic reaction to a network partition alone.

Why fencing matters

Without a fencing step, a network partition could let both the original region and a newly-promoted region believe they're the authoritative writer for the same video/partition at the same time — producing genuinely conflicting metadata updates that are hard to reconcile after the fact. See Failure & Scale -> Region Partition Split-Brain.

In-progress uploads are region/session-specific

A multipart upload session is generally tied to the region/storage session it was created against. A region failure mid-upload should not be assumed to seamlessly hand off to another region unless the upload architecture explicitly supports that — see Failure & Scale -> Regional Failure.

Mechanics 27

Video Observability

What to actually watch, grouped by the stage of the lifecycle it protects.

Upload

Upload success/failure rate, upload completion latency, abandoned-session rate, finalize failure rate.

Processing

Processing queue depth, oldest job age, queued media minutes, per-stage failure rate, processing time per source minute, output validation failure rate, publication latency.

Delivery

CDN hit ratio, shield hit ratio, origin request rate and egress volume, segment 4xx/5xx rate, manifest error rate.

Playback quality

Startup time, rebuffer/stall ratio, playback error rate, delivered bitrate/quality distribution, and seek latency — these are more meaningful QoE signals than raw HTTP latency alone, since they reflect what a viewer actually experiences.

Discovery and lifecycle

Search indexing lag, view-event processing lag, deletion propagation lag.