Get Started

Advantages and limitations of graph databases

1. Advantages and limitations of graph databases

In this lesson, we will deepen our knowledge by studying the advantages and limitations of graph databases.

2. Advantages - flexibility

Let's start with the advantages. Graph databases are flexible and can change as applications and industries change. We don't need to define the final structure of a graph in advance. Thus, if we need to add or delete nodes, properties, and edges to the existing graphs, we can do it without worrying about the current information that we already stored.

3. Advantages - performance

Another advantage of graph databases is their performance. This kind of database doesn't need to perform joins. It should be remembered that the joining process can be potentially time-consuming. Instead, we can simply follow edges from node to node, which is much simpler and faster, even for complex queries or large volumes of data.

4. Advantages - easy representation of the data

Another benefit is that graph databases have an easy representation of the data. The structure of a graph is comparable to human thinking. Graphs map in a more realistic way than other databases, similar to how human brains map and process the world. It makes graph modeling very intuitive. Graphs are easily visualized with the nodes, relationships, and associated properties. This type of representation facilitates understanding.

5. Advantages - horizontal scalability

Horizontal scalability in graph databases is possible. However, it is more difficult than in other NoSQL databases because graphs are connected, and they need to be distributed across multiple machines.

6. Limitations

Graph databases also have some limitations. As we will see in the next lesson, some scenarios are unsuitable for graph databases, such as having entity properties containing extremely large values, like BLOBs, Binary Large Objects, which are typically multimedia objects, or CLOBs, Character Large Objects, which are collections of character data. The reason is that these databases won't perform well, and in fact, it is considered a bad practice. If we need to handle them, it is better to use another type of database to store that information and use the graph database, for instance, just to store the URL that points to the binary data. Finally, graph databases may be a significant change for developers that are used to working with relational databases. They will need to adopt a new data modeling mindset and learn a new query language such as Cypher or Gremlin.

7. Let's practice!

Let's complete some exercises before studying the scenarios where graph databases are suitable.