MDBM

maintenance

by Yahoo · since 2014 · also known as Yahoo MDBM

Yahoo's memory-mapped, zero-copy key-value library, a heavily tuned descendant of SGI's DBM.

key-valueembedded libraryopen source (permissive)legacy

maintenance. Last release v4.13.0 (Dec 2018); the Yahoo repo is idle and only the maintainer's fork (timrc-git/mdbm) saw fixes through 2023.

Overview

MDBM is a C/C++ key-value library that keeps its hash table in a memory-mapped file, so reads can hand back pointers straight into the mapping without copying. Yahoo ran it in production for more than a decade before open-sourcing it under the BSD license in 2014; it descends from Larry McVoy's SGI rewrite of sdbm and adds performance work, multiple locking modes, large-object support, command-line tools, tests and thorough documentation. It suits read-mostly lookup data shared by many processes on one host. The last tagged release is v4.13.0 (December 2018); since then only the original maintainer's fork has seen occasional fixes, so treat it as maintenance-only.

Strengths & trade-offs

Strengths

  • +Zero-copy reads directly from the memory-mapped file
  • +Shared safely by many processes on one host via its locking modes
  • +Over a decade of production use at Yahoo before open-sourcing
  • +Unusually complete documentation and CLI tooling for a KV library

Trade-offs

  • −No transactions or crash-consistent multi-key updates
  • −Upstream repository idle since 2018
  • −Single-host only; no replication or network protocol

Great for

  • +Read-heavy lookup tables shared across worker processes
  • +Local caches of configuration or ad/serving metadata
  • +Replacing ndbm/gdbm in C and C++ services

Think twice for

  • −Workloads needing transactions or durability guarantees
  • −Distributed or replicated data

Capabilities

Native or official first-party support · 1 of 25 tracked

✓Durable persistence
–Transactions
–Joins
–Secondary indexes
–Full-text search
–Vector search
–Geospatial
–JSON
–Change data capture
–Triggers
–Stored procedures
–Materialized views
–TTL / expiry
–Pub/Sub
–Columnar storage
–In-memory
–Compression
–Encryption at rest
–Role-based access
–Time travel
–Branching
–Online schema changes
–Streaming ingest
–Offline sync
–Runs in WebAssembly

Scale & consistency

Comfortable data size
Small · ≤ 100 GB
Horizontal scaling
None
Multi-region
No
Transactions
None
Consistency
Strong
Schema
Schemaless
Architecture
Embedded
Query languages
Key-value API

Single-host, file-backed hash; sized by available address space and page cache.

Deployment

Self-hosted Vendor-managed cloud Serverless Embedded Edge Kubernetes operator

Ecosystem

apis & protocolsC API, C++ API
client languagesC, C++

Alternatives to MDBM

Compare all→
LMDBKey-Value39.7

Tiny memory-mapped B+tree with ACID transactions and lock-free readers; reached 1.0 in 2026.

mdbm vs lmdb →
libmdbxKey-Value4.9

Heavily reworked LMDB descendant: memory-mapped ACID B+tree with auto-growing files.

mdbm vs libmdbx →
Oracle Berkeley DBKey-Value17.0

The 1990s-era embedded key-value library, now Oracle-owned, AGPL-licensed and rarely updated.

mdbm vs berkeley-db →
Kyoto CabinetKey-Value1.7

FAL Labs' C++ DBM library with hash and B+tree files; superseded by its author's Tkrzw.

mdbm vs kyoto-cabinet →
EhcacheKey-Value17.6

The standard embedded JVM cache, with heap, off-heap and disk tiers and optional Terracotta clustering.

mdbm vs ehcache →
SlateDBKey-Value19.7

Embedded LSM storage engine that writes straight to object storage like S3.

mdbm vs slatedb →

MDBM FAQ

What is MDBM?

MDBM is a key-value database by Yahoo, first released in 2014. MDBM is a C/C++ key-value library that keeps its hash table in a memory-mapped file, so reads can hand back pointers straight into the mapping without copying. Yahoo ran it in production for more than a decade before open-sourcing it under the BSD license in 2014; it descends from Larry McVoy's SGI rewrite of sdbm and adds performance work, multiple locking modes, large-object support, command-line tools, tests and thorough documentation. It suits read-mostly lookup data shared by many processes on one host. The last tagged release is v4.13.0 (December 2018); since then only the original maintainer's fork has seen occasional fixes, so treat it as maintenance-only.

Is MDBM open source?

Yes. MDBM is open source. License: BSD 3-Clause.

Does MDBM support ACID transactions?

No. MDBM does not provide ACID transactions; its consistency model is strong.

Does MDBM scale horizontally?

MDBM does not scale horizontally; it runs on a single node, so you scale it up rather than out. It is comfortable at small scale (≤ 100 GB).

How can I run MDBM?

You can self-host it and embed it in your application.

What is MDBM best for?

MDBM is a strong fit for read-heavy lookup tables shared across worker processes; local caches of configuration or ad/serving metadata; and replacing ndbm/gdbm in C and C++ services. Think twice for workloads needing transactions or durability guarantees.

What are the best alternatives to MDBM?

Common alternatives to MDBM include LMDB, libmdbx, Oracle Berkeley DB, Kyoto Cabinet and Ehcache. The right choice depends on your workload, scale and hosting; WhichDB's smart match ranks them against your requirements.

Is MDBM still maintained?

MDBM is in maintenance mode. Last release v4.13.0 (Dec 2018); the Yahoo repo is idle and only the maintainer's fork (timrc-git/mdbm) saw fixes through 2023.

How popular is MDBM?

MDBM ranks #506 of 844 databases on the WhichDB Score (1.9/100), and #80 among key-value databases. The score combines public adoption signals such as package downloads, GitHub activity, job posts and developer discussion.