How does Netflix work?

Vaishnavi Katgaonkar
9 min readSep 9, 2020

--

Why the rise of Netflix has changed the landscape in the entertainment industry for producers, distributors, consumers and what has been Netflix competitive advantage that enabled it to disrupt a 100 year old industry?

What isn’t as simple is what goes into running Netflix, a service that streams around 250 million hours of video per day to around 98 million paying subscribers in 190 countries. At this scale, providing quality entertainment in a matter of a few seconds to every user is not a joke. But the question arises how Netflix have managed such a big network traffic? How they have maintained such high availability and scalability?

This is in the most simplified terms, how Netflix works?

Netflix has been among the best online subscription-based video streaming services in the world for many years, accounting for over 15% of the world’s Internet bandwidth capacity. Users pay monthly rent to access this content and what that means to Netflix is that the user experience should be very smooth and enjoyable.

Netflix Architecture :

Netflix mainly operates in two clouds : AWS and Open Connect. Both clouds must work together seamlessly to deliver endless hours of entertaining videos.

Netflix architecture mainly work on :

  • Client
  • Back-end (AWS)
  • OC or Netflix CDN

Now get’s deeply dive inside this architecture.

1. Client

Fig 1. A reference of Client and Backend architecture based on various sources

The client is the user interface on any device used to browse and play Netflix videos. Netflix supports a lot of different devices including smart TV, android, ios, gaming platforms and web app. All these apps are written by using platform specific code.

2. Backend (AWS)

Backend includes services, databases, storage's running entirely on AWS cloud. Backend basically handles everything not involving streaming videos.

Online content provider Netflix can support seamless global service by using Amazon Web Services (AWS). AWS enables Netflix to quickly deploy thousands of servers and terabytes of storage within minutes. Netflix works on around 700 micro-services.

Some of the components of Backend with their corresponding AWS services are listed as follows:

  • Scalable computing instances (AWS EC2)
  • Scalable storage (AWS S3)
  • Scalable distributed databases (AWS DynamoDB, Cassandra)
  • Video processing and transcoding (purpose-built tools by Netflix)

3. OC or Netflix CDN

Everything that happens after you hit play is handled by Open Connect. Open Connect is Netflix’s custom global content delivery network (CDN). But what is Open Connect exactly?

What is Open Connect?

Anything which involve streaming the video is get completely handled by Open Connect. Open Connect stores Netflix video in different locations throughout the world. When you press play, the video streams from Open Connect, into your device, and is displayed by the client.

Advantages of Open Connect :

  • Less expensive
  • Better quality
  • More scalable
Fig 2. Deployment of OCAs to ISPs sites.

Let’s understand what is CDN in depth.

What is Content Delivery Network ?

Content Delivery Network (CDN) is a system of distributed servers (network) that deliver pages and other Web content to a user, based on the geographic locations of the user, the origin of the web page and the content delivery server. Let’s have a simple example to get clear idea.

Consider you are in India and you have a website which hosts videos in it. What if the user is requesting for a video which is hosted in your website from the United States? It means, the packet(video) should travel from the server in India to US all the way through under sea cables which are used for severing the internet. In this whole process you will face problems like latency (the packet should travel from India to US) and bandwidth consumption just for that single video. How Netflix overcomes such problems?

From reel to screen — a long journey

What would be the process behind this? For Netflix, getting TV shows/movies from the film producer to the customer is a long and arduous process. We can’t begin to imagine.

Fig 3. CDN in a nutshell.

To put it simple let’s take the same example above :

Consider we have placed servers at different locations in different countries with main server in India. So the main server (present in India) will be treated as original server and we will have different cache servers which holds all the video copies in different countries. If the user is requesting a video from any of it’s website from US, the video will be severed from the nearest server present in the US. In this way, content will be delivered much faster and with less bandwidth consumption between India and US.

In a nutshell, Netflix follows following steps:

  1. Netflix stores the original digital copy of the show or movie on to their AWS servers. The original copies are usually in high-quality cinema standards.
  2. Set of AWS servers take this original film file, and convert it into hundreds of files, each meant to play the entire show or film on a particular type of device and a particular screen size or video quality. One file will work exclusively on the iPad, one on a full HD Android phone, and so on. Even more of these files can be made with varying video qualities so that they are easier to load on a poor network connection. This is a process known as transcoding.
  3. The Netflix app or website determines what particular device you are using to watch, and fetches the exact file for that show meant to specially play on your particular device, with a particular video quality based on how fast your internet is at that moment.

