Real-timeexperimental

Local-First Sync Engine

A sync engine for local-first applications. The client owns a SQLite database in the browser (via WASM), every write goes there first, and a small server reconciles edits across clients. I built this to understand whether the local-first promise (offline, instant, multiplayer, but still synced) is actually achievable for everyday CRUD apps in 2026. Short answer: yes, but conflict resolution is still where the design work lives.

SQLiteWASMIndexedDBWebSocket

What this is

A lab, not a product.

A sync engine for local-first applications. The client owns a SQLite database in the browser (via WASM), every write goes there first, and a small server reconciles edits across clients. I built this to understand whether the local-first promise (offline, instant, multiplayer, but still synced) is actually achievable for everyday CRUD apps in 2026. Short answer: yes, but conflict resolution is still where the design work lives.

5

Features

4

Learnings

4

Technologies

Capabilities

What it does

The features that actually got built and run in this prototype.

feature_01.ts
Local SQLite database via WASM with persistent storage in IndexedDB
feature_02.ts
Automatic sync to the server with a write-ahead log, not a snapshot diff
feature_03.ts
Conflict resolution strategies per-table, configurable from last-write-wins to manual merge
feature_04.ts
Offline queue management with optimistic UI and clear rollback on server rejection
feature_05.ts
Selective sync patterns sharing the same primitives as the real-time collaboration blueprint

The stack

What it is built with

The libraries and runtimes I picked for this lab and why they earned their place.

SQLite
WASM
IndexedDB
WebSocket

What I learned

Learnings, in order of how much they surprised me

The things I would tell another engineer before they tried the same experiment.

01
SQLite WASM gives you excellent query performance. The browser is genuinely a database host in 2026
02
Conflict resolution strategies depend heavily on data type. Counters, sets, and text each want different rules
03
Sync granularity has a huge impact on bandwidth. Row-level diffs beat whole-document syncs by an order of magnitude
04
Local-first changes the product, not just the architecture. Users notice the instant feel immediately

Note: This is an experimental project in the experimental stage. It is a learning exercise and technical exploration rather than a production-ready solution. Patterns and code may change.

Want me to build something like this for you?

If this kind of work fits your roadmap, I take on a small number of paid projects each quarter.