Tuesday, November 11, 2008

getting to know Berkeley DB

getting to know Berkeley DB came upon this link:

http://simonwillison.net/2003/Nov/26/discoveringBerkeleyDB/


and this comment:


My only complaint about BerkeleyDB is that it's a wee bit flaky when not used with transactions. Databases can become corrupted, processes can deadlock, etc. I've found problems even when using CDS mode. Only problem with wrapping everything in transactions is the performance hit. So, here's what we came up with as a compromise (we use the excellent BerkeleyDB.pm module from our Perl code): lock the entire database on write with a semaphore. The overhead is negligible in terms of speed, but it's done a remarkable job of keeping our indexes very clean!


lock the entire database on write with a semaphore
???
say again?

Update (a few hours later)
i'm beginning to understand what the comment author meant....my rdbms experiece will freak out with these new ideas in berkeley db...

2 comments :

Gregory Burd said...

Hello, I'm the product manager for Berkeley DB here at Oracle (and I've been part of the Sleepycat/DB team for over five years now). I'm happy to chat directly with you about this or other DB issues. Specifically, Berkeley DB does not offer any guarantee that a database cannot become corrupted (say when you ctrl-c a process in the middle of a DB call) until you are using transactions. DB is a swiss army knife, you can get cut, we try to help you by showing you the sharp and pointy parts but it's up to you to use the tool properly. Contact me with further questions. :)

-greg (greg.burd@oracle.com)

Esdee said...

thanks, greg - i'm still learning Berkeley DB, so that article only had my first expressions (heavilly affected by my previous RDBMS experience :).
BDB fits nicely in our product stack, we do have issues, but they are mostly due to previous design errors...
great work with BDB, good luck!