[Zope] number of objects in ZooDB
Dieter Maurer
dieter at handshake.de
Sun Dec 5 07:37:28 EST 2004
Giuseppe Bonelli wrote at 2004-12-4 16:07 +0100:
>I use ZooDB to store a fairly large amount (?) of objects and I am
>wondering if it is best from a performance point of view to have a lot
>of small object or fewer bigger. About 75% of my objects are also
>cataloged in the Zcatalog.
It depends:
Keep in mind that the ZODB loads and stores always complete
persistent objects (excluding persistent subobjects).
Thus:
* when a larger object contains information that is
usually used together, then it is more efficient to
keep the information together in a single persistent object
(because this reduces the load/store overhead).
* when on the other hand a larger object contains
information sets used for disjoint use cases
it is probably better to split it into different
persistent subobjects, because then you will load and
store less voluminous data.
Usually, avoid very small persistent objects, as persistent
references come with an overhead (you can use very small
persistent objects for special purposes).
And usually avoid very large persistent objects (as
it does not work well with the ZODB caching policy).
> ....
>Is 500.000 objects to be considered an "high" number?
No.
But, when you use "FileStorage", then an index is held in
memory that requires space proportional to the number
of objects in the storage.
500.000 objects may cost you about 5 to 10 MB of RAM.
--
Dieter
More information about the Zope
mailing list