[spambayes-dev] Default storage backend
Tim Peters
tim.peters at gmail.com
Mon Oct 31 21:17:30 CET 2005
[Tony Meyer]
>>> I wonder if we ought to switch to defaulting to ZODB for 1.1a2;
>>> I've been using it for over a year without any database problems
[Richie Hindle]
>> +1 provided there aren't multi-process issues - as I understand it,
>> ZODB (without ZEO) isn't multi-process safe. Which means it should be
>> fine for the POP3 proxy and (I assume?) the Outlook add-in, but maybe
>> not for the Unix side of things?
[Tony]
> Good question. ZODB will fail to open the database if another
> process already has it open.
That depends on how you open it. The actual restriction is that, in
the absence of ZEO, at most one process at a time can open a
FileStorage with write access. Any number of processes can open a
FileStorage simultaneously with read access. The only code difference
is
storage = FileStorage('Data.fs') # read/write access
vs
storage = FileStorage('Data.fs', read_only=True) # read-only access
With read-only access, you can load anything from the database, and
even change stuff (in memory), but you'll get a ReadOnlyError
exception if you try to _commit_ any changes.
> Do those people using SpamBayes in the *nix world have two SpamBayes
> processes running at the same time? I presume two reading processes
> would work fine with bsddb.
Works fine with ZODB too, provided the readers ask for read_only mode.
With ZEO, multiple processes can write too.
More information about the spambayes-dev
mailing list