Paul Winkler <pw_lists@slinkp.com> wrote:
On Mon, Apr 18, 2005 at 02:38:01PM +0200, Milos Prudek wrote:
I have a couple hundred Articles (class instances) in my ZODB. Most instances are 200 kB, some are much larger. One of the Article properties is Number of times the article was read. Any increment causes ZODB to grow by the size of the given instance, due to the fact that ZODB will append a new version of the whole 200 kB or 2MB instance just because a single byte was changed.
Consequently ZODB grows several hundred MB in a single day even if no new article is added.
This calls for some form of non-undoable storage.
Is there an obvious elegant solution that I am missing?
You might consider replacing the NumberOfReaders attribute with a first-class persistent object. e.g. you could use a PersistentList or IIBTree or some such. This would prevent Zope from saving the entire Article object when that one attribute changes. You'd still get some bloat from all the historical revisions of the attribute, but it would be MUCH less.
A better candidate, rather than PersistentList, would be a BTrees.Length. Florent -- Florent Guillaume, Nuxeo (Paris, France) CTO, Director of R&D +33 1 40 33 71 59 http://nuxeo.com fg@nuxeo.com