What is a CDN (Content Delivery Network) and How Does it Work? [Updated for 2023]

A CDN or Content Delivery Network is critical to video, image, and website content delivery and performance across the globe. Most streaming services like Netflix, Amazon Prime, HBO, YouTube, etc. depend on CDNs for their day-to-day existence and to ensure extremely high quality of service, quality of experience, and cost reduction.

In this article, let’s understand what a CDN is, how a CDN works, why you need a CDN, and the advantages of using a CDN.

Let’s get started!

What is a CDN?

A content delivery network (CDN) is a system of distributed servers that are deployed in multiple locations around the world. They sit between the end-user devices and the origin servers to deliver web content, such as HTML pages, images, and videos, to users based on their geographic location. CDNs are designed to scale efficiently to ensure a smooth viewing experience for the clients.

The main purpose of a CDN is to

  • Improve the speed and performance of a website by reducing the distance that data needs to travel between the user and the server.
  • Reduce the cost of serving data by caching them at edge.
  • Protect the origin servers from DDoS attacks

CDNs do this by storing copies of the website’s content/images/videos/etc. on servers that are closer to the user, and delivering the content from these servers instead of the origin server (the main server where the website is hosted).

CDNs are used by a wide range of websites, including large e-commerce sites, media companies, and software-as-a-service (SaaS) providers, to deliver their content to users around the world. CDNs can help to improve the reliability, security, and cost-effectiveness of a website, and can also improve the overall user experience by reducing the time it takes for content to load.

How does a CDN work?

As mentioned in the introduction, a content delivery network (CDN) is a system of distributed servers that are deployed in multiple locations around the world. These servers are connected to the Internet and are used to store and deliver web content, such as HTML pages, images, and videos, to users based on their geographic location.

Let’s now spend a few minutes understanding how a CDN works.

Step 1) When a user requests a web page from a website that uses a CDN, the request is routed to the server that is closest to the user’s location. This is done by using Domain Name System (DNS) routing, which directs the user’s request to the server with the lowest latency (the shortest amount of time it takes for data to travel between two points).

Step 2) Once the user’s request is routed to the correct server, the server retrieves the requested content from its cache (a temporary storage area for frequently accessed data) and delivers it back to the user.

Step 3) If the content is not already stored in the cache, the server will retrieve it from the origin server (the main server where the website is hosted) and store a copy in the cache for future requests.

By distributing the content across multiple servers in different locations, a CDN can help to improve the speed and performance of a website by reducing the distance that data needs to travel between the user and the server. This is especially important for users who are accessing the website from a location that is far from the origin server.

Why do we need to use a CDN?

The main advantage of using a CDN is to improve the speed and performance of a website by reducing the distance that data needs to travel between the user and the server.

This is by far the most important benefit of using a CDN. Let’s pause and understand why. 

Assume that you are running a video streaming service like YouTube and one of the videos on the platform goes viral. What this means is that millions of people want to the watch the video and this is going to generate millions of requests to your origin server. Unfortunately, most origin servers won’t be able to keep up with the demand and might collapse under the load. This is called the “Thundering Herd” problem and explained in detail in this article along with the solution (“Request Collapsing”).

As a result of the origin server collapsing under a high load, your end users will suffer several QoE and QoS problems such as,

  • Video buffering because the server isn’t able to serve them fast enough.
  • Startup-delay because the server is overloaded and can’t serve the videos.
  • Inferior video quality because the player starts switching down to lower bit rates because it cannot get high-quality (high-bitrate) video from the servers promptly.

So how do we solve this problem and prevent it from occurring again?

One solution to the problem is to cache the data on a intermediate server instead of asking the origin server for the data each time. That is, you add a cache in front of the Origin Server that can cache frequently-asked webpages, images, videos and serve them to the end user without going to the origin every single time. And, to serve different geographies, we can set up several of these servers (caches) worldwide to cater to geographically-distributed users and provide faster responses.

This is in-essence what a CDN looks like (geographically-distributed servers) and why it is so powerful in serving images/video/content so quickly to the end users.

how does a CDN work
Content Delivery Network
(Left) Without CDN (Right) With CDN

Advantages of using a CDN

Finally, let’s take a look at the benefits of using a CDN –

Increase in Reliability

A CDN can help to improve the availability of a website by distributing its content (images, videos, data, content) across multiple servers in different locations. This means that if one server goes down, the content can still be accessed from another server. In addition to distributing content across multiple servers, one can also use multiple CDNs to further increase reliability and reduce the dependence on any single CDN provider – here’s how Multi-CDN networks work.

Increased Security

