“In theory, there is no difference between theory and practice. But, in practice, there is.”
CDN, we all know what a Content Delivery Network is and maybe also how it works. At least in theory. It’s easy:
It’s a network, therefore made of cables, servers and other hardware parts
which delivers some sort of content. Just to share a real life example: Olympic games are recorded(that’s the content) and delivered to you via internet, live TV, OTT or any other possible device(and that’s the “deliver”), while the infrastructure which does the deliver is the network. Easy, right?
In theory, again, a CDN could be built anywhere. I mean, we went on the moon and we now have a Tesla approaching Mars and the sun, if we can do that, we can definitely shuffle content back and forth all over the world easily. Nope.
Turns out, sometimes we can build a CDN easily, some others it requires more strategy, but in the end we will be successful, don’t worry about it.
Now, let’s dive onto the technical details.
First of all, my experience is quite vertical and I can share tips/best practices for anything concerning CDNs and caching software, but you should use other sources as well to have a complete overview of both software and hardware.
What do you need to build a CDN?
- Content: that’s on your plate. It can be static, dynamic, live streaming, VoD, OTT. It’s really up to you to come up with the best strategy with your web developers, packagers.
- You need an ISP, again pick the one that fits your needs best.
- You need PoPs, Point of Presence, possible as close as possible to your audience. And that’s where I can help.
A PoP, if you think about it, is nothing else, but a caching node. You want to be close to your end users to reduce latency and you also want to have cache in place to avoid paying content generation costs and overwhelming your network.
A caching node or a PoP consists of software running on a server, the server could be either bare metal or a cloud instance(AWS has more than 30 different machines types available, if you need any help picking the right one reach out because I’ve spent quite some going through the specs of each of them).
Now, let’s assume you have everything you need and you “only” need to assemble the pieces. It won’t make any difference it you try to build a CDN in Norway, in Italy or in Nevada, right?
I mean theoretically it works in the same way for each of the three countries, but then it happens that:
- in Norway temperature might get below -30 degrees(-22 Fahrenheit) and your cables freeze == no signal.
- In Italy you don’t even have fiber cables because every time we try to dig holes in the ground the extend our infrastructure we discover some sort of Roman building and we can’t move forward with the work == no proper infrastructure
- In Nevada I don’t even know if it makes sense to have cables in the desert.(we won’t cover this use case)
Hardware has limitations, software hasn’t and can help you achieving high performances even in harsh conditions.
A CDN in Norway:
Audience is located most likely in Oslo and surroundings, fiber cables reach pretty much every corner of the country, hence setting up a CDN is going to be straightforward and fully optimised:
There will be one(or more) origin server in a data center in Oslo, in the same data center there will also be a caching layer shielding the origin server because content is the most important thing for your business. Slow content is fine, no content means no users.
Other than that we will have one or two PoPs and each of the PoP will have at least two caching servers running in high availability to reduce the strain on the backends and have content replication among the caches.
That’s it. It will work.
How do I know? I’ve lived there and I’ve worked on such projects.
A CDN in Italy:
Audience is more distributed and even more numerous, fiber cables don’t exist everywhere and network availability is really not the best.
There will be one(or more) origin server in a data center in either Milan or Turin where it’s suggested to apply a caching layer which act as shield to avoid killing the web server(s) when spikes happen(we are more than 60million people in Italy, in Norway there are about 5million people, to give you some proportions). Now, we want to have other PoPs in various Italian regions and here the best approach would be to create a hybrid Content Delivery Network where you rely both on commercial CDNs provider and your own infrastructure(where possible). You own your architecture and this gives you huge content control, optimisation and user personalisation skills, do not underestimate this. Combining private and commercial CDN you can reach every corner of the Italian market.
Why this? I’m currently living in Italy and I had the chance to investigate the possible way to tackle such challenges.
If you have any questions just shoot them and I’ll follow-up.