incremental view maintenance, anywhere
live queries, the cache, and optimistic updates — the three things every app gets wrong — handled by one small engine that runs wherever your data does: the browser, a node server, over the wire, or embedded in rust. write the query once; it stays live everywhere. the playground below is that engine — ~228 kb of wasm — running live in this tab.
scroll ↓
01 / 03
point a source at it — a table, a replication stream, an api, a queue, anything that produces rows. materialize a query and the result stays live as writes land. no polling, no re-running. the view is the cache, and it never goes stale.
02 / 03
bring in a second source — your model’s relevance scores, joined in. the same live view, now ordered by what your model thinks matters. operational data and ai output, side by side, kept current by the engine.
03 / 03
add a third source, a live reactions stream. three sources, one query, one view. each write touches one row; the engine propagates just that delta and the view updates in place. nothing re-scans — cost tracks the change, not the table.
04 / playground · live in your browser
this is the actual @rindle/wasm engine, booted in your tab. change the query with the knobs — the engine re-materializes and streams genuine incremental deltas. the code on the left is exactly what runs.
the payoff · local-first
the same engine runs on the client, over its own local database fed by a stream from the server. reads resolve locally and instantly; writes apply optimistically and the engine itself rebases them as the server confirms. same store.query…materialize() as above — only now the client computes its own result.
named mutators apply locally, synchronously — no spinner, no round-trip. the engine rebases them as the server confirms; a rejected write snaps back on its own.
a new query over already-synced rows resolves against the local db — local query resolution, zero round-trips.
the local database is the cache; the engine keeps every view derived from it exact, by construction.
proof · measured, not promised
incremental maintenance means you pay for the change, not the table. measured end to end over a real dataset, scaled 30×.
one engine · four homes
one schema, one fluent builder, one materialized-view contract — view-after-write equals a fresh query, everywhere. swap the backend, keep the code.