4

Looking at options for an embedded NoSQL database written in Java, graph databases come up. What is a graph database (especially in contrast to a key-value store and a document-oriented database) and when would I use one (and when not)?

1
  • 1
    Neo4J, a graph database, has some useful explanations on their website. neo4j.org/learn
    – aaronjg
    Commented Jan 5, 2012 at 3:51

3 Answers 3

1

I learned a little bit about them in school (long time ago). Relational hadn't quite taken over the world yet, but it was close, so graph databases got a cursory mention. IIRC they were pretty much dead at the time. I'm not sure how informative this will really be, but I'll put it out there in case it helps somebody.

Basically, if what I recall is true, a graph database is essentially a graph. You retrieve data (nodes) from the graph, and then to find related information, you would traverse links (edges) to related data in the graph structure.

Other than the obvious case where your data is graph-like and it might be faster/more natural to use, I can't recall any advantages. I don't recall any of the disadvantages, but I would suspect that it might do poorly with with the sorts of things that relational databases do well (i.e. cranking through large sets of tuples).

1

Several sources available to answer the "what" question, including this:

http://www.infinitegraph.com/what-is-a-graph-database.html

When should you use a graph database?

If your data contains a lot of many-to-many relationships, if recursive self-joins are too costly or limiting to your application and scaling needs, and/or your primary objective is quickly finding connections, patterns and relationships between the objects in your data.

0

Graph Databases are useful in scenarios where the information has an inherent graph-like nature such as social networks, bibliographical databases like Wikipedia, fraud detection, media analysis, recommendation, biological networks analysis, ... In these scenarios, it is not likely to obtain only a list of results but a set of entities that are satisfying a given constraint.

Graph databases are useful because:

Relationships between entities are implicit in the model
They are more flexible to manage unknown or dynamic schemas
Favor structural and navigational queries
They are more efficient solving network operations

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