Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


A Fistful of DBM's

December 18, 2000

When Perl stores your hash to disk using dbmopen, it is actually relying on a particular DBM system, known as either ODBM or NDBM. The latter, or the "old DBM", was the original DBM system distributed with Perl. Newer implementations of Perl use NDBM or -- wait for it -- the "new DBM". The old DBM, for example, was slower. The new DBM is faster. Also, the old DBM had a very limited storage capacity -- less than 1K for each value. The new DBM supports storage capacities ranging from 1 to 4K depending on the Perl distribution.

Yet, ODBM and NDBM aren't the only DBM's out there. You can actually use any available DBM to tie your hash to disk. Other DBM's may offer advantages in speed, or storage capacity, or other features that we'll soon see. Remember that DBM's are independent of and incompatible with each other, and if you tie a hash to one type of DBM, you can't simply use that hash with another DBM system.

Many Perl distributions come with additional DBM's, or you can find them at CPAN, the Perl module repository. In particular, four alternative DBM's are commonly used with Perl.

SDBM is the "simple DBM", and is optimized for speed with a small storage capacity per value. Worth considering for large hashes with small values.

GDBM is the Gnu Free Software Foundation implementation of DBM. It offers several advances over the other DBM's, including compatibility with GDBM databases used on many platforms. GDBM is also very fast, and features some synchronization support for shared DBM's which may be accessed by multiple users simultaneously.

DB_File is the module name for BerkeleyDB version 1. This is an even more sophisticated DBM which is fast, supports large values, and offers several different storage architectures: normal hashes, BTrees, and disk-based arrays. We'll take a closer look at DB_File shortly.

BerkeleyDB is the DBM module for BerkeleyDB versions 2 and 3. As you can imagine, these DBM's are the most advanced, and are evolutions from version 1 of this software.

The Humble Hash as DB
The Perl You Need to Know
Tie a Yellow Ribbon ...


Up to => Home / Authoring / Languages / Perl / PerlfortheWeb




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers