[ZODB-Dev] Notes on using wrapper storages for record transformation

Jim Fulton jim at zope.com
Fri May 21 11:52:05 EDT 2010


On Wed, May 19, 2010 at 10:40 AM, Vincent Pelletier <vincent at nexedi.com> wrote:
> Why not defining some kind of callbacks in Storage API, which would allow to
> plug such mechanisms in a storage rather than wrapping around it ?

Mainly because that would be a major change to the storage API.  The
majority of storage methods would be affected by such a change.  It
would require reimplementing all existing storages.

Also note that you often want to control where transfornations
are applied.  For example, when using ZEO, I want to normally
compress and decompress on the client, so methods like load
and store on the server shouldn't do any transformation, however,
packing and conflict resolution on the server does need to deal with
data transformations.  To handle this use case would require passing
4 callbacks.

If you want to combine transformation, for example compression and
encryption, you'd need to layer the callbacks.

Even with it's problems, a layered storage model seems cleaner to me.

Jim


--
Jim Fulton


More information about the ZODB-Dev mailing list