Published on

How to create a multi-CDN infrastructure with regional/local CDN choice

We hope that most of our readers already have an answer to the question 'Why use a multiCDN', but let's get back to basics of the global traffic management briefly.

If you choose a proper combination of CDN providers, answering to your target audience needs (whether that are the regions where you have the most of your users, or the need to have a super low latency like with streaming or VOD), you will be able to achieve much higher ROI on your network infrastructure, than using only one content delivery network.

Multi CDN approach enables you to create flexible, scalable and reliable infrastructure, while drastically reducing the latency in any country around the world (PerfOps FlexBalancer is able to route the traffic to the best performing CDN for the given ASN for every single user).

We have already written an article where the reasons were described in detail, so let's review shortly:

Increasing website/application performance

You can achieve this by intelligently routing the traffic based on the best performing CDNs in real-time. On PerfOps platform, this is possible thanks to FlexBalancer and our comprehensive RUM analytics network, with >500 millions daily tests. This large number of measurements enables us with high accuracy to know which CDN is the fastest at any moment in time.

How to Decrease Your CDN Expenses

Over the past years, we are witnessing the growth of many 'regional' content delivery network providers (Azion, GoCache, G-Core, Dorabase, etc.) that have amazing performance in their own country or region, but much lower cost than CDN giants (Cloudfront, Google CDN, etc.). Including them in your infrastructure can optimize your performance vs. cost ratio. You can use performance / price threshold option on FlexBalancer and for example, route all your traffic to a cheaper CDN as long as it is not more than 20% slower than the more expensive one.

100% CDN Availability

Even the biggest CDN providers in the market have outages. Not always the major ones, but even those ones happen. More often, they are local and not affecting global internet community, but might take down 10s of thousands of your users from your website or online game. Being able to avoid downtime, by re-routing your users in real time to the available CDN (or adding a failover) will save your reputation and income.

China's Multi CDN Presence

Using 2 or more CDNs, including a local one in China (ChinaCache, CDNetworks, etc.) will enable you to further reduce the latency even in mainland China.

Improve SEO by Lowering Latency

Website speed is one of the main factors in Google algorithm for ranking your page high in Google search. Lowering your latency with multi CDN will help you to generate more visitors and leads through organic search.

Should every company use a Multi CDN?

In the majority of the situations, moving to a multi CDN will make miracles for your infrastructure performance, stability, and scalability. This is a trend started about a decade ago and now a days companies are migrating to this approach more than ever.

Based on a recent study done by Intricately, there is 27% year-over-year growth in the number of startup companies using a multiCDN approach. Additionally, it is used a lot by streaming / VOD providers, online gaming, retail, enabling companies to optimize globally distributed content delivery.

Hence, the question is not "Should I use a multi-CDN" but "How to set up my multi-CDN correctly". And in our case it is "How to set it up with PerfOps FlexBalancers".

Multi CDN Provider Alternatives

There are a few key players in addition to the Perfops MultiCDN solution. There are many variables to consider when choosing your MultiCDN provider. If you are looking for a MultiCDN provider who focuses on performance, speeds, geography, and uptime Constellix Multi CDN would be a solid alternative to consider. NS1 also offers a solution that has an emphasis on Multi CDN pricing commits.

How to Set Up Your Multi CDN Solution

Let's imagine that we are, for example, a SaaS company with worldwide users spread. We use multiple CDNs, have providers for different locations and need to build balancing, using the setup listed below:

This is just one example of how the combination of CDN could look like. Your could be completely different and it depends solely on your business, website/app and audience specifics. If you would like to consult our solutions team on the choice of CDN providers, we are always happy to assist (you can write us on team@perfops.net).

How to Implement a Load Balancer

In order to create the above-mentioned logic, we also want to build DNS load balancing based on the following rules:

  1. Visitors from North America/Europe/Asia should get answer from the CDN with the appropriate location (the list from above);
  2. The CDN provider with the best performance (lowest latency) should be selected for the particular location answer;
  3. For non-NA/EU/AS visitors (Globally, from all other continents) the answer could be 'default.myawesomepage.net' hosted at 'Google CDN' as one of the most stable ones;
  4. If the visitor's location or continent is not determined — use the ‘Fallback’ answer, for example, ‘backup.myawesomepage.net’.

A lot of rules there...should it be hard to set up such load balancing? Absolutely not if we use Smart UI type FlexBalancer. If you don't already have a PerfOps account, you can register one quickly.

So we log in, go to FlexBalancer page and create our new Balancer, call it 'smart', select 'Smart UI' type, set up our fallback (remember, it is 'backup.myawesomepage.net') and TTL. And now we need to add the answers.

The first will be 'default' - for the case if user is neither from NA nor from EU nor from AS. We choose 'Global', add default answer and create it:

Great, now let's add our location-based answers. First, for North America. We should add 'google.na.myawesomepage.net' as hostname with Google Cloud CDN as Cloud Platform, and 'cdnetworks.na.myawesomepage.net' (CDNetworks). We get two providers for North America and we must turn on the 'Use Performance data' Option:

And now the CDN (either CDNetworks or Google Cloud) that has better performance (based on our real-time performance data) will be used for our traffic routing.

What we need to now is to do the same for Europe and Asia - add two hostnames with corresponding CDN providers and enable 'Use Performance data' everywhere. Then - 'test and publish', Confirm the deploy, and... that's it!

How long did it take? Well... probably not more than 5-7 minutes.

That was the simplest example of multi-CDN infrastructure with local CDN choice building with PerfOps Smart UI Global Server Load Balancers.

Interested? Schedule a call with our team to provide you guidance on how to easily implement a multi-CDN in your infrastructure.

We are always glad to talk with you!