Skip to content

Releases: kriszyp/lmdb-js

v2.1.0-beta1

11 Dec 17:47
Compare
Choose a tag to compare
Fix file check and binary fetching

v2.0.2

05 Dec 00:49
Compare
Choose a tag to compare
Update version

v2.0.1

30 Nov 04:22
Compare
Choose a tag to compare
Update version

v2.0.0

18 Nov 21:55
Compare
Choose a tag to compare

Producer-Consumer writes

The most central change in v2.0 is a rewrite of how data is batched and written to LMDB, implementing a true multi-thread producer-consumer protocol such that all writes are directly and immediately serialized to a binary format that the writer thread can consume in real-time. This has multiple implications (and hopefully benefits):

  • The writer thread can begin writing pending puts/deletes to LMDB (and async-txns can be queued) immediately after they have been called (in parallel to the main thread), rather than having to wait for a future event to submit the writes and start the transaction. And as more writes occur, they can continue to be queued and consumed by the writer thread as long as it is still processing a transaction. This should provide better write latency and flexibility in batching.
  • This implementation improves memory management, allowing pending writes to written and be cleared/collected from memory without having to wait for transactions to complete and events to be queued, which should be more robust for heavy writing situations, preventing overloading of the queue of operations.
  • All keys are immediately serialized using JavaScript. The (async) put/delete operations don't need to depend on a C++ for writing keys, so any errors in serializing keys are immediately triggered and since key (de)-serialization happens in JS, lmdb-js can now support custom (user-provided) key encodings (so for example, if you want a custom UUID encoder that can efficiently encode UUIDs in 16 bytes).
  • Some additional put flags can now be supported (like "append" puts) (Expose MDB_APPEND #43) in performant way.
  • The V8 "fast api" calls can be used for synchronous puts/deletes (used within async-txns).

Overlapping Sync

In lmdb-js, LMDB now supports "overlapping" syncs. This allows transactions to safely commit prior to be flushed to disk, and then the data can be flushed (and database metadata updated) after the transaction is visible and unlocked, allowing most of the disk I/O to happen in parallel with future write transactions, which can potentially provide some significant performance benefits in some heavy-write situations.

Other Performance Improvements

  • A new binary key comparison function is used that does (32-bit) word by word comparison, instead of byte by byte comparison, for faster b-tree traversals.
  • Compression is now performed in separate thread/tasks from the writes for more parallelism and speed.

Name Change

V.2+ is now published to https://www.npmjs.com/package/lmdb as its canonical NPM package. The 1.x line will continue to be available in the lmdb-store package. The repository has also been renamed to lmdb-js, to reflect the cross-platform goals of this project with Deno support coming soon (and significant internal upgrades in v2 to support this).

Other Upgrades

  • The codebase has been upgraded to ESM (and refactored to be more modular), so lmdb-js can be used with native ESM loading (of course, built CJS modules are included too). This is also one of the necessary steps in hopefully supporting Deno (#83) at some point (once their foreign function interface is complete enough to be useable).
  • Added functions for explicit batching.
  • Improved compatibility with LevelUp.

Legacy Compatibility/Changes

There aren't any intentionally substantive breaking changes to the (documented) API itself, just cleanup and removal of previously deprecated APIs. But the underlying changes are large enough that testing should be done with an update.

v1.6.14

18 Nov 15:24
Compare
Choose a tag to compare
Use published prebuildify

v2.0.0-beta4

16 Nov 12:21
Compare
Choose a tag to compare
Don't run musl build on non-alpine OS

v2.0.0-beta3

09 Nov 18:01
Compare
Choose a tag to compare
Update prebuildify

v2.0.0-beta2

05 Nov 03:13
Compare
Choose a tag to compare
Merge branch 'master' into v2.0

v1.6.13

05 Nov 14:56
Compare
Choose a tag to compare
Exclude 32-bit builds

v2.0.0-beta1

29 Oct 21:05
Compare
Choose a tag to compare
Update version