[ZODB-Dev] Getting rid of ZODB versions (was Re: [ZWeb] Are Versions evil?)

Jim Fulton jim at zope.com
Thu Jul 15 10:00:26 EDT 2004


Peter Sabaini wrote:
> Are Zope Version objects evil?

I might not use the "e" word, but people should be discouraged from using them.

Versions do have their uses.  They provide a way to spread work over many
transactions.  They have a significant disadvantage however, which is that
they, by necessity, lock any objects that they modify.  This is a disaster
if there are objects, like catalogs that many independent transactions
want to modify.  Because of heavy catalog usage in recent years, versions have
become almost unusable.  As a result, many people don't use them, as a result,
they don't get much maintenance, as a result, they seem to have problems
in their implenation beyond their inherent locking problem.

Versions complicate ZODB immensly.

Most of us really want to get rid of them.  The only reason, so far, that
we haven't declared them deprecated is that there are a few hearty
souls who, with care, are able to use them and find them useful. :/
If you know what you are doing and if your situation is right, they
provide a useful function.

ZODB actually provides two mechanisms for spreading work over multiple
transactions:

- versions

- subtransactions (aka savepoints)

The two mechanisms are more or less equivalent in the presense of
multi-version concurrency control (MVCC) and in the absense of write
conflicts. In practice, versions are useless in the presense of write
conflicts and we will soon (Zope 2.8 and Zope X3.0) have MVCC.

I'm 99.9% sure (pretty darn sure for me) that the people who sucessfully
use versions would be as happy to use subtransactions if Zope was able to
maintain long-running transactions over multiple web requests. I'm pretty
sure this is doable.  Unfortunately, I won't have time to work on this
any time soon.

Given this, I'd like to formally announce the intention to deprecate
versions in both Zope and ZODB.  We will formally deprecate versions when
we have a way to maintain long-running transactions in Zope.  I have a good
idea how they would work and I'd be happy to advise volunteers on how to
proceed. Any volunteers? Any objections?

...

> Should I advise against using Versions in the Zope Book?

Yes.  I suggest that moving versions to an appendix with an
introduction explaining their problems and noting that they will
be replaced some time in the furture.

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