GDBM Logo

GDBM (DBA): open-source Embedded DataStore

In computing, a DBM is a library and file format providing fast, single-keyed access to data. A key-value database from the original Unix, dbm is an early example of a NoSQL system. GNU dbm (gdbm) is a library of (embedded) database functions that use extensible hashing and works similar to the standard UNIX dbm functions. These routines are provided to a programmer needing to create and manipulate a hashed database. The basic use of gdbm is to store key/data pairs in a data file. Each key must be unique and each key is paired with only one data item. The keys can not be directly accessed in sorted order. The key/data pairs are stored in a gdbm disk file, called a gdbm database. An application must open a gdbm database to be able manipulate the keys and data contained in the database. The gdbm allows an application to have multiple databases open at the same time. When an application opens a gdbm database, it is designated as a reader or a writer. A gdbm database can be opened by at most one writer at a time. However, many readers may open the database simultaneously. Readers and writers can not open the gdbm database at the same time.
Written in: C

Download GDBM: Source Code

License: OpenSource GPL License

Project Website: gnu.org.ua/software/gdbm


Project Goals
  • Gdbm is the GNU rewrite of the library implementing ndbm features and its own interface
  • Speaking about application we usually mean a separate process ; however, it is entirely normal for a multi-thread program to operate as a GDBM reader in one thread and writer in another, provided, of course, that the two threads don’t operate on the same database simultaneously
Project Features
  • Provides new features like crash tolerance for guaranteeing data consistency
  • It is extremely fast in comparison to relational databases
  • GNU dbm files are not sparse, you can copy them with the usual cp command and they will not expand in the copying process
Project Design and Security
  • Implements a filesystem-based hash table
  • Gdbm includes a compatibility layer, which provides traditional ndbm and older dbm functions ; the layer is compiled and installed if the --enable-libgdbm-compat option is used when configuring the package ; older programs using ndbm or dbm interfaces can use libgdbm_compat without any changes