MoltenDb Web

May 20, 2026 ยท View on GitHub

MoltenDb Logo

๐ŸŒ‹ The Embedded Database for the Modern Web

This is the monorepo for MoltenDb Web โ€” a high-performance Rust engine compiled to WASM with persistent storage via OPFS.

Use it as a full-featured embedded database or as a persistent state manager โ€” your app's data survives page reloads, browser crashes, and unexpected connection loss automatically.

Interactive Demo โ€ข Original Repository โ€ข License

NPM Version License WASM


What's New in v2.0.0

Query Builder

  • Bulk Delete with .where() โ€” delete documents matching a filter clause without listing individual keys.
  • Capped Collections (.maxSize()) โ€” cap a collection to a maximum number of documents; oldest entries are evicted automatically when the limit is reached.
  • TTL Collections (.ttl()) โ€” set a time-to-live (in seconds) on a collection; documents are removed automatically after expiry.

Core Engine Performance

  • Arc<str> collection-key interning โ€” the outer DashMap key was changed from String to Arc<str>. During bulk insert and WAL replay all documents in the same collection share a single pointer instead of allocating a new String per document. Saves ~30 B per doc (~30 MB at 1 M docs) and reduces allocator pressure during startup.
  • MessagePack in-memory storage โ€” the hot document map was switched from serde_json::Value to Box<[u8]> ( MessagePack bytes). Reduces steady-state RSS for 1 M docs from ~4 GB to ~500 MB (~8ร— lower). Decoding to Value happens lazily on read; write paths encode via rmp_serde.

Demos

๐Ÿ”ฌ Interactive Query Demo (Core & Query packages)

Explore the full MoltenDb query builder in a live, zero-setup environment:

This demo lets you test the full query builder API โ€” get(), set(), update(), delete(), .where(), .fields(), .sort(), .joins(), and more โ€” directly in the browser against a real WASM-powered MoltenDb instance.

๐Ÿ…ฐ๏ธ Angular Demo App

A real-world Angular application showcasing the @moltendb-web/angular integration:

The demo app showcases two real-world scenarios:

  • /laptops โ€” A fully-featured data table with filtering, sorting, column visibility, field projection, and reactive summary stats using moltenDbResource.
  • /stress-test โ€” A benchmarking page measuring MoltenDB CRUD performance (bulk writes, reads, filtered/sorted queries, updates, and deletes) displayed as ops/sec.

Packages

This monorepo contains the following packages. Please refer to their individual READMEs for detailed documentation, usage examples, and API references.

PackageDescriptionREADME
@moltendb-web/coreCore WASM engine โ€” low-level database bindingsREADME
@moltendb-web/queryQuery builder โ€” ergonomic API on top of coreREADME
@moltendb-web/angularAngular integration โ€” reactive Signals, resources, and DIREADME
@moltendb-web/reactReact integration โ€” React hooksREADME