Anyone know how spotify may have achieved this? My instinct is that they pre-download the next song in the queue + heavily cache everything. But in my experience, playing a new song in almost instantaneous too.
Anyone know how spotify may have achieved this? My instinct is that they pre-download the next song in the queue + heavily cache everything. But in my experience, playing a new song in almost instantaneous too.
With just an song id, with S3/Cloudfront and [db of choice] I don't think it would be hard to deliver a song in less than 200ms (to the continental US atleast).
[1] http://www.sqlskills.com/blogs/paul/are-io-latencies-killing... - Random article, I'm not sure where I picked it up from, but I've come to believe >100ms db latencies should be rare and when it happens, you messed up somewhere.
Anyone know how spotify may have achieved this?
There is no magic in this. 200ms is an eternity and would actually be considered rather poor performance.
Realistic latency is closer to 100ms for a cache miss (~40ms for your client to reach spotify plus another 40-60ms for their internal fetch).
You have to realize that music files are tiny and consume very little bandwidth by today's standards. All commercial music combined (roughly 30 million songs) fits into half a rack of storage.
They shut that down last year; https://torrentfreak.com/spotify-starts-shutting-down-its-ma...