Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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
add comment

1 Answer

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
1  
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
1  
@cdeszaq - Definitely multi-relational data. –  Oded Feb 9 '12 at 16:12
    
@cdeszaq - Check out neo4j.org –  Oded Feb 9 '12 at 16:13
show 2 more comments

Your Answer

 
discard

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.