Object Databases

I have a favorable opinion of object databases.

For complex, greenfield software applications where managing internal complexity is a priority, I think I would use them over an ORM-based solution.

A problem for ORM that I repeatedly seem to bump into, is how to handle persistent object references whose type is an interface, or very polymorphic, or otherwise unknown. For example, persisting event listener registrations, where the listener type can be anything with a onChange() method. Even good ORM solutions like Hibernate can only handle polymorphism via a single-inheritance model that is unable to address the above use case.

In 2002, I used ODB Versant for Java while at (the now defunct) UK Javaspaces vendor Intamission, and came away with a generally favorable impression.


Javaspaces and Tuple Spaces

I worked at (the now defunct) UK Javaspaces vendor Intamission in 2001 and 2002 implementing a Javaspace. It was a beautiful and highly-performant implementation. While building and trying to sell it, I learned alot about Javaspace-based object database systems; unfortunately, I concluded that they are rather a weak idea.

The sucky bit is the query mechanism: it's based on passing a Template object, with fields partly filled out, to the space, and getting back an object from the space of the same type as the template, and with matching all non-null fields in the template.

  • There's no way to specify a range query. I cant say "People between 5 and 8", I can only say "People who are 5", or "People of any age".
  • There's no way to get back multiple objects from a space in one query. You can only either test for an object (read) or remove and object (taking). Eg You cant say "get me all People who are 5", only "Is there a person who is 5?" and "Give me a person who is 5".

With such anemic query ability, its no surprise tuple spaces never took off.