[Cialug] OT?: DBMs

Matthew Nuzum newz at bearfruit.org
Mon Oct 29 13:00:30 CDT 2007


On 10/29/07, Stuart Thiessen <sthiessen at passitonservices.org> wrote:
> With this,
> I'm understanding that it is really a library of functions used in C,
> and C and various languages simply hook into that library to run those
> functions. If that is the case, then how does one determine the
> version number for that library?

Maybe your programming tool can tell you... this seems to work:
admin at lewis:~$ python
Python 2.4.3 (#2, Oct  6 2006, 07:52:30)
[GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import dbm
>>> dbm.library
'Berkeley DB'

> Also, I am curious if any of you have preferences about which DBM to
> use? This particular application will be read-mostly and write-
> occassionally, which as I understand is the strength of a DBM? Which
> one would you recommend if I am using both python and PHP to connect
> to that DBM and access the data? Currently, I plan to use python to
> handle a standalone application access and PHP to provide a web-based
> access.

I've used all the dbm's and assuming you're using your platform's
abstraction functions, the differences are hard to locate. Before
PHP's dbm abstraction came out I liked gdbm. I've heard that the true
Berkley DB libraries are the fastest, but I heard that via Oracle
marketing material, so who knows.

In PHP and Python you can really benefit from serializing your objects
and storing them in a dbm (I'm pretty sure that's how the berkley xml
db works). I've never tried doing this in a cross-platform way. My
inclination would be to either:
a: Simple - serialize to a common format, like json, and store it
using the dbm library that your PHP and Python program can both agree
to use
b: Less simple - try out Oracle's berkley xml db
http://www.oracle.com/database/berkeley-db/xml/index.html

I actually downloaded the xml db last week to try it out. It's *big.*
But it has xpath built in, which is kind of slick. It also has very
nice license options.

If you need multi-process/thread concurrency, things may get tricky.
That's when I'd consider using a traditional client/server database.
MySQL's isam tables are screaming fast and you don't have to worry
about concurrency. MySQL can be tailored to use very little RAM so
that you hardly notice it's running when its idle. I like PostgreSQL's
features far better, but Postgres requires far more resources when
idle (in my experience) than MySQL, making MySQL the next step up from
dbm when concurrency is needed imho.

The strength of dbm is that it is light weight and fast when you
basically need a hash table that uses little RAM (trading it for disk
space).
-- 
Matthew Nuzum
newz2000 on freenode


More information about the Cialug mailing list