# 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

| Capability | What it gives you |
| --- | --- |
| `MODE APPEND`, `MODE UPSERT`, `MODE VERSIONED` | Event logs, keyed current state, and keyed state with its full version history. An APPEND table carries no primary key. |
| Attribute groups | Several producers write one row, each its own group; a group patch leaves the other groups untouched. |
| `VALID BY` and `REVISION BY` | The version that wins is decided by declared coordinates, per table or per group, never by arrival order. |
| `AS OF COMMIT` reads | Read a table exactly as it was at an earlier commit. |
| Indexes | `MINMAX`, `BLOOM` and `POSTINGS`, scoped to current state, history or both. An index never changes an answer. |
| Storage profiles and codecs | `ROW`, `COLUMNAR`, `HYBRID` per table; per-column encodings and codec chains. |
| Partitions and shards | `SHARD BY` with a shard count or `SHARDS AUTO`; time partitions with `PARTITION BY`. |

## Derived state and streaming

| Capability | What it gives you |
| --- | --- |
| `CREATE TRANSFORMATION` | A 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 views | Engine-owned targets kept current and read by name. |
| Logical views | Named queries for batch reads and streams. |
| `STREAM SELECT` | A snapshot followed by exact changes, over a table or a `TUMBLE`, `HOP` or `SESSION` window, with `WHERE`, `GROUP BY`, `ORDER BY` and `LIMIT`. |
| Emit triggers | `EMIT AFTER WINDOW CLOSE`, `EMIT PERIODIC`, `EMIT ON UPDATE WITH BATCH` and `EMIT PER EVENT`. |
| PSI | Every committed change is published once to every index, view, transformation and stream that reads it. |

## Transactions and consistency

| Capability | What it gives you |
| --- | --- |
| Atomic statements | Every statement commits atomically and durably. |
| Multi-statement transactions | `BEGIN`, `COMMIT` and `ROLLBACK` group several statements into one atomic unit. |
| Exact derived state | A derived definition is exact: its target always equals the definition over its sources. |

## Replication, availability and recovery

| Capability | What it gives you |
| --- | --- |
| Write-ahead log | A write is acknowledged once it is durable. |
| Replication and failover | Tablets are replicated across nodes and a replica takes over when a node is lost. |
| Tablet placement | Tablets move, split and merge as data grows. |
| Backup and restore | Consistent backups of a node's tables and restore to a new node. |
| Graceful stop | A stopping node drains in-flight work before it exits. |

## Security and federation

| Capability | What it gives you |
| --- | --- |
| Users, passwords and API keys | `CREATE`/`ALTER`/`DROP USER` and `API KEY`; a password is passed as a parameter and never appears in query history. |
| Roles and grants | Read, write and subscribe rights per relation. |
| Federation | One instance reads another's tables through a source, under an application access whose grants carry a row policy. |
| Settings | The `SETTINGS` clause on a query, `SET` and `RESET` on a session, and node settings with their origin. |

## Operations and clients

| Capability | What it gives you |
| --- | --- |
| HTTP and WebSocket | `POST /sql` and the write routes over HTTP; multiplexed requests and streams over `GET /client`. |
| TypeScript client `@nyxdb/client` | Both result forms, bearer-to-session exchange, bounded batch writes and resumable bulk loads. |
| System relations | Read-only `system.*` relations for tables, transformations, sessions, settings and more; see [System relations](/docs/operations/system-tables). |
| Functions | A large function library; see the [function reference](/docs/functions). |

See [Deployment topologies](/docs/operations/supported-boundaries) for how a
deployment is laid out.

---

Source: https://nyxdb.io/docs/capabilities/
