[Zope] Non-bloating counter/access logger solution

Chris McDonough chrism@zope.com
12 Jun 2003 10:53:47 -0400


Use a BTrees.Length.Length object.  See Products.ZCatalog.Catalog for an
example of its usage.

On Thu, 2003-06-12 at 10:46, Wankyu Choi wrote:
> Hi all,
> 
> I know the topic has been discussed a lot but I found little help so far.
> 
> I want to implement a simple counter or a complete access logger for ZOPE
> objects.
> 
> Here are my (and many others') problems regarding this:
> 
> - ZODB bloats. Whenever the value of a counter property gets updated, the
> host object is copied doubling its size.
> 
> - Too many read/write conflicts. No matter how little traffic you expect,
> you get tons of read/write conflict errors.
> 
> I thought about saving counter values/logs in an external storage like a
> MySQL table or an external file in order to dupe ZODB into thinking no
> change has been made to the object in question. But that doesn't seem so
> elegant and generic.
> 
> Please share your ideas resolving this issue.
> 
> I have yet to study the internals of ZODB, but can't it have a way to update
> only the designated properties of a persistent object? If not possible, why?
> ( to avoid bloating ZODB  ) 
> 
> Committing a whole object when its access log gets updated lead to excessive
> conflict errors. By updating only the counter property, for example, the
> odds of having conflicts would decrease to a substantial degree. 
> 
> Best regards,
> Wankyu Choi
> ---------------------------------------------------------------
>   Wankyu Choi
>   CEO/President
>   NeoQuest Communications, Inc.
>   http://www.zoper.net
>   http://www.neoboard.net
> ---------------------------------------------------------------   
> 
> 
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )