Getting Started with Neo4j, the Java graph database
Michael Hunger explains how you can get the most out of the growing trend, focusing on one of the leading lights in Neo4j
There is a whole world of information out there where size is not king, and connectedness assumes the throne. Everything in the real – and digital – world is connected and the amount of value in these relationships is tremendous. Historical events are interconnected with political arenas and individual participants. Gene expression is derived from both DNA and environmental factors. Networks, computers, applications and users form intricate interaction networks. Every aspect of our lives is dominated by connected information and things. Big internet companies are trying to harness this power with efforts like the Google Knowledge Graph or Facebook Graph Search.
And whenever we want to store this real world data in a database, we somehow have to take care of this fact. Usually the connections are ignored, denormalized or aggregated to fit in the data model and make operations fast enough. What you lose by doing this is the richness of the information that you could have retained with a different data model and database. That’s where the property graph model and graph databases show up. If graph shaped data shows up in a relational database on the other hand, you’ll easily recognize it by the sheer amount of intermediate join tables and join statements in your queries (and dropping performance levels).
Graph theory is much older than anyone would think. Treating graphs explicitly with database semantics like ACID Transactions is new however. Graph databases are part of the recent NoSQL movement that mostly means non-relational databases. Most of them are open source, developer-friendly and come with a dedicated data-model that suits a certain use case.
Graph databases are well suited to storing, retrieving and quickly querying interesting networks of information. This kind of connected data is also know as graphs – not to be mixed up with artwork, charts or diagrams. Graphs consist of nodes and directed, typed relationships, both of which can hold arbitrary numbers and types of attributes (key-value properties). That is all there is to the graph model.
You have certainly used graphs in the past, either when modelling relational databases (ER-diagram), when drawing your domain on a whiteboard with some colleagues (circles and lines) or when creatively collecting information (mindmaps). The simplicity of the graph model makes it easy to understand and the direct visualization makes it even easier!