[Zope3-dev] Re: [ZODB-Dev] ZODB4 project plan

Barry A. Warsaw barry@zope.com
Tue, 26 Nov 2002 16:53:55 -0500


>>>>> "SH" == Shane Hathaway <shane@zope.com> writes:

    >> - Would the locking mechanism be significantly more efficient
    >> or robust if it was implemented in the database?

    SH> Since the locking is per-object, locking in the database is
    SH> potentially much less efficient than application-level
    SH> locking.  To lock a tree of objects, you have to visit the
    SH> entire tree just to discover what OIDs to lock.

Which mirrors one of the major performance problems with Berkeley
storage 1.0.  Its btrees use one lock per page containing an object
that is touched (plus some overhead per-level of the btree).  Because
of BDB's static lock table we got clobbered with lock exhaustion.
We'd love to have table level locks, but in the meantime, we chuck
Berkeley's lock subsystem and use application level locks.  So in this
case, it's /more/ efficient for the application to do the locking.

-Barry