Object databases

acme on 2001-05-19T09:49:07

As a Perl programmer, I've coded my share of CGI / databasey web applications, coding Perl objects and storing them in various databases. There is a problem with doing this. In the jargon, there is an impedance mismatch between objects and relational databases, which gives rise to object-relational and relational-object mappers such as Tangram and Alzabo. These modules are cute, and somewhat hide the complexities of mapping between objects and tables, but I consider them a hack. A good hack, but Something Better must be out there. And then I read an article on slashdot reminding me about object databases...

In an OODBMS you build up the object model for your system, the OODBMS stores your objects for you, and they appear to you as native objects in your programming language. i.e you don't have to map from your programming languages data structures to relational structures.

I've looked at ZOPE recently, and wondered quite how ZOPE got to be so popular. ZOPE, it turns out, has an object database behind it, called ZODB. So Python has an easy-to-use native object database with various data storage backends, and I wondered quite how hard it would be to take the ZODB concept and rework it in my language of choice, Perl.

(OK, OK, first I thought about using Inline::Python, and then I remembered that speed was important).

Turns out it's not that hard at all, if you think small. The great thing is that you can start simple and then add layers adding more and more functionality.

More on peapod (P?E?A? Perl Object Database) later. I have to finish my TPC slides (when did I suddenly become an award-winning Perl conference speaker, anyway? ;-), which reminds me that I owe gnat a beer...

Oh, and "Hello world".