How Spotify Aligned CDN Services for a Lightning Fast Streaming Experience

Spotify Engineering
7 min readintermediate
--
View Original

Overview

Spotify has streamlined its content delivery network (CDN) services using Fastly's edge cloud platform to enhance the streaming experience for over 230 million users. This article discusses the challenges faced with multiple CDN solutions and the steps taken to standardize and automate CDN operations across various engineering squads.

What You'll Learn

1

How to standardize CDN services across multiple engineering teams

2

Why using Fastly's APIs and VCL can enhance CDN performance

3

How to implement a self-service tool for CDN requests

Prerequisites & Requirements

  • Understanding of CDN concepts and edge computing
  • Familiarity with Fastly's APIs and Varnish Configuration Language (VCL)(optional)

Key Questions Answered

What challenges did Spotify face with its CDN strategy?
Spotify faced challenges with technology fragmentation due to multiple CDN solutions leading to inefficiencies. The lack of oversight resulted in developers using various content delivery methods, which complicated the architecture and hindered performance for non-audio content.
How did Spotify convince squads to migrate to Fastly?
The CDN squad communicated the benefits of faster performance, improved access to metrics, and 24/7 monitoring of the CDN request path to persuade squads already using different CDN domains to migrate to Fastly.
What is SquadCDN and how does it work?
SquadCDN is an internal pre-deployment review service that allows any Spotify squad to request CDN configuration by submitting a YAML string with details like domain and origin. This tool streamlines the review process for CDN requests using Fastly's APIs and VCL.
What lessons did Spotify learn during the CDN alignment process?
Spotify learned several key lessons, including the importance of dogfooding critical services first, maintaining security by keeping sensitive data hidden, and the necessity of verifying configurations to prevent issues during deployment.

Key Statistics & Figures

Monthly active users
230 million
Spotify serves this number of users globally, highlighting the scale of their content delivery needs.
Tracks available
50 million
This extensive library requires efficient content delivery mechanisms to ensure a seamless user experience.
Squads using new CDN configuration system
60+
This represents more than 20% of Spotify's R&D organization, indicating successful adoption of the new system.
Services pushing content through Fastly
80+
These services benefit from improved efficiency due to the new templatized tools and workflows.

Technologies & Tools

Some links below are affiliate links. We may earn a commission if you make a purchase.

CDN
Fastly
Used to deliver audio streaming and other types of content efficiently.
Edge Computing
Varnish Configuration Language (vcl)
Utilized for intelligent caching and customizing CDN functionality.

Key Actionable Insights

1
Implement a standardized CDN workflow to reduce complexity across teams.
By creating a unified approach to CDN services, organizations can streamline operations and reduce inefficiencies that arise from disparate systems.
2
Utilize Fastly's APIs for automation in CDN management.
Automating CDN operations allows teams to focus on value-added projects rather than routine maintenance, improving overall productivity.
3
Encourage squads to adopt self-service tools for CDN requests.
Self-service tools like SquadCDN empower teams to manage their CDN configurations independently, fostering autonomy while ensuring compliance with organizational standards.

Common Pitfalls

1
Allowing squads to create CDN endpoints without proper oversight can lead to security vulnerabilities.
This can happen if developers are not trained on security best practices, potentially exposing sensitive data or allowing unauthorized access.
2
Failing to verify configurations before deployment can result in service outages.
Without thorough verification, issues such as incorrect permissions or misconfigurations can disrupt content delivery, impacting user experience.

Related Concepts

Content Delivery Networks (cdn)
Edge Computing
API Management
Automation In Software Development