MapDB

maintenance

by Jan Kotek · since 2012 · also known as Map<D,B>, JDBM4

Embedded Java database exposing concurrent Maps, Sets and Queues backed by disk or off-heap memory.

key-valueembedded libraryopen source (permissive)mature

maintenance. Last release 3.1.0 (Jan 2024); 2026 activity is dependency pinning and CVE fixes on the 3.1 branch, with no new feature releases.

Overview

MapDB, by Jan Kotek, is an embedded storage engine for the JVM that hands you familiar java.util collections (HTreeMap, BTreeMap, sets, queues) persisted to a file, to memory-mapped storage or to off-heap memory outside the garbage-collected heap. It grew out of the JDBM project in 2012, and the 3.x line is written in Kotlin and Java. Optional write-ahead-log transactions, snapshots, entry expiration with size or time limits and overflow from memory to disk make it popular as a local cache, an off-heap buffer or a simple embedded key-value store. The last feature release is 3.1.0 (January 2024); 2026 commits on the 3.1 branch only pin dependencies and patch CVEs, so treat it as stable but in maintenance.

Strengths & trade-offs

Strengths

  • +Drop-in persistent replacements for java.util Map, Set and Queue
  • +Off-heap storage keeps large data out of GC pressure
  • +Expiration by time or size plus disk overflow for cache use
  • +Single dependency, Apache-licensed, widely used in JVM projects

Trade-offs

  • −No feature release since January 2024; maintenance-only
  • −Transactions are optional and limited; no query language or secondary indexes
  • −Historic format changes between 1.x, 2.x and 3.x complicate upgrades

Great for

  • +Local persistent caches and off-heap buffers in Java services
  • +Embedded key-value storage in desktop or Android apps
  • +Spilling large in-memory collections to disk

Think twice for

  • −Multi-process or networked access
  • −Workloads needing SQL, secondary indexes or strong durability guarantees

Capabilities

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

✓Transactions
✓TTL / expiry
✓In-memory
✓Durable persistence
–Joins
–Secondary indexes
–Full-text search
–Vector search
–Geospatial
–JSON
–Change data capture
–Triggers
–Stored procedures
–Materialized views
–Pub/Sub
–Columnar storage
–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
Limited ACID
Consistency
Strong
Schema
Schemaless
Architecture
Embedded, In memory
Query languages
Java collections API

Single JVM; stores can grow to large files on disk.

Deployment

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

Ecosystem

apis & protocolsJava API, Kotlin API
client languagesJava, Kotlin

Alternatives to MapDB

Compare all→
RocksDBKey-Value48.2

Meta's embeddable LSM-tree key-value engine, the storage layer under dozens of databases.

mapdb vs rocksdb →
LMDBKey-Value39.7

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

mapdb vs lmdb →
H2 DatabaseRelational23.5

Fast pure-Java SQL engine for embedded, in-memory and test databases, with compatibility modes.

mapdb vs h2 →
EhcacheKey-Value17.6

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

mapdb vs ehcache →
Chronicle MapKey-Value8.7

Off-heap, memory-mapped key-value store for Java with microsecond latency and cross-process sharing.

mapdb vs chronicle-map →
Oracle Berkeley DBKey-Value17.0

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

mapdb vs berkeley-db →

MapDB FAQ

What is MapDB?

MapDB is a key-value database by Jan Kotek, first released in 2012. MapDB, by Jan Kotek, is an embedded storage engine for the JVM that hands you familiar java.util collections (HTreeMap, BTreeMap, sets, queues) persisted to a file, to memory-mapped storage or to off-heap memory outside the garbage-collected heap. It grew out of the JDBM project in 2012, and the 3.x line is written in Kotlin and Java. Optional write-ahead-log transactions, snapshots, entry expiration with size or time limits and overflow from memory to disk make it popular as a local cache, an off-heap buffer or a simple embedded key-value store. The last feature release is 3.1.0 (January 2024); 2026 commits on the 3.1 branch only pin dependencies and patch CVEs, so treat it as stable but in maintenance.

Is MapDB open source?

Yes. MapDB is open source. License: Apache License 2.0.

Does MapDB support ACID transactions?

Partly. MapDB offers limited ACID guarantees (for example, single-record or single-partition transactions), with strong consistency.

Does MapDB scale horizontally?

MapDB 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 MapDB?

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

What is MapDB best for?

MapDB is a strong fit for local persistent caches and off-heap buffers in Java services; embedded key-value storage in desktop or Android apps; and spilling large in-memory collections to disk. Think twice for multi-process or networked access.

What are the best alternatives to MapDB?

Common alternatives to MapDB include RocksDB, LMDB, H2 Database, Ehcache and Chronicle Map. The right choice depends on your workload, scale and hosting; WhichDB's smart match ranks them against your requirements.

Is MapDB still maintained?

MapDB is in maintenance mode. Last release 3.1.0 (Jan 2024); 2026 activity is dependency pinning and CVE fixes on the 3.1 branch, with no new feature releases.

How popular is MapDB?

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