Overview of libmdbx
masterlibmdbx is an extremely fast, compact, and powerful embedded transactional key-value database licensed under Apache 2.0. It is designed as a lightweight solution that allows a swarm of multi-threaded processes to ACIDly read and update several key-value maps and multimaps in a locally-shared database.
Key properties include:
- Extraordinary Performance: Uses Memory-Mapping and B+tree structures for $O(\log N)$ operation costs.
- No Maintenance/Recovery: Does not use Write-Ahead Logging (WAL), meaning no crash recovery is required, though this is a consideration for write-intensive workloads requiring high durability.
- Concurrency: Enforces serializability for writers via a single mutex and provides wait-free parallel reading without atomic/interlocked operations. Reading and writing transactions do not block each other.
- Data Integrity: Guarantees data integrity after a crash unless durability was explicitly traded off for write performance.
- Portability: Supports Linux, Windows, MacOS, Harmony, Android, iOS, FreeBSD, DragonFly, Solaris, OpenSolaris, OpenIndiana, NetBSD, OpenBSD, and other POSIX.1-2008 compliant systems.
- Embedded Nature: Distributed as a few flat source files with no internal threads or server processes. It implements the Berkeley DB API with powerful extensions.