[ZODB-Dev] A different sort of ZODB backend
Itamar Shtull-Trauring
itamar@itamarst.org
Wed, 20 Nov 2002 14:08:45 -0500
On Wed, 20 Nov 2002 13:39:14 -0500
jeremy@zope.com (Jeremy Hylton) wrote:
> ZODB's storages don't know much about the objets they store. The
> store() call gets an oid, a revision id, and a pickle. The only thing
> the storage knows about the contents of the pickle is that it can call
> referencesf on it. The ZODB Connection knows how to serialize an
> object so that it can be passed to a storage.
>
> So there's a mismatch right now between what you want to do and where
> the responsibilities lie in ZODB. It sounds like we'd need to create
> another pluggable layer that controls how ZODB serializes an object
> for storage. I think this would be a good idea. The implementation
> in ZODB4 is evolving so that all the serialization responsibility in
> one module. It seems natural to make this pluggable.
Yes, I realized after I posted that basically you would need to replace
pickle for this to work, using a serialization module that separates out
the different stages pickle does. And then like you said get ZODB to
support pluggable serialization.
Twisted has pretty generic infrastructure code for serialization (due to
having 3 serialization libraries, but that's a long story) which I might
use if I ever get around to doing this. I'll take a look when ZODB4 is
more stable.
--
Itamar Shtull-Trauring http://itamarst.org/
Available for Python, Twisted, Zope and Java consulting
***> http://VoteNoWar.org -- vote/donate/volunteer <***