← Study paths

Video from upload to play

Every stage between a creator pressing upload and a viewer pressing play.

6 blocks · about 34 min of reading · ends with Video Streaming Platform

When you finish, you should be able to say

Walk the media pipeline end to end with the numbers for storage and egress.

The route

6 blocks (4 fundamental, 1 senior, 1 staff), then the practice problem.

  1. Upload large files without touching your serversFundamental
  2. Keep large blobs out of the databaseFundamental
  3. Process uploads in parallelStaff
  4. Stream video to any connectionSenior
  5. Serve static bytes from the edgeFundamental
  6. Let browsers and proxies cacheFundamental
  7. Video Streaming Platform (YouTube / Netflix)
Latency & performanceScaling & loadNetworking & deliveryData processing & searchFundamentalSeniorStaff
Read each block, then tick “I can explain this”: the path remembers where you are.Start with step 1
Your Video Streaming Platform so far0 of 6 blocks in
Creator appsplits file into 5 to50 MB partsUpload serviceAmazon EC2 Auto Scalingmetadata row,pre-signed part URLsMetadata DBAmazon Auroravideo, rendition rows,statusObject storageAmazon S3originals cold,renditions hotTranscoding workersAmazon EC2GOP chunks encoded inparallelTranscode queueAmazon SQSone task per chunk andrenditionOrigin shieldAmazon CloudFrontone fetch per segmentper regionCDN edgeAmazon CloudFrontsegments a year,manifests minutesViewer playerpicks a rendition persegmentStep 1: Upload large files without touching your servers1Step 1: Upload large files without touching your servers1Step 2: Keep large blobs out of the database2Step 3: Process uploads in parallel3Step 4: Stream video to any connection4Step 3: Process uploads in parallel3Step 5: Serve static bytes from the edge5Step 5: Serve static bytes from the edge5Step 6: Let browsers and proxies cache6Step 4: Stream video to any connection4POST /videoscreate rowPUT partson completejobssegmentsfetchon misson miss

Next, step 1 adds Upload service, Object storage (outlined). A box fills in when you tick “I can explain this” on the block that introduces it; plain boxes come from the problem itself.

