Multi-CDN considerations
As you develop and scale your architecture for media streaming, a multi-CDN approach might seem appealing. The driver for this is often a desire for more aggregate capacity, wider coverage in different geographies, or improving resilience and performance. Before deciding, it is important to consider some of the disadvantages of a multi-CDN approach:
-
Increased load on the origin – Because each CDN has to populate their caches independently, each one would make the request to your origin for original object. This multiplies incoming traffic by the number of CDNs. To alleviate this, you might consider using AWS Origin Shield, which creates a common caching layer for all the CDNs, located in front of your origin.
-
Increased operational effort and lack of feature parity – Different CDN vendors can offer different feature sets, forcing you towards a lowest common denominator approach. In addition, functionality (such as tokenization), might be implemented differently, so you would still have to align your configuration and application logic, depending which CDN you send your viewers to.
-
Additional components in the architecture – Using multiple CDNs usually increases the number of components in the overall architecture, like additional caching layers, switching service, performance data collection and scoring. This creates more complex architecture and complicates troubleshooting.
If you do decide that a multi-CDN architecture is right for you, a metric-based traffic allocation process can help you make data-driven decisions in the proof-of-concept and operational phases.
To make a data-driven decision, you will need to define and collect a set of metrics. Preferably, you would synthesize data points coming from your application, producing first-hand comparison of the performance and availability metrics between the CDNs. Alternatively, you can rely on the metrics sourced by third-party user experience and monitoring platforms.
After the metrics for each CDN platform have been collected, the next step is to derive a score figure that will determine the split of traffic across the CDNs. The overall score is built from aggregated metrics and you should be able to apply different weighting for each metric in calculating overall score, depending on which aspects of the playback you consider to be the most important one for your use case.
Traffic allocation in multi-CDN environments
With all the metrics and scoring numbers at hand, you will be able to decide how to allocate the traffic between your chosen CDN platforms. Depending on the level of granularity of collected metrics, you can make the allocation decision on different levels in terms of users' presence (country, metro, and ISP level), as well as device type (desktop computer, mobile, tablet, and smart TV). You should continue to monitor against metrics in operation and define thresholds for changes in allocation, maximum value of traffic share per each CDN, and conditions for full failover from one CDN when performance metrics drop below predefined threshold.
In operation, your viewers' requests must be routed between the CDNs in accordance to
allocation decision. When each CDN vendor provides you with a dedicated DNS host name, you can
control traffic allocation between them by returning the right CNAME
in response
to DNS queries for your original domain name. However, the precision of determining viewer's
location and source network might be limited in this approach. Rather than relying on DNS
another possibility is to set up an API endpoint, which will return URL pointing to specific
CDN when viewer requests the playback URL.
In general, the greater the precision, control, and automation you need in managing traffic across multiple CDNs, the more effort is required to develop each of the elements. For a simple solution, such as allocating traffic on a country level, you can think of a simple load balancing solution, where it is acceptable to have limited accuracy in terms of split share, and allocation changes can be done manually. Such a solution could take advantage of community-based measurements of generic test objects for CDN's performance overview, used for deciding on the split per each location in which you operate.
For more information about multiple CDNs, see
Using
multiple content delivery networks for video streaming