<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Maximilian Both</title>
    <description>The latest articles on DEV Community by Maximilian Both (@maximilian_both_50a58f2dc).</description>
    <link>https://dev.to/maximilian_both_50a58f2dc</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3838707%2F497deea2-38c9-451c-8398-bd84f232e229.jpg</url>
      <title>DEV Community: Maximilian Both</title>
      <link>https://dev.to/maximilian_both_50a58f2dc</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/maximilian_both_50a58f2dc"/>
    <language>en</language>
    <item>
      <title>Introducing MoltenDB: A Local-First, Pure Rust Database for the Browser and Server</title>
      <dc:creator>Maximilian Both</dc:creator>
      <pubDate>Sun, 22 Mar 2026 17:51:41 +0000</pubDate>
      <link>https://dev.to/maximilian_both_50a58f2dc/introducing-moltendb-a-local-first-pure-rust-database-for-the-browser-and-server-5ael</link>
      <guid>https://dev.to/maximilian_both_50a58f2dc/introducing-moltendb-a-local-first-pure-rust-database-for-the-browser-and-server-5ael</guid>
      <description>&lt;p&gt;First of all, apologies for being so blunt and straightforward right out of the gate, but I am super excited to finally share what I've been building.&lt;/p&gt;

&lt;p&gt;After a lot of hard work juggling a full-time job and personal life, I'm thrilled to announce the Alpha release of my first major open-source project: &lt;strong&gt;MoltenDB&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;MoltenDB is a JSON document database written completely in Rust. What makes it special is that it compiles to both a native server binary and a WebAssembly (WASM) module. This means you run the exact same query engine and use the exact same log format in your browser as you do on your backend.&lt;/p&gt;

&lt;p&gt;⚠️ &lt;strong&gt;Disclaimer&lt;/strong&gt;: This is currently in Alpha software. APIs might change, and it is not recommended for production just yet. But I am actively looking for developers to test it, break it, and provide feedback!&lt;/p&gt;

&lt;p&gt;🏗️ &lt;strong&gt;The Architecture: Two Environments, One Engine&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;In the Browser (WASM + OPFS)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;MoltenDB doesn't just store data in memory; it acts as a full document store running inside a Web Worker, ensuring zero main-thread blocking.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It persists data across page reloads using the Origin Private File System (OPFS).&lt;/li&gt;
&lt;li&gt;It handles automatic log compaction based on record counts (every 500 inserts) or file size (&amp;gt; 5 MB).

&lt;ul&gt;
&lt;li&gt;The entire engine is bundled into publishable NPM packages (@moltendb-web/core and the type-safe @moltendb-web/query builder).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;On the Server (Native Rust Binary)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;When running as a standalone backend, MoltenDB is built for speed and security.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It is an HTTPS-only server requiring TLS certificates and handles JWT authentication.&lt;/li&gt;
&lt;li&gt;Data is encrypted at rest by default using XChaCha20-Poly1305.&lt;/li&gt;
&lt;li&gt;It offers tiered storage (hot logs and cold logs with mmap reads) for large datasets (100k+ documents).&lt;/li&gt;
&lt;li&gt;You can choose between async writes (50 ms flushes for high throughput) or sync writes (flush-on-write for zero data loss).&lt;/li&gt;
&lt;li&gt;It includes a built-in WebSocket endpoint (/ws) that pushes real-time change events on every single write.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🔎 &lt;strong&gt;GraphQL-Style Querying over Plain JSON&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One of my favorite core features of MoltenDB is how it handles data fetching. Instead of over-fetching full documents or maintaining a complex GraphQL schema, MoltenDB allows you to specify exactly which fields you want back via a simple JSON API.&lt;/p&gt;

&lt;p&gt;Dot-notation works at any depth, so requesting "specs.display.features.refresh_rate" returns only that specific nested value.&lt;/p&gt;

&lt;p&gt;Here is what a typical query looks like via HTTP:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;POST /get
Content-Type: application/json
Authorization: Bearer &amp;lt;token&amp;gt;

{
  "collection": "laptops",
  "where": { "brand": { "$in": ["Apple", "Dell"] }, "in_stock": true },
  "fields": ["brand", "model", "price"],
  "count": 10,
  "offset": 0
}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Powerful Query Features:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Rich WHERE clauses&lt;/strong&gt;: Support for $eq, $ne, $gt, $lt, $contains, $in, and more.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cross-collection joins&lt;/strong&gt;: Join related documents using dot-notation foreign keys at query time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Inline references (extends)&lt;/strong&gt;: Embed data from another collection directly at insert time for O(1) reads later.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Auto-indexing&lt;/strong&gt;: If you query a field 3 or more times, MoltenDB automatically builds an index for it, turning equality lookups into O(1) operations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Document Versioning &amp;amp; Conflict Resolution&lt;/strong&gt;: Every document automatically gets a _v (version counter), createdAt, and modifiedAt. Incoming writes with older or equal versions are silently skipped to handle conflicts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🗺️ The Roadmap (and Anti-Goals)&lt;/p&gt;

&lt;p&gt;As a solo developer, I'm moving at a sustainable pace to keep the architecture clean. Here is what is coming next:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Multi-Tab WASM&lt;/strong&gt;: Implementing Leader Election so multiple browser tabs can share the OPFS engine seamlessly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mobile Native Modules&lt;/strong&gt;: Compiling the Rust core via FFI/JNI to bring this local-first database natively to React Native and Flutter.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Robust Sync&lt;/strong&gt;: Two-way delta sync between the browser and server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Transactions&lt;/strong&gt;: ACID multi-key writes (BEGIN, COMMIT, ROLLBACK).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What I will not be building:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To keep MoltenDB incredibly fast and lightweight, I am strictly avoiding bloat.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No Natural Language Queries (NLQ): While AI is trendy, baking NLQ or vector engines into MoltenDB would destroy the lightweight footprint of the WASM build.&lt;/li&gt;
&lt;li&gt;No Heavy Data Transformations: Operations like map or flatMap belong in your application layer, allowing the query engine to focus purely on retrieving your data as quickly as possible.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🚀 &lt;strong&gt;Try It Out&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You don't even need to install anything to try the WASM version.&lt;br&gt;
👉 &lt;a href="https://www.google.com/search?q=https://stackblitz.com/~/github.com/maximilian27/moltendb-wasm-demo" rel="noopener noreferrer"&gt;Try the Live Browser WASM Demo on StackBlitz&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want to spin up the server locally, you can install it via Cargo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo &lt;span class="nb"&gt;install &lt;/span&gt;moltendb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or&lt;br&gt;
&lt;a href="https://github.com/maximilian27/MoltenDB" rel="noopener noreferrer"&gt;Download the binaries from the releases page from the main GitHub repo.&lt;/a&gt;&lt;/p&gt;

</description>
      <category>rust</category>
      <category>nosql</category>
      <category>typescript</category>
      <category>database</category>
    </item>
  </channel>
</rss>
