[pybsddb] using a database for concurrent reads

Jesus Cea jcea at jcea.es
Sat Oct 25 19:52:02 CEST 2014


On 23/10/14 00:22, Christian Calderon wrote:
> I am totally new to using Berkeley DB, and I am trying to figure out how
> to have multiple processes reading and writing at the same time. I'm
> currently using one process which listens on a socket for requests to
> put, get, or delete data, which all my other processes must connect to
> in order to use the database. Also, I am using bsddb.hashopen to open
> the database, and I'm still figuring out how to use bsddb.db.DBEnv . I
> am using python 2.7 on Windows 7, and I installed Berkeley DB using
> Oracle's installer for version 6.1.19.
> 
> Can someone show me an example of opening a DBEnv using the DB_INIT_CDB
> and DB_INIT_MPOOL flags, and using cursor read locks and write locks to
> get and put data in a DB?

For "serious" usage I would recommend you to use transactional mode. CDB
can not survive a crash or a disk full happening at the wrong time.

I recommend you to read the Oracle documentation linked from pybsddb
site. It is really well written, interesting and full of tips and
details you should know. Berkeley DB allows you a lot of tuning and you
better know where are the turn knobs.

You will be glad of this advice :-)

-- 
Jesús Cea Avión                         _/_/      _/_/_/        _/_/_/
jcea at jcea.es - http://www.jcea.es/     _/_/    _/_/  _/_/    _/_/  _/_/
Twitter: @jcea                        _/_/    _/_/          _/_/_/_/_/
jabber / xmpp:jcea at jabber.org  _/_/  _/_/    _/_/          _/_/  _/_/
"Things are not so easy"      _/_/  _/_/    _/_/  _/_/    _/_/  _/_/
"My name is Dump, Core Dump"   _/_/_/        _/_/_/      _/_/  _/_/
"El amor es poner tu felicidad en la felicidad de otro" - Leibniz

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <https://mailman.jcea.es/pipermail/pybsddb/attachments/20141025/3caea642/attachment.asc>


More information about the pybsddb mailing list