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?).
- 'Kim Kardashian snaps naked selfies with a BLACKBERRY'. *Twitterati gasps*
- Pics Facebook's Oculus unveils 360-degree VR head tracking 'Crescent Bay' prototype
- Crawling from the Wreckage THE DEATH OF ECONOMICS: Aircraft design vs flat-lining financial models
- Analysis Apple's warrant canary riddle: Cock-up, conspiracy, or anti-Google point-scoring
- Bargain basement iPhone shoppers BEWARE! eBay exposes users to phishing vuln