What are the benefits of a CDN? | Webnames Blog

What are the benefits of a CDN?

benefits of cdn

A CDN (Content Delivery Network) is a popular service used by websites to streamline and manage the speed and performance of its assets to visitors. Read on to learn more about the benefits of a CDN, disadvantages if any and to help determine whether your website need a CDN.

The Dilemma

As your web site grows, you may face the dilemma of how to optimize the delivery of its content over the Internet. At first, when your site was a small collection of static text and images, it was simple enough to host all its content on a single web server. But if your site now features dynamic content with extensive video and other high-bandwidth media, it can easily become overwhelmed and suffer from bandwidth overages, slow responsive times, and even crashes. A single-server solution might no longer cut it.

The Solution

See the source image

Imagine a small-town flower shop that sets up a delivery service. For the first few months, the shop owner delivers everything herself by bicycle. As her customer base grows, she buys a car and then a van to handle the growing volume. Eventually, as the business flourishes, she contracts with a courier company to handle the deliveries of most orders. Finally, she sets up a few locations in other cities where flowers can be grown and delivered more quickly to nearby customers.

In this flower shop analogy, the bicycle is your single-server web site with an entry-level service package. Upgrading to a car or van is like upgrading your web hosting to a better service package. So far, so good. But when you need to handle many more customers, you contract with a courier company or open satellite depots. This is where a Content Delivery Network (CDN) comes in.

Content Delivery Networks have come a long way since we first detailed their pros and cons, back in 2013. Modern CDNs are much more complex, with significant implications for security and reliability as they handle many times more data than earlier. Below, we cover the benefits of using a CDN in 2020:

Benefits of a CDN

content delivery network benefits

 CDNs allow you to offload some or all of the job of serving your site to a distributed network of servers on the Internet. These servers are geographically distributed so that visitors can reach them faster than they could reach your primary web server. (To learn more about how a single logical Internet host can be served by many far-flung physical hosts, read up on DNS and IP Anycast.)

For standard applications, CDN servers are optimized for high traffic, high bandwidth static content. This volume-oriented configuration with thousands of resident customers allows them great economies of scale, and generally results in lower bandwidth costs to the end user as compared to traditional single-server web hosting. For example, if you need to feature a video on your web site, it would make sense to upload the video to YouTube or Vimeo and then reference it using a JavaScript or iframe plugin.

Because CDNs typically serve content from third-party hostnames, they can help increase the number of simultaneous connections that a web browser is able to make while it is fetching and rendering a page. This can provide a performance improvement, even if the CDN servers are no faster than your primary web server. (Mind you, the adoption of HTTP/2 has allowed many servers and browsers virtually unlimited simultaneous connections, even without using CDNs across multiple hostnames.)

ddos attack

Another advantage to using a CDN is that it generally offers more protection against Distributed Denial of Service (DDoS) attacks than traditional web hosting. DDoS attacks are malicious floods of nuisance requests from many different machines on the Internet, often controlled by a single attacker and aimed at temporarily disrupting a web site or service. Using a CDN makes it harder for the DDoS attack to focus electronically and geographically on a single server. (Mind you, Webnames Hosting packages already come with Enterprise-level DDoS protection as a standard feature.)

One last and particularly compelling advantage of CDNs comes about when a CDN is used to serve common script and style resources that are widely used by many clients on the Internet. For example, many sites are dependent on common JavaScript/CSS frameworks like jQuery, React, or Bootstrap. If all these sites reference these static framework files from the same CDN URLs, then the thousands or millions of clients who access them will automatically cache the files in their local browser storage. When the same client browses to a different site that uses the same CDN URL, it will no longer need to make any Internet request at all, drastically reducing the time needed to render the page.

Disadvantages of using a CDN

CDNs, while useful, do come with some disadvantages. The first obvious disadvantage is that a CDN will complicate your web application setup. You’ll need to keep track of which of your resources are served locally and which are served by a CDN. Occasionally a CDN will change its URLs or apply other restrictions that you will need to reflect in your HTML source.

While many CDNs, such as CloudFlare, offer free services, you may eventually need to pay for greater performance, particularly with enterprise CDNs such as Akamai.

Another potential disadvantage is security and control. While the big CDN hosts like cdnjs, Google, and Microsoft probably have more people paid to keep their servers secure than you have in your whole company, they are also big and attractive targets for hackers. If one of the big CDN hosts were compromised, it could have a devastating effect on the security and privacy of millions of web users, including your own. This can be mitigated to some extent using a new HTML feature called Subresource Integrity, but you are still putting a lot of trust in large, faceless corporations that have no obligation toward you.

Who is a CDN for?

If you're building your very first website and are not expecting a lot of visitors, a domain name, a hosting package and an SSL certificate should be good enough to get started, if you know how to build a website. Alternatively you could use a website builder.

A need for a content delivery network on your website does not arise until your traffic starts growing over a few hundred every day or if you have major traffic surges at specific times due to the nature of your website. For instance, a sports fan blog might experience traffic surges during and just after a game for match reports and commentary, while it might be relatively flat at other times.

If you're expecting your website traffic to go up rapidly due to marketing campaigns or other activities, we recommend that you consider using a CDN.

Recap

Pros

  • Improved performance due to geographic distribution and caching
  • Potentially lower bandwidth costs
  • Potentially enhanced DDOS protection

Cons

  • Complexity
  • Cost
  • Trusting big corporations / loss of control

In summary, using a CDN is a good way to improve the performance and scalability of your web site. It can increase the complexity of your architecture, but the advantages often outweigh the disadvantages.

Posted in:

General Hosting Security
/* Adroll script */