How Netflix works: the (hugely simplified) complex stuff that happens every time you hit PlayNot long ago, House of Cards came back for the fifth season, finally ending a long wait for binge watchers across the world who are interested in an American politician’s ruthless ascendance to presidency.

Hundreds of microservices, one giant service

Netflix ushered in a revolution around ten years ago by rewriting the applications that run the entire service to fit into a microservices architecture

  • Each application, or microservice’s code and resources are its very own. It will not share any of it with any other app by nature.
  • When two applications do need to talk to each other, they use an application programming interface (API)
  • Developers can now make many changes, small or huge, to each application as long as it plays well with the API

Racing against buffer time

The entire gamut of operations that build up the Netflix ecosystem is rendered useless if the end user’s internet connection is too poor to handle the video quality

  • Netflix uses a Content Delivery Network (CDN)
  • CDNs take the original website and the media content it contains, and copy it across hundreds of servers spread all over the world
  • This greatly reduces the latency – the time taken between a request and a response, and everything loads really fast
  • Earlier, Netflix used a variety of CDN networks operated by giants such as Akamai, Level 3, and Limelight Networks
  • Now, they use their own, called Open Connect
  • They strike deals with internet service providers and provide them the red box you see above at no cost

In a nutshell

Hundreds of microservices work together to make one large Netflix service

  • Content legally acquired or licensed is converted into a size that fits your screen and is protected from being copied
  • Servers across the world make a copy of it and store it so that the closest one to you delivers it at max quality and speed
  • When you select a show, your Netflix app cherry picks which of these servers will it load the video from

How do they run all of these microservices?

They use Amazon Web Services (AWS).

  • Netflix realized that the breakneck pace they were growing at was difficult if they spent their time building computer systems that could support their software and keep fixing and modifying them to fit their needs.
  • So they decided to move all of their servers to the cloud and run everything on the servers of someone else.

From reel to screen – a long journey

If it’s a show/movie Netflix doesn’t produce by itself, they have to negotiate for broadcast rights with the companies tasked with distributing films or TV shows

  • This means paying a large sum of money to get the legal right to broadcast a movie or TV show to customers in various regions around the world
  • Store the original digital copy of the show or movie on to their AWS servers
  • The internet is the umbilical cord that connects Netflix to its customers, and it takes a lot for them to deliver the content a user wants, in the shortest time possible

Source