Storage topology DDL
Experimental catalog objects for local resources, pools, and policies.
Status: Experimental
Storage topology DDL describes how the local engine maps durable roles onto resources. It does not provision disks or create remote replicas.
Topology mutation DDL requires the server to start with --data-dir. The
catalog journal beneath that directory is the durable record for resources,
pools, and policies; an in-memory server rejects these statements.
Resources
CREATE STORAGE RESOURCE nvme0 (
type = 'local_disk',
path = '/mnt/nyxdb/nvme0',
roles = ['data'],
max_bytes = 2000000000000,
node_id = 'local'
);
CREATE STORAGE RESOURCE nvme1 (
type = 'local_disk',
path = '/mnt/nyxdb/nvme1',
roles = ['data'],
max_bytes = 2000000000000,
node_id = 'local'
);The path must be mounted and writable by the NYXDB process before the resource is used.
Pools
CREATE STORAGE POOL fast (
resources = ['nvme0', 'nvme1'],
placement = 'mirror'
);Supported placement values are jbod and mirror. The current runtime is
single-node; a mirror is local storage placement, not a high-availability
replica.
Policies
CREATE STORAGE POLICY trading (
serve_pool = 'fast',
durable = {pool: 'fast'},
delta = {
flush_rows: 262144,
flush_bytes: 268435456,
flush_after_ms: 5000
},
compaction = {strategy: 'merge_tree'},
ttl = 'observed_at < now() - INTERVAL 30 DAY'
);This example omits wal and uses the engine's synthesized local WAL placement.
An explicitly named WAL pool has a narrower contract than a data pool: it must
be a non-draining jbod pool with exactly one local-disk member whose path is
exactly --data-dir. A mirrored or multi-member WAL pool is rejected, and a
second resource at the data-directory root can conflict with the synthesized
default resource. Keep the default unless the exact topology has been validated
against the target release.
A policy can also declare tiered durable placement where supported by the
release. Reference the policy from CREATE TABLE ... SETTINGS storage_policy = 'trading'.
Change and inspect topology
CREATE STORAGE RESOURCE nvme2 (
type = 'local_disk',
path = '/mnt/nyxdb/nvme2',
roles = ['data'],
max_bytes = 2000000000000,
node_id = 'local'
);
ALTER STORAGE POOL fast ADD RESOURCE nvme2;
ALTER STORAGE POOL fast DRAIN RESOURCE nvme1;
ALTER STORAGE POOL fast REMOVE RESOURCE nvme1;
SHOW STORAGE RESOURCES;
SHOW STORAGE POOLS;
SHOW STORAGE POLICIES;Drain a resource and verify evacuation before removal. The engine rejects unsafe or inconsistent transitions.
DROP STORAGE POLICY trading;
DROP STORAGE POOL fast;
DROP STORAGE RESOURCE nvme0;Dependencies must be removed first.
A storage YAML file is an import source for initial catalog state. After catalog DDL exists, the catalog is authoritative; configuration drift is reported rather than silently overwriting catalog objects.
For production layout, mount and recovery guidance, see Storage operations.