YouTube / Netflix
A planet-scale video platform — upload once, transcode, and stream smoothly to millions — worked through the TOGAF ADM.
YouTube / Netflix, the ADM way, in 30 seconds
- A (Vision): upload once, play smoothly everywhere; principles — read-heavy first, smooth playback above all, cheap at scale.
- B (Business): capabilities — upload a video, process it, watch it, browse/search metadata; watching dominates by orders of magnitude.
- C (Data/App): raw uploads, transcoded chunks in blob storage, a metadata DB, and a view-count stream — with upload and playback as separate app tiers.
- D (Technology): ingest the upload → transcode into an ABR ladder → store chunks in blob storage → serve via CDN → adaptive bitrate streaming on the client.
- E–H: ship upload + single-quality playback, add the transcode ladder, then global CDN; govern with playback SLOs and storage budgets.
- Lesson: 'smooth playback' (Phase A) is why Phase D leans on an ABR ladder and a CDN rather than one big file from one origin.
Like a TV station that prints a tape for every living room
Picture an old TV station. A show is recorded once, in a studio. But millions of homes watch it, and each home has a different screen and a different antenna — some get a crisp signal, some a snowy one. The station's whole job is to take that one recording and make sure every home, good antenna or bad, sees something watchable without the picture freezing. A video platform is that station, except there are a billion homes, the recording arrives from anyone at any time, and 'snowy signal' means a slow phone on a train.
Two facts fall out of that picture and never leave. First, one recording is watched a staggering number of times — so the design must make watching cheap and fast, even if that makes recording slower. Second, you can't ship one giant tape and hope every antenna copes — you prepare several versions ahead of time (sharp, medium, snowy-but-smooth) and let each home pick the best one its signal can carry, second by second. Those two facts are the entire system.
What makes it hard — the problem before the solution
- Reads dwarf writes by orders of magnitude. One upload is watched millions of times. The read path must be the cheap, fast one — even at the cost of a slow, heavy write path.
- One upload is not one file. To play smoothly on a 4K TV and a phone on 3G, you need the same video at several qualities — so one upload fans out into many stored versions.
- A stutter is unforgivable. Users tolerate a slow page, but a video that freezes mid-scene feels broken. Smoothness, not raw speed, is the thing you protect above all.
- Storage only ever grows, and egress is the real bill. Videos are never deleted and are huge; the bytes shipped to viewers (egress) cost more than storing or computing them. The design has to make egress cheap or it bankrupts you.
Why the ADM fits
A video platform looks like 'store a file, send a file' — until you notice one upload fans out into many qualities, the read:write ratio is astronomical, and a stutter during playback is the one thing users won't forgive. The ADM keeps those concerns in order: the smooth playback and read-heavy principles from Phase A are exactly what force the transcoding ladder, blob storage, and CDN that dominate Phase D. Nothing in the technology layer is a guess — each piece answers a constraint set earlier.
Phase A — Architecture Vision
Intent: agree what we're building, for whom, and the principles that constrain every later choice.
- Vision: let creators upload video once and let anyone, anywhere, watch it immediately and smoothly across phones, TVs, and laptops.
- Stakeholders: viewers (want instant, buffer-free playback), creators/studios (want reliable uploads and reach), the business (wants bandwidth and storage costs under control at massive scale).
- Principles (the constraints that cascade): read-heavy first (one upload is watched millions of times); smooth playback above all (no buffering, adapt to the network); cheap at scale (storage and egress are the dominant bills, so push bytes to the edge).
Phase B — Business Architecture
Intent: model the business capabilities and value streams before any technology talk.
- Value stream: creator uploads a video → the platform processes it → viewers discover it → viewers stream it smoothly on any device.
- Capability 1 — Upload a video: low volume relative to views, can tolerate seconds-to-minutes of processing latency, must be durable.
- Capability 2 — Process a video: transcode into multiple qualities, generate thumbnails — asynchronous, off the viewer's critical path.
- Capability 3 — Watch a video: astronomically high volume, latency- and smoothness-critical, read-only against finished content.
- Capability 4 — Browse & search metadata: titles, thumbnails, view counts — high volume but small payloads, separate from the heavy video bytes.
Impact: these capabilities are wildly unequal. Watch dwarfs everything and sets the non-functional targets; process must never block a viewer; metadata is a different shape and scale than the video bytes. That asymmetry, discovered here in Phase B, drives the split pipelines in Phase D.
Phase C — Information Systems Architecture (Data & Application)
Intent: define the data and application architecture, and the gap from today (greenfield).
Data architecture
- Raw upload: the original file, kept only until processing finishes (or for re-encodes).
- Transcoded chunks: many small segments per video, one set per bitrate in the ABR ladder — this is the bulk of all storage.
- Metadata: title, description, creator, duration, thumbnail URLs, and the manifest that lists available bitrates — small, queryable records.
- View counts & engagement: high-churn counters that can be eventually consistent — an off-by-a-few count for a second is fine.
The split is the point: huge immutable binary blobs live in one kind of store; small, queryable metadata lives in another. Conflating them would make neither scale well.
-- Small, queryable: lives in the metadata DB, one row per video.
CREATE TABLE video (
video_id TEXT PRIMARY KEY,
creator_id TEXT NOT NULL,
title TEXT,
duration_s INT,
status TEXT, -- uploaded | processing | ready
manifest_url TEXT, -- points at the playlist in blob storage
created_at TIMESTAMP
);
-- The actual video bytes are NOT here. They live as objects like:
-- s3://videos/<video_id>/720p/chunk_0001.ts (a few seconds each)
-- The DB only ever stores pointers, never the heavy bytes.Why blob storage, and not just put videos in the database?
The obvious move is 'it's data, put it in the database.' A database is built for small rows you query and update constantly — indexes, transactions, joins. Video chunks are the opposite: enormous, write-once, never queried by content, and only ever fetched whole by URL. Forcing them into a database buys you features you'll never use and a bill you can't pay, while blob/object storage gives you cheap, durable, infinitely-growable byte buckets addressed by key — exactly the shape of the problem.
| Approach | What it buys | The gap it can't fill |
|---|---|---|
| Videos in the relational DB | One store; transactions over everything. | Row-size limits, backups balloon, egress and cost explode; you pay for query features video never needs. |
| Blob/object storage (chosen) | Cheap, durable, grows forever, served directly or via CDN. | No querying by content — so you keep a small metadata DB beside it for titles and search. |
| Local disk on app servers | Simplest to start. | Not durable, not shared, can't scale past one box — a dead end at planet scale. |
Application architecture
- An upload/ingest tier that accepts bytes durably and hands off processing — isolated so a flood of uploads never touches playback.
- An asynchronous transcoding pipeline connected by queues, so processing scales independently and never blocks a viewer.
- A stateless playback/metadata tier that serves manifests and metadata, with the actual video bytes delivered from the edge, not these servers.
Phase D — Technology Architecture (the core)
Intent: choose the concrete technologies and the deployment design that realize Phase C — and justify each one against the principles and numbers. This is where a technical interviewer spends most of the time, so we'll cover every step.
D1 — Estimate the load (sizing drives technology)
# 500 hours of video uploaded per minute
upload_hours_per_day = 500 * 60 * 24 # 720,000 hours/day
# Each hour stored at ~5 bitrates, ~1 GB/hour average per rendition
storage_per_day_tb = 720_000 * 5 * 1 / 1000 # ~3,600 TB/day of transcoded output
# Reads dominate: say 1B views/day, avg 5 min watched, ~3 Mbps
watch_egress_pbps = 1_000_000_000 * 300 * 3 / 8 / 1e15 # petabytes/day of egress
# Verdict: storage grows forever -> blob store + lifecycle tiers
# egress is the dominant cost -> push bytes to the CDN edgeThe numbers confirm the Phase B asymmetry quantitatively: an enormous write-once / read-billions ratio, storage that only grows, and egress as the dominant bill. Those three facts dictate blob storage, a transcode fan-out, and a CDN.
D2 — Ingest & the transcoding ladder
- Accept the upload durably to a staging area, then drop a job onto a queue (see Message queues) — the uploader gets a fast 'received' response while processing happens asynchronously.
- Transcode into an ABR ladder: one upload becomes several renditions (e.g. 240p, 480p, 720p, 1080p, 4K), each split into short chunks of a few seconds, plus a manifest listing them.
- Fan out the work across a pool of transcoding workers so a long video or an upload spike doesn't stall the pipeline — this realizes the process never blocks watch separation from Phase B.
- Generate a manifest (the playlist of chunk URLs per bitrate) that the player will use to switch qualities on the fly.
// One durable upload becomes many renditions, each chunked (D2).
async function onUploadComplete(videoId, rawObjectKey) {
const ladder = ["240p", "480p", "720p", "1080p", "4k"]; // the ABR ladder
// Fan the work onto a queue so transcoding never blocks the viewer.
for (const rendition of ladder) {
await queue.publish("transcode", {
videoId,
source: rawObjectKey,
rendition, // worker encodes to this bitrate
segmentSeconds: 4 // split into ~4s chunks
});
}
await metadata.set(videoId, { status: "processing" });
}Why transcode asynchronously, not while the uploader waits?
It's tempting to transcode right there in the upload request — accept the file, encode all five renditions, return 'done.' That works for one small upload and collapses under reality. Transcoding a long video takes minutes of CPU; holding the uploader's connection open that long is fragile, and a spike of uploads would pin every server doing encode work while viewers wait for the same machines. The async queue breaks that coupling: upload returns in seconds, and a separate worker pool chews through encodes at its own pace. This is the Phase B rule — process must never block watch — made concrete.
| Approach | What it buys | The gap it can't fill |
|---|---|---|
| Synchronous transcode on upload | Simple; video is ready when the request returns. | Uploader waits minutes; an upload spike starves playback of CPU; one slow encode blocks the connection. |
| Async queue + worker pool (chosen) | Upload returns instantly; encoding scales on its own fleet. | Video isn't watchable for a short while — fine, since creators expect processing time. |
| Transcode on first view (lazy) | No wasted encodes for never-watched videos. | The first viewer of every rendition eats the full encode latency — a terrible first-play experience. |
D3 — Store the chunks & serve via CDN
- Store transcoded chunks in blob/object storage — immutable, cheap, infinitely growable, and durable via replication. Metadata and manifests go in a small, queryable metadata DB; view counts are eventually consistent counters off the hot path (see Consistency models).
- Serve the bytes from a CDN (see CDN): the first viewer in a region warms the edge, and everyone after is served locally — directly realizing read-heavy first and cheap at scale by keeping egress off the origin.
- Adaptive bitrate streaming (ABR): the player measures bandwidth and picks the highest rung of the ladder it can sustain, stepping down on congestion instead of buffering — this is how smooth playback above all actually happens.
- Shard the metadata by video ID if it outgrows one node (see Sharding); the blob store and CDN scale on their own.
// Adaptive bitrate: step DOWN before buffering, step UP when there's headroom.
function chooseRenditionUrl(manifest, measuredMbps) {
// manifest.renditions is sorted ascending by required bitrate.
let chosen = manifest.renditions[0]; // safe floor (e.g. 240p)
for (const r of manifest.renditions) {
if (measuredMbps >= r.minMbps * 1.2) { // 20% headroom avoids thrashing
chosen = r;
}
}
// Chunks are served from the edge, not the origin -> cheap, smooth playback.
return `${manifest.cdnBase}/${chosen.name}/chunk_${manifest.nextIndex}.ts`;
}Why a CDN, and why not just a bigger origin?
A natural instinct is to make the origin server (or cluster) beefier and serve everyone from it. But the enemy isn't CPU — it's distance and egress. A viewer in São Paulo fetching from a US origin pays a long round trip on every chunk, and every chunk of every view leaves your origin's network, which is the most expensive traffic you buy. A CDN fixes both at once: it caches each chunk at an edge near the viewer, so the second viewer in a region is served locally, and the bytes leave the cheap edge instead of your origin.
The gap a bigger origin can never fill is the speed of light and the egress bill. You cannot buy your way out of a 150 ms round trip to another continent, and you cannot afford to push petabytes a day out of one network. The CDN is not an optimization bolted on at the end — it's the thing that makes global, smooth, affordable playback possible at all.
| Approach | What it buys | The gap it can't fill |
|---|---|---|
| One big origin | Simple; one place to deploy and reason about. | Far viewers suffer long round trips; all egress leaves one network at premium cost — it doesn't scale globally. |
| Regional origins | Closer to some viewers; some egress spread. | You still rebuild a CDN by hand, worse — no shared edge cache, uneven coverage. |
| CDN at the edge (chosen) | Nearby delivery, cheap edge egress, origin shielded; one viewer warms the cache for all. | Cache invalidation and cost tuning — but chunks are immutable, so invalidation barely applies here. |
Scaling & bottlenecks — what breaks first
Turn the dial up and a video platform fails in a predictable order. The read path is engineered to be sturdy, so the first thing to buckle is almost always the processing side or a cold cache — never the steady-state stream.
| Breaks first as you scale | The symptom | The fix |
|---|---|---|
| Transcode backlog | Uploads sit in 'processing' for hours during a spike. | Autoscale the worker pool; prioritize short/popular videos; shard the job queue. |
| Cold CDN edge (cache miss storm) | A newly viral video hammers the origin as every edge misses at once. | Pre-warm edges for predicted-hot content; use tiered/origin-shield caching so one fetch fills many edges. |
| Metadata DB hotspots | Browsing and manifest lookups slow down as the catalog grows. | Shard metadata by video ID; cache hot manifests in memory in front of the DB. |
| View-count write storm | A mega-viral video overwhelms the counter store with increments. | Keep counts eventually consistent; batch/aggregate increments; approximate until it settles. |
def start_playback(video_id, client_mbps):
# 1. Tiny metadata lookup — hot ones served from cache, not the DB.
meta = cache.get(video_id) or db.get_video(video_id)
if meta["status"] != "ready":
return {"error": "still processing"}
# 2. Hand the player the manifest; it will fetch chunks from the CDN.
# No video bytes pass through this server at all.
manifest = cache.get_manifest(video_id)
# 3. Fire-and-forget the view count — eventually consistent, off the hot path.
counters.increment_async(f"views:{video_id}")
return {"manifest": manifest, "startRendition": pick_floor(manifest, client_mbps)}Phases E & F — Opportunities, Solutions & Migration Planning
- Greenfield, so sequence by risk: first ship durable upload plus single-quality playback from the origin to prove the end-to-end path.
- Add the transcode ladder next, so playback becomes smooth across devices and networks.
- Then roll out the global CDN, pushing bytes to the edge once traffic justifies the egress savings — each step independently shippable, echoing the expand-contract spirit of the TOGAF commerce scenario.
Phases G & H — Governance & Change Management
- Governance (G): define playback SLOs (startup time, rebuffer ratio, p99 chunk latency), storage budgets with lifecycle/tiering policies for cold videos, and content/licensing rules.
- Change management (H): adding a new codec or a 4K/8K rung is a bounded change to the transcode ladder and manifest — not a re-architecture — precisely because ingest, storage, and serving were drawn as clean boundaries.
A video platform is the canonical read-heavy, egress-dominated system — one write fanned out to billions of reads — and a clean lesson in pushing work off the hot path.
Why it matters
- It makes the read:write asymmetry visceral: the entire design bends toward making playback cheap and smooth.
- It forces the split between huge immutable blobs and small queryable metadata — a pattern that recurs everywhere.
- It shows why the CDN and an adaptive bitrate ladder, not a bigger origin, are the real answer to global scale.
If ignored
- Serve one big file from one origin and viewers worldwide buffer while your egress bill explodes.
- Transcode synchronously on the upload path and a spike of uploads stalls both creators and viewers.
- Mix video bytes into the metadata store and neither the database nor the playback path scales.
Where it fits
- Phase D holds the ingest, transcode ladder, blob storage, metadata DB, and CDN delivery.
- Phase A's smooth-playback and read-heavy principles drive those D mechanisms.
- Sits beside the interview framework as a second way to structure the answer.
Related topics
- CDN: serves video chunks from the edge — the core of cheap, smooth playback
- Message queues: decouples the async transcoding pipeline from upload and playback
- Caching: hot metadata and manifests stay in memory off the database
- Sharding: splits the metadata store as the catalog grows
Interview lens
Questions it unlocks
- Design YouTube / Netflix.
- How do you stream video smoothly to millions of viewers worldwide?
- Walk me through the technology architecture (Phase D) for a read-heavy, egress-dominated service.
60-second answer
I frame it as an ADM walk so every choice is traceable. Phase A sets principles — read-heavy first, smooth playback above all, cheap at scale. Phase B finds four capabilities — upload, process, watch, browse metadata — with watch dwarfing the rest. Phase C splits huge immutable video blobs from small queryable metadata and puts view counts on an eventually-consistent stream. Then Phase D does the technical design: ingest the upload durably and hand it to a queue, transcode asynchronously into an ABR ladder of chunked renditions, store those chunks in blob storage, serve them from a CDN at the edge, and let the player adapt bitrate to the network so playback never buffers. Metadata lives in a sharded DB with a cache in front. E–H ship upload-then-ladder-then-CDN by risk, governed by playback SLOs and storage budgets. The power is that the CDN and ABR ladder are consequences of the Phase A principles, not guesses.
Common traps
- Jumping to 'store the file and send it' without the transcode ladder and CDN that make global playback smooth and cheap.
- Transcoding on the synchronous upload path so processing spikes hurt both creators and viewers.
- Treating view counts as strongly consistent and dragging the hot path into coordination it doesn't need.