Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Where previously there was only relational databases, the data store world is now rife with options like Key-Value, Document, and Graph datastores. Unfortunately, every datastore likes to show how it can be used for anything, but none of them really help people figure out when to use one model over another.

So, the question is: What "things" are graph datastores better at than relational datastores? (ie. faster, simpler, more flexible, more powerful) What makes them better at doing those things?

share|improve this question
up vote 5 down vote accepted

Highly connected graphs are not easy to model or query using relational databases.

Think about social graphs - Bob is a friend to Alice, Alice is a friend to Carol.

How many friends of friends does Bob have?

Modelling and querying this kind of data is what graph datastores are good at.

Another example - think about Dr Who episodes and a corpus of data about all the actors, characters and sets used in them. In a graph datastore you could query all the episodes an actor was in a specific set with a specific character - this is not easy to model or query in relational database.

share|improve this answer
So, answering the the n-steps-away sorts of questions? Or, to put it another way, answering questions that rely on transitivity? – cdeszaq Feb 9 '12 at 16:08
@cdeszaq - Its about traversing and querying relationships between objects as well as the objects themselves. – Oded Feb 9 '12 at 16:09
With the edit: Also multi-relational data? Commonly called ternary relationships, where you need to connect n different entities so a RDBMS "associative table" gets unwieldy as the number of entities to connect gets larger? – cdeszaq Feb 9 '12 at 16:10
@cdeszaq - Definitely multi-relational data. – Oded Feb 9 '12 at 16:12
@cdeszaq - Check out – Oded Feb 9 '12 at 16:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.