Do you want to create your own online store?

Picture of a phone with Shopify software

Start Your Business with Shopify

Try Shopify for free, and explore all the tools and services you need to start, run, and grow your business.

What Is a CDN and How Do CDNs Work?

What is CDN

World Wide Web usage has exploded, with traffic currently growing nearly fivefold year-over-year. What started in the early 1990s with a few scientists in Switzerland sharing research papers is now a massive worldwide network of nearly 5 billion users. Websites, email, audio and video, mobile access, social networking, ecommerce, and online business are woven into our lives, delivering content and solutions to billions. 

This growth would have been impossible without the development of a little-known technology that improves the performance of content delivery to end users over the internet: the Content Delivery Network (CDN)

What is a CDN?

Content Delivery Networks (CDNs) are groups of geographically distributed and interconnected servers designed to speed up internet performance. They achieve this by bringing web content closer to the website’s users. Simply put, instead of everyone in the world accessing a single server for a particular website, website content is stored on servers around the world, nearer to where the expected users are located. This reduces network latency, or wait time for data to be transferred, and ensures better performance for web pages and applications. 

To compare it to the world of fast food, you wouldn’t drive to the McDonald’s headquarters in Chicago to buy a Big Mac—you’d drive a shorter distance to a local franchise.  

How does a CDN work?

The primary location where a website’s content is stored is called the origin server. Types of content stored include static web pages (images, text, code), software downloads, rich media (audio and video), and dynamic content created by applications. Copies of the origin server content are stored on geographically distributed caching servers in data centers called Points of Presence (PoPs). These servers are located near where user requests are expected, the so-called “edge” of the network. These servers are also called “edge servers.”

When a user clicks on a web link, the request is fielded by that domain’s web server. When a CDN strategy is used, the web server for that domain has its DNS (internet address) record redirected to the appropriate CDN servers. They intelligently reroute the requests to the appropriate edge server. Cached content is delivered from the edge server to the client across a shorter distance. If the CDN doesn’t have the requested file, it retrieves it from the origin server and delivers it to the client, and subsequent client requests are fulfilled much faster. The CDN management software uses intelligent algorithms and machine learning to anticipate content requests, retrieve content to the CDN before it is needed, maintain synchrony with changing content on the origin server, and enhance perceived performance.

The duplication and distribution of content has additional advantages: With multiple distributed servers, more users can be supported simultaneously, local network congestion is reduced, busy server traffic can be redirected to another for load balancing, and single points of server failure are eliminated. This all happens transparently to the end user, except for the snappier page load times.

Who uses CDNs?

Organizations that want to deliver complex websites internationally or to improve the online experience for their users should be employing a CDN as part of their web architecture. 

When CDN technology was introduced in the late 1990s, it was primarily used by only the biggest corporate websites and business applications. At that time the technology was new, expensive, and limited to publishing static content. 

Over the past few decades, things have improved. CDN services have become more ubiquitous, and CDN adoption more common. The cost of commercial CDNs has become more affordable, sometimes even being bundled with web hosting packages. Static and dynamic content can now both be served intelligently, and CDNs are essential to rich media streaming, particularly across broader geographical locations.  

Advantages of CDNs

There are many advantages to the use of CDNs for web content distribution, including:

  • Improved user experience. One of the main motivations for most organizations using CDNs is the elimination of long wait times for downloads and streaming, and the provision of a better user experience. 
  • Optimized bandwidth. Distribution of content through CDNs shortens network path distances and reduces or eliminates local network bottlenecks, reducing bandwidth requirements and enabling better network usage.
  • More simultaneous users. By distributing to edge servers, more simultaneous users can be supported than is possible with even a highly scaled centralized solution.
  • Improved security and availability. Distributed Denial of Service (DDoS) attacks are commonly used by cybercriminals attempting to harass or penetrate the defenses of an organization. CDNs inherently offer DDoS protection by multiplying the number of points of access, resulting in a more reliable and available web solution. Many CDNs include support for additional security enhancements as well, such as Web Application Firewalls (WAFs) to protect web applications.
  • Control of access and performance in different regions. It may be the case that your organization wishes to focus its content delivery on certain geographies. Smart deployment of appropriate CDN servers into those areas can enhance your web performance there, and CDN management software can automate responses to spikes in demand. Conversely, it may be desirable to limit access in other areas. A CDN platform can also be configured to help with this.

Disadvantages of CDNs

While there are many advantages to the use of CDNs, there may be drawbacks for some organizations. These include:

  • Cost. For non-trivial web solutions, there will be real costs paid to the CDN host, both start-up costs and ongoing operations costs tied to data transfer volume. If not planned for, these costs can grow to unexpected levels. 
  • Geography. It is critical to match your CDN infrastructure to the geography where your users are. A poor geographic alignment will result in lower performance. Some organizations use multiple CDNs with different footprints to help address this issue.
  • Complexity and support. The use of a third-party CDN introduces additional complexity in deploying and managing your web solutions, as well as an additional layer of support that can potentially complicate solving system problems.

Local restrictions. Some countries and local organizations have blocked internet access to content hosted by some CDNs. This can negatively affect the reach of your website.

Topics: