Content Delivery Networks in a Nutshell

Content Delivery Networks in a Nutshell

Using and developing online services may seem mundane today. Behind the scenes there are plenty technologies that don't always get the appreciation they deserve. Just the basic task of sending data over the network is nothing short of amazing.

Since the transfer of data is ultimately restricted by the laws of physics, it makes a tangible difference if a piece of data is sent half way around the world rather than from next door to you. This is the core of what Content Delivery Networks, CDNs for short, were built to address. A CDN operator is a company with servers around the globe that relay data so roundtrips of network requests and responses are optimized.

In addition to delivering data from the best possible physical location for each user, a CDN has other functions. Since the operators are experts at transferring data in bulk, you can scale up to provide for a global audience from your garage without breaking the bank. Another common task is optimizing the data itself. Modern CDNs can handle compression of images and other assets on the fly, further improving performance by minimizing the total payload sent over the wire or the air.

Security and availability is another aspect that cannot be ignored. There is a lot of malicious activity online, from opportunistic knocking on doors to organized attacks against specific organizations. Hosting your service behind a Content Delivery Network can also offer some protection against these. Due to their sheer scale, many CDN providers can mitigate DDoS attacks and provide an additional layer of security as a Web Application Firewall that can protect against an attack on your service itself.

Deploying a Content Delivery Network

For many cases deploying a Content Delivery Network is not a daunting task. Since a CDN is essentially a layer between your service and the users, the existing infrastructure you have can often largely stay as is. You need some network configuration and added logic in your application to handle purges of stale data.

The hardest part is really managing purging the copies of data on POPs (Points of Presence) on changes. Since the origin of all data is your service you should not be too generous with purging or you will lose the advantages as data needs to be often loaded from your servers running the application. Managing new version deployments to make sure all assets (images, styles, JavaScript code, etc.) are refreshed also needs to be taken into account in your deployment pipeline.

For a complex applications or poorly designed architecture, the above might be more complex than you initially thought, leading to unexpected and difficult-to-track-down edge cases from users from different physical locations. Using a VPN service to fake your physical location can be helpful in debugging, but may not be granular enough.

For Ibexa customers the good news is that we have thought this through for you. Out of the box the system manages purging bits and pieces from caches automatically and has an API that allows integrating to virtually any CDN out there. For an optimal experience consider Ibexa Cloud that comes bundled with an integration to Fastly, a leader in the CDN space. The Ibexa Cloud deployment process automatically ensures that the latest assets are delivered to your users around the world.

What's on the horizon for CDNs?

CDNs have been a staple of web development for years, even decades now. So there is likely not going to be an aggressive expansion in this area. But we will likely have more adoption for resource heavy non-web workloads. For example streaming companies such as Netflix already deploy their own servers with copies of the media directly to teleoperators networks. Meaning that when you're watching your favourite series, it might be that the video is not going through the public internet at all.

The technology landscape is continuously evolving, and content delivery networks are no exception. A recent trend that CDN providers are capitalizing on is Edge Computing. It is a close cousin of the Cloud Computing term we're all accustomed to. With Edge Computing, tasks are not executed on large server farms, but in smaller facilities closer to the end users. This is where CDNs already are, so it makes sense.

It is important that Edge and Cloud are complementary. Tasks like data storage are best handled by large scale facilities to keep cost down, but for tasks where low latency is crucial, Edge Computing can provide an edge. An example of this could be signalling for autonomous vehicles, or maybe streaming games running on the cell tower to your phone to optimize performance and battery life.

But even beyond these futuristic use cases Edge Computing can be useful. Moving some of your logic for personalization or local promotions from the server farm to the edge could make a lot of sense. And since it is by nature an extension to the CDN architecture as a layer in front of your central application, this does not mandate a complete reimplementation from the ground up.

Photo by NASA on Unsplash

Insights and News

By Karl Stapleton
21/06/2024 | 5 Min read
By Karl Stapleton
19/06/2024 | 6 Min read
By Karl Stapleton
17/06/2024 | 4 Min read