Skip to main content
DB

Documentation

Capabilities

What NYXDB provides — tables and versions, attribute groups, transformations, streaming queries, transactions, replication, federation, security and operations.

NYXDB is a SQL database whose tables keep exact current and versioned state, and whose transformations, materialized views and streaming queries are maintained continuously from every committed write.

The examples throughout these docs use two tables: balances, a VERSIONED table of token balances per address, and transfers, an APPEND table of token transfers.

Tables and state

CapabilityWhat it gives you
MODE APPEND, MODE UPSERT, MODE VERSIONEDEvent logs, keyed current state, and keyed state with its full version history. An APPEND table carries no primary key.
Attribute groupsSeveral producers write one row, each its own group; a group patch leaves the other groups untouched.
VALID BY and REVISION BYThe version that wins is decided by declared coordinates, per table or per group, never by arrival order.
AS OF COMMIT readsRead a table exactly as it was at an earlier commit.
IndexesMINMAX, BLOOM and POSTINGS, scoped to current state, history or both. An index never changes an answer.
Storage profiles and codecsROW, COLUMNAR, HYBRID per table; per-column encodings and codec chains.
Partitions and shardsSHARD BY with a shard count or SHARDS AUTO; time partitions with PARTITION BY.

Derived state and streaming

CapabilityWhat it gives you
CREATE TRANSFORMATIONA target table, or one of its attribute groups, kept current from every committed write: filters, GROUP BY folds, LOOKUP, INNER, LEFT and ASOF LEFT joins, chained from one transformation into the next.
Materialized viewsEngine-owned targets kept current and read by name.
Logical viewsNamed queries for batch reads and streams.
STREAM SELECTA snapshot followed by exact changes, over a table or a TUMBLE, HOP or SESSION window, with WHERE, GROUP BY, ORDER BY and LIMIT.
Emit triggersEMIT AFTER WINDOW CLOSE, EMIT PERIODIC, EMIT ON UPDATE WITH BATCH and EMIT PER EVENT.
PSIEvery committed change is published once to every index, view, transformation and stream that reads it.

Transactions and consistency

CapabilityWhat it gives you
Atomic statementsEvery statement commits atomically and durably.
Multi-statement transactionsBEGIN, COMMIT and ROLLBACK group several statements into one atomic unit.
Exact derived stateA derived definition is exact: its target always equals the definition over its sources.

Replication, availability and recovery

CapabilityWhat it gives you
Write-ahead logA write is acknowledged once it is durable.
Replication and failoverTablets are replicated across nodes and a replica takes over when a node is lost.
Tablet placementTablets move, split and merge as data grows.
Backup and restoreConsistent backups of a node's tables and restore to a new node.
Graceful stopA stopping node drains in-flight work before it exits.

Security and federation

CapabilityWhat it gives you
Users, passwords and API keysCREATE/ALTER/DROP USER and API KEY; a password is passed as a parameter and never appears in query history.
Roles and grantsRead, write and subscribe rights per relation.
FederationOne instance reads another's tables through a source, under an application access whose grants carry a row policy.
SettingsThe SETTINGS clause on a query, SET and RESET on a session, and node settings with their origin.

Operations and clients

CapabilityWhat it gives you
HTTP and WebSocketPOST /sql and the write routes over HTTP; multiplexed requests and streams over GET /client.
TypeScript client @nyxdb/clientBoth result forms, bearer-to-session exchange, bounded batch writes and resumable bulk loads.
System relationsRead-only system.* relations for tables, transformations, sessions, settings and more; see System relations.
FunctionsA large function library; see the function reference.

See Deployment topologies for how a deployment is laid out.

On this page