What is a CDN, and what benefits can it bring? If you work in IT, you need to know the answer to such questions. In fact, CDNs are popular solutions, now more than ever. With a CDN, you can improve the performance of your website or application. Thus, you need to understand how can you use CDNs to improve your products. In this post, we explain what is a CDN (Content Delivery Network) in simple terms.
What is CDN?
Understanding the need for a CDN
Without a CDN.
CDN stands for Content Delivery Network. Even if the name is simple (a network that delivers content), it does not shed much light on its functionalities. First, we need to understand what is the content. That’s simple: content is pretty much everything you can access from the Internet. The pages of a website are content, the videos on YouTube are content, and the same goes for the music on Spotify and so on. In some way or another, the website or app needs to deliver that content to you. If they don’t, their product will be useless.
With the traditional approach, the content provider (YouTube, Spotify, the website, etc.) holds all the content. When you want some of it, you just ask them and they will send it to you. This works perfectly but comes with two major concerns.
- Latency – if you are far away from the provider’s servers, it will take a little bit more time to get the content. Even if we are just talking about a couple of hundreds of milliseconds more, that delay can be enough to break a real-time application.
- Bandwidth – again, if you are far away from the provider’s server, the content needs to travel all the way to you. To do that, it will need some bandwidth on all the parts of the Internet between you and your provider.
As you can see, the two major concerns only apply in one case: when you are far away from the provider’s server. So, the root cause of this problem is that you are far away from the content. How can we solve that? That’s when the CDN enters the picture.
Introducing the CDN
With a CDN, user connects to a closer cache server.
Now, we can answer what is CDN as simply as: CDN is a system that gets the content closer to the final user, before the user asks. In other words, it is a network of cache servers. The content providers distribute copies of their content in many servers across the globe, and when you require the content you will get it from the server that’s closest to you. Easy, right?
CDN is a system that gets the content closer to the final user before the user asks. It is a network of cache servers.
For a CDN to work, it needs to do two main things.
- The cache servers must get the latest copy of the content from the “main” server often enough to avoid discrepancies
- You need to put in place some mechanisms so that the users are sent to the local cache server, and not to the central one
Luckily, CDN providers exist. They can take care of all of that for you, and they work perfectly for simple applications and websites. However, if you are working with something more special and that requires customization of the cache, you may need to create your own CDN. If that’s not your case, you can start out with Cloudflare, which has free options as well.
Wrapping it up
So, let me summarize everything. CDN stands for Content Delivery Network, and it is a network of cache servers that takes the content the user wants close to the user. They do that automatically before the user asks. For them to work, they need to get often the original content from the “central” server, and you need to send your user to the local cache server, not to the main one.
What do you think of CDN? Have you been using it in your sites and projects? Let me know in the comments.