Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

mldbm ndbm sdbm gdbm db :: what differences

by perlcapt (Pilgrim)
on Nov 06, 2004 at 12:48 UTC ( #405754=perlquestion: print w/ replies, xml ) Need Help??
perlcapt has asked for the wisdom of the Perl Monks concerning the following question:

Because of availability or compatibility issues of different platforms and Perls (Linux, Cygwin, ActiveState), I have had to move between database (key/record) libraries. This table gives an overview of the availability of many of these. I would love to know what the under-the-cover differences are. Why are some not available on some platforms? Why are some so much faster than others?

Comment on mldbm ndbm sdbm gdbm db :: what differences
Replies are listed 'Best First'.
Re: mldbm ndbm sdbm gdbm db :: what differences
by deliria (Hermit) on Nov 06, 2004 at 17:26 UTC

    Aside from those listed in the table, there's an alternative to DB_File (DBM) in BerkelyDB.

    Both DB_File and BerkeleyDB link to the libraries from Sleepycat, but the latter links to a newer version with better support for different table types, internal locking etc.

    I've been playing around with it lateley, and a table of 12 million records can be about 3 times faster then a regular mysql-isam table.

    The difference in speeds across the different versions mostly comes from the way the data is stored and the way data is retrieved from the table using sequential lookup, hashed lookup, tree-based indexing and how it reads from the database.

    I don't know enough about those modules other than DB_File and BerkeleyDB, but the the table in the link you provided shows most implementations use custom block-sizes, whereas BerkeleyDB uses the block-size of the underlying IO system, so a diskread fetches a full with 1 read. When I changed this to a custom value performance dropped significantly


Re: mldbm ndbm sdbm gdbm db :: what differences
by simonm (Vicar) on Nov 06, 2004 at 15:03 UTC
    Each of these modules is based on a different underlying C library that provides the implementation. (They weren't written specifically for Perl.)

    Because of differences in how the C code was written, some of those are simpler to compile in a particular environment than others, or run faster or slower.

Re: mldbm ndbm sdbm gdbm db :: what differences
by mspringer (Initiate) on Nov 06, 2004 at 19:08 UTC
    Ben, Thanks for the table it is helping us figure out several compatibility issues that we were encountering. Melissa Springer

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://405754]
Approved by jfroebe
Front-paged by jfroebe
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (12)
As of 2015-11-30 21:46 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (783 votes), past polls