{
  "slug": "lmdb",
  "term": "LMDB",
  "aliases": [
    "Lightning Memory-Mapped Database"
  ],
  "definition": "LMDB is an embedded transactional key-value database that uses memory-mapped B+ trees, copy-on-write updates and multi-version concurrency control.",
  "note": "The original MDB design separates the application tree from a transaction-indexed free-page tree. [chu] Our pinned C-API experiment kept eight 16 KiB values while varying reader lifetime; an active snapshot exhausted fixed 1 MiB and 2 MiB maps, whereas ended and reset-reader controls completed 256 overwrites. These are constructed observations, not a benchmark or failure-rate estimate. [hesela-observation]",
  "related": [
    "lmdb-reader-table",
    "copy-on-write",
    "snapshot-isolation"
  ],
  "status": "shipping",
  "advantages": [],
  "limitations": [
    {
      "text": "Map capacity, reusable pages and live payload bytes are different quantities; these test counts are not universal thresholds.",
      "citationIds": [
        "hesela-observation"
      ]
    }
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-10-16",
  "citations": [
    {
      "id": "chu",
      "title": "Howard Chu. MDB: A Memory-Mapped Database and Backend for OpenLDAP. LDAPCon 2011, sections 3.2 and 4.2.",
      "url": "https://www.openldap.org/pub/hyc/mdb-paper.pdf",
      "accessed": "2026-10-16"
    },
    {
      "id": "api",
      "title": "LMDB 0.9.33 API: transaction lifetime, reset/renew, map capacity and reader checks",
      "url": "https://github.com/LMDB/lmdb/blob/3a29a24777c82a0165de813ae696a5068b5add30/libraries/liblmdb/lmdb.h",
      "accessed": "2026-10-16"
    },
    {
      "id": "implementation",
      "title": "LMDB 0.9.33 implementation: mdb_find_oldest, mdb_page_alloc and mdb_reader_check0",
      "url": "https://github.com/LMDB/lmdb/blob/3a29a24777c82a0165de813ae696a5068b5add30/libraries/liblmdb/mdb.c",
      "accessed": "2026-10-16"
    },
    {
      "id": "hesela-observation",
      "title": "Hesela: controlled LMDB reader-lifetime experiment, complete results and limits",
      "url": "https://hesela.dev/research/lmdb-reader-lifetime.json",
      "accessed": "2026-10-16"
    },
    {
      "id": "hesela-analysis",
      "title": "LMDB readers: a stable snapshot can exhaust a fixed map",
      "url": "https://hesela.com/analyses/lmdb-readers-page-reuse-map-full/",
      "accessed": "2026-10-16"
    }
  ]
}