So once the videos are transcoded, these files are pushed to all of the OC servers.

How Recommendation System works in Netflix?

Fig 4. Amazon Web Services

Whenever you access the Netflix service, it’s recommendation system strives to help you to find a show or movie to enjoy with minimal effort. But how exactly Netflix find outs your area of interest? It’s amazing right..!

Netflix find out your interactions with their service (such as your viewing history and how you rated other titles), other members with similar tastes and preferences on their service and information about the titles, etc.

In addition to knowing what you have watched on Netflix, to best personalize the recommendations Netflix also look at things like:

  • the time of day you watch,
  • the devices you are watching Netflix on,

Moreover based on two different algorithms Netflix try to simplify it’s work :

a) Content based filtering algorithm:

Depending upon the watching history, CB algorithm aims to recommend items or movies that are alike to movies the user has liked before.

b) Collaborative filtering algorithm:

CF algorithms are based on the idea that if two clients have similar rating history then they will behave similarly in the future. If, for example, there are two very likely users and one of them watches a movie and rates it with a good score, then it is a good indication that the second user will have a similar pattern.

How does Netflix manages the username, isolation and privacy of users?

Netflix estimates that it uses around 700 microservices. A micro-service in AWS is an architectural and organisational approach to software development where software is composed of small independent services that communicate over well-defined APIs. These microservices helps Netflix to control each of the many parts of what makes up the entire Netflix service: one microservice stores what all shows you watched, one deducts the monthly fee from your credit card, one provides your device with the correct video files that it can play, one keep track on your watching history and so on.

1. Username Management :

Netflix stores user’s information in AWS database. It uses DynamoDB and Cassandra for their distributed databases to store information, such as profile info, billing information, all the movies you’ve ever watched etc. User management is a small independent service which manages the profile information like username, password, etc. For example, Email address along with password is securely stored in the database.

2. Isolation :

The information, recommendations, watching history, etc is securely stored by linking them to the account information (key-value unique pair) in the database. When single account has shared screens, the information is stored accordingly. Open Connect play a very important role here.

3. Privacy :

AWS utilizes an end-to-end approach to secure and harden client’s infrastructure, including physical, operational, and software measures. AWS data protection services provide encryption and key management and threat detection that continuously monitors and protects your cloud environment.

Your name, address, email address, payment method, your ratings on shows or movies make up the information you actively provide to service provider. Information Netflix manually collects login patterns to identify devices you are logging in from, your IP address, watch history, time spent and interactions with customer service representatives.

However, Netflix do not use the data to offer any third-party advertising services and your information is contained within Netflix servers only.

How the content gets updated all over the world?

In the prime time when everyone is at home in the evening and surfing over the internet for TV shows/movies, there will be a huge traffic. So instead of trying to hover a truck loads of movies and TV shows across town in traffic jam, Netflix created a way to data store across the internet free-way in the middle of night when it’s empty. So when users are ready to watch the shows, they are already present in the network and there Open Connect, plays a role of milestone.

To cut long story shortly …

This is what happens when you hit that Play button:

Fig 5. Playback architecture for streaming videos
  • Hundreds of microservices, or tiny independent programs, work together to make one large Netflix service.
  • Content legally acquired or licensed is converted into a size that fits your screen, and protected from being copied.
  • Copies are generated and transferred to all the servers globally with the help of OC. It is achieved by the process called Proactive Caching. Netflix already knows what and when the viewers in different locations would like to watch next. The predicted videos are copied from AWS to OCAs at respective locations and by having movies readily available to stream even before viewer has asked for it, Netflix ensures a great viewing experience.
  • When you select a play, your Netflix app fetches the URLs and then fetches the quality of the network and provides the most reliable connection to you.

It looked so simple before, right?

In short, Netflix’s cloud architecture, proven by their production system to serve millions of subscribers running on thousands of virtual servers, has demonstrated a high availability with optimal latency, strong scalability through integration with AWS cloud services and resilience capability to network failures and system outages at global scale.

Hence, we conclude with how does Netflix work. I have collected this information from various sources. If you have any suggestions please enlighten me.

--

--