Fastly reduced 30% of CDN delivery cost for api.video
Video connects companies with customers in powerful ways. Yet hosting and its delivery has always been a hassle… until api.video service arrived. With an easy end-to-end service that covers encoding, delivery and storage, adding video to a website, app, CMS, or software is smooth sailing, everyone from eLearning providers to C-marketplaces and social networks gets on board.
Flushed with success after securing Series A funding in summer 2022, api.video firmly focused on extending its reach in key markets in Europe, the US, and beyond. But one big challenge to worldwide leadership in its vertical emerged: scaling performant video delivery via its CDN.
An ambitious firm determined to follow its own path, api.video architecture follows an on-premises deployment model, preferring not to rely on any major cloud providers. This allows for the flexibility to run its own infrastructure and a greater latitude to manage costs.
Niche CDN provider CDNetworks was being used in its two data centers – in Canada and Europe. However, it became apparent that this provider would require a more performant solution.
At a key moment in api.video’s growth strategy, several significant challenges existed:
- Cache performance was poor under a full load. Especially for live streaming of events to a larger audience. This was a massive issue which could prevent them from scaling. Product access had to be restricted until it could be resolved.
- They were also unable to leverage the CDN for a complex private feature as it requires some programming logic to be implemented on the CDN itself.
- The previous CDN provider only made logs accessible once per day – at midnight China standard time. Considering that the api.video team was based in Europe, they couldn’t access a full day’s logs until a day later – making any quick mitigation of any abuse impossible.
- Opaque routing within its old CDN was suboptimal and offered no control. This built-in shielding algorithm was routing the majority of traffic to Europe, while the origin datacenter was in Canada. The issue was never resolved, and the Canada datacenter was eventually decommissioned, leaving only one data center.
But that’s not all: aside from overcoming these issues, api.video wanted to leverage future features that the previous CDN provider would not allow by lacking the feature or mandated policies. This wish-list included:
- Supporting custom domains
- Domain referrer restrictions
- The ability to control request log data
- Support for the Cloud Data Management Capabilities (CDMC) framework and built-in optimizations for video use cases.
It also extended to Kafka integration for request log push, HTTP2 support (and HTTP3 for the future), custom peering and strong worldwide presence.
With a clear dos and don’ts list and criteria drafted, api.video set out to find a CDN with the technical capacity and global clout essential to drive its growth strategy.
After carving out crucial criteria, api.video reached out to a set of six potential vendors in August 2022 – starting a robust benchmarking process that covered features, cost, and performance.
Feature benchmarking (led by whose product team?) lasted until the end of September, with three providers shortlisted: Fastly CDN, Cloudflare, and Akamai.
Along with considering the specified features, api.video also analyzed each vendor products’ ease-of-use and ability to engage with support teams.
- Native integration with Kafka. A key decision point since api.video was building a new Kafka-based analytics pipeline.
- Easily managed and efficient caching invalidation. As data is replicated across the world, there must be a way to ‘delete’ data on the CDN. This is vital for custom domains and has been impossible with CDNetworks.
- Support for custom domain features. With Fastly CDN, api.video can change the URL a video is served through – from a white label to the customer’s domain. This highly requested feature is configurable from Fastly.
- Access to real-time data. Real-time logs and metrics provide the timely insights needed to investigate anomalies, continually improve performance and iterate any new releases faster.
After the performance round, api.video tech teams joined the conversation on cost and pricing, engaging vendors until the end of October. In December and January 2023, infrastructure and video engineering teams conducted technical tests with Fastly. Then later in January, they switched to production.
Results – Fastly takes first
With benchmarking concluded, Fastly was the clear winner in all key criteria. Next came migration from CDNetworks to Fastly CDN. And since the delivery of every video and livestream would be impacted, with all calls passing through the CDN, every customer would be affected.
Data generated by the CDN shows how many people watch each video and this generates the usage component of invoices. So it was essential no customer viewership was lost in the migration process.
Thanks to careful preparation, there was no customer service interruption, no drop of VOD (video on demand) or live stream and no spike in errors. And usage collection proceeded with no issues during the transition.
With Fastly in place, the full extent of the transformation fed into results:
- Fastly outperforms previous CDN in the popular live-stream use case.
- Improved time to first byte (TTFB) in regions underserved by previous CDN. This means greatly reduced time to retrieve video data in South America, Africa, and Asia.
- Configuration of private video features now possible, as well as configuration of shielding features in the context of a worldwide origin infrastructure.
Poised for global success
The switch to Fastly leveraged two main advantages for api.video:
- Reactivation of Live 1.0. When the previous CDN made their livestream product unreliable, api.video stopped advertising it. With Fastly, a revitalized Live 1.0 is launchable – while api.video works on developing Live 2.0.
- New invalidation system. Leveraging Fastly CDN features, api.video is working on a new, efficient, easily manageable invalidation system. Again, this will increase product reliability.
Now, api.video has the peace of mind it needs to proceed with its strategic growth plan. With peak performance and reliability, api.video can grow its European base and penetrate the US and Americas, as well as other key global markets.
At a pivotal crossroads, api.video switched from a stumbling CDN to a highly performance one – ensuring to maintain their position as the leader in video infrastructure service used by 30,000 developers and cementing their value prop: integrate videos in minutes.