views:

388

answers:

11

Background: Okay, so I'm looking for what I guess is an object database. However, the (admittedly few) object databases that I've looked at have been simple persistence layers, and not full-blown DBMSs. I don't know if what I'm looking for is even considered an object database, so really any help in pointing me in the right direction would be very appreciated.


I don't want to give you two pages describing what I'm looking for so I'll use an example to illustrate my point. Let's say I have a "BlogPost" object that I need to store. Something like this, in pseudocode:

class BlogPost
    title:String
    body:String
    author:User
    tags:List<String>
    comments:List<Comment>

(Assume Comment is its own class.)

Now, in a relational database, author would be stored as a foreign key pointing to a User.id, and the tags and comments would be stored as one-to-many or many-to-many relationships using a separate table to store the relationships. What I'd like is a database engine that does the following:

  • Stores related objects (author, tags, etc.) with a direct reference instead of using foreign keys, which require an additional lookup; in other words, objects on top of each other should be natively supported by the database
  • Allows me to add a comment or a tag to the blog post without retrieving the entire object, updating it, and then putting it back into the database (like a document-oriented database -- CouchDB being an example)

I guess what I'm looking for is a navigational database, but I don't know. Is there anything even remotely similar to what I'm thinking of? If so, what is it called? (Or better yet, give me an actual working database.) Or am I being too picky?


Edit:

Just to clarify, I am NOT looking for an ORM or an abstraction layer or anything like that. I am looking for an actual database that does this internally. Sorry if I'm being difficult, but I've searched and I couldn't find anything.


Edit:

Also, something for the JVM would be excellent, but at this point I really don't care what platform it runs on.

+1  A: 

Exactly what you've described can be done with (N)Hibernate running on an ordinary RDBMS.

The advantage of using such a persistence layer with an ordinary database is that you have a standard database system combined with convenient programming. You declare your classes in a very natural way, and (N)Hibernate provides a way to translate betweeen references/lists and foreign key relationships.

Java tutorial: http://docs.jboss.org/hibernate/stable/core/reference/en/html/tutorial-firstapp.html

.NET tutorial: http://blogs.hibernatingrhinos.com/nhibernate/archive/2008/04/01/your-first-nhibernate-based-application.aspx

If you insist that you don't want to use a well-supported standard RDBMS and would rather trust your data to something more exotic and less heavily tested, you're looking for an Object Relational Database.

However, such a product would probably be best implemented by making it be a layer over a standard RDBMS anyway. This is probably why ORMs like (N)Hibernate are the most popular solution - they allow standard RDBMS software (and widely available management/user skills) to be applied, and yet the programming experience is 99% object-based.

Daniel Earwicker
See my edit, I'm not looking for an ORM solution or an abstraction layer, I'm looking for an actual database that does that. I'm currently using abstraction to mimic this but I want to see if there is an actual database that does it natively.
musicfreak
Sorry if I'm being difficult and/or picky, by the way. If nothing like this exists it's not a heartbreaker for me, but I was just wondering if there was something similar, because it would make my life easier.
musicfreak
You're not being difficult - your question might benefit from some insight into why the solution mustn't be based on an RDBMS. How would you be able to tell, with a sufficiently good abstraction layer?
Daniel Earwicker
He is definitely looking for an Object Database, not an ORM. There are definite benefits to using an ODBMS over an ORM, if you are truly not concerned with using that database for other relational-type purposes (i.e. reporting).
jrista
Nevertheless, he's a little crazy to rule out RDBMS+ORM as a solution, as the example given his question is solved in the first few pages of the tutorials I posted.
Daniel Earwicker
The example given was simply for the sake of having an example; my web application is much more complex than that. And I'm not ruling out an ORM solution, that's what I'm using right now, but if there's an actual database that can natively do this, I'd rather use it.
musicfreak
A: 

This is exactly what LINQ was designed for.

Microsoft LINQ defines a set of proprietary query operators that can be used to query, project and filter data in arrays, enumerable classes, XML (XLINQ), relational database, and third party data sources. While it allows any data source to be queried, it requires that the data be encapsulated as objects. So, if the data source does not natively store data as objects, the data must be mapped to the object domain. Queries written using the query operators are executed either by the LINQ query processing engine or, via an extension mechanism, handed over to LINQ providers which either implement a separate query processing engine or translate to a different format to be executed on a separate data store (such as on a database server as SQL queries (DLINQ)). The results of a query are returned as a collection of in-memory objects that can be enumerated using a standard iterator function such as C#'s foreach.

Nippysaurus
A: 

There's a variety of terms, all linked to Object-Relational Mapping, aka ORM, which is probably going to be the most useful one for you to look up. ORM libraries exist for many programming languages.

Roger Pate
I edited my question; I'm not looking for an ORM or abstraction layer, I'm looking for an actual database that does this.
musicfreak
+1  A: 

I think our looking for this: http://www.odbms.org/. This site has some good info on Object Databases, including Objectivity, which is a pretty good object database.

jrista
+1 for the link. Objectivity looks like what I want, but the price tag doesn't look appealing. But I'll look into it if I can't find anything else.
musicfreak
Check out that odbms.org site too. There are other object databases that might meet your price point (however, they might not quite meed Objectivities quality.)
jrista
Looking right now, thanks. :)
musicfreak
+5  A: 

You could try out db4o which is available in C# and Java.

Sam Saffron
+1 Interesting!
MrZombie
A: 

Oracle's nested tables provide some part of that functionality, though in updates, you cannot just add a row to the nested table - you have to replace the whole nested table.

ammoQ
A: 

I guess you're looking for an ORM with "EntityFirst" approach.

In EntityFirst approach the developer is least[not-at-all] concerned with Database. You just have to build your entities or objects. The ORM then takes care of storing the entities in Database and retrieving them at your will.

The only EntityFirst ORM witihn my knowledge "Signum". It's a wonderful framework built on top of .net. I recommend you to go thrgouh some videos on the SignumFramework website and I'm sure you'll find it useful.

Link Text: http://www.signumframework.com

Thanks.

this. __curious_geek
Again, I am NOT looking for an ORM. But thanks anyway.
musicfreak
Yes, you're not looking for an ORM but SignumFramework is one of its kind. They were the first to produce LinqProviders for their framework outside Microsoft office. Signum has very strong features.
this. __curious_geek
A: 

ZODB perhaps? good introduction find here: http://www.ibm.com/developerworks/aix/library/au-zodb/

niko
I did actually have a look at ZODB, but I've heard it has terrible performance problems. Not sure if that's still true; those rumors are pretty old.
musicfreak
+1  A: 

Elephant does this: http://common-lisp.net/project/elephant/

skypher
+7  A: 

I think what you are describing could easily be modeled in a graph database. Then you get the benefit of navigating to the nodes/edges where you want to make changes without any need to retrieve anything else. For the JVM there's the Neo4j open source graph database (where I'm part of the team). You can read about it over at High Scalability, as part of an overview at thinkvitamin or in this stackoverflow thread. As for the tags, I think storing them in a graph database can give you some extra advantages if you want to find related tags and similar stuff. Just drop a line on the mailing list, and I'm sure the community will help you out.

nawroth
Hmm, I just looked up the term and that actually sounds like exactly what I need. Thank you very much!
musicfreak
A: 

You could try out STSdb, DB4O, Perst ... which is available in C# and Java.

smateev