Home

LMDB

LMDB, short for Lightning Memory-Mapped Database, is a memory-mapped key-value store designed for high performance and data integrity. It stores all data in a single on-disk database file that is mapped into a process’s address space, enabling fast, low-latency access through normal memory operations. LMDB provides ACID transactions and supports snapshot-style reads, with read-only transactions that do not block and do not incur major overhead for concurrent access.

Architecturally, LMDB uses a B+ tree–like structure organized for memory-mapped access. Reads occur directly from the

The API is a C library, with core concepts including environments (MDB_env), databases (MDB_dbi), transactions (MDB_txn),

Key characteristics and usage: LMDB is optimized for read-heavy workloads and offers very low latency for simple

Licensing and ecosystem: LMDB is released under a permissive OpenLDAP Public License and has influenced related

mapped
memory,
while
writes
are
serialized
through
a
single
writer
transaction,
ensuring
a
consistent
commit.
Copy-on-write
semantics
protect
data
integrity
during
updates,
so
readers
can
proceed
while
a
commit
completes.
LMDB
supports
multiple
named
databases
within
a
single
environment
and
exposes
a
simple
transactional
API
that
is
designed
to
be
embedded
in
applications.
and
key/value
pairs
(MDB_val).
The
API
provides
both
read-write
and
read-only
transactions,
and
it
guarantees
durable
commits
by
flushing
changes
to
disk
at
commit
time
(subject
to
configuration
options).
Bindings
exist
for
many
programming
languages,
making
LMDB
usable
from
a
wide
range
of
ecosystems.
key-value
access.
It
is
commonly
used
as
an
embedded
database
or
cache,
suitable
for
applications
requiring
strong
consistency
and
fast
lookups.
Limitations
include
a
single-writer
constraint
that
can
bound
write
throughput
and
certain
size
and
addressing
considerations,
which
are
important
to
understand
for
large-scale
or
highly
concurrent
write
workloads.
projects
and
derivatives,
contributing
to
its
broad
adoption
in
performance-critical
storage
scenarios.