[ZODB-Dev] nontransactional, oid, and thread safety. oh my!

Randy randito at gmail.com
Wed Sep 29 22:34:44 EDT 2004


I am investigating using ZODB 3.2 for a web based application.  I plan
to use ZODB with a FileStorage.

I have a first pass implementation up and running; however, I have
some questions, that maybe the gurus could help me with.

1)  Is there a way to disable transactions?  My app is write intensive
and the writes are causing the database to get VERY large, in a short
period of time.  I could implement a daily pack() strategy to minimize
the size, but that's not the solution to fit my problem.

Transactions are not a requirement for my application; is there way to
disable transaction in FileStorage?  If not, are they any good Storage
implementations that don't do transactions?  Or should I roll my own?


2)  Entries written into the database have a unique id.  If you glance
at the transaction data, you see "oid" references, that uniquely
identifies these database entities.

Are those oid's publicly available?  I'm using an incrementing counter
stored in the database, for my id's.  However, I'd much rather use the
ones in the database.


3).  Thread safety.  What are some best practices can follow to make
database writes and reads thread safe?  I've read about some of the
strategies that ZODB uses to handle conflicts, including "try it 3
times" and providing "resolution hooks" in case it fails.  I've also
read about using a connection object for each thread.

Any recommendations from the trenches?  I could always roll my own
connection pool, and hand those out to threads wanting to read/write
from the database.

Thanks!


Randy


More information about the ZODB-Dev mailing list