how to build a cdn
13 Apr 2015

How to Build a CDN

Before answering on a question “How?”, it’s necessary to answer on a question “Why?” it is profitable to build a CDN. There are plenty of already existing CDN’s which are ready to use; why building a CDN still make sense? First of all, in own CDN building it is possible to make an optimal geographical spread of CDN servers. CDN technology is largely based on geographically close location to users, that’s why it is important to have a possibility to locate CDN servers optimally close to concrete customers. Already working CDNs servers can be located far from some of target countries and there will be no possibility to affect this. Second advantage of own CDN is a flexibility of setting (cashing for example), which undoubtedly will be more flexible for concrete business than existing CDNs. Finally, building of own CDN structure means investments in own infrastructure, while to use out-source CDN means to invest in other businesses.

Considering all the above, it is important to find out in what geographical regions, countries it is advisable to locate CDN servers. To make a Content Delivery Network (CDN) works, proxy-server and anycast needed. Proxy server is a service in computer networks, which allows customers to make indirect requests to another networks. Anycast is a network addressing methodology in which data from the server are routing to the closest topologically node in a group. There are services that provide the ability to create a CDN on three or more continents. Building a CDN requiring several steps, depending on the service that is used. For example Scalescale asks for such steps: to order a DNS instance, to install Docker and run with “coocood/geodns” image on the DNS instance, to order the CDN “edge” instances, to setup a test domain for the CDN, to verify that CDN is working using need website (in this example – JustPing.com). While using CloudFront there will be a different mechanism, but it is usually explained in detail on a service’s page. Some of more known CDN companies are Cloudflare, Fastly, Amazon, CloudFront, MaxCDN, Akamai and Cachefly; but there are many other CDN companies that can help to build CDN.

If a company wants to have their own CDN servers, a process will be much more difficult and the company will need to make significant investments to a hardware. To build own CDN server the company needs a server, an AS (Autonomous system) and a free ip-routenum, in which CDN will be located. Server should be with multiple physical cores to spread the load of a network card on each core balanced (that is why network card should have a function of spreading load on different cores). A sufficient amount of RAM for the cache needed too; otherwise, cache will use remote drives. All hardware should be set properly to optimize the final efficiency. The average number of CDN servers for most of CND companies is 70 – 150. Every server will require investments in hardware as well as in maintenance in different countries – this can be really heavy expenses. However, for CDN suppliers it is an integral part of the business.