Symas Lightning Memory-mapped Database
An ultra-fast, ultra-compact, crash-proof key-value embedded data store.
LMDB is an extraordinarily fast, memory-efficient database developed by Symas for the OpenLDAP Project. With memory-mapped files, it has the read performance of a pure in-memory database while retaining the persistence of standard disk-based databases. In other words, it runs like a bat out of hell, performing several times faster than other DB engines — several orders of magnitude faster in many cases. No buffers or caches needed, no memory copies generated. And it’s only limited to the size of the virtual address space, not to the size of physical RAM.
Bottom line, with only 32KB of object code, LMDB may seem tiny. But it’s the right 32KB. Compact and efficient are two sides of a coin; that’s part of what makes LMDB so powerful.
The features at a glance:
- Ordered-map interface (keys are always sorted; range lookups are supported)
- Fully-transactional, full ACID semantics with MVCC
- Reader/writer transactions (readers don’t block writers; writers don’t block readers)
- Fully serialized writers (writes are always deadlock-free)
- Extremely cheap read transactions, which can be performed using no mallocs or any other blocking calls
- Multi-thread and multi-process concurrency supported; environments may be opened by multiple processes on the same host
- Multiple sub-databases may be created with transactions covering all sub-databases
- Memory-mapped, allowing for zero-copy lookup and iteration
- Maintenance-free (no external process or background cleanup or compaction required)
- Crash-proof (no logs or crash recovery procedures required)
- No application-level caching (LMDB fully exploits the operating system’s buffer cache)
- 32KB of object code and 6KLOC of C
- Licensed under the OpenLDAP Public License