home ¦ Archives ¦ Atom ¦ RSS

NMH: An Ode to BSDDB

I've noted here and seen elsewhere usage of Sleepycat's implementation of Berkeley DB for persistent storage. I've started really pushing on an application that uses it as well, and I have to see it's a really handy tool.

  • The C level library builds easily on both Win32 and UNIX

  • Amazingly, the Java wrappers build just as easily on both platforms
  • Since BerkeleyDB uses plain old files, it's easy to back up and restore your database.
  • For the standard Python implementation, there's a wonderful module that wraps the library and makes it easy to store most Python objects straightforwardly.
  • With a little bit of work, I've got Jython using the same DB files unchanged, and pulling out Python objects written by the CPython implementation.
  • The basic API ignores concurrency, but if you need it you can make DBs sharable between threads and across process address spaces.
  • Transactions. Nuff said.
  • Exceedingly well documented
Basically I'm slogging around multi-megabyte persistent stores and accessing them in two different languages on two different platforms. Painlessly. Many current hackers knee jerk reaction to any kind of querying/persistent storage requirement is to automatically pull out MySQL. If you have relatively well understood, not too complex queries you're probably better off using Berkeley DBs.

© Brian M. Dennis. Built using Pelican. Theme by Giulio Fidente on github.