HeadlinesBriefing favicon HeadlinesBriefing.com

LMDB 1.0 Offers Zero‑Copy, ACID Embedded Store

Hacker News •
×

The release of LMDB 1.0 brings a lean, B‑tree‑based embedded store that mirrors the Berkeley DB API while stripping out unnecessary layers. By exposing the whole database as a memory map, reads pull data directly from mapped pages, eliminating mallocs and memcpy calls. The library delivers full ACID guarantees, supports concurrent threads and processes, and runs without a dedicated page‑cache.

Writes use a copy‑on‑write scheme, so active pages never get overwritten. Only one write transaction may run at a time, preventing deadlocks, while readers operate lock‑free on a multi‑version snapshot. Because LMDB tracks free pages internally, the file size remains bounded and no write‑ahead log or compaction is required. Enabling a read‑write map boosts throughput but sacrifices the read‑only mode’s immunity to stray writes.

Developers must watch lock‑file semantics: broken locks or lingering reader transactions can block writes and cause rapid file growth. The library advises periodic calls to mdb_reader_check and warns against using LMDB on remote filesystems, where flock semantics break. Howard Chu and Symas Corp. retain copyright through 2026 under the Open LDAP Public License, permitting free use with attribution.