606e The ServerSide Interoperability Blog » Neward, object data bases and ORM issues

Neward, object data bases and ORM issues

db4objects provides an object data base management system. While ODBMS technology has proved a niche technology over the years, it is poised as another means of achieving interoperability. db4objects describes their object DB as native to Java and .NET. For example, the software supports class aliases that reconcile the different naming conventions so that Java and .NET db4o instances (clients or servers) can share persisted objects without the need to deploy classes to the server. Of course, there is more.

TheServerSide Interop Blog Charter Blogger Ted Neward [shown here] recently took a look at the db2objects space as part of a broader interview on TheServerSide.com. Here we provide some highpoints from that discussion, as well as a link to Ted Neward’s new TSS.com TechTalk on Object/Relational Mapping and the Vietnam of Computer Science.

As we begin our story, Ted notes that he is wearing a DB4Object shirt.

What has happened … and … I am obviously wearing their shirt, the DB4Object guys, one of the things that they have done, a couple of things that they have done differently that I find myself agreeing with, what they have done first of all is they have not stood up and said, ‘We want to replace the relational database in the IT world.’ As a matter of fact, for a long time they were aiming squarely at the embedded space where guys are still rolling their own persistence engine. Like guys are sort of writing Java object, serialization objects to disk and then folding them back up.

These guys are [saying] we can do this a lot better. We will create our own persistence implementation. We will make it very efficient. I think their runtime is measured in code and like a couple of 100K. Their memory overhead footprint is trivial. I do not think it is more than 50K runtime footprint. They have done a good job about working on the embedded space. They are not trying to replace your relational database. They are saying we have some compelling reasons to be in place and more importantly we have a much, much better query approach than the traditional QL style approach or the query-by-example approach or the query-by-API approach. They have what they call native queries, which lets me write the actual query in Java.

. . .

In the C# space, for example, you use what .NET refers to as anonymous delegate, right, but in Java space you would use an anonymous interclass, but effectively what you do is you say, DB, assuming that is your reference to the object container, the database, db.query(new Predicate (new Predicate(), this is an anonymous inner class, { public boolean match(Person candidate). Okay, now inside of that candidate is basically you can imagine it like this. We are going to take this anonymous inner class, shuttle it over to the database, we are going to load every person within the database, all right. We are going to instantiate this object, pass it into that match method and then execute this match method, and if it returns true then it is part of the return set, if it returns false, it does not. So, inside the code you say if name.getLastname().equals(“Neward”) and age greater than 21, right, let us find all new words we are able to drink, return true or else return false, right. So, you are programming in the language of your choice. You are not writing these predicates in SQL or OQL or HQL or what have you.

Now, this is only half the story, right, because I can see the look on your face, it is like, wait a minute. You are going, if I have a million persons in this database, you are telling me I am going to instantiate a million of these guys just to call this method. This is the beautiful part about what they do. Because they are in a runtime environment, because it is a compiled bytecode, they can actually take this class, shuttle it over to the database and do bytecode analysis on it. So, we are going to look at the match implementation and say, ‘Look, we referenced the last name field, right, we referenced this static value Neward, so we will turn this into our native query API what they call the S.O.D.A. The simple object descent API. We will turn it into a S.O.D.A query, which is the query by API approach where you have to specifically code each hand dissent into the object and each field and so. It is painful, but they are going to do that for you. So, now we do not have to actually instantiate the object. They just walk through the various data values on disk, so in essence it is almost like I am taking a SQL query and picking it apart and turning it into the query plan and sending that to the database, right. That is a rough corollary to what we would see in the relational space, so there is no parsing or interpretation that needs to happen there. So, they can get some really, really fast results because of this native queries approach that we do not, I do not have to write it in OQL, I do not have to write it in any sort of arbitrary query language. The language that I have used to express my person is in fact the language that I used to determine whether or not this person is appropriate to be returned as part of that query. You almost have to play with it and see the code a little bit to really appreciate. I think it is kind of pretty. I think it is kind of nice because I do not have to learn these really weird arbitrary languages when I want to stay entirely within the object space.

Ted goes on to admit DB40 may not optimize everyting you might want to do. He points to the concerns around object databases… View Object/Relational Mapping and the Vietnam of Computer Science.

The db4o people are a busy group….db4objects (www.db4o.com), the creator of the leading open source object database for the Java platform, helped solve a leading Japanese car manufacturer’s hard drive problem by eliminating it.

db4objects will demonstrate at SUN’s Java Playground at booth #1336 a navigation system that is powered by db4o and a NAND drive. The demo shows how db4o maximizes database performance and optimizes NAND life. The db4o/NAND navigation system runs up to 10x faster than a navigation system with a traditional hard drive.

Related ODB links
db4o site
TechTalk: ORM and VietNam - TSS.com

2 Responses to “Neward, object data bases and ORM issues”

  1. fx Says:

    When I read “Now, this is only half the story, right, because I can see the look on your face, it is like, wait a minute” I felt like, hey, where did that first half go? Dont’t drink and blog :)

  2. Augusto Says:

    Speaking of T-shirts, Neward was wearing an “I love C#” t-shirt at JavaOne. This is one brave guy! :-)
    His Java/.Net interoperability talk was a lot of fun, and very practical.


Leave a Reply

0