DEV Community

Zainab-Saad
Zainab-Saad

Posted on

Why use graph database?

Graph database uses nodes/vertices to store entities and edges to store relationships between these entities. Most of the value of graph databases are derived from these relationships. These relationships represent complex interconnected relations between the nodes.

Examples of graph databases include Neo4j. Examples of relational databases are postgreSQL, MySQL, Oracle etc.

We use graph databases because it provides:

  • Flexibility
    Graph databases are schema-free and thus any change in the properties (attributes) of a node or edge does not require the entire schema to be altered. This is quite unlike relational databases such as postgreSQL where if one record has a different set of attributes, you need to change the entire schema of the relation/table.

  • Agility
    Graph databases being time-efficient are a great choice in agile development where there is a need for efficient data storage and management under a time constraint.

Size vs Complexity Relation
There is a size vs complexity relation between the graph and relational database. It is a fact that the graph databases perform the best when the complexity of relationships between the entities is to be scaled whereas relational databases perform best when size of the database needs to be scaled.

References

Oldest comments (3)

Collapse
 
joelbonetr profile image
JoelBonetR 🥇

Nice introduction to the topic 🤩 thank you for sharing!

If you happen to write an article to explain Graph DBs (Neo4J or any alternative) please ping me, I'd love to take a look at it to learn the nuances 😄

Best regards

Collapse
 
zainabsaad profile image
Zainab-Saad

Sure, I shall do that.

Collapse
 
joelbonetr profile image
JoelBonetR 🥇

Thank you! 😁