Live queries over WebSocket.
db.useQuery is a WebSocket subscription. Pylon walks the change log on every write and pushes the exact diff to each subscribed client, keeping the UI current without polling or cache invalidation.
import { db } from "@pylonsync/react"; function Messages({ roomId }: { roomId: string }) { // A live subscription. Re-renders the instant anyone, // anywhere, inserts or edits a matching Message row. const { data: messages } = db.useQuery<Message>("Message", { where: { roomId }, }); return messages.map((m) => <Bubble key={m.id} message={m} />);}- Subscriptions update in milliseconds because the server pushes diffs instead of waiting for clients to poll
- Local-first: reads hit an in-browser store, writes apply optimistically and reconcile
- Queue mutations offline and sync them when the connection returns
- Multi-tab coherent via a leader election over BroadcastChannel
How it works.
db.useQuery("Order")liveOn every write, Pylon walks an append-only change log and finds the affected subscriptions. Clients receive a minimal insert, update, or tombstone instead of fetching the result again. A 10,000-row table therefore updates as cheaply as a 10-row one.
What you’d otherwise wire up.
Each line is a piece teams normally assemble for this one capability. On Pylon it is part of the runtime.
- A WebSocket server, plus reconnect and backoff logic
- A client cache and the invalidation rules that keep it honest
- Optimistic update plumbing and its rollback path
- A polling loop, or an SSE fallback for browsers that drop the socket
Apps built with it.
Scaffold any of these with npm create @pylonsync/pylon.
A trading marketplace deployed from a monorepo, with listings, watchlists, an activity feed, faceted search, and per-user ownership.
A multiplayer procedural island with three.js in the browser and Pylon SSR and realtime sync on the server. Every visitor moves through the same world.
A social feed with live posts and likes, public reads, and owner-only writes.
Build it on Pylon.
One framework for your schema, sync, auth, functions, realtime, and SSR. Free to start.