CDN 101 for PMs

Ezgi Demirayak
The Startup
Published in
5 min readMay 25, 2020

You typed Facebook.com to your browser and you are waiting for the website to load. 2 seconds passed and it’s still loading.. 4 seconds passed and it is still loading.. 6 seconds passed…OKAY, WHAT IS GOING ON?! Imagine this happened when you were shopping on Amazon to buy very important things that you obviously don’t need or even worse..when you want to watch your favorite series on Netflix.

You probably would give a reaction like this, right? To prevent these unwanted delays that could lead to a bad user experience, companies who serve content globally rely on CDNs.

A content delivery network (CDN) is a system of geographically distributed servers that deliver web content to the users based on their locations.

Okay.. but how does it work?

CDNs are placed at Internet Exchange Points (IXPs) which are the main locations where different Internet Providers (ISPs) connect to provide each other access to traffic on their networks.

Let’s continue with our Netflix example. Let’s say you are living in Europe and you want to watch Friends on Netflix using your smart TV. You clicked Season 3, Episode 8: The One with Football and you are waiting for it to start. At this point since you requested this episode from Europe, your request will be directed to the nearest CDN which in this case will be in Europe (check my beautiful(!) artwork above). The CDN will serve you the episode quickly if it has the local copy available (if it already cached it before). If the content is not available it means that it has not been requested by another viewer recently (not cached) or the content is not in high demand and the CDN will need to query another CDN in its system and request the content from it. This process will continue until CDN finds the content. If the CDN was not able to find the content, it finally will request it from the origin server (in this case the server is the US), cache it locally, and then serve it to you. When another Friends fan requests the same episode right after you, this time since initial CDN cached the content, it already has the episode locally and will serve the content directly to the viewer quickly (what a lucky person!).

What are some benefits of using a CDN?

  • Reduces Latency -> Improves User Experience
  • Reduces Bandwidth Usage and Cost
  • Increases Content Availability
  • Prevents Single Point of Failure

Reduces Latency -> Improves User Experience

The geographically distributed nature of the CDN shortens the distance between the content and the user. This means that because the content will travel less distance, it will reach to its user in less time. If Netflix was not using a CDN then your device would make a request to the origin server (in the US) and wait for a response back from it, which is the episode. So the content would travel from the US to Europe over the Atlantic Ocean resulting in a high Round Trip Time — the time it takes for a client device to send a request and receive a response from the server. Instead, with a CDN system, the episode is served to you from the nearest server in Europe in a shorter time (lower RTT) so that you can happily watch your favorite shows without getting frustrated by loading times.

Reduces Bandwidth Usage and Cost

Bandwidth refers to how much digital information we can transfer (send or receive) across a connection in a certain amount of time. If you are the only one who is streaming series on Netflix then you should be fine, but the chance of this happening is close to zero… Imagine a scenario where CDN does not exist and millions of people who live across the globe requesting content from the origin server. The origin server would need to manage all these requests at the same time and try to serve the content (response) as fast as possible to all these different locations, resulting in a very high bandwidth requirement. However, when we cache contents to globally distributed CDNs, less data needs to be transferred in and out of the origin server thus reducing the bandwidth usage as well as the cost associated with it.

Prevents Single Point of Failure and Increases Content Availability

CDNs replicate the same content in multiple places (redundancy) to improve the availability of the content and to help to restore if in case a server fails. If anything happens to any of the servers, CDN can still find another copy of the content and serve it to the user. This is done by using a load balancer, which is another concept that I may tackle in the upcoming posts.

Why should Product Managers care?

Content load speed (web page, video, etc.) plays a crucial role in any user’s experience with the services they use. Even a second of load time latency may cause a reduction in user satisfaction. Since providing a delightful experience to the users is one of your main goals as a Product Manager; providing a fast and reliable product/service should be your priority. If you are a Product Manager of a product that serves on a global scale then CDNs should be crucial for your content distribution (video/audio/text) and there are not many reasons not to use a CDN considering that many companies offer it for free.

Some CDN Companies

Akamai, Amazon Cloud Front, BitGravity, Broadpeak, CDN77, CacheFly, CDN.NET, CloudFlare.

Further Reading & Resources

Technical Deep Dive

Netflix CDN — Open Connect

CDN and Security

--

--