Monday, November 26, 2007

Anatomical breakdown of how the iTunes Wi-Fi Music Store backend works at Starbucks

The iTunes Wi-Fi Music Store has been getting some notable press lately. Around here at Silver Lining we recently rolled out a release to our software for iPhone compatibility, and then a few of us started talking about how the wi-fi music store might operate. Having spent my fair share of time in inernet music startups, I took a crack at breaking down how the backend of the wi-fi music store works for my coworkers. They insisted that I write my thoughts to the general public for consumption, so here goes.

I searched the web for clues, and came up with a few, but didn't actually find a technical description of the backend blessed by Apple or an Apple engineer blogging under a pseudonym. However, this statement by Starbucks Chairman Howard Schultz was quite helpful - "Schultz said the Apple partnership required a substantial infrastructure upgrade for Starbucks.". Before I go into what I think exactly this infrastructure upgrade was, let's review how the store operates.

When an iPod touch is in range of a Starbucks T-Mobile hotspot, a fifth button appears on the iPod touch display. So that requires the wireless driver to continuously poll for Starbucks' SSID, or possibly trigger a callback on detection of a new SSID which matches certain criteria. Easy enough.

The clutch feature of the store client is that you can press a button and buy the song which is currently playing in the Starbucks. Great for impulse buying. But how does it work? There are several possible explanations, but what really seemed to be the hard part would be purchasing a song right when it stops playing, or shortly after. Those are the real impulse purchases. How do you synchronize the user clicking 'buy this track', with what is currently playing?

My answer is that you have a fixed playlist running on an iMac at the Starbucks location (the substantial upgrade that Schultz mentioned). The iMac downloads the playlist from the big iTunes store using a probably slightly modified iTunes client, and runs through each playlist, downloading new playlists as needed. "The Starbucks button allows you find out what is currently playing in the store plus the 10 previous tunes and purchase said music right on the spot.". So when you click 'Buy currently playing track', the music store client on the iPod notes the time, queries the iTunes store, and retrieves the list of 10 last played songs from that time. Pretty simple, and the key is that you can do it with a server side upgrade to the iTunes store and not much else (except for the iPod wi-fi store client and the iMac in Starbucks). Although I could see how in Starbucks' eyes that putting an iMac in a Starbucks would be a 'substantial infrastructure upgrade'.

I've told this to a few people, and some of them thought that the music was streaming through the internet to the Starbucks. Having spent many hours dealing with the nits of streaming audio over the internet, I can say that's probably not the case. It's just so much easier to use playlists and download the music in advance, you avoid all the technical problems associated with streaming.

I'm sure that we will see this functionality coming to iPhones and notebooks soon enough with a software upgrade. It would be interesting to take a look at the traffic flowing back and forth between the iPod touch and Apple's servers. That's on my todo list, but I've never really liked Starbucks coffee, so it might be a while.


About the Author
Founder - Silver Lining Networks http://www.silverliningnetworks.com

No comments: