Why Graph Databases Rock at Social Media!
Ever get the feeling you’re drowning in data? Well how do you think your database feels! The traditional database, the relational database is more popular than your favourite pair of jeans, but is it always the most effective, or is there another database which could be better? Relational databases are lightning fast when operating a huge number of predetermined records, but projects where there are massive amounts of varying data generated can swamp its ability. This can be problematic for a website that requires a lot of variation in relationships. Recently Yoyo were given an unusual project, and we were keen to get stuck in.
The client, Audiosplitter is a start-up who came to Yoyo requiring the full works to launch their new service – an identity, a full web design and build and to help shape their idea of a brilliant new music website. The original focus of their new site was for users to create a collection of songs based on recommendations, which was a fantastic idea and something Yoyo were excited to get involved in. The original idea was then expanded to make the site more like a social network. A social media site is totally different to standard websites due to its multiple users, links and connections and would need some kick ass software to support it.
A relational database organises data into constrained tables and links them based on defined relationships, so it is great for storing and retrieving fixed data. The graph database however is schema-less, meaning you don’t have to previously specify what type of data you want in the tables. Instead it uses connected data and varying relationships, and this flexibility fitted perfectly with the Audiosplitter project due to the large quantity of varied data required, and the ever developing focus of the site.
James, Yoyo’s Technical Director, selected the Neo4j software based on the three key aspects: it runs off Java, it is web friendly and it is an open source. The positives to the Neo4j were impressive. The database was easy to use at its simplest level, for example when building a user interface to add data. However, one challenge faced was in relation to the recommendations, and working out how similar two things are. The process was originally taking three minutes to load, so a java plug in was written within the Neo4j to see if this sped up the process. This reduced the loading time to just two seconds, which was excellent because a prolonged loading time can be detrimental to a social site like Audiosplitter, as users may get bored and close the site.