Audio Streaming & Vector SearchPRODUCTION RETROSPECTIVE

Spotify: Sub-200ms Audio Latency & Annoy Vector Search

Instant audio playback and recommendation systems: chunked Vorbis/AAC audio streaming, Annoy approximate nearest neighbor vector search, and event-driven data infrastructure.

High-Level Architectural Overview

Spotify achieved its signature instantaneous playback (sub-200ms audio latency) by pre-fetching the first few seconds of tracks, prioritizing initial byte delivery over total bandwidth, and utilizing approximate nearest neighbor (ANN) vector search for hyper-personalized real-time recommendations.

Key Engineering Problems & Trade-Offs

Sub-200ms Audio Playback Architecture

100M+ tracks, 600M+ monthly active listeners worldwide
The Scaling Problem

Eliminating audible buffer delay when users tap play, creating the illusion of local music playback on mobile networks.

Engineering Solution

Chunked audio streaming with dual-phase delivery: the initial 5 seconds are requested with maximum priority without compression buffering; subsequent chunks stream smoothly in background.

Architectural Trade-Offs

High initial HTTP request count per track vs instantaneous audio start time.

How to Say This in an Interview

Highlight how prioritizing initial byte delivery (TTFB) creates perceived performance superiority over raw maximum download throughput.

Curriculum Topics Used in Spotify Architecture (4)
Full Syllabus
Primary Technical Sources & Published Papers
Annoy: Approximate Nearest Neighbors in C++/Python

Erik Bernhardsson, Spotify • 2018

Ready to Practice Spotify-Style Systems?

Start with foundational networking, compute, and storage, and build up to complex distributed consensus.

Start Free: Topic #1