9
Lightning Memory-Mapped Database
A discussion on Twitter broke out about LMDB (Lightning Memory-Mapped Database) and I realized I’ve been using it for quite some time now and haven’t written about it as of yet. So here goes!
LMDB is a database storage engine similar to LevelDB or BDB which database authors often use as a base for building databases on top of. LMDB was designed as a replacement for BDB within the OpenLDAP project but it has been pretty useful to use with other databases as well. It’s API design is highly influenced by BDB so that replacing BDB is straight forward.
LMDB is a transactional ACID key/value storage engine (I don’t throw ACID around very easily because ACID is a strict set of guarantees and requires significant work, you can’t just put lipstick on an LSM-tree or ignore index inconsistencies and claim ACID) that is implemented using an Append-only Copy-on-write B+Tree (different than the currently popular LSM-tree based storage engines). LMDB provides:
- Nested transactions.
- Serializable Isolation (highest guarantee of I in ACID possible).
- MVCC (Multiversion concurrency control) to provide concurrency.
- Since it’s not an LSM-tree implementation, it doesn’t require compaction or clean-up processes.
- Resiliency to data corruption without requiring a transaction log. No recovery process after a restart.
- Removes the need for managing caches and cache tuning by using memory mapping.
- A single writer that never blocks readers which removes the need for complex locking and removes the possibility of deadlocks.
- Multiple readers run lockless and never block each other or the single writer.
- Support for batched writes.
Howard Chu has a great session video available that discusses the history and design of LMDB along with benchmark results. You can find some other benchmark results available here.
With any storage engine you should sufficiently test long term workloads that are similar to the characteristics of your production workload to test if LMDB is a good fit. Each storage engine behaves a little differently. Don’t judge based on benchmarks that run for minute(s). As I wrote about before, even short term workloads running for 3 hours can unlock some details that will never be seen in a 5 minute benchmark. Please do the due diligence and pick the right choice for your workload.
There are several language wrappers for LMDB.
multilizer pdf translator 8.3.2
Java
Erlang
C++
Node.js
Ruby
convert secured pdf to word file
Lua
Go
Objective-C
Recent Posts
- the evangelical universalist.epub
- Batching and pipelining linearizable operations in replicated logs
- Trick to reduce allocations improves response latency in Haywire
- Improving the protocol parsing performance in Redis
- Mencius and Fast Mencius a high performance replicated state machine for WANs
- Tuning Paxos for high-throughput with batching and pipelining
- Scalable Eventually Consistent Counters
- Create benchmarks and results that have value
- Routing aware master elections
- My new test lab
- Responsible benchmarking
- Understanding hardware still matters in the cloud
- The “network partitions are rare” fallacy
- Messaging and event sourcing
- Further reducing memory allocations and use of string functions in Haywire
- HTTP response caching in Haywire
- Atomic sector writes and misdirected writes
- How memory mapped files, filesystems and cloud storage works
- Hello haywire
- Active Anti-Entropy
Archives
- chapter 29 section 1 from appeasement to war.pdf
- September 2014
- May 2014
- pdf password remover v5.0
- para sa broken hearted.epub
- February 2014
- January 2014
- November 2013
- October 2013
- infix pdf editor 4.19 crack
- the best thing epub
- corel videostudio pro x6 tutorial pdf
- May 2013
- April 2013
- March 2013
- January 2013
- October 2012
- astrology: star connection philip s. berg.pdf
- toyota company profile pdf download
- May 2012
- fraction word problems 7th grade pdf
- cara download di qfs mobi
- January 2012
- December 2011
- September 2011
- July 2011
- June 2011
- May 2011
- April 2011
- March 2011
- February 2011
- December 2010
- November 2010
- October 2010
- September 2010
- August 2010
- July 2010
- June 2010
- May 2010






