3 Topics
Chapter•95 Minutes

Capstone Project 3: Design a Video Streaming Platform

Design ingestion, transcoding, metadata, adaptive playback, CDN distribution, and cost-aware content lifecycle.

Requirements, Uploads, and Media Data

A video platform typically supports upload, validation, transcoding, metadata management, playback, search, and viewing analytics. Store metadata and ownership in a transactional database while storing original and derived media in object storage.

Upload large files directly to object storage using short-lived multipart upload sessions. The API records an upload intent and verifies completion before enqueuing processing. Validate duration, codec, file size, rights, and content safety according to the product's policies.

Define playback expectations: startup time, buffering ratio, supported devices, resolutions, geographic reach, and access restrictions. These requirements determine transcoding profiles, CDN strategy, and whether live streaming—which has different latency constraints—is in scope.

Key Takeaways
  • Separate media blobs from metadata and ownership records.
  • Design for large uploads and incomplete-upload cleanup.
  • Clarify on-demand versus live streaming requirements.
Knowledge Check

What is adaptive bitrate streaming designed to do?

Transcoding, Packaging, and Adaptive Bitrate Streaming

Workers create multiple renditions at different resolutions and bitrates, then package media into segments and manifests such as HLS or MPEG-DASH. The player selects a rendition based on available bandwidth, buffer health, and device capability, reducing quality when conditions worsen and increasing it when safe.

Transcoding is compute-intensive and should run asynchronously. Track processing states, retries, per-rendition results, and job versions. A video should not be marked ready until the required outputs and manifests are validated.

Use separate queues for short clips and long high-resolution videos if their resource profiles differ. Keep source files until retention rules allow deletion, and ensure retries do not mix segments from incompatible processing versions.

Key Takeaways
  • Adaptive bitrate streaming adjusts quality to network conditions.
  • Transcoding needs durable jobs and explicit readiness state.
  • Version generated outputs to keep manifests and segments consistent.

Playback Delivery, CDN Caching, and Cost Controls

Playback clients fetch manifests and media segments, ideally from a nearby CDN edge. Segment caching can reduce origin load dramatically, but authorization and cache-key design must be correct for private videos. Signed cookies or URLs can provide temporary access.

Measure startup delay, rebuffering ratio, playback errors, bitrate selection, CDN hit ratio, and origin egress. View counts should be defined carefully: a play request, a started stream, and a qualified watch are different metrics. Analytics events can be batched asynchronously.

Video cost is dominated by storage, transcoding, and bandwidth at scale. Apply lifecycle tiers, rendition policies, quotas, deduplication where appropriate, and geographic delivery strategies. Do not optimize only for storage price if retrieval delays damage playback experience.

Key Takeaways
  • CDN delivery reduces latency and origin bandwidth when caching is correct.
  • Playback quality metrics are more meaningful than raw request counts alone.
  • Control storage, transcoding, and egress as separate cost drivers.