Each block has a diagram. Open one beside its step, or all of them at once.
  1. Upload large files without touching your servers

    Networking & deliveryfundamental~6 min

    Large files should never pass through your API servers; this is how they bypass them.

    Uploads stream through API servers, which become a bandwidth bottleneck.

    Say it like this: API servers should never carry upload bytes, so the client asks for short-lived pre-signed URLs and sends the file straight to object storage in resumable parts, and the server only validates and records the result.

    Adds to the design: Upload service, Object storage

    Check yourself: How do you know the upload is complete and not corrupt?

    The complete call is the only signal. The server assembles the parts, compares the stored size and checksum with what the client declared, and probes the file header to confirm it is the type claimed. Until that passes, the video row stays in uploading and nothing downstream runs.

    Read this block →

  2. Keep large blobs out of the database

    Scaling & loadfundamental~5 min

    Where the bytes live, and the properties that make it the right home.

    Images, videos and uploads bloat the database and the app servers.

    Say it like this: Bytes that are written once and read many times belong in object storage, which gives me eleven nines of durability and effectively unlimited capacity behind a plain HTTP interface, so my database and app servers never touch a blob.

    Adds to the design: Object storage

    Check yourself: Why not store files in the database?

    Every replica, backup and cache would carry the bytes, and the database is optimised for small rows with indexes and transactions, not multi-gigabyte sequential reads. Object storage is built for exactly that shape and costs ten to fifty times less per gigabyte.

    Read this block →

  3. Process uploads in parallel

    Data processing & searchstaff~6 min

    Transcoding as a DAG of parallel tasks with retries per chunk.

    Transcoding a long video or processing a large file takes hours on one worker.

    Say it like this: A two-hour upload would take hours on one encoder, so I split it at keyframes into chunks and run the encodes as a DAG of parallel tasks with per-task retries, which turns wall-clock time into a few minutes and makes a failure cost one chunk instead of the whole file.

    Adds to the design: Transcoding workers, Transcode queue

    Check yourself: Why cut at keyframes, and what is a GOP?

    A group of pictures starts with a keyframe that can be decoded on its own, followed by frames that reference it. Cutting anywhere else leaves a chunk whose first frames depend on data in the previous chunk, so each chunk must begin at a keyframe to be encoded independently.

    Read this block →

  4. Stream video to any connection

    Networking & deliverysenior~6 min

    How the player picks quality per segment, and why segments exist.

    One video file either buffers on slow links or wastes bandwidth on fast ones.

    Say it like this: Connections vary by the second, so I transcode into a ladder of renditions, cut each into short segments, and let the player pick the bitrate per segment from the manifest based on the bandwidth it measures.

    Adds to the design: Transcoding workers, Viewer player

    Check yourself: How does the player decide which bitrate to request next?

    It estimates available bandwidth from the last few segment downloads, smoothed to avoid reacting to noise, and looks at how many seconds are buffered. With a full buffer it can risk a higher rendition; with a draining buffer it steps down even if the last sample looked fine. The rule is usually: pick the highest bitrate that is some fraction, say 80%, of the estimate.

    Read this block →

  5. Serve static bytes from the edge

    Latency & performancefundamental~5 min

    Segments are immutable and popular, which makes them the ideal thing to cache at the edge.

    Users far from your servers wait on round trips for images, scripts, video segments.

    Say it like this: Latency to users is dominated by distance, so I serve every static and cacheable byte from a CDN edge near them and let the origin handle only misses and dynamic requests.

    Adds to the design: Origin shield, CDN edge

    Check yourself: What can you cache on a CDN besides images and video?

    Anything identical for every requester with the same key: API responses for public data, anonymous HTML, redirect responses, even 404s. The test is whether a response can be shared. If it depends on the user, keep it private or cache only the shared fragments.

    Read this block →

  6. Let browsers and proxies cache

    Networking & deliveryfundamental~6 min

    The headers that let browsers and CDNs cache correctly for a year.

    Clients re-download unchanged resources on every visit.

    Say it like this: Most of what a client fetches has not changed, so I version static assets by content hash and cache them for a year, and give everything else a validator so the client can revalidate with a 304 instead of re-downloading.

    Adds to the design: CDN edge

    Check yourself: What is the difference between no-cache and no-store?

    no-cache lets caches store the response but requires revalidation with the origin before each reuse, so you get 304s and bandwidth savings. no-store forbids storing it at all, which is right for secrets and for responses that must be observed every time, like a tracked redirect.

    Read this block →

  7. Putting it together

    How the blocks above combine into one design for Video Streaming Platform. The numbers on the boxes are the steps that introduce each part.

    The video platform, assembled from the path
    Creator appsplits file into 5 to50 MB partsUpload serviceAmazon EC2 Auto Scalingmetadata row,pre-signed part URLsMetadata DBAmazon Auroravideo, rendition rows,statusObject storageAmazon S3originals cold,renditions hotTranscoding workersAmazon EC2GOP chunks encoded inparallelTranscode queueAmazon SQSone task per chunk andrenditionOrigin shieldAmazon CloudFrontone fetch per segmentper regionCDN edgeAmazon CloudFrontsegments a year,manifests minutesViewer playerpicks a rendition persegmentStep 1: Upload large files without touching your servers1Step 1: Upload large files without touching your servers1Step 2: Keep large blobs out of the database2Step 3: Process uploads in parallel3Step 4: Stream video to any connection4Step 3: Process uploads in parallel3Step 5: Serve static bytes from the edge5Step 5: Serve static bytes from the edge5Step 6: Let browsers and proxies cache6Step 4: Stream video to any connection4POST /videoscreate rowPUT partson completejobssegmentsfetchon misson miss

    Each number is a step of this path; a box with two numbers is shaped by both blocks. The ring colour is the block's category, as on the route map. Boxes without a number come from the problem itself. Point at a step below, or at a bubble, to see where it appears.

    1. Upload large files without touching your servers
    2. Keep large blobs out of the database
    3. Process uploads in parallel
    4. Stream video to any connection
    5. Serve static bytes from the edge
    6. Let browsers and proxies cache

    Creators upload straight to object storage with pre-signed multipart URLs, a queue-driven worker fleet encodes chunks in parallel into five renditions, and viewers stream segments from the CDN, which almost never goes back to the origin. API servers never touch video bytes.

    How each block shows up in the design

    • 1. Upload large files without touching your servers: the upload service creates the metadata row and returns pre-signed multipart URLs, and the creator app PUTs 5 to 50 MB parts straight to object storage in parallel, so 500 TB a day of ingest never passes through an API server.
    • 2. Keep large blobs out of the database: originals, segments and manifests live in object storage under keys like v/video_id/rendition/seg_n.m4s, while the metadata database holds only small rows; lifecycle rules move originals to cold storage after transcoding and abort abandoned multipart uploads.
    • 3. Process uploads in parallel: completing the upload enqueues a job, the orchestrator splits the file at GOP boundaries into 10 to 30 s chunks, and stateless workers encode one chunk and rendition each, turning about 50 core-minutes per 10-minute video into one or two minutes of wall-clock time.
    • 4. Stream video to any connection: the workers produce five renditions from 240p to 1080p with segments cut at the same keyframes, and the player measures each segment's download speed and switches rendition at the next 4 s boundary without a glitch.
    • 5. Serve static bytes from the edge: viewers fetch manifests and segments from the nearest CDN edge, misses go through an origin shield so each segment is fetched from storage once per region, and a hit rate of at least 95% keeps origin egress under 5% of the roughly 10 Tbps peak.
    • 6. Let browsers and proxies cache: segments are immutable and cached for a year because a re-encode writes new keys, while manifests are cached for minutes because renditions can be added later; private videos use signed URLs the edge validates.
  8. ★

    Video Streaming Platform (YouTube / Netflix)

    Now run the timed practice. The blocks above should appear in your answer without prompting; if one does not, that is the one to reread.

