The DBA functions provide a single, uniform interface to a wide variety of dbm-style databases.
dbm was one of the first databases used on UNIX and UNIX-like platforms. Excellent for small applications, dbm is a lightweight database that uses a simple indexed key-value format for storing data. A variety of dbm-like databases have been developed in the years since dbm was first deployed. Often, dbm-style databases can replace flat files, offering significantly better performance and usability.
PHP supports a fair variety of dbm-style databases, including cdb, db2, db3, dbm, gdbm, and ndbm. The following list provides some details:
cdb - A fast, constant dbm-style database by D.J. Bernstein, author of the popular qmail package - http://cr.yp.to/cdb/install.html. PHP only supports read operations for cdb.
db2 and db3 - Modern dbm-style databases from SleepyCat software. Visit http://www.sleepycat.com for more information.
gdbm - The GNU dbm-style database. Visit http://www.gnu.org/software/gdbm/gdbm.html for more information.
dbm - The use of dbm with PHP is deprecated. dbm was the original Berkley dbm-style database. Check your system's manual pages for more information.
ndbm - The use of ndbm (New Database Manager) with PHP is deprecated. ndbm was developed as a successor to the Berkley dbm-style database. Check your system's manual pages for more information.
Concurrent access to the same db file may corrupt the data stored in the file. Developers should always use some kind of file locking to prevent this from happening. See the entries on flock() for information on PHP's lightweight file locking mechanism.