Let’s Discuss Content Delivery Network or CDN in short and see exactly What it is?
Now before getting into the structure of CDN, let’s first see the definition of CDN. For Example :- When you visit a website you see loaded content from that server and if you are not using a Content Delivery Network, then you are going to be putting stress on that server, just a tiniest amount of stress on the server, for it to render the pages and for it to show you the content and if you have tons of visitor’s then this can really put down your server and cause it to be very slow and unresponsive and if you have a very major website and people are finding your website loading slow then you are probably be losing some people when that happens. So how do we solve that? Yes, with CDN!!
So, what is a CDN does? It distributes the static content of your websites like pictures and videos and puts them in the locations closer to the people you are serving the content and that varies by what content delivery network really using.
There are multiple content delivery networks out there including Amazon etc. So there services have servers all over the world and what it does is that it caches the contents to those servers and then when the person visits your site then it would load those images from those node servers instead of your personal server thus taking the load off of your server and distributing it out across the networks.
Now that we have somewhat of a running definition of CDN going, now let us talk about content delivery networks and how it works?
You can think of it as a tree: up at the very top you have the root server and this is the root source of everything and anything that is from your website i.e. pictures, videos and contents all of that stuff is right here and let’s say if we now want to implement a content delivery network then how does it happen?
Well, it will happen usually through DNS changes. You usually get a DNS record for your content delivery network and you will place it with all the images and pictures, links that happen to have on your website. Most likely you are using some sort of website that has automation so that would usually happen that way.
There are 2 types of content delivery networks that are Push and Pull. When you push a server that means you are actually pushing the all of that static content onto the content network’s servers. For ex:- if you are uploading an image what would happen to a server? Well, it would take that image and push it off to the content delivery network. The CDN would then take that image and caches it out across its network.
A Pull server works a little bit differently, Somebody actually has to request the link to what you are looking for. For Example:- An image when the first and the very first person goes to that image the CDN is going to go to your root server and pull that image out, download that image and distributes it across the network to be served locally.
So when you first implement a pull server CDN, you are going to have a little bit slowness with loading because it is starting to cache all that content. Now which one is better and which is the worst? Well! there is no such right or wrong answer. It all depends on the situation.
Now that we have all this content being served across the network, How does it work? Pretty simple! These CDN’s have things called Nodes. These Nodes are servers all around the world and they get these servers as many places as possible to serve the content locally and then when a person who may be from foreign, maybe across the street or whatever, it is going to look up when it is going to get the image. It is going to say, “here is the DNS of the image.” The CDN is going to say “Ok, I recognized you. From saying the USA”, for ex. It is going to say “Well! you are from the USA, I am going to find the closest node to the USA and load you the image for you”.
Thus, in turn allowing you load the site faster and the load on your server is nice and low and now this would cost you some money per gigabytes, so not very bad, if you have more traffic to your website. Usually the websites like Youtube etc. It is very helpful for the people who might have slow websites or web servers that are not very fast.
It allows you to basically reach out to more people in the shorter amount of time. Now that we know what CDN is and how it works and it is the simplest explanation of it.
Summary: Why use CDN?
CDN greatly reduce the load time, when a user browses a page then the browser automatically download the jQuery file from the closest available server in the network.
Visit – Hostdens