The same parts on other clouds

The diagrams above name AWS services as one concrete example. Every part has a close equivalent elsewhere. In an interview, name the role first, such as “a managed Redis cache”, then the product you would pick.

AWSUsed here asGoogle CloudMicrosoft AzureOpen source and others
Amazon EC2 Auto ScalingUpload service, Upload API, API, HTML / stats APICompute Engine managed instance groupsVirtual Machine Scale SetsKubernetes Deployment with a HorizontalPodAutoscaler, Nomad
Amazon AuroraMetadata DBAlloyDB for PostgreSQL, Cloud SQLAzure Database for PostgreSQL or MySQLPostgreSQL, MySQL, CockroachDB
Amazon S3Object storage, Bucket: standard, Infrequent access, Archive, Origin / object storeCloud StorageBlob StorageCloudflare R2, MinIO, Ceph
Amazon EC2Transcoding workers, Probe + split, Encode 1080p, Encode 720p, Encode 480p / 360p, Side tasks, PackageCompute EngineAzure Virtual MachinesDigitalOcean Droplets, any VM or bare metal
Amazon SQSTranscode queuePub/Sub, Cloud TasksService Bus queues, Queue StorageRabbitMQ, ActiveMQ
Amazon CloudFrontOrigin shield, CDN edge, CDN, Edge PoPCloud CDN, Media CDNAzure Front DoorCloudflare, Fastly, Akamai
Amazon DynamoDBMetadata DBFirestore, BigtableCosmos DBScyllaDB, Apache Cassandra
AWS Step FunctionsOrchestratorWorkflowsLogic Apps, Durable FunctionsTemporal, Apache Airflow