tags:

views:

578

answers:

2

Hi,

Is there an open source object oriented database for C++ available?

I had looked at Object oriented Relationship Mapping (ORM) libraries like those posted here: http://stackoverflow.com/questions/74141/good-orm-for-c-solutions

and these were intereting as well: http://stackoverflow.com/questions/600684/object-oriented-like-structures-in-relational-databases http://en.wikipedia.org/wiki/List_of_object-relational_mapping_software#C.2B.2B

My experience so far has been painful. The solutions don't appear to be mature and I've had difficulty even compiling some of them, and the documentation and support can be sparse.

I suppose at some level I'm trying to avoid learning SQL (I'm not a database developer). On the other hand, my gut feeling is that ORMs are an architectural 'workaround' in that they are creating a layer above a database system that inherently doesn't support objects.

My ideal database library would allow the following:

  1. Allow one to specify the object hierarchy tree based on class names, perhaps in XML or just in C++.
  2. Allow one to specify which fields of those classes should be persistent.
  3. Provide an API to create, update, delete, retreive the hierarchy of objects.
  4. Ideally, provide an API for the in-memory tree itself, including concurrent access to tree nodes.

I had worked on embedded system that had such a custom database and api.

I'm almost at the point where I'm just going to create my own and open source it.

Just wondering if there is anything off the shelf I can use.

I saw this: http://en.wikipedia.org/wiki/Comparison_of_object_database_management_systems

and am trying to figure out this might work:

http://www.fastdb.org/fastdb.html

Thanks in advance.

A: 

Honestly, unless you're into "bleeding edge", I would stay away from OO databases. In almost all cases, they're not well supported, immature, and have various support issues client side.

The problem is, only the relational databases (and certain non-relational ones) get 99% of the attention, and thus end up far more mature. ORM may be a workaround, but if you want reliability, it's really what you need.

UPDATE:

To clarify, I'm sure there are some very reliable open source OODB's out there, but my requirements for "realiability" are more than just whether it doesn't crash and doesn't corrupt data. It includes reliability of the client connectors, reliability of the integration with the object models of popular languages, etc...

This is about open source OODB's, not commercial ones.

Mystere Man
How many OO databases have you used in production?
anon
Yes, "avoiding learning about SQL" isn't IMO a good reason. By the time you've specified which fields you want to serialize you might as well be using SQL!
ChrisW
+1  A: 

I'm not going to make any recommendations, because I don't know of a high-quality FOSS OO database. I would however make the following observations:

  • OO database are not a way of avoiding SQL - you need both. Frankly, If you don't know SQL pretty well, your life as a professional programmer iis likely to be unhappy.

  • OO databases are mature - they have been around for well over 20 years. I personally first used one on a large project in the finance industry 15 years ago.

  • OO database are best used where relational databases fail - I've used them in complex financial instrument modeling, oil-pipeline optimisation and telco work.

  • ORM databases take the bad parts of the OO and the relational models and make something even worse of them.

  • My favourite commercial OODB is ObjectStore, but I haven't done any work with it for quite while now.

Hope that is vaguely helpful.

anon
Where do relational databases fail? I mean, "for what data/applications/requirements?".
ChrisW
Tree/graph navigation. Much slower (by 1000x) with relational than with OO.
anon
Navigation, eh? I've been using the nested set model to store trees in SQL. It's thus cheap to select the records in a tree and/or sub-tree/branches, which I then rehydrate into an object tree outside the database.
ChrisW
Believe me, no matter how fast a SQL database is, an OO database will be stunningly faster - it is almost their raison d'etre.
anon