Beats&Sounds: never miss a show

I'm really proud to present you our1 new creation: Beats&Sounds

The idea

Beats&Sounds syncs with your Spotify account to give you a personalized list of concerts in your area (provided by SongKick). It doesn't matter how you prefer to use Spotify - whether you choose to follow particular artists or put together playlists with all your favorite tracks - we'll find the performers you love and make sure you know when they're touring near you.
In addition to tracking your artists, we'll also show you concerts for similar artists that you might not have discovered yet.
You might just find your next favorite band.

That's cool

Yes, absolutely, it is!

My contribution

The problem

When we started working at Beats&Sounds I immediately recognized a problem. SongKick in fact only allows you to get the list of all the events planned for a specific area; that's not a problem if you are interested in what's going on in King City, but was quite an heavy job for bigger cities like San Francisco. And when i say heavy job i really mean it: around 15 (fifteen) seconds to complete.

That was unacceptable, it was completely killing the user experience

The solution

The solution we came up with was (quite) simple but very efficient: creating a database acting like a cache, an intermediate storage level between the user and the SongKick API.

The implementation

I hardly wanted to use MySQL instead of MongoDB because our goal was performance, not easy implementation.

When i was finally able to convince all my pairs about the need of MySQL we started analyzing the structure of the SongKick's JSON response, and after that I designed the db schema.
Developing the db structure was a pretty long and tedious task, and we changed it's structure several time because we were not enough satisfied by it's behaviour and it's performance. But our hard job was payed: using our database-cache system allowed us to improve the responsiveness of our website by an amazing 95% !

The maintenance

Using API is (should) easy because you are simply asking for data to someone else and usually the the data sent back by the API is immediately sent to the user. It's like "send this data to the user". But what we did was completely different, our approach is "send this data to me, i will rearrange it and then send it to the user".
The whole point is that now we are acting as intermediary, so it's our duty deciding what data to request from SK, it's our duty deciding when we should do that and it's our duty sending to the user always the as newest as possible data.

Meet Stachanov

To handle all this work I created Stachanov, a worker run using a Cron task that it's constantly checking our database looking for old entries to delete, inconsistency to remove and new data to store.


I loved working on this project and I really hope i will find the time to keep working on it.
Some feature that i'd like to add are:

  • Ability to select a custom location
  • Instagram integration
  • Social sharing
  • Mobile app
  • Smart push notification

The project is open source, so if you like the idea, we would love to see somebody else working on it!

Thank you and enjoy your music!

Oh, I also wrote an (i hope) amazing documentation about our database infrastructure that you can find here