arXiv:2609.01818cs.DBSep 2026

Manuscript Offprint

arXiv:2609.01818

Zeta-Lite: A Concurrent, Branchable In-Browser SQL Database for Agentic Memory

Gene Zhang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

The browser has become a first-class database host: applications increasingly want to store, query, and reason over structured data entirely on the client — for privacy, offline operation, local-first collaboration, and, most recently, as durable memory for in-browser AI agents. The prevailing way to get SQL in the browser, compiling PostgreSQL to WebAssembly (PGlite), inherits PostgreSQL's process model: a single backend connection that executes one statement at a time and blocks. That model cannot express concurrent transactions, and it leaves richer capabilities — semantic search, graph queries, database branching — to whatever the compiled server happens to include.

We present zeta-lite, the browser form factor of the Zeta database engine: a WebAssembly build that compiles the same parser, planner, optimizer, and executor as the Zeta server down to a 2.87 MB gzipped artifact. Zeta-lite keeps the engine's log-centric asynchronous MVCC core, and this single design choice yields two capabilities no other in-browser SQL engine provides. First, overlapping snapshot-isolated transactions on a single thread: multiple transactions hold distinct read/commit timestamps and interleave, with snapshot-isolation conflict detection between them, without threads or SharedArrayBuffer. Second, copy-on-write database branching — whole-database fork, merge, and rebase — which falls out of the MVCC log almost for free and is, to our knowledge, absent from every other browser SQL engine and rare even in servers. On top of these, zeta-lite exposes a feature-complete PostgreSQL surface (joins, CTEs, window functions, JSONB with GIN indexes, full-text search, HNSW vector search, SQL/PGQ graph queries, multi-database) and snapshot-to-OPFS durability that needs no worker, no SharedArrayBuffer, and no cross-origin isolation headers. Across Chrome, Firefox, and a native reference runtime, zeta-lite sustains 268k–315k point reads/s and holds a mixed read/write workload flat over millions of operations, with in-browser throughput within ~5–15% of native. We argue that a completeness/concurrency/size trade-off usually taken for granted is not fundamental: the log-centric MVCC design collapses it, and the result is a small, fully-featured, concurrent SQL database that is an especially good fit for agentic memory — where cheap branchable state lets an agent explore, inspect, and commit or discard speculative work. This is a v0.1 preview.

Keywords: in-browser database; WebAssembly; MVCC; snapshot isolation; database branching; agentic memory; OPFS; local-first.

ACM CCS: Information systems → Database management system engines; Software and its engineering → Runtime environments; Computing methodologies → Intelligent agents.

*Correspondence: genegzhang@gmail.com.

Availability. The compiled zeta-lite engine is published to npm as zeta-lite and attached to GitHub Releases; it is free for any use, including commercial, though the engine source is closed (available separately under NDA). The hand-authored surface — the interactive SQL playground, the SQL reference, and the full evaluation apparatus used in this paper — is public in the repository above. Every measurement in §7 is reproducible from it against the published artifact, with no engine-source access required: the throughput and snapshot-isolation benchmarks (playground/bench.mjs, playground/bench.html), the in-browser soak harness (playground/endurance.html), the recorded native and two-browser soak reports (docs/benchmarks/), and the methodology (docs/benchmarks/README.md).

1 Introduction

Data has been moving toward the client. Applications that once round-tripped every query to a server increasingly want to hold structured data in the browser itself: local-first apps keep working offline and sync opportunistically; privacy-sensitive tools keep user data on the device by construction; collaborative editors resolve state locally for latency. The most recent driver is AI agents that run in the browser and need somewhere durable to keep what they learn — a memory that is queryable, structured, and private to the user's device. In all of these, the database is no longer a remote service but a component that ships with the page.

The dominant way to get real SQL in the browser today is to compile PostgreSQL to WebAssembly, as PGLite does. This is a genuine achievement and it established that the demand is real. But it inherits PostgreSQL's process architecture: a single backend connection that runs one statement at a time and blocks until it finishes. That architecture cannot represent two transactions in flight at once, so the concurrency semantics an application can rely on are limited to what a single serial connection provides. It also fixes the feature set to whatever the compiled server includes, with capabilities like semantic search, graph queries, or database branching either absent or bolted on separately.

We take a different architectural bet. Zeta-lite is the browser form factor of the Zeta database engine, a single Rust codebase that also builds as an embedded library, an OLTP/HTAP server, a cluster, and an OLAP engine. The browser build compiles the same parser, planner, optimizer, and executor to a 2.87 MB gzipped WebAssembly artifact and keeps the engine's defining feature — a log-centric asynchronous MVCC core. From that one design choice, two capabilities follow that no other in-browser SQL engine provides, and both are consequences of the same mechanism rather than separately engineered features. The first is overlapping snapshot-isolated transactions on a single thread: because a transaction's view is a timestamp over an append-only log rather than ownership of a connection, many transactions can be open at once, each on its own snapshot, interleaving at statement boundaries with snapshot-isolation conflict detection — with no threads and no SharedArrayBuffer. The second is copy-on-write database branching: whole-database fork, merge, and rebase, which the log makes nearly free because the row versioning a branch needs already exists for isolation.

On top of these, zeta-lite carries a feature-complete PostgreSQL surface — joins, CTEs, window functions, JSONB with GIN indexes, full-text search, HNSW vector search, SQL/PGQ graph queries, multi-database — and persists via a snapshot to the Origin Private File System that needs no worker, no SharedArrayBuffer, and no cross-origin-isolation headers.