You're unable to read via this Friend Link since it's expired. Learn more
Member-only story
What is a Graph Database Anyway?
Explaining a complex concept in simple words

Graph databases are not a new concept. Graph theory was actively developed in the 1960s and since then the first attempts for building storage for graph structures have already appeared. The general idea is to persist the graph as a data structure and operate with it through the queries. It is like a mixture of graphs and databases, taking the best parts of both of them.
The main driver for graph databases was the expansion of social networks and the improvements of recommendation engines. Social networks want to know the person’s connections better in order to suggest new friends, while recommendation engines mine the person’s interests to find the ideal next proposal.
Let’s explore how graph databases work, their main principles, and their advantages.
Idea
From the graph theory, we know that every graph consists of two essential components: vertex and relation. A vertex defines the actual data, a relation describes how different vertices connect to each other. The simplest and most popular example would be a social graph:

We can see that every node in the graph represents a person. Each person has properties for name and age. Describing people with these properties looks similar to the entry in the SQL database — but this is the only similarity.
What makes a graph database different is the connections between the vertices. Every node can have multiple relations (or edges). In more complex systems, the edges can have their own properties. For instance, weights define how strong the connection between the nodes is. In our example, we have different types of connections between the vertices. All connections with their properties are persisted as well.
In relational databases like PostgreSQL and MySQL, the relations between the entries are defined through one-to-many and many-to-many relations. Those relations are not persisted explicitly. We have to run multiple queries and combine the results through the JOIN command. This makes read operations…