Saturday 4 January 2014

Content Delivery Network (CDN)


Content Delivery Network (CDN) works as a cache layer between the Web client and Web server. It provides the fast delivery to the client by providing static contents using a closer cache server.

How CDN works.




CDN work flow.

1.       a web client wants to get some content from web server (image1.abc.com), it queries local DNS who is image1.abc.com.
2.       local DNS does not know who is image1.abc.com then it queries the root DNS
3.       by iteration, root DNS provides the authority DNS server for image1.abc.com.
4.       local DNS queries SOA
5.       SOA returns a CNAME to the local DNS. Usually it is on a smart DNS name.
6.       local DNS queries the smart DNS server
7.       smart DNS server use a complicated algorithm to the decide a suitable CDN node name (IP)
8.       localDNS returns the IP to the web client
9.       web client asking the content from the specified CDN node.
10.    CDN provides the content (image1.abc.com) to the web client.

To sum up, CDN use DNS alias to change the destination from the real web server to the CDN provider. Compared with the real web content which is usually over several KB or even MB, the DNS query packages are very tine.
CDN content is usually for static content, such as images, video, CSS. It does not apply to any dynamic page such as ebusiness price query.
The source provider will push the content the CDN provider if the content get updated.
The CDN can pull the content if the query is for a missing content.
CDN will cache the content for next query.

Key component of CDN:

Two components of CDN are:
Smart DNS: the DNS check the requestor’s location and the current load of CND nodes (a complicated algorithm with lots of facts). Then it returns a suitable CDN nodes to the client.

Cache Server: the cache server contains the content of the image files. It is usually a copy from the real server.

No comments:

Post a Comment