What is a Content Delivery Network or CDN?
A CDN is like owning a restaurant chain instead of one restaurant to sell more of your burgers around the world.
CDN, which stands for Content Delivery Network, is a mechanism of distributing content to users in a highly available and fast way. CDNs are like fast food restaurant chains. Instead of having one restaurant which serves all burgers to all customers in the world, they rely on a high number of identical restaurants which are distributed across the globe to better serve customers.
The story of Jane and the unique restaurant
Let's take the example of Jane, who loves this unique and delicious Burger from her hometown. Because she lives far away from it, each time she wants a burger, she has to travel for two hours, and sometimes, even wait for another hour in line because too many people are waiting for the same burger. In case there's an issue in the kitchen, it's impossible for Jane and all the other customers to get their burger.
The story of Bob and the famous restaurant chain
Now, let's take a look at Bob and this famous burger restaurant chain which you can find almost anywhere across the globe. Bob is used to travel a lot. Whether he's at home or traveling for work, he can always find a place to eat his favorite sandwich nearby. They always taste and smell exactly the same, because they're using the same recipe and the same ingredients. This food chain has its headquarters in the US, where they elaborate new recipes, so that new burgers can then be sold all over the world. If one restaurant has to close because of a fire in the kitchen, you can always go to a different restaurant where they sell the exact same product.
An efficient way to distribute your content to global users
Content delivery networks are made possible thanks to 3 different parts:
- Origin Servers which contain content the source of data to distribute
- Servers across the world which cache and distribute that content and sync with the first ones
- A mechanism to always route users to the nearest server
By using CDNs, you're reducing the time to access your assets for your users, reducing the load on your main server which doesn't have to server static assets anymore.
Benefits of using a CDN
- Improved latency & response time for global users
- Increased availability
- Decreased load on main application & services