~learn.
0:00 / 1:22
Side quest 7 · Spotify

30 songs on a flight: how Spotify pays for each play exactly once

transcript

Every Spotify play is money for an artist. Count one twice, and someone gets paid twice.

You're on a flight. Offline. You play 30 songs. Six hours later you land. All 30 events upload together. Delivery is at least once. Some arrive twice.

Just count arrivals? Every retry counts again. Your flight plays land in the hour they arrived. Not when they played. And bots on loop get paid.

Even a clever key fails. User, track and upload time? A retry has a new upload time. The duplicate slips straight through.

The fix: a play ID. Made on the phone when the music starts. Every copy carries it. The counter keeps one per ID. Count by event time. When the music actually played. Then a minimum listen, say 30 seconds. And a fraud check for bots. What's left is counted once. In the period it was played.

Skipped before 30 seconds? Not paid. But not wasted. It's a taste signal of minus 0 point 5. So recommendations learn what you don't like.

At-least-once delivery. Exactly-once counting. Exactly once is a key, not a transport.

Full breakdown in the lecture.