Saturday, August 25, 2007

OODB vs RDB

It seems that whenever there is a discussion about using Object databases the debate veers towards whether to use an OODB *or* an RDB.

There are often many factors affecting DBMS choice in specific situations but most OO applications require persistence to disk and good query performance. OODBs minimise the pain of persisting an object model. RDBs tend to be much better at arbitrary querying.

I now tend to suggest the use of both and OODB and an RDB. Object persistence all happens to the OODB and the OODB is the operational repository for the system. The RDB is used to hold a flattened summary of the data in the operational repository. The problem of writing a summary to an RDB is much simpler than the problem of persisting objects with the former being much more like writing a report or producing a web page than saving a complex object structure in a way that can re retrieved and reanimated. The schema of the OODB is simply the object model of the application. The schema of the RDB would include the things that need to be searched upon and no more.

This OODB *and* RDB approach is an idealised model that may not work out in all cases, but I think it could well be a practical solution in many cases.

1 comment:

Alan Lovejoy said...

There is yet another option: A triple-store (for example, Mulgara). Storing objects (or anything else) into a triple store is quite easy to do, and so are arbitrary queries (ref: SPARQL).