[ZODB-Dev] The database root: It's a trap!

Jim Fulton jim at zope.com
Wed May 12 07:07:29 EDT 2010


A common mistake for new users is to treat the database root
object as a big collection.  There are 2 problems with this:

1. The current root object implementation isn't scalable.

2. Making the root object an application collection reduces flexibility
   because the database can effectively only have a single collection.

I think this is a problem that needs to be solved.  Some possible
solutions:

A. Change ZODB so that new databases have BTrees as root objects.

   This has the advantage that BTrees are scalable.  It has a number
   of down sides:

   - BTrees should only be used when keys are known to have a stable
     ordering.  If we had a scalable hash data structure, that would
     be better.

   - This encourages mistake 2 above.

B. Change ZODB so that the root object is a variant of persistent
   mapping that either refuses to store more than a small number of
   objects, or at least issues a warning when more than a small
   number of objects is stored.

I think I prefer B. What do other folks think? Any other ideas?

Jim

--
Jim Fulton


More information about the ZODB-Dev mailing list