top of page
Writer's picture_ shli001@uw.edu

CDN: The Backbone of Modern Online Services

Updated: Oct 26, 2020

Introduction

A Content Delivery Network(CDN) is a globally distributed network of proxy servers, serving contents from locations closer to the users. Generally, static files such as HTML/CSS/JS, images, and videos are served from CDNs. This helps to lower the latency that users experience when viewing the same high-quality content regardless of where the users are located. Without the CDN, content origin servers would have to handle every single user request. It may significantly increase server workloads and network traffic, which makes it more likely for servers to fail. However, by handling user requests and serving contents from proxy servers that are physically closer to end users(e.g. on the edge), A CDN can help distribute bandwidth across multiple servers and improve the site rendering speed and performance for the users. As such, CDNs are widely used as a means to ensure consistent user experience for all users across different geographic regions and help prevent server crashes in the event of traffic surges.

Today, over half of all network traffic is already being served by CDN, and this number is still increasing.

Given the importance of CDN, a good understanding of CDNs and how they work is key to unlocking greater performance benefits for users. In this post, I will discuss what CDN is, how it works, and how you may start using it in your next project.


How CDNs Work


A CDN consists of data centers distributed in multiple geographic locations known as Points of Presence(PoPs). These PoPs consist of caching servers(a.k.a edge servers) that are responsible for the storage and delivery of cached contents to users in its proximity. For example, with a Germany-based website that uses CDN, users from the U.S. would be mapped to communicate with an optimally-located edge server in the U.S. when they visit the website that is hosted in Germany. If you are curious, the mechanism is called DNS Redirection. The edge server would then respond with the cached version of the requested content such as the company logo or web page HTML if it has been pre-saved on that server. Otherwise, the server will look for the requested content on other servers in the CDN and send the content back to the users. If the requested content cannot be found anywhere in the CDN or the cached content has expired, the server will fetch the requested content from the server in Germany and store the fetched content to serve future requests. Most of the time, doing so will avoid sending the request across the Atlantic and back, which would significantly reduce the round trip time required to establish a connection for users in the U.S.

In essence, CDN puts digital contents in many places at once, fulfilling nearby user requests that otherwise have to be handled by the content origin server.

If you want to learn more about the technical details of CDN, I recommend reading this as a starting point.


Potential Limitations

The reason why static contents such as HTML/CSS/JS, images, and videos are frequently served from CDN is that they don’t change very often. That means it is beneficial for users to get the same data from the CDN once it has been loaded from the origin content server. However, dynamic contents, such as home feeds, are not good candidates for edge caching with CDN because they are frequently customized per user and need to be updated several times throughout the day.


Should I Use CDN?

It is important to realize that CDN is a type of performance optimization for your service. If you are running a large-scale service, such as online gaming, advertising, or eCommerce, then CDN might help to create a better user experience. Also, CDNs are paid, third-party services, so the exact usage depends on your goals, priorities, and budgets. However, if you are running a strictly localized website or app with a majority of users located in the same region as your hosting, having a CDN yields little benefit.


How to Start Using CDN

Currently, cloud service providers such as Amazon, Microsoft, Google, and Cloudflare offer CDN as a service. They also provide functionalities that are beyond the cover of this post. For example, in addition to serving static content, AWS’s CloudFront and Cloudflare’s CDN are capable of serving dynamic content such as dynamic web pages or APIs. When choosing a CDN provider, it is important to consider what is necessary for your service. For instance, if you need global coverage and massive scaling, then Microsoft’s Azure CDN may be the right choice. On the other hand, if you need consistent performance and easy management, then Google’s Cloud CDN may be worth looking into. You can learn more about the differences between CDNs by reading this.


Summary

CDN stands for Content Delivery Network. The goal of CDN is to improve user experience in terms of speed. In particular, it improves page load time for the users by serving contents from locations closer to them. A CDN consists of data centers located in multiple geographic locations called Points of Presence(PoPs). These PoPs contain cached versions of contents such as web pages and videos that would serve users in their vicinity. As such, CDN puts digital contents in many places at once, fulfilling local user requests that would otherwise have to be handled by the content origin servers with a longer delay. Large-scale services can benefit a lot from the use of CDN. In case you want to use CDN, it is important to choose a CDN provider that meets most, if not all, of your service requirements.


References

  • “Amazon Cloudfront.” Amazon, Book On Demand, 2012, aws.amazon.com/cloudfront/dynamic-content/.

  • Nicholas C. Zakas. “How Content Delivery Networks (CDNs) Work.” Human Who Codes, 29 Nov. 2011, humanwhocodes.com/blog/2011/11/29/how-content-delivery-networks-cdns-work/.

  • “What Is a CDN? How Does a CDN Work?: Imperva.” Learning Center, Imperva, 23 Mar. 2020, www.imperva.com/learn/performance/what-is-cdn-how-it-works/.

  • “Why Use a Content Delivery Network (CDN)?” GTmetrix, 23 Feb. 2017, gtmetrix.com/why-use-a-cdn.html.

56 views0 comments

Recent Posts

See All

Comments


bottom of page