Our Journey Choosing the Best CDN Partner

- February 16, 2017


This post details Filestack’s own notes and research from our hunt to find the best CDN to partner with to deliver billions of files for our end users around the world.  We presently deliver 186 TB of data with 1.7 billion requests monthly, so picking the right CDN was an important decision. Although we eventually chose Fastly after extensive research into features, performance, and price, we realize that “the best CDN” is specific to your use case. We are sharing our notes and research to help you find the best CDN for you.  

Filestack’s Need for a CDN Partnership

Filestack is an API for handling files (images, videos, documents and more) end-to-end. From file upload, to transformation, to delivery, Filestack powers your file backend, ensuring seamless file management.

 

Filestack originated as a tool for file uploads, with a file picker widget and JavaScript API that allow end-users to upload files from social networks and cloud drives such as Facebook, Dropbox, Instagram, Google Drive, and store the files directly in their S3 buckets or other cloud storage containers. It was soon apparent that our customers needed more than just the ability to upload files.

 

in addition to supporting API-based file transformations like crop, resize and compress, we wanted to enable fast, reliable downloads. So adding a CDN was the next step. Filestack now offers CDN to our users by default. Everytime a file is uploaded through our file picker widget or JavaScript API, we generate a CDN URL for our users to use to deliver the file immediately.

 

However, our CDN integration did not happen overnight. We conducted weeks of research to determine which CDN we should partner with. Our primary goals in establishing a CDN partnership were (1) Increasing download speeds for our end-users, (2) reducing load and cost on our infrastructure. At the time of our search in 2015, we were sending out 77 terabytes of data monthly, and paying about $7,000 for data transfer. As we grew, the number of files we were handling were increasing exponentially month over month, and in order to maintain high performance we needed to either provision additional API servers (which would only increase our costs) or partner with a CDN provider. We are now sharing our extensive research with you, in case with can assist with your own CDN search, and save time and effort on your end.

CDN Comparison

There are many CDNs to choose from that all vary in their features, performance, and pricing structures, making them difficult to compare side to side. For example, some CDNs have base pricing, while others charge by the gigabyte, while others do a combination and sell add-on features. Yikes. For a solid overview, check out this crowd sourced CDN comparison website, which does a good job comparing basic features by CDN.

 

However, choosing a CDN is not as cut and dry as looking at a single comparison chart. Because of add-on features and performance differences, to truly know the best requires more in depth research.

 

For example, on a general list, Cloudfront and Edgecast can check off all of the basic features. However, before we began our search for a CDN to partner with, we were already using Cloudfront and Edgecast for some of our own file delivery. We were using Edgecast to deliver our API assets (JavaScript libraries), and Cloudfront to deliver our website and Picker assets (images, styles and javascripts). We found that Edgecast was expensive and hard to manage, and Cloudfront was slow and lacked basic functionalities, such as full cache configuration (necessary for us to offer custom CNAME to users), full versioned configuration, and a detailed metrics dashboard. We were ready to move on.

 

We were able to pretty easily narrow it down down to a final two: MaxCDN and Fastly.

Fastly vs MaxCDN

Fastly vs MaxCDN: The Final Showdown

 

At this point, we were down to only two CDNs: MaxCDN and Fastly. This was in the fall of 2015, so although these are the features we compared then, both CDNs are continually building out new features, and we recommend confirming current numbers before relying on our data for the present. Below is our final comparison:

 

Fastly MaxCDN
Website Link Link
Number of POP servers 31 18
Max File Size 5 GB 10 MB
Key Purging yes no
API invalidation yes yes
Log Streaming to S3 yes yes
Support Email, IRC, Twitter Chat, Email, Phone
Dedicated SSL yes yes
SAN SSL yes no
Wildcard SSL yes yes
API yes yes
Edge Backend Varnish Nginx
Full edge customization yes (Custom VCL) no
Pseudo Streaming yes yes
Load Balancing yes no
Documentation Very Good Good
Real Time Analytics yes yes
Configuration Versioning yes no
Origin Shield yes yes
Customers Stripe, Vimeo, Twitter, Imgur, Github, imgIX, Shopify, Yammer Garmin, Nissan, Forbes

 

The above table is pretty comprehensive, but we were most interested in how Fastly and MaxCDN compared on the 10 features below:

1. POP Locations

There is a common misconception that more POPs are better. In the past, CDNs would build more servers around the world to be as close to as many end users as possible. This is a very expensive procedure, and actually not the most efficient way to delivery files fast and powerfully around the world. Fastly was the first CDN to focus on higher performing POPs as opposed to pure quantity.  All of their POPs are ultra high performing, so even though they have fewer POPs than Cloudfront and other CDNs, they are able to deliver content with blazing speed anywhere in the world.  

