WebÞing

AnyDBM
A general-purpose DBM library for C++
(including RDBM networked DBM for C and C++)

Copyright © WebThing Ltd, 1998: all rights reserved.
Author Nick Kew.

AnyDBM uses a DBM to implement persistent objects in C++. It is developed primarily for Internet Server programming, including persistent CGI and ECGI, but is sufficiently generalised to be of possible use in other applications.

It is not "yet another DBM package", in the sense that Berkeley DB followed GDBM followed NDBM followed DBM. Rather it is a high-level templated front-end to all these DBM packages. It complements, but does not substitute, any of these packages.

Why AnyDBM?

It's happened to me - many times. My program is based on, say, Berkeley DB. I need to install it on a Client's machine. But Berkeley DB isn't there, and refuses to build cleanly, while NDBM and GDBM sit there smiling at me ...
... so I wrote a Unified Interface, and eliminated the headache!

  1. AnyDBM is a completely unified interface to the various DBM packages. The underlying implementor is merely a Template parameter. Programs written with AnyDBM can change between the different DBMs without touching the source code!
  2. AnyDBM includes RDBM-lite, enabling any AnyDBM program to work as a Network Client or as a direct DBM user, again without changing the source code. Server implementations of RDBM for each of the DBMs supported are included in the distribution.
  3. AnyDBM is templatized to store user-defined objects as opposed to just character strings (or "datum" or "DBT" types).
  4. AnyDBM offers transparent Associative Array and Iterator notation.

Implementation

AnyDBM comprises the following:

  1. Tie - A templatized Associative Array class that stores user-defined objects using a user-selected DBM implementation.
  2. BASE_DBM - Virtual Base class defining the Interface for all the implementations, and a default DBM locking regime
  3. Implementations: DB_HASH, DB_BTREE, DB_RECNO using Berkeley DB; GDBM and NDBM
  4. RDBM - A Network Client DBM implementation
  5. RDBM_C - An RDBM interface for C programmers
  6. DBServer - A template for generating Servers for RDBM
  7. rdbm rpcgen code - the physical Client-Server interface for RDBM
  8. DATUM - a class unifying the data structures required by the different DBMs.
  9. LOCKMGR - Classes implementing different locking regimes within an RDBM Server
  10. Example program, and a Server implementation (usable with any of the underlying DBMs supported).

Application

Networked DBM Authentication for the Apache Webserver:

  1. mod_auth_rdbm - Apache Module
  2. rdbmmanage - CGI (or ECGI) program for password database management.

Though also free, this is separated from the main AnyDBM package due to the different Licensing terms (Apache License).

Availability and License

AnyDBM is free software, under the terms of the GNU Library General Public License, and is available from this server.

Further Reading

(under construction)