[ZODB-Dev] Storage Interfaces

Jim Fulton jim at zope.com
Thu Apr 26 19:33:57 EDT 2007


I've just checked in a fair bit of re-factoring to try to define  
reasonable storage interfaces. The results can be found at:

   http://svn.zope.org/ZODB/trunk/src/ZODB/interfaces.py?view=auto

and

   http://svn.zope.org/ZODB/trunk/src/ZEO/interfaces.py?view=auto

Some notes:

- I added a new tpc_transaction method to allow ZEO to get some  
information it needs without groping for _transaction.  Storage  
servers will still work with storages that don't have this method,  
but will log problems.  Current storage implementations should add  
this method.

- I'm not sure whether history, loadSerial, pack, and registerDB,  
should be in IStorage.  I have a feeling that packing and other  
database-management tasks should be exposed some other way.  history  
and loadSerial are fairly special, although they can be wildly  
useful. (IMO, there should be a history view for all Zope objects  
that lets one at least see the transaction history for an object even  
if looking at old data isn't supported.)  Only very specialized  
storages need registerDB AFAICT.

- See my earlier message about getExtensionMethods.

- I was able to retire a poorly documented and understood method that  
was only needed by ZEO: loadEx.

- Intentionally included version-support methods from the APIs.

- I arranged that storages that don't support undo or versions don't  
need to provide any of the methods.

I cleaned up various other sundry things along the way and identified  
some bugs, fixing at least one.

Comments on the APIs are very welcome.  Hopefully this will clarify  
some things.

One of my text tasks will be to add some documentation about  
concurrency requirements.

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