layout and fields at create. If you omit them, the modality default applies and telemetry infers columns from traffic.
→ Overview · Storage
Layouts (schema shape)
Layout is the physical column shape inside the engine. It is not the modality and not the storage class.Which layouts each modality allows
jsonb is the telemetry “start flexible” layout. map is the point “sparse KV” layout. Do not send map on telemetry or jsonb on mutable.
Document and vector are the two modalities where the platform owns the column set: the upload and search surfaces read those columns by name, so fields you send at create are replaced rather than merged. The difference is what happens to anything else. A document dataspace is hybrid, so fields of your own — sent as metadata on a registration — are absorbed into overflow and read back. A vector dataspace is typed and has no overflow, because a search filter has to be a real indexed column.
Promotion ladder (telemetry)
Telemetry climbs as hot paths stabilize:jsonb— every user field in overflow. Fast to ingest; queries read JSON paths.hybrid— frequent, type-stable paths become real columns. The rest stays in overflow. The read view coalescescolumnwithoverflow.pathso you do not see a seam.typed— overflow drained, schema frozen. Surprise keys orphan. This is the gate fortiering: hot_cold.
PATCH /projects/{pid}/dataspaces/{id}/schema:
storage_class: cheap cannot promote — there is no hot MergeTree to ADD COLUMN and backfill. Freeze the schema before choosing cheap, or stay on fast.
Field catalog
Each user column is a field: apath (temperature, location.lat), a type, and a state.
Field types
Declare them in
fields at create:
Field state
On a
typed layout there is no overflow state — a mismatch is an orphan, not a new overflow field.
State hybrid overflow is queryable (the only modality where the overflow blob is a first-class read surface). ClickHouse overflow is exposed through the read view’s JSON/coalesce projection, not as a raw blob you select by default.
Dataspace schema state
The catalog also tracks a whole-dataspaceschema_state:
schema_version is monotonic. Every applied schema change bumps it. Producers and the write plane treat it as the generation of the catalog snapshot they normalized against.
Auto vs review
Attaching any edge sync target forces
review. You do not want a mirrored SQLite table silently growing typed columns on the device’s cloud replica.
List proposals: GET …/dataspaces/{id}/schema-proposals.
What happens to bad rows
Orphan is a schema problem. Late/future timestamps are a time-window problem and go to dropped-rows, not orphan.
Schema changes at runtime
Applying a schema change (promote, add typed column, freeze layout):- Writes pause briefly for this dataspace (other dataspaces in the project wait in the durable buffer — no loss).
- Engine DDL runs (
ALTERon Postgres or ClickHouse hot). - Catalog fields, Arrow schema, and JSON schema regenerate;
schema_versionincrements. - Writes resume. Readers pick up the new schema on the next cache miss.
typed → jsonb. Promotion is forward.
Natural-key columns should be declared in fields when you set natural_key, especially on state/mutable — those modalities do not invent columns from ClickHouse inference.
Related
- Dataspaces overview
- Storage —
fast/cheap,hot/hot_cold, and which layouts unlock them - Telemetry · Point · State · Mutable · Document · Vector
- API introduction