[Zope-dev] Non Bloating Page Counter

Casey Duncan casey@zope.com
Tue, 5 Nov 2002 17:03:39 -0500


A solution that I've employed in the past is to keep the counters in RAM=20
(perhaps in a dict stored as a module global keyed by object path) and wr=
ite=20
the values that have changed persistently every 5-10 minutes.

The drawback to this is that you can loose some counts if the server goes=
=20
down, plus the count won't be accurate across ZEO app servers sharing the=
=20
same storage (but they'll be close). I generally deal with this by readin=
g=20
the commited values rather than the volatile ones.

-Casey

On Tuesday 05 November 2002 03:55 pm, Brian R Brinegar wrote:
> Hello,
>=20
> 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 pytho=
n
> script which increments some value in zope will bloat the ZODB.
>=20
> 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.
>=20
> 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?
>=20
> Zope is transactional, but products like ZLDAPConnection have the abili=
ty
> to be "non-transactional" what does this mean? Could I use this in my
> counter?
>=20
> -Brian