1.4 Billion Stories: The Tech Behind Spotify Wrapped
This is not a debate about whether Spotify, Apple Music or YouTube Music is better. I tried Apple Music but my playlists were already in Spotify from my Android days, and I did not want to lose years of carefully collected songs.
What I do want to talk about is Wrapped, because it is around the corner, and because the 2025 edition was stylish enough to make me stop scrolling and ask a very nerdy question: what is actually happening behind the scenes?
It starts with listening events
Every time you play, skip or finish a track, that action becomes an event. Spotify has not published exactly how its raw event storage is laid out, so I will not pretend to know the details. What is public is that the company runs its data processing on Google Cloud, and that Wrapped is a batch job at heart: a full year of events gets crunched into per user summaries. Press coverage generally describes the window as running from early January to the end of October, which explains why Wrapped lands in the first days of December rather than on 31 December.
The Dataflow years
Back in 2015, Spotify built and open sourced a Scala API for Apache Beam and Google Cloud Dataflow called Scio. They chose Dataflow over Dataproc because it scaled with less operational overhead. Wrapped then became the stress test. The 2018 campaign ran one of the largest Dataflow jobs ever on Google Cloud, and the data team hit limits on how much data they could shuffle.
By Decade Wrapped in 2020, the User Wrapped data engineering team (they called themselves the Time-Turners) processed roughly five times the data of 2018 at a fraction of the cost. A later team member described the workflow as taking a Wrapped concept written in SQL and translating it into a Scala pipeline that produces the giant datasets powering the backend.
Then came the AI layer
2025 added something new: Wrapped Archive. For each eligible user, Spotify picked up to five remarkable days from their listening history, then generated a short story about each one.
Finding the days. A priority ordered set of heuristics did the picking. Some are simple, like Biggest Music Listening Day (most minutes) or Biggest Discovery Day (most first time artists). Others are cleverer, like Most Nostalgic Day or Most Unusual Listening Day, which measures how far you strayed from your normal taste. A distributed pipeline computed the candidates, and the results were stored in object storage. Each user's data was then published to a message queue so the next stage could consume it asynchronously.
Writing the stories. The numbers are wild. About 350 million eligible users, up to five reports each, roughly 1.4 billion reports, all generated ahead of launch day. The engine ran for four days straight.
Running a top frontier model a billion times was not economical, so the team used distillation. A large model produced high quality reference outputs, which were curated into a reviewed gold dataset. A smaller, faster model was then fine tuned on it, and Direct Preference Optimization with human A/B evaluations pushed quality further.
A few details I liked:
- The prompt included a summarised stats block because, in their words, LLMs are bad at math.
- Previously generated reports were passed in to avoid repetition.
- The user's country was included so spelling and vocabulary matched.
- Reports were generated one at a time per user, so earlier ones could inform later ones.
Where the reports are stored
This is my favourite part. Spotify used a distributed, column oriented key value database built for high throughput writes. Their post does not name the product, though the design is the classic wide column store style. Each user is one row, keyed by user ID.
Up to five reports for the same user could be written at nearly the same moment, which sets up a classic race condition if you track completed days as one list. Their fix was data modeling rather than locking. Each remarkable day got its own column qualifier in a dedicated column family, using the date as YYYYMMDD, so 15 March becomes 20250315. Concurrent writes touch different cells in the same row, with no locks and no read modify write cycles.
Write order mattered too. The report content is written first, then a small metadata entry marks the day as complete. A user can never see a reference to a report that was not fully written.
Surviving launch day
Wrapped does not ramp up. It spikes. Auto scaling reacts to load it has already seen, which is too slow, so the team scaled compute pods and database nodes hours before launch. They also ran synthetic load tests across every region, timed after pre scaling and before real traffic, to warm connection pools, caches and database block caches. When real users arrived, nothing was cold. This is a recurring theme in their engineering posts, which also describe load testing for the 2022 campaign, when Wrapped served more than 150 million engaged users across 111 markets.
Checking a billion stories
Even a 0.1% failure rate on 1.4 billion reports means millions of broken stories, and humans cannot review that. So the team used an LLM as a judge, grading a random sample of about 165,000 reports on accuracy, safety, tone and formatting. They used several small rule based queries per report instead of one giant prompt, and made the judge write its reasoning before giving a score, which made grading more consistent.
The evaluation caught a real bug. Some Biggest Discovery Day reports celebrated the wrong number of artists because of a timezone bug upstream in the data pipeline. The model wrote a lovely story about the wrong day. Because every report was logged with metadata, they traced it, fixed the pipeline, deleted the affected reports in bulk and regenerated them.
What I took from it
Spotify's own summary is that at this scale the LLM call is the easy part. The real work is capacity planning, replay and recovery, cost discipline and safety loops, all for one high stakes moment. Having cut a Bloomberg data pipeline from over eight minutes to under ninety seconds in my own work, I have a lot of respect for that. The pretty cards are just the tip of a very serious data engineering iceberg.
So when your Wrapped drops, enjoy the aesthetic, but remember there is a pipeline behind every slide.
And if you want your own numbers beyond Wrapped, Spotify lets you request your data from its privacy settings.
References and further reading
Primary sources from Spotify
- Inside the Archive: The Tech Behind Your 2025 Wrapped Highlights (Spotify Engineering, March 2026). The main source for Wrapped Archive: the remarkable day heuristics, distillation and fine tuning, the 1.4 billion reports, the storage schema, pre scaling and the LLM as a judge evaluation.
- Spotify Unwrapped: How we brought you a decade of data (Spotify Engineering, 2020). Covers the Decade Wrapped pipeline, the Time-Turners team and the jump in data volume since 2018.
- How Spotify Optimized the Largest Dataflow Job Ever for Wrapped 2020 (Spotify Engineering, 2021). A deeper look at the Dataflow side.
- Load Testing for 2022 Wrapped (Spotify Engineering, 2023). Source for the 150 million engaged users across 111 markets and the launch day load testing approach.
Press coverage and secondary sources
- Codecademy interview with a Wrapped 2021 data engineer. A first person account of translating SQL concepts into a Scala pipeline.
Happy Life.
原文:https://www.a8q9.cn/en/article/1-4-billion-stories-the-tech-behind-spotify-wrapped-ebd62c.html