[ZODB-Dev] Excellent overview of ODBMS and my take on ZODB

Patrick K. O'Brien pobrien@orbtech.com
Mon, 25 Feb 2002 12:32:37 -0600


Here is a very nice overview of ODBMS in general:

http://www.versant.com/products/vds/whitepapers/WP_001001r6W.pdf

And here is my assessment of ZODB as it relates to this overview (feel free
to correct any mistakes or misunderstandings on my part):

ZODB does let you store (just about) any complex object model in the
database. A few caveats are that your classes have to subclass the
Persistent base class, and you cannot use __getattr__ or __setattr__
methods. This does limit what you can do to intercept attribute access,
which is why I created a Field class in my Bulldozer project. ZODB is also
slightly behind in supporting the new classes in Python 2.2 and the new
capabilities that those bring.

ZODB does assign Object Identifiers automatically. And you can get to them
if you know the attribute/method call. However, they are somewhat limited by
the fact that they get reassigned if/when you export your objects to another
storage type (for example from File Storage to Berkeley). This isn't
necessarily the worst thing in the world, but it is a bit of a wart.
Especially if you expect to be able to use the OID as a link to data in some
other system, such as a relational database. At this point you are better
off generating your own "key" value.

Navigation in Persistent objects is identical to navigation in Python. So
you can just do "oneInvoice.customer" and the customer object is retrieved
from the ZODB transparently. (Unless it is already in memory, etc. The main
point is you don't have to worry about those details in your application
code. It is all transparent.)

ZODB is as transparent as the Java example in the white paper. So
oneInvoice.customer.name = 'Versant' would be the Python equivalent and this
name change would get persisted on the next commit().

Distributed storage is not supported by ZODB at this point. And I don't get
the impression that this is on anyone's to-do list, though rumor has it that
Jim Fulton has been heard whispering about such things
(http://lists.zope.org/pipermail/zodb-dev/2001-May/000801.html). The storage
enhancement requests/proposals that I could find are:

1. Standby (http://www.zope.org/Wikis/ZODB/StandbyStorage)
2. MixedMode (http://www.zope.org/Wikis/ZODB/MixedModeStorage)
3. Replicated
(http://dev.zope.org/Wikis/DevSite/Projects/ZEOReplicatedStorage/FrontPage).

ZODB does not have an Object Query capability. On the Zope side there is the
Catalog capability, which has some query-like features. But, imho, ZODB
really needs its own indexing and cataloging features minus the Zope
overhead. (I've just started hacking up my own versions of these to strip
out all the Zope assumptions. Yuck. I, personally, consider this a major
weakness of ZODB.)

ZODB has an Object Cache as well. Refer to the Jim Fulton paper for the gory
details:

HTML -
http://www.python.org/workshops/2000-01/proceedings/papers/fulton/zodb3.html
PDF -
http://www.python.org/workshops/2000-01/proceedings/papers/fulton/fulton-zod
b3.pdf

Hope this proves useful to someone.

---
Patrick K. O'Brien
Orbtech