[ZODB-Dev] two level cache

Dieter Maurer dieter at handshake.de
Thu Mar 29 17:22:10 EDT 2007


Atmasamarpan Novy wrote at 2007-3-28 11:02 +0200:
> ...
>Problem:
>Current ZODB design creates a separate cache for each ZODB connection 
>(ie. a thread in zope). It means that the same object could be 
>replicated in each connection cache. We cannot do much about it since we 
>do not know in advance that a particular object will not be modified. 
>But it is a kind of waste when a number of modified objects is 
>relatively low to a number of read-only objects.

The idea to share read only objects between different connections
came up some month before.

Jim and Tim convinced me that it would not work (at least not without
lots of code insprection for C extensions handling persistent
objects (such as BTrees):

  The problem: while an object may be read only on the application
  level, it is not read only below this level:

    E.g. the ZODB will store the objects load state in "_p_changed".

  This is not multi-thread safe when different threads can do these
  updates concurrently (as would be possible when read only objects
  were shared between connections).

  Of course, this could be fixed -- but at quite some price...



-- 
Dieter


More information about the ZODB-Dev mailing list