2. Max File Size

A large file limit is important to ensure fast delivery of large files.  If your image exceeds the maximum allowed, you are forced to serve it from the original server. This is likely to be slower, and more expensive for you in terms of bandwidth costs because instead of caching the file on the CDN servers, you have to re-serve it.  We found that Fastly had a much larger file size limit: 2GB without streaming and 5GB with streaming, versus MaxCDN which only offered 200MB in file size. We cannot anticipate the all file sizes our customers are going to be uploading, but we did notice a steady amount of growth in files over 100MB.  Going with a CDN provider that allowed a larger max file size was a crucial component for us.

3. Key Purging

Key Purging allows you to remove groups of cached files from the CDN. Our API allows customers to remove their files from Filestack. When that happens we have to make sure that file and ALL its conversions are removed. Therefore if conversions are cached by CDN we need to invalidate them all. We do not store metadata about conversions (as it would be too much data to keep) so we need to be able to invalidate them using single API call.  Fastly provides us with Surrogate Keys invalidation which allows us to do this, while MaxCDN does not have corresponding functionality.

4. SAN SSL

SAN stands for Subject Alternative Names, it helps protect multiple host names under a single SSL certificate and is commonly used for sites that have specific domains that don’t change frequently. A SAN offers the ability to add several domains and sub-domains to the SSL certificate on the fly and then reissued.

 

With SAN certificate, the CDN that is responsible for managing the domains. They include the wildcard domain in their SAN certificate and manage renewals, keys and PEM files. With Dedicated SSL certificate, you receive a dedicated IP address on all CDN POP servers.  Both Fastly and MaxCDN offers Dedicated SSL but only Fastly offers SAN certificates.

5. Full Edge Customization

In terms of customization abilities, Fastly is superior. Fastly uses Varnish in their backend, so anyone can create their own Varnish configuration and upload it to Fastly using their API with instant provisioning. Varnish is a widely adopted standard, which makes it easier to use because there is more information and resources around for it.  MaxCDN has customizations and capabilities, but they use Edge Rules, which has more API and UI constraints.

6. Load Balancing

Most CDNs will be able to handle high load , but not all will be able to offer the same performance levels. With Fastly you can setup Load Balancing to multiple origin servers on the CDN level, which could save you management time, load and infrastructure cost. MaxCDN does offer similar functionality.

7. Configuration Versioning

One of the most important things when selecting a partner is to ensure you are getting the performance you expect.  Fastly offers the ability to create custom configurations, test, add additional configs, and run multiple tests against each other to ensure we’re setting our customers up for success.  Very similar to A/B testing a marketing campaign, we were able to do this with Fastly and found a configuration that worked great for us.  Unfortunately, this type of functionality was not exposed in MaxCDN so it was much harder to test various configurations.  

8. Customer Case Studies

It is a generally a good sign if a CDN serves other companies in your industry. In our case, we saw that Fastly delivers content for companies in our market who also handle heavy volume of files, like Vimeo, Imgur, imgix, which lends some credibility to the fact that Fastly might be superior for our use case. MaxCDN servers companies like Garmin, Nissan, and Forbes, which although are credible brands have very different use cases than we would have.

9. Pricing

CDNs often have hidden fees, setup costs, contracts, and/or minimum commits. Some CDNs charge per GB of bandwidth, while others have negotiable flat rates. Almost all have extra fees for supplemental features, so it’s important to note which features you can’t live without in addition to bandwidth pricing. Filestack was able to negotiate bulk pricing with Fastly. Our low rates ensure that we are able to offer extremely competitive bandwidth pricing to our users. CDN is included without any additional charge into all of Filestack’s basic plans, and can be customized for our Filestack Pro plans.

10. Support

CDNs offer varying levels of support. Many offer phone and  24/7 support. You might also want a SLA to ensure that you will be compensated for any downtime. We found the Fastly Support team and engineers to be remarkably responsive to our needs and the needs of our customers. Together, we were able to work on a joint engineering effort that allowed us to deliver custom CNAME as a feature to our users. We were impressed by their dedication and attention.

 

And the winner is…. Fastly!

For Filestack, we found that Fastly satiated all of our needs, and was going to go above and beyond to allow us to go above and beyond with our customers. Our partnership with Fastly allows us to act as an image CDN our self. We can offer our users all of Fastly’s features (33 POPs, large file upload size, custom CNAME, fast download time, low cost structure, etc.), and combine this with our file uploading and transformation technology for an end to end file handling solution. If you have any questions related to CDN, feel free to reach out to support@filestack.com and we are happy to help.