Youtube System Design: A Cloud Architect's perspective

Daniel HerDaniel Her
2 min read

In this blog post, we’ll explore a high-level system design for a video-sharing platform from a cloud architect’s perspective. The platform includes features for video uploads, metadata handling, transcoding into multiple formats, content analysis for inappropriate material, and global delivery of video content to users.

The goal? Leverage serverless AWS services for maximum scalability and minimal operational overhead.


System Workflow

1. Video Upload

Users upload their raw video files to an S3 bucket, which serves as the platform's object storage layer. S3 provides durability and scalability, making it ideal for handling large media files.

  • Trigger: Upon a successful upload, an S3 event notification is sent to an AWS Lambda function.

2. Video Transcoding

The Lambda function triggered by the S3 upload sends a job to AWS Elemental MediaConvert. MediaConvert processes the raw video and transcodes it into multiple formats and resolutions (e.g., 360p, 720p, 1080p) for adaptive streaming.


3. Notification of Job Completion

Once MediaConvert finishes transcoding, it emits a job completion notification to Amazon EventBridge. EventBridge then triggers another Lambda function to perform the following tasks:

  1. Handle Video Metadata:

    • The Lambda function extracts metadata (e.g., resolutions, duration, file size) and stores it in DynamoDB.

    • Why DynamoDB?

      • Serverless, highly available, and capable of handling immense traffic.

      • Scales effortlessly with growing demand, ensuring low latency for metadata queries.

  2. Content Analysis with Rekognition:

    • The Lambda function sends the processed video to Amazon Rekognition for inappropriate content analysis.

    • If flagged, the function updates the DynamoDB record with moderation details, ensuring the platform enforces content policies.


4. Video Storage and Distribution

The transcoded video files are stored in a destination S3 bucket, which serves as the origin for Amazon CloudFront, AWS’s content delivery network (CDN).

  • CloudFront as a CDN:

    • Caches the processed videos and metadata globally for low-latency delivery to users.

    • Ensures that users worldwide experience fast video playback regardless of their location.


Why This Design Works

  • Scalability:

    • Serverless components like S3, Lambda, DynamoDB, and MediaConvert scale automatically, ensuring the system can handle spikes in uploads and user traffic.
  • Cost-Effectiveness:

    • Pay-as-you-go pricing for AWS services minimizes costs, especially during periods of low activity.
  • Global Reach:

    • CloudFront ensures users worldwide receive low-latency video streams, improving their overall experience.

This design combines AWS's powerful serverless services to create a highly scalable, efficient, and user-friendly video-sharing platform. With minimal operational overhead and robust automation, it’s built to handle everything from uploads to global delivery. Let me know your thoughts or if you’ve implemented something similar!

0
Subscribe to my newsletter

Read articles from Daniel Her directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Daniel Her
Daniel Her