My latest fascination…

… is with graph databases, specifically Neo4J.

What is a Graph Database?

As in so many cases, a picture is worth … you know the rest.

Neo4J Visual Reference Card

Briefly put, Neo4J is a ‘schema-less’ database that places emphasis on the relationships between nodes, rather than focusing on a rigid structure to the data itself.

Some types of data and transactions, such as a system that looks up, say, a listing of songs on an album by a specific artist, can be implemented using a fairly strict set of guidelines describing the type of data and how it is related (the band recorded the following songs on the following album… you could even include the date and location of the recording). This could be described with just a few data  and descriptions (band name, album name, song name, date and location), and a simple set of relationships (band ->album->song->location & date).

If you are familiar with relational database management systems (RDbMS), you may already know the set of rules used to reduce data repetitiveness (normalization) and enforce rigid adherence to relationship hierarchy (referential integrity) can lead to convoluted mechanisms to achieve the desired results.  Constructs such as ‘bridge’ tables or ‘join’ tables are necessary to appropriately represent complex relationships in these systems.

Graph Databases by O’Reilly Media

Regarding our previous example, what happens when you would like to not only list the songs from a given band and album, but also understand what other songs have been recorded independently by the other band members?  Suddenly we are faced with relationships that are not strictly hierarchical.  How many relationships are we interested in?  What about the recordings by the band members’ collaborators?  Or their collaborators?  You can see that very quickly what was once a rigid and easy to navigate hierarchy of relationships quickly becomes unwieldy using a traditional RDbMS.  All of this has been well documented in the freely available ebook, Graph Databases (written by Neo4J, but an excellent resource).

When I first started learning about graph databases, the thing that first caught my attention was the ease with which a graph can handle complex relationship situations, such as the example above…

More on that in my next post…

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s