[SOLVED] Graph and Relational Data Models

Issue

To me, relational data is a graph, where each table is a node, and each foreign key is an edge connecting the two nodes together.

So when I hear about things like Neo4j and “graph databases”, it is difficult for me to understand how they are inherently different from a relational model, which is already itself a graph!

Most important, because I can’t tell the difference between the two, it’s difficult for me to figure out which problem domains are best solved with a graph model, and which ones are best solved with a relational model. I’m looking for a set of guidelines to say: Hey, this problem is definitely best represented by a graph model, so I will use (say) Neo4j. Or, to say: This problem is definitely best represented by a relational model, so I will use (say) MySQL.

Edit: In summary, what problem domains (data-wise) do graph models solve better than relational models?

Solution

one of the cases you would want to use neo4j instead of relational DB:

as soon as you are using mostly several joins between tables, especially when joining a table on itself, consider using graph DB.

in my eyes using a graph DB is a method to store those kind of information, which i’m querying in very few ways (or maybe i’m using just one pattern of query) and i’m looking for the speed of the answer.
having relational DB is better when you use plenty query types and still have plenty of computational power.

if you would like to know more and go deeper into graph DB, i suggest you to read smthing about math graphs in general (http://en.wikipedia.org/wiki/Graph)

Answered By – ulkas

Answer Checked By – Pedro (BugsFixing Volunteer)

Leave a Reply

Your email address will not be published.