Fastfull embedded transactional key-value storage engine ★ Surpasses the legendary LMDB in reliability, capabilities and performance ★ Used in hundreds of open
Fastfull embedded transactional key-value storage engine ★ Surpasses the legendary LMDB in reliability, capabilities and performance ★ Used in hundreds of open
libmdbx is an extremely fast, compact, powerful, embedded, transactional key-value database, with Apache 2.0 license. libmdbx has a specific set of properties and capabilities, focused on creating unique lightweight solutions.
Allows a swarm of multi-threaded processes to ACIDly read and update several key-value maps and multimaps in a locally-shared database.
Provides extraordinary performance, minimal overhead through Memory-Mapping and Olog(N) operations costs by virtue of B+tree.
Requires no maintenance and no crash recovery since it doesn't use WAL, but that might be a caveat for write-intensive workloads with durability requirements.
Enforces serializability for writers just by single mutex and affords wait-free for parallel readers without atomic/interlocked operations, while writing and reading transactions do not block each other.
Guarantee data integrity after crash unless this was explicitly neglected in favour of write performance.
Supports Linux, Windows, MacOS, Harmony, Android, iOS, FreeBSD, DragonFly, Solaris, OpenSolaris, OpenIndiana, NetBSD, OpenBSD and other systems compliant with POSIX.1-2008.
Compact and friendly for fully embedding. Just a few flat source code files. Here no internal threads nor server process(es), but implements core part of the Berkeley DB API with many powerful extensions.
Historically, libmdbx is a deeply revised and extended descendant of the legendary Lightning Memory-Mapped Database. libmdbx inherits all benefits from LMDB, but resolves some issues and adds a large set of improvements.
Please rely on the libmdbx.dqdkfa.ru site with FAQ, Tips, Rules/Checklists, Knowledge base, references for
C++andCAPI, etc.
Key-value data model, keys are always sorted.
Multiple key-value tables/sub-databases within a single datafile.
Range lookups, including range query estimation.
Efficient support for short fixed length keys, including native 32/64-bit integers.
Ultra-efficient support for multimaps. Multi-values sorted, searchable and iterable. Keys stored without duplication.
Data is memory-mapped and accessible directly/zero-copy. In-memory fullscan of database records is extremely-fast.
Transactions for readers and writers, ones do not block others.
No transaction conflicts nor deadlocks since writes are strongly serialized.
Readers are non-blocking, notwithstanding snapshot isolation.
Reads scale linearly across CPUs.
Both explicit defragmentation and continuous zero-overhead database compactification.
Automatic on-the-fly database size adjustment.
Olog(N) cost of lookup, insert, update, and delete operations by virtue of B+ tree characteristics.
Improbably fast and robust get(key) operations accelerated by shareable lockfree cache.
Online hot backup.
Append operation for efficient bulk insertion of pre-sorted data.
No WAL nor any transaction journal. No crash recovery needed. No maintenance is required.
Flexible transaction API with support for nested transactions.
Customizable database page size.
256 (mostly for testing), maximum 65536 bytes, default 4096 bytes.0, maximum ≈½ pagesize (2022 bytes for default 4K pagesize, 32742 bytes for 64K pagesize).0, maximum 2146435072 (0x7FF00000) bytes for maps, ≈½ pagesize for multimaps (2022 bytes for default 4K pagesize, 32742 bytes for 64K pagesize).1327217884 pages (4.944272 TiB for default 4K pagesize, 79.108351 TiB for 64K pagesize).2147483648 pages (≈8.0 TiB for default 4K pagesize, ≈128.0 TiB for 64K pagesize).32765.libmdbx uses shadow paging instead of WAL. Thus syncing data to disk might be a bottleneck for write intensive workload.
libmdbx uses copy-on-write for snapshot isolation during updates, but read transactions prevents recycling an old retired/freed pages, since it read ones. Thus altering of data during a parallel long-lived read operation will increase the process work set, may exhaust entire free database space, the database can grow quickly, and result in performance degradation. Try to avoid long running read transactions, otherwise use transaction parking and/or Handle-Slow-Readers callback.
libmdbx is extraordinarily fast and provides minimal overhead for data access, so you should reconsider using brute force techniques and double check your code. On the one hand, in the case of libmdbx, a simple linear search may be more profitable than complex indexes. On the other hand, if you make something suboptimally, you can notice detrimentally only on sufficiently large data.
For now please refer to chapter of "BoltDB comparison with other databases" which is also (mostly) applicable to libmdbx with minor clarification:
The full list of all bindings (several dozen) is available in the Bindings and Projects section of the libmdbx homesite; here are only a few high demand.
| Runtime | Repo | Author |
|---|---|---|
| Rust | libmdbx-rs | Artem Vorotnikov |
| Go | mdbx-go | Alex Sharov |
| .NET | libmdbx-dotnet | Anton Maisak |
| CPython | PyPi/clibmdbx | @jyj117 |
| Python | PyPi/libmdbx | Lazymio |
| NodeJS | mdbxmou | Igor Ikonopistsev |
| Zig | mdbx-zig | Sayan J. Das |
Since December 2025 libmdbx is available only in an amalgamated source code form like SQLite, without additional dependencies and internal resources needed only for development of libmdbx itself. Packages support for common Linux distributions is planned in the future, since release the version 1.0.
The source code is available on SourceCraft and mirror on GitHub.
Please use the stable branch or the latest release for production environment through staging and the master branch for development a derivative projects.
Source code provides build through the use CMake or GNU Make with bash.
All build ways are completely traditional and have minimal prerequirements like build-essential, i.e. the non-obsolete C/C++ compiler and a SDK for the target platform. Obviously you need building tools itself, i.e. git, cmake or GNU make with bash. For your convenience, make help and make options are also available for listing existing targets and build options respectively.
So just using CMake or GNU Make in your habitual manner and feel free to fill an issue in the case something will be unexpected or broken down.
Amalgamated source code does not contain most of the tests and other internal components for several reasons. You can find explanations of the reasons in the comments to the presentation of libmdbx roadmap on the eve of 2026. However, an extended example of using the C++ API will be added soon, which can also be used as a simple smoke-test.
By default libmdbx track build time via MDBX_BUILD_TIMESTAMP build option and macro. So for a reproducible builds you should predefine/override it to known fixed string value. For instance:
make MDBX_BUILD_TIMESTAMP=unknown ...cmake -DMDBX_BUILD_TIMESTAMP:STRING=unknown ...Of course, in addition to this, your toolchain must ensure the reproducibility of builds. For more information please refer to reproducible-builds.org.
There are no special traits nor quirks if you use libmdbx ONLY inside the single container. But in a cross-container(s) or with a host-container(s) interoperability cases the three major things MUST be guaranteed:
No open issues yet, or sync has not completed.