DEV Community

Cover image for How Netflix Uses the Cloud - AWS
Lionelโ™พ๏ธโ˜๏ธ for AWS Community Builders

Posted on • Updated on • Originally published at softwaresennin.dev

How Netflix Uses the Cloud - AWS

How they Use AWS Services

Binge-watching ๐Ÿฟhas become more and more of a phenomena. Netflix ๐ŸŽฌ has transformed the way we watch shows. Beneath its interface ๐Ÿ” is a really sophisticated system that effortlessly introduces new shows, movies ๐ŸŽฅ and beams them to countless devices ๐Ÿ“ฑ๐Ÿ’ป worldwide.

Today, we'll take a deep dive into the magic โœจ behind Netflix's content orchestration and distribution, and unravel the AWS cloud โ˜๏ธ mechanics that support its beautiful framework. ๐ŸŒ๐Ÿ› ๏ธ

1. The Netflix Magic ๐ŸŽฌ๐Ÿฟ

Step 1: Metadata and Shows โœจ

We start our Netflix adventure with its administrators ๐Ÿง™โ€โ™‚๏ธ uploading fresh episodes and movies, with metadata such as tags ๐Ÿท๏ธ, titles ๐Ÿ“œ, and descriptions ๐Ÿ–‹๏ธ. The metadata is the backbone of organizing and categorizing shows, making your search for the next binge-watch, sleek and smooth. The metadata will be stored in the Elasticsearch/OpenSearch Database ๐Ÿ—ƒ๏ธ, renowned for their flash โšก speed search !

Metada

Step 2: Uploading and Process Videos! ๐ŸŽฅโžก๏ธโ˜๏ธ

Once our Admin hits the upload button, the video ๐ŸŽž๏ธ is uploaded to an Amazon S3 bucket ๐Ÿชฃ. To make sure everyone, no matter their device ๐Ÿ“ฑ๐Ÿ’ป๐Ÿ–ฅ๏ธ or internet speed ๐ŸŒ, gets a flawless viewing ๐Ÿฟ experience, once uploaded, the video gets a a complete makeover ๐Ÿ’„. Thanks to AWS Elemental MediaConvert ๐ŸŒ€, the video is converted into various sizes (4K, 1080p, 720p), perfectly fitting all screen sizes.

2nd

Step 3: AI Content Analysis in Action! ๐Ÿ”๐Ÿค–

Next, let's get into quality checks. For that, Netflix uses its AWS Rekognition ๐Ÿง โš™๏ธ. It meticulously scans ๐Ÿ•ต๏ธโ€โ™‚๏ธ all uploaded videos to spot any sensitive ๐Ÿšซ content ๐Ÿ“ผ. Thanks to this tool ๐Ÿค–๐Ÿ”, Netflix ensures that their platform remains a safe and wholesome space for all viewers. After all it is safety first, binge later! ๐Ÿ›ก๏ธ๐Ÿฟ

ai content analysis

Step 4: AWS Step Functions for Parallel Processing ๐Ÿคนโš™๏ธ

We all have our shows that we are impatiently waiting to watch on our favorite streaming platform. So the Netflix team cannot wait and upload one movie then another. To fix this, Netflix amped up its efficiency by using AWS Step Functions for speedy parallel processing ๐ŸŒŒโฉof videos. Think of AWS Step Functions as a series ๐ŸŽผof tasks, from content scanning ๐Ÿ”„ to AI content analysis ๐Ÿ”๐Ÿค– (Step 1 to 3), all at the same beat. With all these processes happening side by side, not only does the waiting time โณ drop drastically, but in addition the whole Netflix ecosystem runs even smoother ๐Ÿš€โœจ.

step functions

Step 5: Smart Storage Frequent vs Infrequent Access ๐Ÿ“ฆ๐Ÿ”„

Once the processing is completed, our videos are stored in a frequently used Amazon S3 bucket ๐Ÿฅ‚๐Ÿ’ผ, where it's all set for prime time. Here's the smart bit: any movie or episode that is not frequently watched ๐Ÿคทโ€โ™‚๏ธ๐Ÿ“‰, gets transferred to a cozy spot in the 'chill-zone' S3 Glacier ๐Ÿ›‹๏ธ๐Ÿชฃ. This storage switch-ups ๐Ÿ•บ๐Ÿ’ƒ not only ensure that costs are kept low ๐Ÿ’ฒโš–๏ธ but also that resources are used in the best way possible ๐Ÿง โšก

Efficiency meets elegance! ๐ŸŽฉโœจ

storage

Step 6: Deep Freeze Dive for Rare Gems ๐Ÿ”๏ธโ„๏ธ

What about those shows and episodes ๐ŸŽฌ that only a select few cherish ๐Ÿ’Ž? Netflix keeps them Amazon S3 Glacier. Think of AWS S3 Glacier as a vault ๐Ÿ—๏ธ where cinematic rarities are safely kept, until needed. This multi-layered storage strategy ๐Ÿฐ ensures that all Netflix's content is cost-effective.

A balance of budget ๐Ÿ’ธ and value ๐Ÿ’ก with flair! ๐ŸŽ‰๐ŸŒŒ

Next -> The Nextflix Express Lane

glacier s3

Step 7: Netflix and AWS CDN (Open Connect) ๐Ÿš€๐ŸŽฅ

