Daniel J. Bernstein, a prominent figure in the world of cryptography and secure software development, has announced the release of the latest project cdb 20250121. Known for his work on projects such as qmail, djbdns, NaCl, Ed25519, Curve25519, and ChaCha20-Poly1305, Bernstein’s new project offers a data storage format and library for incorporating key/value database functions into applications. This release comes more than 25 years after the last update to cdb, which was version 0.75 released in February 2000.
The new version of cdb introduces the cdb64 format, which utilizes 64-bit types in data structures. This new format allows for the creation of databases up to an exabyte in size on 64-bit platforms, a significant increase from the previous limit of 4 GB. The database is designed to be highly compact, with a 4096-byte header and 48 bytes of service information per record (compared to 2048 bytes and 24 bytes per record in the 32-bit version). Accessing the database only requires two disk operations if the key is present, and one operation if it is not. The database also supports atomic replacement, crash resistance, and non-blocking read access.
Several other changes have been implemented in the new version, including:
- Support for building using the configure script and installation with the “make install” command.
- Removal of test script bindings to csh.
- Replacement of internal integer values with the “num” type defined as “long long”, along with updates to certain functions to work with this type.
- Separation of the software interface for working with buffers into inbuf and outbuf, as well as cleaning up the hier interface.
- Removal of definitions for unused functions and discontinuation of wrappers such as str_len, alloc, uint32, exit, error, and systype.
- Reworking of the code to eliminate the use of outdated C constructs, including old-style function definitions, empty prototypes, and the old style of main() definition.
- Inclusion of const and static definitions.
- Enabling the “-Wall” flag during the build process and cleaning up the code to address warnings.
- Enabling the -fwrapv, -fno-delete-null-pointer-checks, -fno-strict-aliasing, and -fno-strict-overflow options during compilation.