Spotify System Design: Small Files, Huge Scale

Spotify reported 788 million monthly active users and 306 million paying subscribers in Q3 2026. Every one of them expects a song to start the instant they tap it, skip without delay, and keep playing offline on a plane.

Music is different from video: files are small (a few MB per song), but people play many of them, skip often, and expect zero waiting. That shapes Spotify's architecture.


🎯 Quick Answer (30-Second Read)

  • Audio files are encoded at several quality levels and served through CDNs.
  • Instant playback comes from aggressive caching on the device, prefetching the next track, and fast first bytes from the CDN.
  • Metadata (songs, artists, playlists) lives in backend services and databases separate from audio.
  • Recommendations like Discover Weekly combine listening history, playlist co-occurrence and audio analysis.
  • Infrastructure: Spotify moved from its own data centres to Google Cloud (announced 2016) and open-sourced Backstage, its developer portal.

High-Level Architecture

flowchart TB APP["📱 Spotify app
local cache + offline downloads"] --> GW["API gateway"] GW --> MS["Microservices
search, playlists, library,
user, social"] MS --> DB[("Metadata stores
tracks, artists, playlists")] GW --> PLAY["Playback service
licensing, rights, which file"] PLAY -->|"signed URL"| APP APP -->|"audio bytes"| CDN["CDN edge"] CDN --> ST[("Audio storage
multiple bitrates")] APP -->|"listening events"| EV[["Event pipeline"]] EV --> REC["Recommendation &
personalisation"] EV --> ROY["Royalty reporting"] REC --> MS
Component Job
Playback service Checks rights for your country and plan, picks the right file and quality
CDN Delivers audio bytes from servers near you
Microservices Search, playlists, library, profiles
Event pipeline Every play, skip and save becomes data
Royalty reporting Counts streams to pay rights holders

Making Playback Feel Instant

sequenceDiagram participant U as You participant A as App participant P as Playback service participant C as CDN U->>A: Tap song alt In local cache / downloaded A-->>U: Plays immediately else Not cached A->>P: Request track P-->>A: Signed URL + format A->>C: Fetch first chunk C-->>A: First seconds of audio A-->>U: Starts playing A->>C: Fetch rest in background end A->>C: Prefetch next track in queue

Tricks that make it fast:

  • Local cache: songs you play often are kept on your device.
  • Prefetching: the next song in your queue starts downloading before the current one ends.
  • Start fast, then upgrade: fetch the first chunk quickly so playback begins, then load the rest.
  • Several bitrates: lower quality on weak networks, higher on Wi-Fi and Premium.

History note: Spotify's early desktop app used peer-to-peer sharing between users to reduce server load. As CDNs got cheaper and mobile took over, Spotify phased P2P out around 2014.


Recommendations: Discover Weekly

Collaborative filtering
Songs that appear together in many people's playlists are probably related.
Language models on text
Reviews, blogs and descriptions reveal how people talk about artists.
Audio analysis
Models analyse the sound itself, helping new songs with few listeners get recommended.

These signals combine with your history (plays, skips, saves) to build personal playlists like Discover Weekly, refreshed every Monday.

Key takeaway: human-made playlists are Spotify's secret training data. Billions of playlists tell the system which songs "go together," far better than genre labels.

Infrastructure and Teams

  • Google Cloud: Spotify announced in 2016 that it was moving from its own data centres to Google Cloud, using services like BigQuery and Pub/Sub for its data pipelines.
  • Microservices and squads: Spotify became known for small autonomous teams ("squads") each owning services. Spotify itself has said the "Spotify model" was a snapshot of how it worked, not a framework to copy.
  • Backstage: with thousands of services, Spotify built an internal developer portal to catalogue them, then open-sourced it as Backstage in 2020. It's now a CNCF project used by many companies.

Interview Checklist

  • Separate metadata services from audio delivery
  • Multiple bitrates, CDN delivery, signed URLs
  • Client caching, prefetching and offline downloads (encrypted, licence-limited)
  • Rights and licensing checks per country
  • Event pipeline for recommendations and royalty counting
  • Search across tracks, artists, podcasts

Frequently Asked Questions

How does Spotify play songs so quickly?

Spotify caches frequently played songs on your device, prefetches the next track in your queue, and streams the first chunk of audio quickly from nearby CDN servers so playback starts while the rest downloads. Downloaded songs play directly from local storage.

How does Spotify Discover Weekly work?

It combines collaborative filtering based on which songs appear together in users' playlists and listening histories, text analysis of how songs and artists are described online, and audio analysis of the tracks themselves, personalised with your own listening behaviour.

Does Spotify use AWS or Google Cloud?

Spotify announced in 2016 that it was migrating its infrastructure from its own data centres to Google Cloud Platform, and it has publicly described using Google Cloud services for data processing and analytics.


Conclusion

Spotify's design separates small, rights-checked audio files served via CDN from a large set of metadata microservices. Caching, prefetching and multi-bitrate audio make playback feel instant, while a huge event pipeline turns every play and skip into recommendations and royalty payments.


Sources

Last verified: 2 November 2026.


Related reads: How Spotify Negotiated Music Licenses · YouTube System Design · How the YouTube Algorithm Works · Microservices Architecture Explained

I write about system design and how real products are built. Follow on LinkedIn or X, or invite me to speak.