[ZODB-Dev] what appears inside zodb storage?

David McCusker david@osafoundation.org
Wed, 18 Dec 2002 18:19:30 -0800


I wonder whether someone can verify my current understanding of what appears
inside a zodb storage like file storage.  (If other storages have contents
that differ substantially, this would be good to know in some detail.)

I understand a storage contains mainly a collection of pickled objects,
where each object has an oid, and an index that maps oids to objects.
In addition to this, there are transacted updates to the objects.

Maybe an updated object is updated by writing a new version entirely, and
making the map cause the oid to refer to the new version while leaving the
old one alone (without deleting it), so packing is needed to make storage
smaller.

So my theory is that a file storage contains pickled objects and a map of
oids to those objects, and maybe old stale versions of objects, and a
chained linked list of transactions that allow earlier views of the world
to be taken instead of the last one.

When zope btrees are used and these are stored persistently (are they
always stored persistently?) where are the btrees stored?

Maybe I should be reading the code to verify this model, but I was hoping
someone on this list could correct me so when I describe this to Chandler
folks I can get it right.

My motivation for asking today is a desire for versions in Chandler that
support synchronization and replication.  A simple transaction model
(which zodb might have, but I don't know) need only have a way to indicate
which version of an object should apply for a given transaction.  It need
not make it easy to consult specific versions of an object.

In a Chandler discussion this morning, we had half an idea we'd be
journaling our object changes in a fashion independently of zodb in order
to support our needs for synchronizing repositories that have different
modified branches of some comman ancestor version.

In order for me to come up with a correct description of what we need
and why, it would help to know exactly what is inside a zodb storage, so
when other things are needed too, we can say what zodb does not cover.

-- David McCusker