DEV Community

Cover image for When to use RDB or GDB?
Muhammad Farooq
Muhammad Farooq

Posted on

When to use RDB or GDB?

See the tutorial: Advantages of Relational DB, Graph DB, and RGDB

The following details will help you decide when to choose which database over the other. To maintain the existing system or to further advance the system depends entirely on your choice.

Fast analysis or Log management

The graph DB is suitable for predictive analytics and fraud detection because it easily finds and identifies hidden patterns that are difficult to find with a naked eye. Since it is generally optimized for data inquiry and analysis, it is an excellent choice if these are important traits to consider for the project.
However, if there is no need for data analysis and the purpose of the project is to simply record data in logs, the relational DB may be a better choice.

Depth of relationship

The graph DB is worth considering when there are numerous connections or patterns within the stored data and when meaningful insights need to be returned. It efficiently finds hidden patterns, providing additional factors to aid in decision-making. Converting structured, semi-structured, and unstructured data into a graph DB can broaden the perspective on data understanding.

The relational DB is more suitable than the graph DB if the project is more transaction-oriented. Sometimes it is better to simply store and manage data rather than trying to understand the relationship between data.

Consistency of data model

Finally, the graph DB is recommended when the data model needs to be changed frequently. The graph DB is schema-less, so its flexibility in adding properties is well known. Additional attributes can be added in order to understand the depth of analysis or when the attribute of certain data is not strictly defined (eg. unstructured data such as video or photos).

On the other hand, table data of the relational DB boasts consistency, which becomes its advantage. When storing personal information such as name, date of birth, location, etc., the relational DB may be more efficient due to not having to change new fields or data often.

RGDB: a multi-model that can use both RDB & GDB

At present, finding hidden insights from a vast amount of data is becoming a trend as it could mean increasing corporate competitiveness. As such, the number of cases taking advantage of the efficiency of both the relational and graph databases is increasing.
For example, let’s say a bank has decided to build an AI management system using data from a relational DB that has been used for monitoring voice phishing. This bank has millions of accounts with transaction history and the detailed transactions between accounts and accident reports must all be recorded in a table format. The storage and management of big data can be maintained with the existing management system just fine, but among the data, some parts may require pattern tracking or deep analysis (eg. transaction info between accounts) for further insights. In that case, the said data can be transferred to the graph DB for analysis and the analyst will be able to find, for example, fraudulent activities like abnormal transactions.

In fact, many of the current big data platforms implemented with the graph DB also maintain relational DB for data management. Each DB working together may be able to bring out a synergy that complements each other’s strengths and weaknesses.

The purpose is the key

As there are always two sides to everything, the graph DB, despite being the latest database technology, is not a perfect solution to all problems. The same can be said of relational DBs that many companies have been using for a long time. Depending on the need of the company, either one of them or both may be required.

The main reason for choosing the graph DB is to analyze data relationships. As for relational DB, it is to accurately aggregate numerous data. If you want to apply both for different purposes and increase efficiency at the same time, you may want to consider a multi-model database with a mix of the two. For example, accurate management of existing data can be done with a relational DB and data analysis with a graph DB. This is one of the ways to gain new insights while maintaining the existing data management paradigm.

Before deciding which database to choose, it would be wise to consider what characteristics your data have or what you want to achieve from the data. Seeking a tip from an expert consultant regarding the decision may also be a good choice. In the end, the choice is yours to decide.

Visit Apache AGE:

Top comments (0)