What is a Graph Database?
A graph database stores data in a graph, the most generic of data structures, capable of elegantly representing any kind of data in a highly accessible way.
Let’s follow along some graphs, using them to express themselves. We’ll “read” a graph by following arrows around the diagram to form sentences.
A Graph contains Nodes and Relationships
A Graph –[:RECORDS_DATA_IN]–> Nodes –[:WHICH_HAVE]–> Properties.
The simplest possible graph is a single Node, a record that has named values referred to as Properties. A Node could start with a single Property and grow to a few million, though that can get a little awkward. At some point it makes sense to distribute the data into multiple nodes, organized with explicit Relationships.
Query a Graph with a Traversal
A Traversal –navigates–> a Graph; it –identifies–> Paths –which order–> Nodes.
A Traversal is how you query a Graph, navigating from starting Nodes to related Nodes according to an algorithm, finding answers to questions like “what music do my friends like that I don’t yet own,” or “if this power supply goes down, what web services are affected?”
Indexes Look-up Nodes or Relationships
An Index –maps from–> Properties –to either–> Nodes or Relationships. It –is a special–> Traversal.
Often, you want to find a specific Node or Relationship according to a Property it has. This special case of Traversal is so common that it is optimized into an Index look-up, for questions like “find the Account for username master-of-graphs.”
Emil Eifrem explains the secret behind websites like Twitter, Yelp and Facebook.
Watch the video »