Sync Anchors & Delta Catch-Up
A client that goes offline and reconnects needs to recover lost state without re-downloading the entire database. Sync anchors track the exact moment each channel was last consistent, allowing your backend to serve precise delta backfills over any transport.
Re-fetching entire datasets on every reconnect scales poorly and introduces state race conditions. A sync anchor eliminates both problems by reducing catch-up to a single per-channel question: "What mutated after timestamp X?"
An anchor is a per-channel timestamp
SyncAnchorMap.How adapters transmit sync anchors
- WebSocket: Encodes anchors in the initial URL query (
?syncAnchors=...) for eager catch-up, then executes an explicitSYNC_REQUESThandshake frame after subscription confirmation. - Socket.IO: Emits
FLUX_SYNC_ANCHORon connect, followed by a channel-scopedflux_sync_requesthandshake. - SSE: Appends
?syncAnchor=<unixMs>directly to the stream endpoint URL and processes backfill events upon connection. - Supabase: Invokes the
flux_request_deltaRPC function over Postgres Realtime.
The Single-State Changelog Architecture
FluxChangelog).Every code sample on this page past this point is illustrative, shown in TypeScript and Node because that's what the Flux client and reference servers use — but nothing about the server side requires Node or JavaScript at all. Flux's adapters only care about the wire contract: specific event names for Socket.IO, specific JSON frame shapes for raw WebSockets, and specific query-string parameters for SSE. Whatever language your backend runs in — Python, Go, Ruby, Java, PHP — can implement the same single-state changelog pattern and query contract.
Supabase / Postgres Delta catch-up
Socket.IO Delta catch-up
flux_sync_request for each channel and expects a flux_sync_complete response payload containing the array of delta rows from queryChangesSince.WebSocket Delta catch-up
action: 'SYNC_REQUEST' and expects action: 'SYNC_COMPLETE' carrying the backfill rows.SSE Delta catch-up
req.query.syncAnchor, executes queryChangesSince, and streams backfill events down the open response body immediately after client registration.MongoDB Change Stream Catch-Up
FluxChangelog collection. Catch-up queries scan this collection to return deduplicated delta rows.notifyReconnect, sync, and onChannelSubscribed are all optional on the adapter contract. An adapter that implements none of them still works — it just runs in live-only mode, catching whatever happens from the moment it reconnects forward, with no retroactive catch-up for what was missed while offline. Delta catch-up is an enhancement a transport opts into.
For complete backend setups, refer to getting-started/websocket, getting-started/socketio, and getting-started/sse.