[ZODB-Dev] Re: Database size increase on commit()

Tres Seaver tseaver at palladion.com
Wed Nov 21 14:46:48 EST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

tsmiller wrote:

> This is what my gut feeling was telling me.  Before I knew ANYTHING about
> the ZODB it seemed natural and easy to just use dictionaries as data
> structures for things such as accounts, books, dialogs, etc..   But it looks
> like the database saves the entire dictionary if anything in it changes.  Is
> this correct and is this why I need to use the PersistentMappings or BTrees?

Yes, you are correct.

> Why would I use one over the other?  

Both obey the "mapping protocol" used by Python.  PersistentMapping
tries harder to work like a dict;  the various BTee variants tend to
scale better when the mapping gets large, at the cost of O(logN) lookup
behavior, vs. O(1) amortizedd for the PM.



Tres.
- --
===================================================================
Tres Seaver          +1 540-429-0999          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHRIso+gerLs4ltQ4RAhtNAKDbG3MzQXiG5cofIjmL23o/10Z80gCeMMGX
pRcV4PRFu7cg2Nmg1g8qSp8=
=H4hQ
-----END PGP SIGNATURE-----



More information about the ZODB-Dev mailing list