There is no single answer to this question, and the take-away of this article is that everything depends on how the data will be used.
If your system requires you to query data like a graph, a tree, a hierarchical structure — in short with a complex and highly connected model –, then a graph management systems is probably the best choice.
The next step depends on the way the data is to be processed: if you have real-time access needs and the volume is not too high, a graph database or a custom graph representation in memory should be fine.
If there is in addition a need to store data as a graph, a graph database will do it. Such a choice will allow you to easily traverse the relationships, with some trade-offs like complementary indices for reporting or CRUD display. And vice-versa if you opt for a relational database.
Lastly, if the volume of data to process is huge, a graph processing solution must be considered, at the cost of higher processing delays and a batch approach.
The election of the database is a crucial architectural decision that is often made at the beginning of a project, but it may not be carved in stone. By keeping one’s code and architecture clean, complying to the principle of separation of responsibilities, and with a clean view of the data model, new choices can be made and the architecture can evolve. If necessary, two separate persistence solution can coexist for each use case: this is the world of polyglot persistence.
In the next article, we will dive deeper into the characteristics of graph databases and development tools that are proeminent today.