Welcome to ezcdb, the constant database multitool.
What you can do here:
Or read on...
The ezcdb package provides a single, easy to use command-line utility to create, query, analyze and operate on constant database files in the cdb data format.
A "constant database" is a collection of records whose values are generally considered persistent, or "constant". Meaning, they don't change often.
The cdb file format is a datafile specification originally developed by Daniel J. Bernstein, designed for fast access to disk-based keyed data. A cdb is commonly known as a "hash" database -- also an "associative array" -- where the physical location of a particular record may be directly computed from the value of its key.
A cdb may be considered as a "write-once, read-many" data file, and in fact that is exactly how it is implemented. When making any change to the data, the entire cdb file is regenerated and atomically moved into position. It is a simple paradigm that eliminates many of the complexities related to concurrency and record locking that are normally encountered in database applications. And creating a cdb file from an input source is extremely fast, typically on the order of 100 times faster when compared to generating Berkeley DB or GNU DBM datafiles.
cdb's are most suitable for applications where the data remains relatively invariant, keys are known, and data access is primarily read-only. That is, things like a user/password database, a chart of accounts for a general ledger, or a periodic table of the elements are perfect applications for a constant database.
The cdb file format is frequently encountered along the djb way, found in such packages as qmail, djbdns, and ucspi-tcp. I wanted to develop my own implementation for the libasagna library project, and put together this ezcdb utility as a result.
ezcdb is similar in purpose to the original cdb package (last released in February 2000!), but provides a contemporary update with some tasty feature candy:
Meanwhile, ezcdb retains these features:
And the author is even friendly, sort of!