Improving performance with CDNs
How does it help?
The prime objective of a CDN is to bring down latency, which is the time taken by a server to receive, process and deliver a resource to a client. In layman terms, it reduces page load times. While taking care of that problem, CDNs also bring down bandwidth and help improve global availability. CDNs employ a simple process of caching static files over a range of servers distributed over the world!
Do you need a CDN?
Although a CDN provides you with great services, it is not useful in all situations. A CDN is helpful when the users of your product are distributed geographically. So, if the users are limited to let’s say, a city, or a relatively small area, CDNs may not be the solution for your problem, and you should search for other avenues.
How does a CDN work?
As mentioned earlier, a CDN stores the same static resources on various servers over the world wide web. Requests for a particular resource are usually algorithmically directed to the nodes that would handle them faster. Usually, the location of the user serves as the basic characteristic of directing a request.
This may either be determined by the easiest pathway to the server (lowest number of hops) or higher availability in terms of server performance. At times, the location that are least expensive may be chosen, but mostly, they correspond with those which are nearer. CDNs use a lot of techniques for content delivery like active web caches, global load balancers and failover systems.
Types of CDN:
Conventionally, CDNs were classified on the basis of delivery technology, but modern classification is done based on the service goal and who pays for the service.
Content Provider CDN: The goal of this type of CDN is reducing page load times. The content is available on the provider’s PoP (point of presence) and deployed globally. Such CDNs are used by sites like YouTube and Hulu.
Service Provider CDN: Such CDNs reduce external or internal bandwidth cost for an ISP by caching the content within the network of the ISP. The content is located at the ISP’s PoPs.
Peer to Peer CDNs: In peer to peer (P2P) networks, clients use the resources as well as provide them. This is unlike the client-server relationship, where the content is provided by the server to the client. More number of users leads to better content delivery in this case. BitTorrent is a good example of P2P CDNs.
Knowing your requirements:
Before you jump onto the question of choosing a CDN, you must first chalk out your requirements. What kind of resource do you need to provide? Do you need streaming services or just downloads? Where are majority of your users located? How much is your traffic now and how much do you expect it to grow? These are some questions that you need to be sure of before you approach any CDN service provider.
Choosing the right CDN:
After deciding on what exactly it is that you require, you need to choose a CDN. In many websites, setting up the CDN can be automated. For instance, the WordPress plugin, W3 Total Cache, makes the process very easy by managing this for you.
There are a few questions that you must keep in mind while choosing the right CDN. Although CDNs promise 100% uptimes, that doesn’t necessarily mean that all nodes are up for all the time! You must ascertain how you would be compensated in case of outages. You must also ask your CDN provider how overages or bursts are charged. Also, you must specifically ask the provider if streaming is supported, in case you plan to stream content. For instance, Amazon’s S3 is a really good CDN being provided at a cheap price, but it doesn’t provide streaming services.
Sometimes choosing a decent CDN is better than not choosing one at all, even though it might not be your best option. Sometimes it’s just a matter of optimizing the settings to get you the best output. Here is a detailed post on how to choose the right CDN for your needs.
Over the last few years, there has been considerable growth in the CDN industry as many people are realizing its use. The market was previously dominated by a handful of companies, but new players are constantly emerging, leading to better services and lower costs. As per an article by Streaming Media, it’s as low as 2.5 cents per GB for 500 TB per month.
The technology is getting better too. SPDY (pronounced SPeeDY) is a experimental protocol designed by Google for a faster world wide web by addressing the problem of latency (used by websites like Google and Facebook). At present, however, there hasn’t been a proper implementation of SPDY in CDNs, but it has a great potential in optimizing the overall user experience.
Let’s hope that this post enhanced your knowledge of CDNs and enlightened you whether or not you require one for your products.