[Zope-dev] Non Bloating Page Counter

Dieter Maurer dieter@handshake.de
Fri, 8 Nov 2002 22:55:05 +0100


Brian R Brinegar writes:
 > We've had requests from several of our users for the ability to have a
 > drop in page counter within zope. However creating a page counter python
 > script which increments some value in zope will bloat the ZODB.
 > 
 > Solutions exist where values are stored on the file system or in a
 > database. Unfortunately our users don't have file system access and it is
 > unacceptable to expect them to request a database account and setup
 > database connections and methods just to create a page counter.
 > 
 > I would like to create a Page Counter product that doesn't bloat. If a
 > product is created that doesn't subclass History or UndoSupport does it
 > still bloat?
It does.

The bloat is a consequence of how "FileStorage" works (I appends
changes at the end of the file and does never override something).

You need a different storage (a non-undoable one) to prevent
this behaviour, e.g. BerkeleyStorage or OracleStorage.

When your load is light and your counter consists justs of
an integer, then your bloat is only several dozens of byte
and you may be able to live with it....


Dieter