Re: [ZODB-Dev] two level cache

2007-03-29 Thread Dieter Maurer
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
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev


Re: [ZODB-Dev] two level cache

2007-03-28 Thread Benji York

Atmasamarpan Novy wrote:
A current ZODB cache will become a first level cache (L1), each ZODB 
connection maintains its own copy. When an object is needed it reads it 
from L2 cache instead from a storage. L2 cache is a common for all ZODB 
connections. Objects are stored there in the state where references are 
not yet resolved from their persistent form.


If you're using FileStorage without ZEO, then your operating system's 
disk cache will act in a way similar to what you're describing as your 
L2 cache.

--
Benji York
Senior Software Engineer
Zope Corporation
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev


Re: [ZODB-Dev] two level cache

2007-03-28 Thread Jens Vagelpohl

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On 28 Mar 2007, at 11:02, Atmasamarpan Novy wrote:

Two level cache:
A current ZODB cache will become a first level cache (L1), each  
ZODB connection maintains its own copy. When an object is needed it  
reads it from L2 cache instead from a storage. L2 cache is a common  
for all ZODB connections. Objects are stored there in the state  
where references are not yet resolved from their persistent form.


We can still have the same object replicated in respective L1  
caches, now even one more copy is in L2. But a large L2 and a  
smaller L1 could possibly lead to a more efficient caching strategy  
than it is now.


Use ZEO and you get your single L2 cache, file-based, for free...

jens



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFGCjMDRAx5nvEhZLIRAlSzAKCTBxBlGHXNOkHO5aTP7TTAES9ItwCgjjyO
ioZBNTrEPaczODj6RzRsboU=
=H6pt
-END PGP SIGNATURE-
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev