[ZODB-Dev] Perennity of ZODB format

Jim Fulton jim at zope.com
Sat Sep 25 09:14:31 EDT 2004


Paul Winkler wrote:
> On Fri, Sep 24, 2004 at 09:54:23PM +0200, Dieter Maurer wrote:
> 
>>Pierre-Yves Delens wrote at 2004-9-24 08:51 +0200:
>>
>>>...
>>>
>>>>Q.1 Do you have docs about the ZODB datas-format :
>>
>>The ZODB stores Python objects as (Python) pickles.
> 
> 
> Isn't that up to the storage?

No.

> Sure, most of the storages in use (FileStorage, DirectoryStorage)
> use pickles but that's not mandatory - see APE.
> Or maybe I misunderstood and the data first gets pickled before
> APE decides what to do with it?

As originally designed, storage API theoretically deals with
opaque strings.  The storages aren't supposed to care what's in the
strings.  In practice, the strings are pickles and some storages,
like the Berkeley storage and APE rely on this.  The storage API
should really be revised to reflect some sort of pickle explanation.

> That seems wasteful. <shrug>

It is the job of the database to do serialization.  There are
lots of details of serialization that storages should not be rsponsible
for.  APE is unusual becase it reserializes the data.  Note that, thanks
to cPickle, the upsteam serialization is quite fast.

> More to the point, the ZODB serialization format is typically something
> that the user doesn't care about at all.  Objects go in, 
> objects come out, it "just works".

Sure, at the application level, but it *is* an open documented format.

Jim

-- 
Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org



More information about the ZODB-Dev mailing list