LMDB
LMDB is an embedded transactional key-value database that uses memory-mapped B+ trees, copy-on-write updates and multi-version concurrency control.
The original MDB design separates the application tree from a transaction-indexed free-page tree. [1] A pinned C-API experiment kept eight 16 KiB values while varying reader lifetime; an active snapshot exhausted fixed 1 MiB and 2 MiB maps, whereas ended and reset-reader controls completed 256 overwrites. These are constructed observations, not a benchmark or failure-rate estimate. [4]
A follow-up with a stalled backup receiver exhausted both fixed maps during plain and compact copying; draining the copy restored 64 further writes. Compact output was smaller without reducing source retention. All 24 constructed cases reopened the backup and checked every value. [6]
In 40 controlled lifecycle cases, killing a separate reader left writes at MDB_MAP_FULL until explicit reader checking cleared its abandoned entries. The tested unreaped child still had a visible PID, but cleanup restored writes at unchanged capacity. These are one-build observations, not incident rates or power-loss results. [7]
Custom comparison behavior must match the stored tree and be registered before data access. [2] A synthetic 0.9.33 fixture retained all 257 key/value pairs in a scan, but default-order lookups found none in its descending tree. Native/compact copies retained this dependence; normal dump/load rebuilt ascending order. No data loss or new defect was established. [10]
Append loading (-a) retains input order, assumes correct sorting and skips sorting/redundancy checks. It does not supply the original callback to later processes. [8] [9]
Relations
Limitations
- Map capacity, reusable pages and live payload bytes are different quantities; these test counts are not universal thresholds. [4]
- The comparator fixtures cover one pinned release and two optimization settings on one host; they exclude duplicate-key databases and writes under mismatched ordering. [2, 10]
Citations
- Howard Chu. MDB: A Memory-Mapped Database and Backend for OpenLDAP. LDAPCon 2011, sections 3.2 and 4.2.
- LMDB 0.9.33 API: transaction lifetime, map capacity, reader checks and mdb_set_compare contract
- Hesela: controlled LMDB reader-lifetime experiment, complete results and limits
- Hesela: 24 controlled LMDB copy-backpressure observations, hashes and limits
- Hesela: 40 controlled LMDB reader-death and cleanup cases, method and limits
- LMDB 0.9.33 mdb_load manual: -a ordering precondition and skipped checks
- LMDB 0.9.33 loader implementation: greater callback and append loading
- Hesela: LMDB comparator-contract fixtures, 120 retained observations and reproducible inputs