DB
Concepts

Streams

Ordered, replayable change data that unifies historical backfill with a live tail.

Streams are NYXDB's model for change data: an ordered, replayable sequence of committed changes that subscribers can follow.

Ordering and sequence numbers

Every change carries a sequence number. This gives streams deterministic ordering and is the basis for exactly-once semantics and deduplication.

Backfill plus tail

A streaming query can start from history and then follow the live tail without a handoff seam — the same storage contract serves both. This is what lets a subscriber replay from the beginning of a stream and stay current.

SELECT symbol, price
FROM trades
STREAM HISTORICAL;   -- replay, then follow

The routing invariant

Handler chaining matches on stream:key pairs, not stream names alone. This invariant keeps fan-out precise: a subscriber to one key does not receive the entire stream.

Streams connect to indexes, materialized views, and fan-out channels through PSI, the engine's shared routing layer.

On this page