
This library supports and encourages the use of conditional writes this allows for atomic operations that are dependendent on previously read data, and most transactional types of operations can be written with an optimistic-locking based, atomic-conditional-write pattern.

However, by batching writes, when a database is under load, slower transactions enable more writes per transaction, and this library is able to drive LMDB to achieve the maximum levels of throughput with fully sync'ed operations, preserving both the durability/safety of the transactions and unparalled performance.

Writing data and waiting for confirmation that has been writted to the physical medium is critical for data integrity, but is well known to have latency (although not necessarily less efficient). With the default sync'ing configuration, LMDB has a crash-proof design a machine can be turned off at any point, and data can not be corrupted unless the written data is actually changed or tampered. Consequently, lmdb-js is designed for transactions to go through this asynchronous batching process and return a simple promise that resolves once data is written and flushed to disk. On the otherhand, commiting transactions does involve I/O, and vastly higher throughput can be achieved by batching operations and executing on a separate thread.
ACID PRO 8 DENO CODE
LMDB is a memory-mapped database, reading and writing within a transaction does not use any I/O (other than the slight possibility of a page fault), and can usually be performed faster than the event queue callbacks can even execute, and it is easier to write code for instant synchronous values from reads.

In idiomatic NodeJS and Deno code, I/O operations are performed asynchronously. Lmdb-js is designed for synchronous reads, and asynchronous writes. It supports multiple types of JS values for keys and values, making it easy to use idiomatic JS for storing and retrieving data in LMDB. This library handles translation of JavaScript values, primitives, arrays, and objects, to and from the binary storage of LMDB keys and values with highly optimized native C++ code for breakneck performance. It supports both native ESM and CJS usage. This library has minimal, tightly-controlled, and maintained dependencies to ensure stability, security, and efficiency. In Deno, this package could be directly used from the deno.land lmdb module, but Node-API support is currently in-progress, so probably will require Deno v1.24+ (for older versions of Deno, you can use lmdb-js v2.2.x).
ACID PRO 8 DENO INSTALL
The standard Node-API based functions are used in all other versions and still provide excellent performance, but for absolute maximum performance on older versions of Node, you can use npm install -build-from-source. It also includes accelerated, high-speed functions for direct V8 interaction that are compiled for, and (automatically) loaded in Node v16. Lmdb-js is based on the Node-API for maximum compatility across all supported Node versions and futue Deno versions. This library is published to the NPM package lmdb (the 1.x versions were published to lmdb-store), and can be installed with: npm install lmdb Lmdb-js is used in many heavy-use production applications, including as a high-performance cache for builds in Parcel and Elasticsearch's Kibana, as the storage layer for HarperDB and Gatsby's database, and for search and analytical engine for our clinical medical research.

It provides a simple interface for interacting with LMDB, as a key-value db, that makes it easy to fully leverage the power, crash-proof design, and efficiency of LMDB using intuitive JavaScript, and is designed to scale across multiple processes or threads. This is an ultra-fast NodeJS and Deno interface to LMDB probably the fastest and most efficient key-value/database interface that exists for storage and retrieval of structured JS data (objects, arrays, etc.) in a true persisted, scalable, ACID compliant database.
