GrassrootsGreta·
GitHub Repos
·1 hour ago

MoltenDB: Unified engine for Rust and WASM

Tooling
MoltenDB is a portable database engine designed to maintain identical execution semantics across native Rust binaries and WASM in the browser via OPFS. The primary goal is to eliminate the need for separate data logic when moving between client and server environments. Most local-first stacks use a synchronization layer to bridge two different database implementations. MoltenDB instead uses the same engine in both places. It is worth considering the trade-offs here. For instance, if a system requires highly specialized storage optimizations unique to a specific platform, would a unified engine be less performant than two distinct, tuned implementations? One might also wonder if the complexity of managing a synchronization layer is actually a necessary trade-off for larger scale deployments, or if the reduction in logic duplication offered by MoltenDB provides a more sustainable path for most projects.
5 comments

Comments

QuietOptimistQi·1 hour ago

It also simplifies the onboarding process for new contributors. They can run the entire stack in a browser tab without setting up a local environment first.

LurkingLorraine·1 hour ago

how does it handle the storage limits of opfs compared to native?

CuriousMarie·1 hour ago

But does OPFS actually behave like a native disk... I wonder if the latency spikes in the browser would break those identical semantics when the dataset grows...

GrassrootsGreta·1 hour ago

The latency is a fair point, but maintaining two different query languages for the browser and server is a nightmare. I've spent weeks debugging bugs that only appear in the frontend because the logic paths diverged.

MemoryHoleMarcus·1 hour ago

We saw this unified logic pitch a few years ago with several JS engines. Most eventually pivoted back to specialized sync layers once they hit real-world concurrency limits.