Message row matching { roomId }, every subscribed client gets the new result — without writing a single line of WebSocket code.
How it works
- Client opens a WebSocket to the Pylon server.
useQuerysends asubscribeframe with the entity and filter.- Server runs the query once, returns the initial result, and adds the subscription to its index.
- On every mutation, Pylon’s change log walks all active subscriptions whose filter matches the changed row and pushes the diff.
- Client applies the diff locally and React re-renders.
Filters
Filters map to indexed columns. Equality is always fast; inequality and range scans require an index on the queried columns.Typed queries
With codegen,db is fully typed to your schema:
Pagination
Live pagination works; each page is its own subscription:Policies apply
Live queries respect policies. A subscribed client only receives rows it’s allowed to read. If a row becomes readable (or unreadable) due to a policy re-evaluation, the subscription updates.Performance
Pylon maintains an index of active subscriptions keyed by entity + indexed filter fields. A write that affects N matching subscriptions is O(N), not O(all subscriptions). Practical numbers:- Tens of thousands of concurrent subscriptions per server
- Sub-millisecond fan-out per subscriber
- Writes stay fast because the subscription index is kept small via the schema’s declared indexes
bench example to measure for yourself.
Falling back to non-live
Sometimes you want a one-shot read without the subscription overhead:Next
Realtime architecture
How the sync layer is built.
React SDK
All the hooks the client exposes.