What is the difference between graph-based databases and object-oriented databases?

Gili picture Gili · Feb 7, 2010 · Viewed 11k times · Source

What is the difference between graph-based databases (http://neo4j.org/) and object-oriented databases (http://www.db4o.com/)?

Answer

Johannes Ernst picture Johannes Ernst · Feb 10, 2010

I'd answer this differently: object and graph databases operate on two different levels of abstraction.

An object database's main data elements are objects, the way we know them from an object-oriented programming language.

A graph database's main data elements are nodes and edges.

An object database does not have the notion of a (bidirectional) edge between two things with automatic referential integrity etc. A graph database does not have the notion of a pointer that can be NULL. (Of course one can imagine hybrids.)

In terms of schema, an object database's schema is whatever the set of classes is in the application. A graph database's schema (whether implicit, by convention of what String labels mean, or explicit, by declaration as models as we do it in InfoGrid for example) is independent of the application. This makes it much simpler, for example, to write multiple applications against the same data using a graph database instead of an object database, because the schema is application-independent. On the other hand, using a graph database you can't simply take an arbitrary object and persist it.

Different tools for different jobs I would think.