CDNs can help to protect against Distributed Denial of Service (DDoS) attacks by absorbing the traffic and blocking malicious traffic before it reaches the origin server. CDN customers can set up rules to deny requests from certain clients or sets of IP addresses. CDNs can thus act as the first line of defense from malicious attacks.

Reduced Bandwidth Cost

Using a CDN can help to reduce the amount of bandwidth required by the origin server, which can result in lower hosting costs. Origin servers like AWS S3 are very expensive for serving data and will result in very large bills if data is served directly from storage (like S3) instead of using a CDN caching-layer in-between.

Reduced Infrastructure Costs

Infrastructure costs in terms of Origin Servers are reduced as most of the load is absorbed by the CDN. In addition to lowering the costs, the use of CDNs leads to lower bandwidth consumption for the Origin Servers.

Better User Experience

By reducing the time it takes for content to load, a CDN can improve the overall user experience of a website. This is especially important for users who are accessing the website from a location that is far from the origin server.

Overall, using a CDN can help to improve the performance, reliability, security, and cost-effectiveness of a website, and thus deliver an amazing user experience. Specifically, if you are a live streaming company, then you must read this article to understand how a CDN can improve live streaming performance and reliability.

Conclusion

I hope this explanation helped you understand what a CDN is, how it works, and the advantages of using a CDN. Several commercial CDNs like Akamai, Fastly, Cloudfare, KeyCDN, LimeLight, Medianova, and others do an excellent job delivering content to the end-users and improving the video watching experience – for different use-cases, architectures, and budgets.

In future articles of our video streaming series, we’ll look at concepts in CDN technologies such as Multi-CDNs, Edge Caches, Edge Computing, and more.

Until then, take care and happy streaming!

More Reading

If you are interested in CDNs, then do read these articles to learn more about their applications.

  1. How does a CDN work?
  2. What is the Thundering Herd Problem in CDNs? What is Request Collapsing?
  3. How does a Multi-CDN work?
  4. What is the advantage of using a CDN for Live Streaming?
  5. What is Cache Hit, Cache Miss, and TTL (Time-To-Live) in CDNs?
krishna rao vijayanagar
Krishna Rao Vijayanagar

Krishna Rao Vijayanagar, Ph.D., is the Editor-in-Chief of OTTVerse, a news portal covering tech and business news in the OTT industry.

With extensive experience in video encoding, streaming, analytics, monetization, end-to-end streaming, and more, Krishna has held multiple leadership roles in R&D, Engineering, and Product at companies such as Harmonic Inc., MediaMelon, and Airtel Digital. Krishna has published numerous articles and research papers and speaks at industry events to share his insights and perspectives on the fundamentals and the future of OTT streaming.

Pallycon April NAB 2024

5 thoughts on “What is a CDN (Content Delivery Network) and How Does it Work? [Updated for 2023]”

  1. Hi Krishna.

    Thanks for this excellent foundational article on CDNs! As you continue your series, please be sure to cover Open Caching – https://opencaching.streamingvideoalliance.org/ – which was developed by the Streaming Video Alliance – https://www.streamingvideoalliance.org/ and is being commercialized by Qwilt – http://www.qwilt.com – and Cisco – http://www.cisco.com and others.

    Open Caching is new architecture and business model that will help streaming scale. Service Providers such as BT, Telecom Italia, Verizon have deployed this new model in which edge caches are deeply embedded in their networks. The outcome is better quality streaming, more delivery capacity and better ecosystem economics.

    I look forward to your next article!

    Mark Fisher
    Qwilt

    1. Thanks for the kind words of appreciation, Mark. And, thank you for the idea about writing about Open Caching – I’ve added it to our CDN series. Great tip!

      1. Hello Krishna,
        Thanks for writingthe blogs on topic like streaming media which was really untouched before.
        This is really helpful to get the top level understanding of how CDN works.
        But one query regarding the difference between Encoder and Transcoder:-
        * Encoder Compresses the raw data and transcoder get the compressed input then resizes into different resolution ut here you mentioned
        “The transcoder resizes the video and compresses it into different bitrate-resolution combinations (called Profiles)”
        I am bit confused in getting the clarity between Encoders and transcoders with respect to ott/iptv.
        Regards
        Kafeel

  2. Pingback: CDN Request Collapsing and the Thundering Herds Problem Simplified - OTTVerse

  3. Pingback: Using Origin Shields for Amazing CDN Performance & Video Streaming: Benefits and Providers - OTTVerse

Leave a Comment

Your email address will not be published. Required fields are marked *

Enjoying this article? Subscribe to OTTVerse and receive exclusive news and information from the OTT Industry.