In 2020, Netflix became and international phenomenon. They needed to provide similar seamless quality to their international customers. As a solution, Netflix used AWS' Content Delivery Network, Open Connect ๐ŸŒโšก Open Connect uses AWS' Edge Locations located internationally to slash wait times ๐Ÿ• making sure their next binge-worthy shows are just a blink away ๐Ÿ“บโœจ.

Lightning-quick movie magic! ๐Ÿฟ๐ŸŽฌ๐ŸŽ‰

CDN

Step 8: Diving Deep with Data Magic ๐Ÿ”โœจ

The one thing which too many people seem not really that important but which makes all the difference to all companies, is data. To unlock the mysteries of its user habits ๐Ÿ•ต๏ธโ€โ™‚๏ธ๐Ÿ’ก and system prowess ๐Ÿ–ฅ๏ธ๐Ÿš€, Netflix uses ELK stack trio: Elasticsearch, Logstash, and Kibana.

How do they all work together to make Netflix better ?

First Elasticsearch the detective, sorts and stashes away logs (clues) ๐Ÿ“๐Ÿ”; next, Logstash the craftsman, processes and channels the data ๐ŸŒŠโš™๏ธ; and Kibana? The artist ๐ŸŽจ, paints beautiful data visualizations for Netflix engineers to use. With this dynamic trio, Netflix ensures every move is backed by data ๐Ÿ“Š and strategy๐Ÿช„!

Analytics


2. Netflix and us, viewers ๐ŸŒโœจ

Step 1: One Service, Many Screens ๐Ÿ“บ๐Ÿ“ฑ๐Ÿ’ป๐ŸŽฎ

Now let us step into our shoes. Whether you're on a smartphone ๐Ÿ“ฑ, TV ๐Ÿ“บ, laptop ๐Ÿ’ป, or even a gaming console ๐ŸŽฎ, you can access your favorite streaming platform. This chameleon-like adaptability ensures that no matter your device, you always have access to ๐Ÿฟ๐ŸŽฌthe same responsive, seamless and beautiful user experience.

screen

Step 2: A Dazzling Dance of Design and Delivery ๐ŸŒ๐Ÿ’ƒ

Whenever you open Netflix, you're actually viewing their website built using the magical React.js ๐Ÿช„๐Ÿ–ฅ๏ธ. React.js is a JavaScript library and is what gives you a dazzling experience. When you halt on a movie, a video snippet plays which captivates ๐ŸŒ€๐ŸŽจ your attention. And who ties it all together? The CDN (Open Connect), acting as the bridge ๐ŸŒ‰, ensuring that every video and frame is delivered in perfect harmony ๐ŸŽถ๐ŸŽฌ.

frontend

Step 3: Searching for a show ๐Ÿ”๐Ÿ’Ž

Looking for your next show? Go to the search page of Netflix and type away! ๐ŸŽนโœจ As you search, the website communicates with the CDN ๐ŸŒ, which connects with Netflix's backstage โ€” AWS API Gateway and microservices ๐ŸŽฉโš™๏ธ. This triggers a Lambda function (a magic spell) if you will ๐Ÿช„โšก, which will go and search / query the database, using the metadata you provided.

Your personal concierge for your binge-watching journey. ๐Ÿฟ๐ŸŒŸ

searching / indexing

Step 4: Using CDN for Video Delivery๐Ÿš‚โœจ

Once the search is complete, the CDN (Open Connect), like a cinematic librarian ๐Ÿค“๐Ÿ“š, will quickly grab the video's metadata from the digital archives -> Database and, at the same time, connects to the S3 bucket where the shows๐ŸŽฌ๐Ÿชฃ are kept. Both the movie's metadata (details) and the movie itself will be cached / stashed within the CDN ๐ŸŒ๐ŸŽฅ, prepping for future movie nights.

Step 5: Seamless Playback ๐Ÿฟ๐ŸŒŒ

Thanks to CDN's (Open Connect) ๐ŸŒ smart caching / stashing skills ๐Ÿง ๐Ÿ”, frequently accessed content are very smooth (minimal latency)! Regardless of a user's location ๐ŸŒ, this caching mechanism ensures a lag-free experience ๐ŸŽฅ๐Ÿ’จ. So sit back, relax, and enjoy a seamless cinema spree! ๐Ÿ›‹๏ธ๐ŸŽ‰

playback

Conclusion ๐ŸŒŸ

I am still to study the backend of other streaming platforms. However from my research, Netflix's behind-the-scenes magic โœจ is nothing short of tech wizardry ๐ŸŽฉ๐Ÿ”ฎ. First with AWS's unique tools and power trio - Elemental MediaConvert, Rekognition, and Step Functions, Netflix consistently concocts a potion of optimized content ๐Ÿฐ. In addition to that, AWS' storage solutions ๐Ÿ—„๏ธ, Open Connect CDN ๐ŸŒโšก, and ELK ๐Ÿ” ensures that viewers like you and I get a cost-friendly, lightning-quick ๐Ÿš€, and always-on ๐ŸŒ streaming experience.

NETFLIX ARCHITECTURE

As all our screens connect to Netflix ๐Ÿ“บ๐Ÿ“ฑ๐Ÿ’ป, one thing is very clear - their promise of delivering seamless content, remains unwavering ๐Ÿค˜๐ŸŽฌ!

Top comments (2)

Collapse
 
tanushree_aggarwal profile image
Tanushree Aggarwal

very informative post!

Collapse
 
softwaresennin profile image
Lionelโ™พ๏ธโ˜๏ธ

I am so glad you found it useful. I really enjoyed this journey to writing this.