No SQL engine
Queries compose over indexed slices in memory. No joins planner, no incremental view maintenance.
syncbase is a database that runs inside your app and at the edge. Reads come from local memory. Writes apply instantly. Every change reaches every collaborator — browser tab, phone or agent — in one hop.
Reads and optimistic writes resolve against the local replica. No spinner, no loading state.
From one client's write to every subscriber: edge fan-out, sequencer, push. No polling.
Memory to answer a lookup from immutable segments with HTTP range reads.
Durable Objects and R2 are the whole backend. Nothing to provision, replicate or vacuum.
A person opens a task. Three agents start working on it. A teammate leaves a comment while the person rewrites the plan the agents are executing. Everyone is a writer, and the agents write fast, in parallel, for minutes at a time.
Request–response apps were built for one writer who waits. Bolt agents onto them and four things break.
The agent finished two minutes ago. The tab still says running, until someone refreshes.
The agent saves the row with its new status. The person saves the same row with a new title. The last request wins the whole row.
Every click is a round trip. Every agent step triggers a refetch of everything that might have changed.
Cache keys, polling, sockets, retry queues and an offline mode: five systems, each slightly wrong about the current state.
A sync engine replaces all of it with one primitive: a replicated database with a single order of events. Every client holds the data it may see, writes locally, and converges on the same sequence — people and agents alike.
The same Rust engine runs in the browser, in Workers and on mobile. One sequencer per workspace orders writes; fan-out servers at the edge push them out; immutable segments in R2 hold everything else.
The mutation lands in the optimistic overlay and the UI renders it in the same frame.
issue.save()The sequencer checks sync groups and policies, runs commands authoritatively and assigns the next seq.
validate · apply · seq++Fan-out pushes the batch only to clients whose sync groups and loaded slices match.
groups ∩ row.groupsEach client drops its overlay, applies the batch in order and replays what is still pending. Intent survives.
drop · apply · replayHot rows flush to immutable segments in R2. New clients bootstrap from the edge cache, never from a database.
L0 → L1 · CAS manifestAn agent holds a scoped replica, writes through the same API as the UI, and shows up live in front of the person who started it. syncbase gives it the primitives to do that without stepping on anyone.
Browser, Bun, Node or a Worker. The agent's writes render in the user's tab the moment they are sequenced.
Agents draft into a named overlay on top of live data. A person reviews the diff; promote or discard it in O(1).
Named commands run optimistically on the client and authoritatively on the server. Ten agents incrementing a counter get the right sum.
Token streams go into a CRDT field while a person edits the same text. Deltas merge commutatively and relay peer-to-peer.
Ephemeral awareness frames — cursors, "running tests", "reading auth.ts" — travel through the edge and never touch storage.
Every row carries sync groups. An agent's token lists the groups it may touch; it never receives anything else.
Declare classes. Mutate fields. Call save(). The rest — persistence, ordering, conflict resolution, fan-out — is the engine's job.
import { Model, model, field, hasMany, crdtField, createYjsCodec } from "@syncbase/client";
import * as Y from "yjs";
@model({ name: "Run", loadStrategy: "partial", syncGroups: (r) => [`proj:${r.projectId}`] })
export class Run extends Model {
@field({ indexed: true }) accessor projectId = "";
@field() accessor status: "queued" | "running" | "done" = "queued";
@field({ type: "number" }) accessor tokensUsed = 0;
@hasMany(() => Step, { foreignKey: "runId" }) accessor steps!: ReactiveCollection<Step>;
// Streamed by the agent, edited by the human — merged, never overwritten.
@crdtField(createYjsCodec(Y)) accessor plan!: CrdtFieldController<Y.Doc>;
}import { observer, useCollection, useAwareness } from "@syncbase/react";
export const RunView = observer(({ run }: { run: Run }) => {
const steps = useCollection(run.steps); // suspends until hydrated
const { peers } = useAwareness(`run:${run.id}`); // who is here, human or agent
return (
<section>
<header>{run.status} · {run.tokensUsed} tokens · {peers.length} watching</header>
{steps.map((s) => <StepRow key={s.id} step={s} />)}
<button onClick={() => { run.status = "done"; run.save(); }}>
Mark done {/* renders in 0 ms, syncs in one hop */}
</button>
</section>
);
});// An agent is just another client. Bun, Node or a Worker.
const store = new SyncedStore({
models: [Run, Step],
commands: [recordUsage],
userId: "agent:reviewer",
syncGroups: ["proj:42"], // sees only what its token grants
transport: new WebSocketSyncTransport({ baseUrl, token }),
});
await store.connect();
store.createOverlay("review"); // propose, don't overwrite
await store.applyLocalToOverlay("review", {
op: "patch", model: "Run", id: run.id, fields: { status: "done" },
});
await store.runCommand(recordUsage, run, { tokens: 1840 }); // intent, not a value
const plan = run.plan.doc.getText("plan");
for await (const t of llm.stream(prompt)) plan.insert(plan.length, t);// One Worker, two Durable Objects, one R2 bucket. No database.
export class WorkspaceSequencerDO { /* new WorkspaceSequencer({ sql, r2, wasm, … }) */ }
export class WorkspaceFanoutDO { /* new WorkspaceFanout({ … }) */ }
export default {
fetch: (req: Request, env: Env) =>
createSyncbaseWorker<Env>({
schema: buildSchemaDescriptor([Run, Step]),
segmentCodec: createWasmSegmentCodec(wasm),
authenticate: createJwtAuthenticator({ getSecret: (e) => e.JWT_SECRET }),
getR2: (e) => e.SYNCBASE_R2,
getSequencer: (e, ws) => sequencerClient(e.SEQUENCER, ws),
getFanout: (e, ws, shard) => fanoutClient(e.FANOUT, ws, shard),
upgradeToFanout: (req, e, auth, shard) => forwardSocket(e.FANOUT, req, auth, shard),
}).fetch(req, env),
scheduled: (_e: ScheduledEvent, env: Env) => compactAll(env), // L0 → L1 in R2
};Linear showed that a sync engine with partial loading, sync groups and a purpose-built segment store makes software feel instant. Nobody shipped that design as a library. syncbase does — and builds it on the edge instead of a database.
The same immutable segments live in R2 and in the browser's OPFS. A cold start is a cacheable range read, not a query.
Durable Objects hold the order of events; R2 holds the data. No Postgres, no logical replication, no connection pool.
Per-field last-writer-wins for records, semantic commands for intent, CRDT fields for text. Chosen per field, not per product.
Sync groups decide what a client may see; index subscriptions decide what it has loaded. Large workspaces stay light.
Named overlays share the confirmed base without copying it. Agent proposals and previews cost nothing until promoted.
The engine runs as WASM in browsers and Workers, and through UniFFI on iOS and Android. Checked with state-machine property tests, crash-consistency tests and Quint specs.
| syncbase | Postgres syncZero · Electric | Document CRDTsJazz · Automerge · Liveblocks | Event-sourced SQLiteLiveStore | |
|---|---|---|---|---|
| Source of truth | Its own engine on Durable Objects + R2 | Your Postgres | Documents merged on every peer | An event log per store |
| Writes | Optimistic and offline, rebased by seq | Through server mutators or your API | Local, merged commutatively | Local events, rebased |
| Conflicts | Per-field LWW · commands · CRDT fields | Server decides | A CRDT for every value | Event reducers |
| Partial sync | Sync groups + index subscriptions | Queries or shapes | Per document | Per store |
| Cold start | Range reads of immutable segments from edge cache | Replicate query results | Load documents | Replay or snapshot |
| To operate | A Worker and a bucket | Postgres + sync service | Sync server or hosted | Sync backend |
No magic, no hidden service. Each layer is a documented format or a class you can read.
syncbase-coreSBSEG001 · block-based · posting lists · CRC32 trailerSBW1 binary frames · JSON fallbackseq · commands · Yjs/yrs, fractional order, PN-counter, LWW-set(model, index, key)Queries compose over indexed slices in memory. No joins planner, no incremental view maintenance.
syncbase is the database of record. There is no CDC bridge from an existing database.
About 1,000 requests/s per Durable Object, batched by fan-out. Shard hot workspaces with partitioned sequencers.
Write rules are TypeScript hooks. A declarative permission language is not part of 0.1.