Home

MDBM

MDBM is an open-source embedded key-value database library that provides a persistent, disk-backed store using memory-mapped I/O. It is designed for high performance and a lightweight footprint, making it suitable for caching, session storage, and other workloads that require fast key-value access with simple durability guarantees. The library is written in C and offers a straightforward API for applications to create or open a database file, store and retrieve values by key, delete keys, and iterate over entries. Operations are designed to be fast and support concurrent access by multiple processes and threads through the same database file, with configuration options to tune memory usage, page size, and the size of the in-memory cache.

MDBM stores data in a hashed layout on disk, enabling efficient average-time lookups for key-value pairs. It

MDBM has been used in various open-source and embedded projects as a lightweight alternative to heavier database

uses
a
memory-mapped
representation
to
reduce
copying
and
to
allow
the
operating
system
to
manage
paging.
The
API
typically
includes
functions
to
open
or
create
a
database,
store
or
update
a
key-value
pair,
fetch
a
value
by
key,
delete
a
key,
and
close
the
database;
batch
and
iteration
helpers
are
often
provided.
systems
when
simple,
fast
key-value
storage
is
sufficient.
It
competes
with
other
embedded
stores
in
terms
of
footprint
and
performance,
and
is
commonly
chosen
for
applications
requiring
low-latency
access
to
a
compact
on-disk
store.