Streams
The local ordered-change model behind live queries, transforms, materialized views, and PSI routing.
A stream is an ordered sequence of committed changes that an in-process subscriber can follow. Streams are the change-delivery model shared by live queries and engine maintainers; they are not a separate broker service.
Ordering
Committed changes carry local sequence information. Within the current single-node contract, sequence and commit boundaries make replay deterministic and prevent partial multi-record commits from becoming visible.
Sequence numbers do not create a production exactly-once delivery SLA. Streaming transport, reconnect continuity, and shared channels are Experimental. A client that disconnects must reconnect and reconcile from a fresh snapshot or an application-owned checkpoint.
Snapshot and tail
A live read first establishes a coherent initial result, then follows changes
that commit after its snapshot boundary. STREAM HISTORICAL SELECT can replay
one attribute stream before following its live tail. V1 requires an attribute
table and exactly one declared attribute, plus entity and axis columns. The
example table is defined in the
SELECT reference:
STREAM HISTORICAL
SELECT instrument_id, observed_at, price
FROM instrument_prices;This replay form is append-preserving; it rejects ORDER BY, DISTINCT,
LIMIT, and projections spanning independent attributes.
The engine's local snapshot-to-tail handoff is tested for gaps and duplicates. That guarantee does not extend to a lost network connection or a different node—there is no supported distributed node today.
The routing invariant
Every pipeline and DAG edge matches a stream:key pair, never a stream
name alone.
The key is part of routing identity. A subscriber for one key must not receive unrelated keys from the same stream. PSI owns this routing contract for live queries, transforms, indexes, schema/cache listeners, and future subscribers.
Streams and tables
Tables remain the system of record. A stream is how committed changes are delivered to interested in-process consumers:
committed table change
|
v
PSI stream:key
|
+-- live query
+-- transform
+-- materialized view / index maintainer
+-- schema or cache listenerDropping a source relation closes its source generation and terminates attached live cursors with a terminal error. Recreating a table with the same name creates a new generation; an old subscriber is not silently attached to it.