CDN

Content Distribution Network or Content Delivery Network is known as CDN. As the name signifies it is a network that allows various applications to distribute their contents to the clients. “Content” that is referred in this term is static content, which doesn’t change frequently. A typical example of such static content is any image you see on the web. The image contents don’t change often and hence it is referred as “static”.

Why does one need CDN?

With global customers, a website can expect traffic from anywhere in the world. However, most of the times servers that host your application would be located in a single location (barring some exceptions). How fast a webpage will be served is constrained by the physical distance between server and a client. As a result, a visitor from the US will have higher latency as compared to a visitor from India when the web server is located in India. In this highly competitive edge, where customer drops of if there’s even a 2-second delay in response, websites strive to deliver contents as fast as possible. And this is where CDN comes into picture.

Content Delivery Network caches the static contents at various places in various geographic locations. These locations are called as Edge locations. The edge locations are configured to fetch data from the base web server, called as “Origin Server”. The data remains in the cache until expiry. After expiration, the Edge location queries the “Origin” server and fetches if the data is modified.

Load websites faster using CDN
CDN gives you speed!!

But how does this solve the problem in latency?

CDN has created the cache locations. But the real question is how would a client know which Edge location to request data from? This is solved by the Content Delivery Network. Each CDN endpoint has multiple IP addresses corresponding to all the Edge locations. CDN uses a concept for GeoDNS. GeoDNS allows the DNS (Domain Name Server) to identify the location of requesting client IP and return an IP address of the nearest Edge location. This is why we say CDN returns the data from nearest geo-location.

How does CDN Work
How does CDN Work – Source: https://f9official.com/2017/08/28/content-delivery-network-cdn/

So when you request a webpage, the request goes to the webserver. The HTML specifies that static resources should be loaded from CDN. As a result, the client makes the request to the CDN. CDN delivers contents from nearest geo-location.

Any other advantages?

Yes. Since your static data is cached to external servers i.e. the edge locations, your web/app server is free to do the operations where logic is involved. Using CDN reduces the load on the web/app server, thereby improving the response times to the clients. This results in the better customer experience.

CDN providers

  • Akamai
  • AWS CloudFront
  • MaxCDN
  • Azure CDN

Related Links

Related Keywords

AWS CloudFront, GeoCDN, Anycast

One Reply to “CDN”

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.