1 post • joined 30 Apr 2008
Object DB for complex data
I think the power and popularity of RDBMS is due primarily to the standard query language and efficient indexing which makes those queries fast. If your application does not use those heavily and you want to 'model' your data using complex objects, you might want to consider something else, like an Object database.
For example, we have a very complex Contact object that needs to be simply saved by ID and re-read later; I considered pasting the entire serialized object graph here but it is 1300+ lines and goes 5-6 levels deep (for a single object); here are a few of the hundreds of XPath's to give you some idea of the types of data involved:
There are also addresses; co-borrowers; assets; etc etc etc.
Here is all the code needed to save this ENTIRE object to db4o (and the code to read it is similar); NO O/R problems here:
String fileName = "TEST.db4o";
ObjectContainer db = Db4o.openFile( fileName );
db.set(contactObject); // That's it ! Your entire object graph is saved.
'Normalizing' this object would take a LONG time; and a LOT of code; and make it more difficult to make future changes.
There are also commercial object DB's (Objectify, Intersystems Cache) that provide SQL access to your objects; too bad no open-source projects do a decent job of this (yet?).
- iPad? More like iFAD: We reveal why Apple ran off to IBM
- +Analysis Microsoft: We're making ONE TRUE WINDOWS to rule us all
- Climate: 'An excuse for tax hikes', scientists 'don't know what they're talking about'
- Analysis Nadella: Apps must run on ALL WINDOWS – PCs, slabs and mobes
- Yorkshire cops fail to grasp principle behind BT Fon Wi-Fi network