Four Lessons We Learned from Creating Spotify’s Desktop App

August 4, 2021 Published by Spotify Engineering

TL;DR Over the years, Spotify’s brand has expanded to encompass a number of products, from mobile apps to web players to car things. But sitting at the core is our flagship product, the one that started it all: the desktop app. In the first episode of our podcast series, “Spotify: A Product Story”, host and Chief R&D Officer Gustav Söderström walks through how the app (and Spotify in general) came to be — and the product lessons you should take away from that journey. So read on to learn how Spotify had to completely rethink peer-to-peer (P2P) networking to improve our user experience, and why everyone needs a bit of magic to stand out from their competitors. And, of course, please check out the podcast yourself to hear even more about how Spotify became, well, Spotify.

How do you steal from a pirate?

Let’s rewind to the mid-2000s. At this point, music piracy wasn’t a new phenomenon, but it was a newly popular one. No longer did you have to physically steal records, rip radio onto a cassette, or even burn a CD. With peer-to-peer technology, all it took was an internet connection and some software, and you could be moments away from nabbing a song for yourself, with almost no chance of getting punished for it. 

Sure, download speeds could be painfully slow, the programs were a bit janky, and that album you pirated might turn out to be low-quality, incomplete, or covertly smuggling a virus along with it. But, hey, it was pretty convenient and low risk, all things considered. It was also, most importantly, absolutely free. What could compete?

In the very first episode of the podcast, Spotify co-founder and CEO Daniel Ek remembers considering what it would take to beat piracy at its own game when first conceiving of the company:

Daniel: I guess if you could take the concept of downloading all the world’s music, like you have on Napster and Kazaa, for a free price or a very low price, and you married it with the user experience of iTunes, so that it would feel like you had all the world’s music on your hard drive — that would be a much better experience than piracy. And then I think everyone would turn to that.

In other words, when it comes to guiding your product strategy, our first lesson is an important rule to live by: convenience trumps everything. The appeal of music piracy for most people, after all, wasn’t to deliberately sabotage the record industry or cut off a revenue stream for artists — it’s that it was free and relatively convenient. After realizing that, Spotify’s mission was set: if we could provide those same things with an even better user experience while still generating revenue, then, and only then, did we have a shot at success.

Go big or go home

But how exactly could we make a user experience that good? How could we actually beat pirates at their own game? One obvious improvement was speed; waiting hours over a slow connection to download an album was a massive pain, no matter how free it was. But when we looked at the tech and tools out there, it wasn’t immediately clear how to make anything better.

Luckily, Spotify co-founder Martin Lorentzon ran into someone who knew how. Enter Ludde Strigeus, the creator of µTorrent, one of the world’s most popular BitTorrent clients and, ironically, one of the largest drivers of music piracy. If there were one person who could promise to push the limits of what client-server technology and P2P networking could do, it was him.

Little surprise, then, that Ludde was fielding offers from Silicon Valley left and right. Even so, he wasn’t in any rush to accept any of them. As he puts it in the podcast, “When I find a project that interests me enough, I can’t really stop working on it. So the problem is to actually find these projects.” 

Bad news for other companies, but great news for us. You see, it’s always good to keep in mind our second lesson: great ambition attracts great talent. This is why companies always need to keep moving the goalposts. When Daniel and Martin first approached Ludde to give him the hard sell on Spotify, a company whose goal, again, seemed impossible to achieve at the time, Ludde signed right up.

The rules are only suggestions

And it wasn’t long before he identified Spotify’s problem — and the solution.

Ludde: Doing it in the browser wasn’t even an alternative. There wasn’t any competitive way to do it in the browser at that time. The browsers weren’t mature enough.

Essentially, if Spotify ran in a browser, it would only be able to run as fast as the rest of the browser-based internet, which included our competition. That meant that it would never provide a better experience than piracy if we went that route. 

Fortunately, Ludde already knew our third product lesson: don’t be afraid to break the rules. The problem was bigger than just a matter of finding the right tech; for Spotify to be what we wanted, we would need to custom-build everything in our entire infrastructure from the ground up. In short, we would need to go full stack.

Not to go into too much detail here, but at the time, most of the internet was made up of “thin clients,” like web pages or Flash-based clients that ran in-browser, and used more traditional, standardized protocols like HTTPS. Seeing the limitations of that, Ludde and a team of engineers ran in the exact opposite direction, creating a stand-alone “fat client,” building entirely new protocols and hybridizing client-server and P2P technology to suit their own ends. (Check out Episode 01, “How do you steal from a pirate?”, to hear more of that nitty-gritty stuff about persistent TCP connections and how our P2P implementation saved us bandwidth cost.) It was only by rethinking every layer of our infrastructure that we were able to pull Spotify off, to create that magic moment of double-clicking on a new song and having it instantly play. And speaking of magic …

Do you want to see a magic trick?

All of that ambition would have meant nothing if we couldn’t secure the licensing deals we needed to actually play music on our app. We knew our tech was cool and groundbreaking, but would anyone else? The music industry was being ravaged by the same peer-to-peer technology that Spotify was using in the desktop app. Why would they want to strike a deal with someone who seemed like the enemy?

When Michelle Kadir joined Universal Sweden in 2008 to vet new technologies that could potentially help the ailing music industry, she originally saw Spotify as just another start-up setting up a meeting, vying for her attention. That was, until she saw the product in action.

Michelle: The thing that happened that was kind of pure magic in that meeting was that [Daniel] did a comparison. He started playing a song on the software, and the song played so quick, so instant … I mean, I don’t know if people remember, but playback was slow back then. Even if you had an MP3 on your computer, and you played it via, you know, Winamp, iTunes, this was faster. And we were like, “You have the files on your computer, right?” And he was like, “No, it’s in the cloud.”

That’s our fourth and final lesson: differentiating yourself from your competitors is one thing. But if you can pull off something that no one thought was possible — a magic trick — now that’s captivating. Captivating enough to potentially change the minds of not only users, but an entire industry that’s stuck in a rut.

So, sure, that’s four lessons, but why stop there? The podcast series “Spotify: A Product Story” shares all these stories and dozens more, filled with insider insight and product strategy lessons from the employees, collaborators, and musicians who made Spotify what it is today. Join host and Chief R&D Officer Gustav Söderström and check out all the episodes right here.


Tags: