unlike a relational database, an object database can be used to store objects and their relationships directly. There are several commercial object database. ObjectStore is one of them. it has JAVA and c++ API. You can even download a free version (ObjectStore PSE) from its website.