Skip to main content

Stream Data Archives

A Stream Data Archive is the unit of configuration and storage for time-series data in OctoMesh. Each archive is a versioned, typed, per-tenant CrateDB table that captures a curated set of attribute paths from a Construction Kit type. Archives have a strict lifecycle (Created → Activated → Disabled / Failed), a schema that is frozen once activated (the one exception is adding a declared column, see Conflict precedence), and a three-tier activation gate (instance → tenant → archive) that determines whether the data plane is open.

Archives are runtime entities — instances of the System.StreamData CK model — and can be created, activated, disabled, retried, and deleted through the Refinery Studio, GraphQL, REST, or the octo-cli.

Backing up archive data

Archive rows can be backed up too. Use ExportArchiveData / ImportArchiveData to move a single archive's rows, or include all of a tenant's archives in a full tenant backup with dump --include-archive-data — see Repository Backup & Restore. The export and the import are also CK methods with an operation handle (System.Bot/TenantRepository.ExportArchiveData-1 / ImportArchiveData-1, see Restore and archive data as asynchronous methods).

What an Archive Is​

An archive bundles three concerns into one entity:

  • Target CK type — the source-of-truth for the data shape. Inheritance is supported: an archive defined on type A applies to all derived types; one CrateDB table per concrete type.
  • Column list — the attribute paths captured at ingestion time, mapped to typed CrateDB columns. Required vs. optional and indexed vs. non-indexed are configured per column.
  • Status — the lifecycle state. Inserts and queries are accepted only when status is Activated.

Where a CK model defines the shape of data, an archive defines what slice of that data is persisted to time series. Many archives can target the same CK type — different retention, different columns, different downsampling.

Properties​

PropertyDescription
Per-tenantEach tenant has its own CrateDB schema. No cross-tenant data.
TypedEach captured attribute path becomes a real CrateDB column with a declared type.
Fixed definitionOnce activated, what the table cannot follow is refused: TargetCkTypeId, removing a column or changing its type. New version = new archive. Adding a column stays possible. See What can change after activation.
Multi-archiveA CK type may be captured by any number of archives concurrently.
Status-gatedInserts and queries are accepted only while the archive's status is Activated.
Soft-delete preserves dataDisabling an archive blocks reads and writes but preserves the underlying CrateDB table.

Archive Subtypes​

The abstract base Archive has three concrete subtypes (System.StreamData CK model, ≥ 1.4.0):

SubtypeTime axisIngestion pathUse case
RawArchiveSingle timestamp per rowExternal producers (SaveStreamDataInArchive@1, IStreamDataRepository.InsertAsync)Instant measurements (sensor readings, machine telemetry, events)
RollupArchiveBucketed [bucketStart, bucketEnd)System rollup orchestrator only — no external insertsDerived bucketed aggregations of one or more source archives (raw, time-range, or rollup-of-rollup)
TimeRangeArchiveExplicit [from, to) range per rowExternal producers (SaveTimeRangeStreamDataInArchive@1, SaveTimeRangeSeriesInArchive@1, IStreamDataRepository.InsertTimeRangeAsync)Externally pre-aggregated data (EDA reports, smart meters, weather APIs)

RawArchive and TimeRangeArchive are operator-defined and accept external data. RollupArchive columns are generated server-side from the configured aggregations — direct edits are rejected.

CK Model​

Loaded only when StreamData is enabled at the instance level. Lives in System.StreamData (currently 1.28.0).

Since 1.23.0 the model uses CK language 2. Every type and record declares derivable: Any, so your own models can still derive from Archive or from the records, as with every earlier 1.x version. No attribute access is restricted and no type implements a System interface. The model carries minEngineVersion 3.5.1: an installation needs services with the CK language 2 engine before it can import it.

1.24.0 adds the archive lifecycle as CK methods (Archive.Activate-1 … RollupArchive.CreateArchive-1) with their parameter and result records; see archive lifecycle methods. 1.25.0 adds rollup control and recomputation (RollupArchive.Freeze-1 … RollupArchive.BackfillFromSource-1) and the result record RecomputeJobInfo. 1.28.0 adds the column methods (Archive.AddComputedColumn-1 … Archive.RepairComputedColumn-1) and the optional member RecomputeJobInfo.ComputedColumnName; with them every stream-data mutation has a method. 1.30.0 adds the asynchronous RollupArchive.Recompute-2 and BackfillFromSource-2 (operation handle, see asynchronous recompute and backfill) and deprecates Recompute-1 and BackfillFromSource-1. Its minEngineVersion is 3.5.67: services on an older engine cannot load System.StreamData 1.30.0.

# Abstract base
ckType: Archive
isAbstract: true
attributes:
- TargetCkTypeId # CkId<CkTypeId>
- Columns # array<CkArchiveColumn>
- Status # CkArchiveStatus
- RawRetentionMs # int64, optional — partition-drop horizon
- MaxRetroactiveReachMs # int64, optional — bounded retro reach cap for automatic recompute (since 1.6.8); null = unbounded
- ConflictPrecedence # array<CkArchiveConflictKey>, optional — ordered keys deciding which of two writes to one row survives (since 1.13.0); empty = last write wins

ckRecord: CkArchiveConflictKey # since 1.13.0
attributes:
- Column # string — one of the archive's own columns
- Order # CkConflictKeyOrder — HigherWins | LowerWins

# Concrete subtypes
ckType: RawArchive (derivedFrom: Archive)
ckType: TimeRangeArchive (derivedFrom: Archive)
attributes:
- Period # TimeSpan, optional — advisory hint
ckType: RollupArchive (derivedFrom: Archive)
attributes:
- Sources # array<CkRollupSourceReference> — the source archives with their validity spans (since 1.8.0)
- SourceArchiveRtId # OctoObjectId, optional — DEPRECATED since 1.8.0, kept so pre-1.8.0 entities import unchanged
- BucketSizeMs # int64
- BucketAlignment # FixedSize | CalendarDay | Iso8601Week | CalendarMonth | CalendarQuarter | CalendarYear
- ReferenceTimeZone # IANA zone id (e.g. Europe/Vienna), optional — anchors calendar alignments (since 1.6.4)
- WatermarkLagMs # int64 — how far behind real time the orchestrator stays
- LastAggregatedBucketEnd # DateTime, optional
- Aggregations # array<CkRollupAggregation>
- FrozenUntil # DateTime, optional

ckEnum: CkArchiveStatus { Created, Activated, Disabled, Failed }
ckEnum: CkRollupFunction { Avg, Min, Max, Sum, Count, TimeWeightedAvg, StateDuration, First, Last }
ckEnum: BucketAlignment { FixedSize, CalendarDay, Iso8601Week, CalendarMonth, CalendarQuarter, CalendarYear }

ckRecord: CkRollupSourceReference # since 1.8.0
attributes:
- SourceArchiveRtId # String, required — the source archive (raw, time-range, or another rollup)
- ValidFrom # DateTime, optional — INCLUSIVE start; null = open start
- ValidTo # DateTime, optional — EXCLUSIVE end; null = open end

ckRecord: CkArchiveColumn
attributes:
- Path # attribute path, e.g. "sensor.reading.value" or "readings[*].value"
- Required # bool
- Indexed # bool (default true — opt-out only when justified)

ckRecord: CkRollupAggregation
attributes:
- SourcePath # attribute path on the source archive's CK type
- Function # Avg | Min | Max | Sum | Count | TimeWeightedAvg | StateDuration | First | Last
- TargetColumnName # optional override; otherwise derived from SourcePath + Function

Source declaration and the deprecated scalar​

Sources replaces the single SourceArchiveRtId a rollup carried before 1.8.0. Both forms are reconciled in exactly one place — the snapshot mapping on the read side of the runtime store — under this rule:

A non-empty Sources list wins. When Sources is empty, a set SourceArchiveRtId is read as one unbounded source. A SourceArchiveRtId that disagrees with a non-empty Sources list is carried as a conflict and rejected at activation — never during enumeration, so listing a tenant's rollups can't fail because one entity is inconsistent.

The platform itself never writes SourceArchiveRtId any more: new rollups are stored with Sources only. The scalar exists so that entities, seeds and blueprints written before 1.8.0 keep importing unchanged, and a rollup stored in that old form behaves exactly as before — one unbounded source is operationally identical to a pre-1.8.0 single-source rollup. No CK-model migration is involved.

Engine decision doc: octo-construction-kit-engine/docs/concept-multi-source-rollups.md — the authoritative, rule-level description of sources, validity spans and coverage.

Storage Layout​

Naming​

ElementConvention
Schemaclean(tenantRtCkId.SemanticVersionedFullName), max 63 chars
Tableclean(targetCkType.SVF) + "_" + clean(archiveRtCkId.SVF), max 200 chars
ColumncamelCase from CK attribute id; nested paths concatenated camelCase via ColumnNameMapper

clean() strips non-alphanumerics. When a generated name exceeds the length limit, the helper truncates and appends a deterministic SHA-256 suffix ({truncated}_{hash16}). The truncation is logged at Information with both names for traceability.

Standard columns (every archive table)​

ColumnTypeNotes
rtIdTEXTEntity instance id
timestampTIMESTAMP WITH TIME ZONEDatapoint timestamp (UTC)
ckTypeIdTEXTConcrete type (relevant for inheritance)
rtCreationDateTimeTIMESTAMP WITH TIME ZONEDEFAULT CURRENT_TIMESTAMP
rtChangedDateTimeTIMESTAMP WITH TIME ZONEUpdated on conflict
rtWellKnownNameTEXTOptional

Primary key: (timestamp, rtId, ckTypeId).

TimeRangeArchive replaces timestamp with bucketStart + bucketEnd; PK is (bucketStart, bucketEnd, rtId, ckTypeId).

Path → column mapping​

Path shapeCrateDB column typeNullability
Scalar (voltage)mapped from CK attribute primitive typeNOT NULL if required
Record (sensor)OBJECT(STRICT) with subfields from CkRecordas above
Array of scalars (readings[*].value)ARRAY(<scalar type>)NOT NULL if required
Array of records (readings[*])ARRAY(OBJECT(STRICT))as above

Each generated column is indexed by CrateDB's default rules unless CkArchiveColumn.Indexed = false, in which case the DDL emits INDEX OFF. Disable indexes only for columns that are read but never filtered or aggregated on.

Upsert semantics​

Inserts run as multi-row INSERT … ON CONFLICT DO UPDATE on the row key — (timestamp, rtId, ckTypeId), or (window_start, window_end, rtId, ckTypeId) on a windowed archive. By default every column of the archive is overwritten by the incoming value, so the last write wins for that row.

rtChangedDateTime is bumped on every conflict; rtCreationDateTime is never modified, and rtWellKnownName is written on insert and then left alone. Idempotent re-inserts are safe.

An incoming NULL clears the stored value

The upsert does not merge column by column. A second producer writing the same row must carry the full set of columns it owns, or the columns it omits are nulled.

Conflict precedence — deciding which write wins​

Last-write-wins means the stored value reflects the order writes arrive in, not the data. Wherever the same row can legitimately be written more than once — a corrected reading, a re-sent document, a backfill running next to a live feed — that is a correctness problem: replaying the same set of writes in a different order produces a different archive.

Archive.ConflictPrecedence (System.StreamData 1.13.0, available on every archive type) makes the update conditional. It is an ordered list of keys, each naming one of the archive's own columns plus which direction of it wins:

FieldMeaning
Columnone of the archive's own columns — the guard compares the incoming value against the stored one
OrderHigherWins for timestamps, versions, sequence numbers · LowerWins for rank codes numbered best-first

An empty list is the default and keeps the behaviour described above, so declaring a precedence is an explicit opt-in and changes nothing for existing archives.

The keys are compared lexicographically: the first decides, and a later one only breaks a tie in the ones before it. That makes them a total order over the data, so the surviving value is its maximum — the same value whichever write lands first. (Read as a conjunction — "better rank and newer" — the outcome would still depend on arrival order, which is the problem being solved.) This holds for writes the keys tell apart: two writes that are equal in every key are not ordered by them, and the later write replaces the stored row (an identical re-delivery stays an idempotent upsert), so declare enough keys to distinguish every pair of writes that can carry different values.

A write that loses leaves no trace at all: not the values, not rtChangedDateTime, not was_updated.

Null handling:

StoredIncomingOutcome
NULLvalueincoming wins — a row with no ranking information stays replaceable
valueNULLstored wins — a write that cannot prove it is better never displaces one that can
NULLNULLtie; the next key decides

The last key accepts equality, so re-delivering an identical payload is idempotent rather than silently dropped.

Example — metering values, where a manual correction always wins and an estimate never overwrites a measurement:

ConflictPrecedence:
- { Column: $Origin, Order: HigherWins } # manual beats automated (see Row origin)
- { Column: DataQuality, Order: LowerWins } # 1 = L1 measured … 3 = L3 estimated
- { Column: SourceDocumentDate, Order: HigherWins } # the document's own timestamp
The enum's numbering is the precedence

With LowerWins over an enum column, the CK enum keys decide the ranking — every value of the enum takes part. Check the whole enum, not just the values you had in mind. Basic.Energy/DataQuality holds only real qualities since Basic.Energy 2.0.0 (L1 = 1, L2 = 2, L3 = 3): the former Unknown = 0 would have outranked every real reading and Manual = 4 could never displace anything. Whether a value was entered manually is recorded as the row origin instead.

Two constraints:

  • Every key must be one of the archive's own columns, except the reserved $Origin; anything else is rejected when the archive is activated.
  • The precedence applies to ingest only. Restoring rows with ImportArchiveData bypasses it — an operator restoring a snapshot gets back exactly what they gave.

Adopting a precedence on an archive that is already Activated usually means declaring a new column for the ranking value. Declared-but-missing columns are added to the CrateDB table on the next activation (add-only, and a Required column is added nullable because existing rows cannot retroactively have a value) — no rows are lost, and existing rows carry NULL for the new column. Call activateArchive on the active archive to trigger it: the archive stays Activated, and if adding a column fails the error is returned while the archive keeps its status and its table. Rollup archives are left out, because their aggregate columns are derived and a new aggregation needs a backfill rather than an empty column. A precedence key has to name one of the archive's columns; an archive whose ConflictPrecedence names anything else fails to activate.

Row origin — manual or automated​

Every row of a raw or time-range archive records where it came from: entered manually or delivered automatically. Rollup archives do not carry the origin, their rows are computed; each rollup bucket reports its manual values instead.

ColumnContent
row_originmanual or automated. A row written before the origin was recorded holds NULL and reads as automated.
manual_written_byManual rows only: who wrote the row. Through REST: preferred_username, else name, else the ClaimTypes.Name claim, else the subject id; a token without a subject records its client id. Through a pipeline: the name the trigger verified (name, else preferred_username), else its subject or client id, otherwise the service account of the pipeline, otherwise pipeline:<pipelineRtId>. It is set by the platform from the verified token, never taken from the data, and never empty.
manual_written_atManual rows only: when the platform wrote the row.
manual_reasonManual rows only, optional: the reason the writer gave.

The writer declares the origin; a write that declares nothing is automated, so existing producers are unchanged. Declaring a reason without origin manual is refused. A write that contains manual rows is visible to the very next read: the archive refreshes the table right after it, so a person who saves a correction and reloads sees the new value (automated batches keep CrateDB's asynchronous refresh of about a second).

$Origin as a precedence key. $Origin is a reserved conflict precedence key (order HigherWins only) and the one key that is not a user column:

  • an incoming manual row always replaces the stored row,
  • an automated row never replaces a manual one, whatever its other keys say,
  • between two automated rows the following keys decide.

A manual value wins by default. A raw or time-range archive whose ConflictPrecedence does not name $Origin ranks by it first — also an archive without any precedence: then the guard is $Origin alone, and between two automated writes the last one still wins. An archive that names $Origin decides where it stands:

ConflictPrecedenceBehaviour
nonemanual wins and stays protected; automated vs automated: last write wins
[DataQuality LowerWins, …] (no $Origin)$Origin is evaluated first; the archive's keys decide only between automated writes
[$Origin HigherWins, DataQuality LowerWins, …]the same, written out
[DataQuality LowerWins, $Origin HigherWins]the quality decides first; the origin only breaks a tie — a manual L3 does not replace a stored L1 (the write fails, see Write result)
[$Origin Ignore, …]opt-out: the origin takes no part, a manual value has no priority; with no other key the last write wins

LowerWins on $Origin, Ignore on a column key and naming $Origin twice are refused when the archive is activated. The replaced value is not kept — a row is always single-valued.

Reading the origin. row_origin, manual_written_by, manual_written_at and manual_reason can be selected, filtered and grouped by in stream-data queries of raw and time-range archives (GraphQL and the stream-data query nodes). They are not part of the default projection; name them explicitly. Filters and groups on row_origin treat legacy NULL rows as automated.

A manual write that changes a window an active rollup has already aggregated triggers a recompute of exactly that window, without the reach cap that applies to automated late data — a person corrected a known window, and the rollup must not keep the replaced value.

Write result​

Every write tells the caller how many rows the archive stored and why the others were not:

Skip reasonMeaning
CkTypeMismatchThe row's CK type is not the archive's target type.
LowerPrecedenceThe stored row wins the conflict precedence.
ManualValueProtectedAn automated row met a manual one and the archive ranks by origin (the default).

Rows that lose against a stored row are a normal outcome for automated deliveries. A manual row that could not be stored is never a success: the write fails (REST answers 409 with the result in the body, a pipeline node fails).

Time semantics​

  • Canonical timezone is UTC. Incoming timestamps are normalized; naive DateTime values are interpreted as UTC.
  • API responses serialize as ISO-8601 with explicit Z.
  • Late-arriving data is accepted via the standard upsert path.
  • Future timestamps are not rejected — drift detection belongs in the pipeline / monitoring layer.

Lifecycle​

StatusTable stateInserts / QueriesNotes
CreatedNot provisionedRejectedFully editable. No CrateDB resources allocated.
ActivatedProvisioned, frozenAcceptedDefinition fixed except for added columns.
DisabledProvisioned, frozenRejectedData preserved. Re-enable to resume.
FailedMay be partialRejected (queries and exports of an archive Failed on Hidden columns run without those columns)Activation DDL failed, or a column reaches a Hidden attribute. Editable. retryActivate is idempotent.

What can change after activation​

The definition of an archive is an entity, and the entity API, ImportRt and a blueprint update can reach every attribute. What the table cannot follow is refused on all three while the archive is Activated, and on a Disabled archive that was activated before: enabling it meets the same table. The message names the archive and the field, and a blueprint update that meets such a change fails.

ArchiveRefused, needs a new archiveStays possible
Raw, time-rangeTargetCkTypeId, removing a column, changing the type of a columnAdding a column (the next activateArchive adds it to the table), MaxRetroactiveReachMs, ConflictPrecedence, RawRetentionMs
RollupTargetCkTypeId, Aggregations, BucketSizeMs, BucketAlignment, ReferenceTimeZone, SourcesWatermarkLagMs, CarryLookbackMs, FrozenUntil

A re-apply of an unchanged definition passes. Computed columns have their own lifecycle and column methods, which stay available. A Created or Failed archive stays editable, and so does a Disabled archive that was never activated, which is how seeds import their archives.

Path validation runs on every transition that ends in Activated (Created/Disabled/Failed → Activated): each CkArchiveColumn.Path is re-validated against the current CK model. Failures throw ArchivePathInvalidException before any DDL runs.

Deletion is destructive: the CrateDB table is dropped (idempotent DROP TABLE IF EXISTS) and the entity is soft-deleted (rtState = Archived). Historical data is lost. Deletion is allowed from any status — except an archive of any subtype that is listed as a source of a rollup, which is rejected with RollupSourceInUseException.

Activation Layers​

Every data-plane operation is gated by a three-level AND-coupled check:

Instance enabled? ── no ──▶ DI does not register CrateDB stack; tenant enable throws.
yes
▼
Tenant enabled? ── no ──▶ Archive activate throws.
yes
▼
Archive Activated? ── no ──▶ Insert / query throws ArchiveNotActivatedException.
yes
▼
OK
LayerSource
InstanceStreamData:Enabled in appsettings (default false)
TenantStreamDataGlobalSettings.IsEnabled (per-tenant flag)
ArchiveCkArchive.Status == Activated

The studio reads both flags from the aggregate tenant-features endpoint (GET {tenantId}/v1/features/status, whose streamData part carries { instanceEnabled, tenantEnabled }); if instanceEnabled = false the archive navigation is hidden. If instanceEnabled = true but tenantEnabled = false the user sees an empty state with an "Enable for tenant" action.

Authorization​

Three roles, registered in the identity service alongside AdminPanelManagement:

RoleAllowed operations
StreamDataAdminFull lifecycle: Create / Update / Delete archives; Activate / Disable / Enable / Retry; rollup lifecycle (Freeze / Unfreeze / Rewind).
StreamDataWriterInsert into activated archives. Metadata read (List / Get archives). No lifecycle, no CRUD.
StreamDataReaderTime-series queries (simple / aggregation / grouped / downsampling). Metadata read. No insert, no lifecycle.

Switching stream data on or off for the whole tenant (POST /enable, POST /disable) needs the tenant role TenantManagement, not StreamDataAdmin.

AdminPanelManagement implies all three. Enforcement is server-side; the studio gates buttons by route guards only. A user without write rights who clicks an action gets a notification from the server-returned ArchiveNotActivatedException / Forbidden.

The same rule holds on every path that changes an archive or its columns: the GraphQL mutations, the archive lifecycle methods and the REST endpoints all require StreamDataAdmin. The REST endpoints check the role too; older versions accepted any token with the octo_api scope there.

Rollup Archives​

A rollup archive consumes one or more source archives and writes one row per [bucketStart, bucketEnd) window. Buckets are sized by BucketSizeMs and aligned by BucketAlignment:

AlignmentBucket boundary
FixedSizeLastAggregatedBucketEnd + N · BucketSizeMs (offset-invariant; ignores the zone)
CalendarDayLocal midnight in ReferenceTimeZone
Iso8601WeekMonday 00:00:00 local time in ReferenceTimeZone
CalendarMonthFirst day of month 00:00:00 local time in ReferenceTimeZone
CalendarQuarter1 January / 1 April / 1 July / 1 October, 00:00:00 local time in ReferenceTimeZone (since System.StreamData 1.8.0)
CalendarYearJanuary 1 00:00:00 local time in ReferenceTimeZone

BucketSizeMs is informational only for the calendar alignments (month and quarter lengths vary). The orchestrator stays WatermarkLagMs behind real time before closing a bucket, so late-arriving raw data still lands in the right window.

CalendarQuarter follows the CalendarMonth shape exactly: alignment happens in local wall-clock time and is converted back to UTC, so DST is handled for free — in Europe/Vienna the quarter holding the spring-forward switch is 90 days minus one hour of UTC duration, the one holding the fall-back switch is 92 days plus one hour. An empty ReferenceTimeZone yields UTC quarters.

Bucket interval vs source granularity​

The rule is evaluated per source, against each source's declared window length (a TimeRangeArchive's Period, or a rollup source's BucketSizeMs). Raw sources that expose no declared granularity are unconstrained. Activation rejects a violation with RollupBucketIntervalException; the check lives in RollupValidator.ValidateForActivation, so a misconfigured rollup fails fast at Activate rather than producing wrong aggregates at query time.

Rollup alignmentSourceAccepted when
FixedSizeanyBucketSizeMs is ≥ the source window and an integer multiple of it — e.g. over a 15-minute source, 15 min / 30 min / 1 h / 1 d are accepted, while 5 min (finer) and 20 min (not a whole multiple) are refused
calendar / ISO weeka calendar-aligned rollup sourcethe source alignment nests inside the rollup alignment: CalendarDay ⊂ CalendarMonth ⊂ CalendarQuarter ⊂ CalendarYear. Iso8601Week contains only CalendarDay and nests inside nothing but itself
calendar / ISO weeka time-range, fixed-size, or fixed-bucket rollup sourcethe source window does not exceed the alignment's longest bucket: 1 d (CalendarDay), 7 d (Iso8601Week), 31 d (CalendarMonth), 92 d (CalendarQuarter), 366 d (CalendarYear)

The constraint prevents a single source row from being split across two output buckets, which would silently distort Sum/Count and skew Avg/Min/Max. The last row is what makes a legacy-history cutover legal: a time-range archive whose quarterly windows declare a ~92 d Period is accepted under a CalendarQuarter rollup, while anything genuinely coarser is rejected.

Validity spans​

Each entry of Sources is a CkRollupSourceReference carrying the source archive plus an optional half-open validity span [ValidFrom, ValidTo) — ValidFrom inclusive, ValidTo exclusive, either bound null for an open end. A reference with neither bound is unbounded and covers every bucket. Two references that abut at the same timestamp are therefore disjoint, and the bucket that starts at the cutover belongs to the later source.

This is what lets legacy history imported at a coarse granularity and natively ingested fine-grained data share one rollup ladder:

legacy quarterly time-range archive ──[ ValidTo = 2025-10-01 ]──┐
├──► CalendarQuarter rollup ──► yearly rollup
15-minute raw archive ──► monthly rollup ──[ ValidFrom = 2025-10-01 ]──┘

Rollups stacked on top need no knowledge of the split; consumers still query one archive per request.

Validation​

Every rule below names the offending source archive in its message and surfaces verbatim through the GraphQL / REST error mapping. Rows 1–6 and 12 are pure checks on the declaration and row 7 additionally walks the tenant's rollups; all of them run at create and again at activation. Rows 8–11 need each source's snapshot and run at activation only.

#RuleException
1At least one source is declared.RollupSourcesRequiredException
2Each source archive appears at most once.DuplicateRollupSourceException
3A bounded span is non-empty (ValidFrom < ValidTo).RollupSourceSpanInvertedException
4At most one source has an open start, at most one an open end.RollupSourceSpanOpenEndConflictException
5Spans are pairwise disjoint (abutting spans are disjoint — the intervals are half-open).RollupSourceSpanOverlapException
6Every span boundary lies on a bucket boundary of the rollup, in its reference time zone. A boundary aligned in UTC but not in the reference zone is rejected, and vice versa.RollupSourceSpanNotOnBucketBoundaryException
7No cycle in the source graph — following source edges from the rollup must never reach it again (including listing itself).RollupSourceCycleException / RollupCycleException
8Every source archive exists, is not soft-deleted, and is Activated.RollupSourceMissingException / RollupSourceNotActivatedException
9Every source targets the same CK type as the rollup.RollupSourceTargetTypeMismatchException
10Bucket granularity per source (table above).RollupBucketIntervalException
11Every aggregation path resolves on every source.RollupSourcePathMissingException
12A deprecated SourceArchiveRtId that disagrees with a non-empty Sources list.RollupSourceDeclarationConflictException

Rule 6 is what guarantees the property the whole design rests on: every bucket lies entirely within exactly one source's span, or within none.

The aggregation rules that predate multi-source support — at least one aggregation, no duplicate (SourcePath, Function) pair, a ComparisonValue on every StateDuration — now run at create as well, so createRollupArchive fails fast on inputs it used to accept silently and only reject at activation.

Per-bucket source selection​

Per tick the orchestrator loads each distinct source snapshot once, then resolves the source per closed bucket:

  • A span covers the bucket → the existing single-source aggregation runs unchanged against that archive, the watermark advances, the run is audited.
  • No span covers the bucket (a gap bucket) → no row is written, the watermark advances past it, and the skip is logged at Debug. Gap buckets are a declared, normal state — not an error.
  • The covering source is missing or not Activated → the tick stops with a WARNING naming rollup and source, and the watermark stays put. Aggregation resumes exactly where it stopped once the source is available again; nothing is silently skipped.

Because the source is fixed for a whole bucket, the result is identical to a single-source rollup over the concatenated data for Sum, Count, Min, Max, Avg, First and Last. For the LOCF-carry functions TimeWeightedAvg and StateDuration the carry-in never crosses a source boundary — the first bucket served by a later source opens without a carry from the earlier one, so its covered duration can be shorter than a concatenated single-source rollup would report. That is the only documented divergence.

Aggregation specs are logical (SourcePath + Function) and are resolved into physical columns per source: either a column the source declares verbatim (an ingested column by Path, a computed column by Name, a rollup source's physical column by its physical name), or — on a rollup source — the child aggregation with the same path and the same function, read function-preserving over the child buckets. Chained rollups written in the physical-name style (amountvalue_sum / Sum) therefore keep working unchanged.

The initial watermark of a newly activated rollup is unchanged: it is derived from the clock alone, never from a source, so a multi-source rollup starts exactly where a single-source one would.

Recompute and backfill across spans​

  • A retroactive write into a source propagates to the rollup clipped to that source's span on both ends. A late write into the legacy archive after the cutover, or into the native archive before it, is correctly ignored.
  • A recompute of [from, to) is split into per-source segments first and only then into chunks; each segment runs against its own source snapshot, sequentially in time order, and the job's row and window totals accumulate across segments. A range no span covers completes with zero totals.
  • Backfill start = the minimum over all sources of max(earliest stored timestamp of that source, ValidFrom). A source holding no data in its span contributes nothing; if no source contributes, the backfill is a logged no-op. Backfill stays manual (rewindRollupWatermark / backfill_rollup_archive).
History at the same granularity needs no rollup change

If imported history has the same granularity as the native data — a replay of 15-minute values into a 15-minute raw archive — there is nothing to declare here. Write it directly into the raw archive through the ordinary ingest path; the existing rollups above it pick it up, and a rewindRollupWatermark + backfill recomputes the affected buckets. Multi-source declarations are only needed when the history arrives at a coarser granularity and therefore has to live in its own archive.

Reference time zone (calendar alignments)​

The calendar alignments snap each bucket to a local calendar boundary in ReferenceTimeZone — an IANA zone id such as Europe/Vienna — so the buckets are DST-correct: a CalendarDay bucket runs local-midnight to local-midnight, which is 22:00Z → 22:00Z under CEST (summer) and 23:00Z → 23:00Z under CET (winter). An empty zone falls back to UTC boundaries. FixedSize ignores the zone — a whole-hour window is offset-invariant for a whole-hour zone, so an hourly rollup needs no zone. Available since System.StreamData 1.6.4.

Alignment and zone are fixed after activation

BucketAlignment and ReferenceTimeZone cannot change once the rollup is Activated. Switching a live rollup from FixedSize/UTC to a calendar alignment in a real zone (e.g. moving a daily rollup to CalendarDay + Europe/Vienna) needs a new rollup: create it, activate it, and backfill it with rewindRollupWatermark.

Day start (gas days)​

A CalendarDay rollup can start its day at a local time other than midnight: DayStartOffsetMs is the local time of day, in milliseconds after local midnight in ReferenceTimeZone, at which every bucket starts. The gas day of the gas industry runs from 06:00 to 06:00 local time, so a gas-day rollup carries DayStartOffsetMs = 21600000. null or 0 is a midnight day (the behaviour before System.StreamData 1.22.0).

The buckets stay DST-correct: a gas day is 23, 24 or 25 hours long. Example, Europe/Vienna, DayStartOffsetMs = 21600000:

Gas day startingLocal start → endUTC windowLengthCount of complete hourly data
2026-03-28 (spring forward in it)06:00 CET → 06:00 CEST2026-03-28T05:00Z → 2026-03-29T04:00Z23 h23
2026-07-0106:00 CEST → 06:00 CEST2026-07-01T04:00Z → 2026-07-02T04:00Z24 h24
2026-10-24 (fall back in it)06:00 CEST → 06:00 CET2026-10-24T04:00Z → 2026-10-25T05:00Z25 h25

Rules (checked at create and at activation; a violation is RollupDayStartOffsetInvalidException, GraphQL STREAMDATA_ERROR, with a message naming DayStartOffsetMs and the allowed range):

  • a whole number of minutes in [0, 86400000);
  • only with BucketAlignment = CalendarDay — a week, month, quarter or year rollup cannot carry it;
  • a rollup chained on a gas-day rollup must be a CalendarDay rollup with the same DayStartOffsetMs and the same ReferenceTimeZone; a month rollup over gas days would cut gas days in two;
  • like the zone, it cannot change after activation.

Set it with createRollupArchive(input: { …, bucketAlignment: CALENDAR_DAY, referenceTimeZone: "Europe/Vienna", dayStartOffsetMs: 21600000 }), or as DayStartOffsetMs on a RollupArchive in a blueprint seed / ImportRt. rollupsFor returns it as dayStartOffsetMs. To read gas days, ask the series resolver with the same day start, or run a downsampling query with local-day bins with binOrigin: "06:00" — raw and rollup bins coincide on the instant.

Aggregation functions​

CkRollupFunction maps to one or two storage columns:

FunctionStored columnsRead-time formula
Sum{base}_sumas-is
Min{base}_minas-is
Max{base}_maxas-is
Count{base}_count (BIGINT)as-is
Avg{base}_sum, {base}_count (both stored)sum / count — keeps chained rollups numerically correct
First{base}_firstvalue at the earliest observation in the bucket (numeric source columns)
Last{base}_lastvalue at the latest observation in the bucket (numeric source columns)
TimeWeightedAvg{base}_integral (value × ms), {base}_duration (ms)integral / duration; the query function INTEGRAL reads integral alone as energy, see Integral from a rollup

The Columns[] projection on a rollup is derived from Aggregations[] via RollupColumnGenerator.Generate; an edit of Columns has no effect.

Each declaration in Aggregations[] is independent, so one rollup archive can carry many aggregations over different attributes (e.g. Sum of energy and Max of power), plus several functions of the same attribute (e.g. Min and Max of power). All declared aggregates are produced in a single pass over each source bucket and each is exposed as its own series. To add an aggregation to a rollup that is already activated, create a new rollup with the full aggregation set and backfill it with rewindRollupWatermark: Aggregations[] cannot change after activation.

Manual values of a bucket​

Every rollup reports how many of its values were entered manually, without a change to its definition. Two platform columns sit next to the aggregates, like row_origin on raw rows. They are not part of Aggregations[]:

ColumnBucket value
manual_countNumber of manually entered source values. Empty reads as 0.
last_manual_atWhen the latest manual entry was written; empty without one.

Name them in the columns of a stream-data query; they can be filtered and aggregated as well, and they are not part of the default projection. On a rollup over a rollup the counts add up and the latest time stays the latest. Automated rows and rows written before the origin was recorded count as delivered. A correction replaces the delivered value of its interval, so it counts once, and it reaches every level of the ladder through the usual recompute, also in a range older than MaxRetroactiveReachMs or frozen with FrozenUntil.

Existing rollup tables get the columns on their own after the platform update. No backfill is needed on a tenant without manual rows, because empty reads as 0. A tenant with manual rows gets the values of its older buckets from a normal recompute of the affected range.

No user-defined column can be named manual_count or last_manual_at, including a generated aggregation column: Count over an attribute Manual needs a TargetColumnName.

Operator controls​

OperationMutationNotes
CreatecreateRollupArchive(input)Takes sources[] (CreateRollupSourceInput: sourceArchiveRtId, optional validFrom / validTo). Server derives TargetCkTypeId and Columns from the sources + aggregations. The deprecated scalar sourceArchiveRtId input is still accepted for compatibility and is mutually exclusive with sources[]; it is mapped to one unbounded source before storing.
Freeze a rangefreezeRollupArchive(rtId, until)Monotonic — the new until must be ≥ the current FrozenUntil. The orchestrator stops producing buckets whose bucketEnd falls in the frozen range.
UnfreezeunfreezeRollupArchive(rtId, acceptGaps)Idempotent. acceptGaps is recorded for audit but the gap-detection guard is a follow-up.
Rewind the watermarkrewindRollupWatermark(rtId, toBucketEnd)Re-aggregates from the given bucket boundary forward. Destructive: previously committed rows in the rewound range are temporarily out of sync until the orchestrator catches up.
Recompute a rangerecomputeArchive(rtId, from, to, rtIdScope?)Optimistic, no-downtime recompute of [from, to), optionally scoped to a single entity. Readers keep seeing a consistent snapshot throughout. See Rollup Recompute below.

Delete guard. Any archive — raw, time-range, or rollup — that is listed as a source of a non-soft-deleted rollup cannot be deleted; deleteArchive refuses with RollupSourceInUseException, in either storage form and whatever validity span the reference carries. Remove or replace the rollup first.

Sources are fixed after activation

createRollupArchive is the supported way to declare sources, and the studio's edit mode shows them read-only. A change of Sources on an activated rollup is refused: it would put an already-populated rollup out of sync with its declaration.

Disabling a source of an activated rollup stays allowed. It is not blocked and does not fail the rollup — the orchestrator simply stalls at the first bucket the disabled source serves until the source is activated again, or the watermark is rewound past it.

A rollup that keeps failing shows it. Its status stays Activated and every tick tries again, but from the first failed run LastRunError, LastRunErrorAt and ConsecutiveRunFailures on the rollup say why it does not advance, and the third failed run in a row writes an error to the event log. The next run that succeeds clears them.

Rollup Recompute​

When raw data changes after the fact — late values, corrections, re-ingests — the rollup rows derived from that window are stale. A recompute re-aggregates the affected windows. The hard requirement is that consumers (meshboards, pipelines, the API) keep working while a recompute runs: no 500, no aborted pipeline, and every read returns a consistent snapshot — either the previous values or the new ones, never a half-written mix.

Deep dive

For the engineer-facing internals — how a retroactive write is detected (RetroactiveWriteDetector, the consumed-watermark criterion), the dirty-windows ledger, the dependency-graph propagation, the periodic orchestrator, the optimistic atomic swap with an end-to-end sequence diagram, and a comparison of all four (re)compute paths — see Rollup Recompute Internals.

Triggers​

TriggerSurfaceBehaviour
ManualrecomputeArchive GraphQL mutation · POST /archives/{rollupRtId}/recompute · octo-cli RecomputeArchiveAn operator forces a recompute over [from, to), optionally scoped to one entity (rtIdScope). Requires StreamDataAdmin.
PeriodicRecomputeOrchestratorHostedService (per-tenant tick)Drains the dirty-windows ledger and recomputes only the windows actually marked dirty — not the whole archive.
Chain propagationinternalAfter a rollup's recompute commits, its own dependents are marked dirty so a multi-level rollup-of-rollup chain rolls forward top-down.

The periodic trigger is the automatic path — it drains the dirty-windows ledger the detector fills on every retroactive write, so no operator has to reset a threshold by hand. A single very-late write can only drag an automatic recompute back as far as the per-archive bounded retro reach cap (Archive.MaxRetroactiveReachMs, since 1.6.8; null = unbounded), combined with the host StreamData:Recompute:MaxRetroactiveReachHardLimitMs ceiling. Manual recomputeArchive and rewindRollupWatermark stay unbounded — the deliberate escape hatch for a deep correction.

Optimistic atomic swap (how consistency is guaranteed)​

CrateDB has no multi-statement transaction, so the swap uses a per-window generation pointer:

  1. Each rollup table carries a generation column (BIGINT NOT NULL DEFAULT 0) that is part of the primary key. Normal forward aggregation always writes generation = 0.
  2. A recompute aggregates the range into a per-archive staging table, then copies those rows into the live table stamped with the next generation N+1. The previous generation stays in place and visible.
  3. A tiny per-rollup side-table (archive_<rtId>__genmap) holds the active generation per range. Flipping that pointer to N+1 is a single-row write — the atomic commit point.
  4. The read path injects generation = CASE WHEN <range> THEN <activeGen> … ELSE 0 END, so every query resolves exactly one consistent generation per window.
  5. After the flip a background sweep deletes the now-superseded generation's rows.

Failure semantics: a job that crashes before the flip leaves the staging table orphaned (reclaimed by name on the next run) and the live table + pointer untouched — readers keep seeing the previous values. A crash after the flip but before the sweep only leaves dead rows the next sweep reclaims. No partial state is ever observable.

Scoping​

rtIdScope restricts the whole pipeline — staging aggregation, the generation pointer, and the post-flip sweep — to a single entity (metering point / stream). A late value for one stream therefore recomputes only that stream's windows and never touches unrelated entities sharing the same bucket. Omitting rtIdScope recomputes the entire range.

Coalescing​

Overlapping triggers for the same archive coalesce: their ranges merge into one active job, and the superseded trigger is recorded with state Coalesced in the job history. There is at most one active recompute per archive at a time.

Interaction with rewind​

rewindRollupWatermark re-aggregates a range forward at generation = 0. If that range had previously been recomputed, the active-generation pointer would otherwise keep readers pinned to the stale recomputed generation. The rewind therefore reconciles the generation map: it drops the pointers reaching past the rewind boundary and deletes the orphaned generation > 0 rows there, so the forward re-aggregation becomes authoritative again. This is a no-op when stream data is disabled or nothing was recomputed.

Job history & observability​

Every recompute is recorded as a job snapshot, queryable newest-first (capped at 50):

  • GraphQL — runtime.streamData.recomputeJobsFor(rtId) returns [RecomputeJobInfo!]!.
  • REST — GET /archives/{archiveRtId}/recompute-jobs.
  • octo-cli — ListRecomputeJobs.

RecomputeJobInfo carries state (Running / Completed / Failed / Coalesced), rowsProcessed, windowsProcessed, startedAt, finishedAt, durationMs, and errorReason (set on failure). In addition, the per-rollup RollupArchiveInfo (via rollupsFor) exposes live health fields: recomputeInProgress, lastRecomputeStartedAt, lastRecomputeSuccessAt, lastRecomputeFailureAt, lastRecomputeFailureReason, dirtyWindowsPending, and pendingRecomputeRanges. Failures are also emitted through the archive audit trail.

Archive Coverage​

Coverage answers "which resolution is actually available for which time range?" — the question a chart has to answer before it can decide which rung of a rollup ladder to read. Since System.StreamData 1.8.0 every archive, base and rollup, exposes it.

Measurement and timestamp convention​

Coverage is measured from CrateDB on request, never derived from the model or the validity spans:

Archive shapeavailableFromavailableTo
windowed (rollup, time-range)MIN(window_start) — the start of the earliest stored windowMAX(window_end) — the end of the latest stored window (the exclusive end of the last bucket, not its start)
rawMIN(timestamp)MAX(timestamp)
  • Coverage is archive-wide, not per entity rtId, and is a single from/to pair.
  • Null semantics — an archive without rows, or without a backing table, has no coverage: both fields are null. Never a sentinel range, never an error. Every other storage error propagates.
  • Coverage does not show gaps. Holes inside the range are deliberately not represented, so a family whose native ingestion started long after the legacy history ended still reports one contiguous-looking range.

Caching​

Answers are memoised per (tenant, archive) with a default TTL of 60 seconds, configurable per host via StreamData:Coverage:CacheTtlSeconds (mesh-adapter environment variable StreamDataCoverageCacheTtlSeconds). A TTL of zero disables memoisation; a negative TTL is rejected. Entries are invalidated on an archive delete, on completion of a recompute or backfill job, and tenant-wide when a tenant's stream data is dropped or the feature is disabled. Ordinary ingest is deliberately not invalidated — it only extends the range and the TTL absorbs it. Within the TTL a query issued seconds after data arrived can therefore still route to a coarser rung; lower the TTL if a deployment needs it fresher.

The family query​

One call returns the queried archive plus every rollup transitively reachable from it, in breadth-first order with the queried archive first. It accepts any archive rtId of the family:

SurfaceCall
GraphQLstreamData.coverageFor(rtId)
RESTGET /api/v1/streamData/archives/{archiveRtId}/coverage
MCPget_archive_coverage

Each rung carries archiveRtId, rtWellKnownName, status, isBase (the rung is not a rollup), bucketSizeMs (rollup: BucketSize; time-range base: Period; raw base: null), bucketAlignment, storedFunctions (empty for a base archive), and availableFrom / availableTo. An unknown rtId, or a tenant without stream data, yields an empty list, not an error.

A multi-source rollup belongs to the family of each of its sources and reports the same measured coverage in each — listed exactly once per family.

A disabled finer rung can make a coverage end misleading

Coverage is measured per archive, not derived from the graph. A disabled rung keeps reporting the range of the rows it still holds while no new data arrives, so its availableTo can look current although the rung stopped advancing. Read status from the family query alongside the coverage to tell a disabled rung from a live one.

Coverage in resolveSeriesQuery​

The resolution-aware resolver applies coverage as a filter over the candidate rungs before its existing selection rule:

  1. A rung covers the request when its availableFrom is at or before the requested start (equal counts as covering; the requested end is not considered). A rung without coverage never covers.
  2. The base rung takes part in the filter like every other rung.
  3. If no rung reports coverage at all, the filter is inert — the plan is byte-for-byte the pre-coverage result, including its signal. Hosts that do not wire a coverage provider keep the old behaviour.
  4. Candidates are the covering rungs; if none covers, the candidates are the rungs with the earliest availableFrom, ties kept.
  5. The existing selection rules then run unchanged over the candidates.

When the filter changes the chosen archive the result carries signal = CoverageLimited — which takes precedence over Ok and ResolutionLimited — plus actualPoints (the delivered point count), a diagnostic naming the excluded finer rung and its available-from, and the first-class field finerRungAvailableFrom (null when the excluded rung reports no coverage at all).

Two deliberate edge cases: if the filtered plan lands on a refusal (NoSuitableRollup / UnknownBaseGrain) that signal is kept and the coverage exclusion is prepended to the diagnostic; and if the covering candidates would yield EmptyLadder, the unfiltered result is returned — so a CoverageLimited answer always names a covering fallback rung.

GetQueryById@1 routes through the resolver and, as before, keeps the persisted archive with a warning for any signal other than Ok, routing only through the existing bucket-grid gate.

Time-Range Archives​

For externally pre-aggregated data with explicit [from, to) windows. There is no source archive and no orchestrator on this path; producers push rows directly:

  • GraphQL mutation: createTimeRangeArchive(input) — same admin-grade role guard as rollup create.
  • Pipeline nodes: SaveTimeRangeStreamDataInArchive@1 for rows that already carry their source rtId, SaveTimeRangeSeriesInArchive@1 for whole series (one anchor entity per series).
  • REST: POST /api/v1/streamData/archives/{archiveRtId}/insertTimeRange.

Period on TimeRangeArchive is advisory only — it lets the studio render a default time range but is not enforced at insert time.

Computed Columns​

A computed column on a raw or time-range archive is derived by a formula from one or more other columns of the same row, rather than supplied by the producer — e.g. powerFactor = activePower / apparentPower. The value is materialised as a real, typed CrateDB column, so it is natively aggregatable by rollups and visible to direct SQL consumers (Grafana).

  • Where it is evaluated — server-side in the CrateDB repository on every ingest path (pipeline node, REST, SDK), so the value is identical regardless of producer. The formula uses the shared mXparser dialect (see the Formula Expressions reference under Communication).
  • Result type — declared explicitly and cast back from the double mXparser computes: Boolean, Int, Int64, Double, or DateTime (ticks). String and non-scalar types are not supported. A formula / NaN / NULL-operand error stores NULL for that cell; ingest never fails.
  • CK model — CkArchiveColumn carries Name + Formula + ResultType + the engine-managed ComputedState (since System.StreamData 1.5.0) and ComputedVersion / PendingFormula (since 1.6.1 / 1.6.2 respectively). A column with a Formula is computed; one with a Path is ingested. The two are mutually exclusive.

Active-archive lifecycle (optimistic / atomic)​

Adding, re-formulating, or removing a computed column works on an Activated archive without blocking ingest or breaking readers, reusing the optimistic semantics of Rollup Recompute:

  • Add — the column is persisted Pending, the physical column is added (ALTER TABLE ADD COLUMN), a backfill populates it across the existing rows while it stays hidden from readers, then it flips to Active atomically. A backfill failure leaves it Failed and the previous archive state intact.
  • Change formula — the column keeps serving its previous values (version N) while the new formula is backfilled into a versioned physical column {base}__v{N+1}; ingest dual-writes both during the backfill; then a single store write swaps the version pointer atomically. A failure reverts to the previous formula.
  • Remove — dropped from the logical projection; the physical column is left as a harmless nullable orphan the read path no longer projects.

Limitation (formula change). Because a formula change re-versions the column's physical name, changing the formula of a computed column that another computed column references is rejected (ComputedColumnInvalidException) — re-point or remove the dependent first. Direct-SQL / Grafana consumers that bind to the physical name must likewise follow the rename.

Rollups over computed columns​

A CkRollupAggregation.SourcePath may target a source computed column by its Name — the rollup aggregates it natively like any ingested column (single- and multi-aggregate). A RollupArchive may also carry its own computed columns over its aggregated output columns.

API Surface​

GraphQL — archive lifecycle methods​

Since System.StreamData 1.24.0 the archive lifecycle is available as CK methods of the archive types. They replace the lifecycle mutations below, which keep working and are marked @deprecated(reason: "Use <method id>"). Use the methods in new clients.

MethodCalled asResultReplaces
System.StreamData/Archive.Activate-1activate(rtId) on every concrete archive typeArchiveTransitionResult (archiveRtId, status, transition)activateArchive
System.StreamData/Archive.Disable-1disable(rtId)ArchiveTransitionResultdisableArchive
System.StreamData/Archive.Enable-1enable(rtId)ArchiveTransitionResultenableArchive
System.StreamData/Archive.RetryActivation-1retryActivation(rtId)ArchiveTransitionResultretryArchiveActivation
System.StreamData/Archive.DeleteArchive-1deleteArchive(rtId)Boolean (true)deleteArchive
System.StreamData/TimeRangeArchive.CreateArchive-1createArchive(input: { archive: {...} }) (static)String (runtime id)createTimeRangeArchive
System.StreamData/RollupArchive.CreateArchive-1createArchive(input: { archive: {...} }) (static)String (runtime id)createRollupArchive
System.StreamData/RollupArchive.Freeze-1 (1.25.0)freeze(rtId, input: { until })ArchiveTransitionResultfreezeRollupArchive
System.StreamData/RollupArchive.Unfreeze-1 (1.25.0)unfreeze(rtId, input: { acceptGaps }) (acceptGaps optional)ArchiveTransitionResultunfreezeRollupArchive
System.StreamData/RollupArchive.RewindWatermark-1 (1.25.0)rewindWatermark(rtId, input: { toBucketEnd })ArchiveTransitionResultrewindRollupWatermark
System.StreamData/RollupArchive.Recompute-1 (1.25.0)recompute(rtId, input: { from, to, rtIdScope }) (rtIdScope optional)RecomputeJobInfo (jobRtId, state, rowsProcessed, windowsProcessed, startedAt, finishedAt, durationMs, errorReason, lastProgressAt)recomputeArchive (until 1.30.0)
System.StreamData/RollupArchive.BackfillFromSource-1 (1.25.0)backfillFromSource(rtId)RecomputeJobInfo, no result for an empty sourcebackfillRollupFromSource (until 1.30.0)
System.StreamData/RollupArchive.Recompute-2 (1.30.0)recompute2(rtId, input: { from, to, rtIdScope }) (rtIdScope optional)operation handle; the operation ends with RecomputeJobInforecomputeArchive
System.StreamData/RollupArchive.BackfillFromSource-2 (1.30.0)backfillFromSource2(rtId)operation handle; the operation ends with RecomputeJobInfo, no result for an empty sourcebackfillRollupFromSource
System.StreamData/Archive.AddComputedColumn-1 (1.28.0)addComputedColumn(rtId, input: { name, formula, resultType, indexed }) (indexed optional, default true)ArchiveTransitionResultaddComputedColumn
System.StreamData/Archive.AddColumn-1 (1.28.0)addColumn(rtId, input: { path, indexed }) (indexed optional, default false)ArchiveTransitionResult (transition: AddArchiveColumn)addArchiveColumn
System.StreamData/Archive.RemoveComputedColumn-1 (1.28.0)removeComputedColumn(rtId, input: { name })ArchiveTransitionResultremoveComputedColumn
System.StreamData/Archive.UpdateComputedColumnFormula-1 (1.28.0)updateComputedColumnFormula(rtId, input: { name, formula })ArchiveTransitionResultupdateComputedColumnFormula
System.StreamData/Archive.RetryComputedColumnBackfill-1 (1.28.0)retryComputedColumnBackfill(rtId, input: { name })RecomputeJobInfo with computedColumnNameretryComputedColumnBackfill
System.StreamData/Archive.RepairComputedColumn-1 (1.28.0)repairComputedColumn(rtId, input: { name, from, to }) (from, to optional)RecomputeJobInfo with computedColumnNamerepairComputedColumn

The instance methods are declared on the abstract Archive, so RawArchive, TimeRangeArchive and RollupArchive all have them. The archive input of the create methods has the same fields as the input of the mutation it replaces.

The rollup methods (1.25.0) are instance methods of RollupArchive with the arguments of the mutations they replace. Recompute-1 and BackfillFromSource-1 answer synchronously with the job, as the mutations do: Recompute-1 runs the recompute and the generation swap of rollup recompute in the call (a rollup that is not activated answers a job in state Failed with the reason). BackfillFromSource-1 queues the backfill and answers its job at once: a new Pending job, the already active job of the rollup the backfill was folded into, or a Failed job for a rollup that is not activated; no result when the source archive holds no data. For a caller who may call the method, a target id that does not exist or that the caller cannot see is answered with METHOD_TARGET_NOT_FOUND before any job is created; a caller without the role gets METHOD_FORBIDDEN first, whether the target exists or not. Poll the RecomputeJob entity for the later states. The job's id is jobRtId in the method result (rtId in the mutation). Recompute-1 and BackfillFromSource-1 are deprecated since 1.30.0 (their contract is unchanged); use the -2 versions.

Asynchronous recompute and backfill​

Since System.StreamData 1.30.0 RollupArchive.Recompute-2 and RollupArchive.BackfillFromSource-2 start the recompute or the backfill and return an operation handle at once; follow the operation with runtime.operations (see asynchronous callers). The call is authorized when it is accepted, exactly like -1: role StreamDataAdmin, the tenant of the token, a write grant on the rollup. The work then runs in the asset repository, detached from the caller: a client that disconnects or times out does not stop it.

MethodOperation progressOperation result
Recompute-2stage RECOMPUTINGSUCCEEDED with the completed job (RecomputeJobInfo); FAILED with STREAMDATA_RECOMPUTE_FAILED (parameters jobRtId, reason) when the job ended Failed, also for a rollup that is not activated
BackfillFromSource-2stage QUEUED with parameter jobRtId as soon as the job is queued, then PENDING / RUNNING / SWAPPINGSUCCEEDED with the completed job, or without a result for an empty source archive; FAILED with STREAMDATA_RECOMPUTE_FAILED when the job ended Failed

The job is also listed in the recompute jobs of the archive (GET /archives/{rtId}/recompute-jobs, recomputeJobsFor). When the asset repository restarts during a backfill, the queued backfill continues on the background orchestrator, while the operation ends as METHOD_OUTCOME_UNKNOWN; read the job in the recompute jobs then. There is no call that cancels a running recompute; it runs until its job ends.

mutation {
runtime {
systemStreamDataRollupArchives {
recompute2(rtId: "6a1f…", input: { from: "2026-03-01T00:00:00Z", to: "2026-03-02T00:00:00Z" }) {
operation { operationId }
}
}
}
}

query {
runtime {
operations(operationId: "…") {
items { state progress { stageCode parameters { name value } } result error { code parameters { name value } } }
}
}
}

The REST endpoints POST /archives/{rtId}/recompute and POST /archives/{rtId}/backfill-from-source call these methods and keep their answer: recompute answers the finished job once the operation ended (a job that ended Failed is still a 200), backfill-from-source the Pending job as soon as the operation reported it (204 for an empty source). Both stay available; they have no sunset date. Three points differ from the direct call:

  • Behaviour change: on a deleted or non-rollup archive both endpoints now answer 400 (not found) instead of 200 with a Failed job. The call is refused before any job exists: no job is stored and no operation is accepted.
  • backfill-from-source waits for the queued job at most Methods:StreamData:BackfillQueueTimeout (default 60 seconds), then answers 504 naming the accepted operation; the operation keeps running, follow it with runtime.operations or the recompute jobs.
  • The endpoints keep their direct call, without the -2 methods, when Methods:StreamData:Enabled is false or the tenant holds a System.StreamData older than 1.30.0 (the method is not declared there). The answers are then those of the direct call.
mutation {
runtime {
systemStreamDataRollupArchives {
recompute(rtId: "6a1f…", input: { from: "2026-03-01T00:00:00Z", to: "2026-03-02T00:00:00Z" }) {
result { jobRtId state windowsProcessed errorReason }
}
}
}
}
mutation {
runtime {
systemStreamDataRawArchives {
activate(rtId: "6a1f…") { invocationId result { archiveRtId status transition } }
}
}
}

mutation {
runtime {
systemStreamDataRollupArchives {
createArchive(input: { archive: {
sources: [{ sourceArchiveRtId: "6a1f…" }],
bucketSizeMs: 3600000, watermarkLagMs: 0,
aggregations: [{ sourcePath: "ActivePower", function: AVG }]
} }) { result }
}
}
}

Column methods​

The column methods (1.28.0) are instance methods of Archive with the arguments of the mutations they replace. They change the columns of an Activated raw or time-range archive; a rollup refuses them, as with the mutations (its columns are derived).

  • addComputedColumn adds a computed column and queues its backfill as a background job. It answers at once, with the column in Backfilling; the job ends it Active or Failed. resultType is a value of the enum CkComputedColumnResultType (Boolean, Int, Int64, Double, DateTime; in GraphQL e.g. DOUBLE).
  • addColumn adds an ingested column for an attribute of the target type without recreating the archive. Existing rows read null for it. A path the archive already captures changes nothing. A path that reaches an attribute with access: Hidden is refused with STREAMDATA_ERROR, as with the mutation, because stream-data queries do not enforce attribute access.
  • updateComputedColumnFormula queues the backfill of the new formula; readers keep the previous values until the job switches the column. removeComputedColumn removes a computed column that no other computed column references. Removing a name the archive does not have changes nothing; updating, retrying or repairing it is refused with STREAMDATA_ERROR (the mutations answer a generic error).
  • retryComputedColumnBackfill queues the backfill again for a column that ended Failed or is stuck; repairComputedColumn re-evaluates the empty cells of an Active column in [from, to). Both answer the queued job with computedColumnName set, or the job that is already queued for the column. Follow it with recomputeJobsFor(archive) or the RecomputeJob entity.
mutation {
runtime {
systemStreamDataRawArchives {
addComputedColumn(rtId: "6a1f…", input: { name: "powerFactor", formula: "activePower / apparentPower", resultType: DOUBLE }) {
result { archiveRtId status transition }
}
}
}
}

Same behaviour as the mutations. The asset repository handles the methods itself (in-process) with the same engine calls, so a method makes the same transition and creates the same archive as its mutation.

  • Role: StreamDataAdmin, like the mutations. Without it the call is refused with METHOD_FORBIDDEN (the mutations answer FORBIDDEN) and nothing changes.
  • Errors: a refusal of the stream-data engine carries the same code as the mutation: STREAMDATA_INVALID_TRANSITION (e.g. disabling a Created archive), STREAMDATA_ARCHIVE_NOT_FOUND, STREAMDATA_ARCHIVE_NOT_ACTIVATED, STREAMDATA_SCHEMA_IMMUTABLE, STREAMDATA_PATH_INVALID, STREAMDATA_ACTIVATION_FAILED, STREAMDATA_ERROR. The details the mutation puts into the error extensions are extensions.parameters here (archiveRtId, fromStatus, attemptedTransition, actualStatus, path, message). New: STREAMDATA_NOT_ENABLED when stream data is not enabled for the tenant (the mutations answer a generic error). Input errors the mutation reports with a validation message (both or none of sources / sourceArchiveRtId, an unknown time zone) are METHOD_VALIDATION_FAILED with the field (archive.sources, archive.referenceTimeZone).
  • Tenant: a method only reaches archives of the tenant of the call; an id of another tenant's archive is METHOD_TARGET_NOT_FOUND. A token issued for another tenant is refused with METHOD_FORBIDDEN (reason: tenant-not-allowed), also a token of a parent tenant; a service (client-credentials) token passes only for its own tenant or when its client is on the cross-tenant allow-list TenantAuthorization:CrossTenantServiceClientIds.
  • Idempotency: Activate-1, AddColumn-1, RetryComputedColumnBackfill-1 and RepairComputedColumn-1 are idempotent (a second call changes nothing or answers the queued job). For the others pass an idempotencyKey if a retry must not run twice.
  • Generic create stays allowed: blueprints create archives through ImportRt, so the create methods do not replace the generic create of the archive types.
  • An administrator can switch the methods off with OCTO_METHODS__STREAMDATA__ENABLED=false on the asset repository (default: on); a method call then answers METHOD_HANDLER_NOT_AVAILABLE, and the mutations and the REST endpoints keep working with their direct lifecycle call.

GraphQL — lifecycle mutations​

Under mutation.streamData. Every streamData mutation is deprecated in favour of the archive methods and keeps working; the deprecation reason names the method:

MutationReturnsDescription
activateArchive(rtId)ArchiveTransitionResultProvisions the CrateDB table, transitions to Activated.
disableArchive(rtId)ArchiveTransitionResultActivated → Disabled. Table is preserved.
enableArchive(rtId)ArchiveTransitionResultDisabled → Activated. Re-validates column paths.
retryArchiveActivation(rtId)ArchiveTransitionResultFailed → Activated. Idempotent (CREATE TABLE IF NOT EXISTS).
deleteArchive(rtId)BooleanDrops the CrateDB table and soft-deletes the entity. Rejected if any rollup lists it as a source.
createRollupArchive(input)OctoObjectIdsources[] + aggregations; server-derived TargetCkTypeId + Columns. Optional bucketAlignment, referenceTimeZone, dayStartOffsetMs (day start).
createTimeRangeArchive(input)OctoObjectIdOperator-defined target type and columns.
freezeRollupArchive(rtId, until)ArchiveTransitionResultMonotonic FrozenUntil set.
unfreezeRollupArchive(rtId, acceptGaps)ArchiveTransitionResultClears FrozenUntil.
rewindRollupWatermark(rtId, toBucketEnd)ArchiveTransitionResultRe-aggregates from the given boundary.
recomputeArchive(rtId, from, to, rtIdScope?)RecomputeJobInfoTriggers/coalesces an optimistic recompute of [from, to), optionally per entity. Returns the job snapshot.
addComputedColumn(rtId, name, formula, resultType, indexed?)ArchiveTransitionResultAdds a computed column and backfills it (optimistic / atomic).
updateComputedColumnFormula(rtId, name, formula)ArchiveTransitionResultRe-formulates a computed column (versioned backfill + atomic swap). Rejected when another computed column references it.
removeComputedColumn(rtId, name)ArchiveTransitionResultRemoves a computed column (physical column left as an orphan).
addArchiveColumn(rtId, path, indexed?)ArchiveTransitionResultAdds an ingested column for an attribute of the target type.
retryComputedColumnBackfill(rtId, name) / repairComputedColumn(rtId, name, from?, to?)RecomputeJobInfoQueues the backfill again / repairs empty cells of an Active column.
backfillRollupFromSource(rtId)RecomputeJobInfo (none for an empty source)Queues a backfill of a rollup over the whole source history; no result when the source holds no data.

The matching read queries are runtime.streamData.recomputeJobsFor(rtId): [RecomputeJobInfo!]! (most recent jobs, newest first, capped at 50) and streamData.coverageFor(rtId) (see Archive Coverage).

Rollup read DTOs (rollupsFor, the generated CRUD projections) expose bucketAlignment, referenceTimeZone, dayStartOffsetMs and sources[] with the validity spans, plus the deprecated derived field sourceArchiveRtId — populated only when the rollup declares exactly one unbounded source, and null for every genuinely multi-source rollup and for a single source that carries a span. Clients that render the source themselves apply the same precedence for display: a non-empty sources wins, otherwise the deprecated scalar is shown as one unbounded source.

All mutations require StreamDataAdmin. Domain exceptions (§Exceptions below) surface as stable GraphQL error codes via error.extensions.OctoDetails.

CRUD on archives (List / Get / Update) is auto-generated from the CK model and lives under runtime.systemStreamDataArchives / …RawArchives / …RollupArchives / …TimeRangeArchives. What an activated archive cannot apply is refused.

GraphQL — path enumeration​

query availableArchivePaths(ckTypeId: ID!, maxDepth: Int = 5): [ArchivePathInfo!]!

type ArchivePathInfo {
path: String! # "sensor.reading.value", "readings[*].value"
primitiveType: String # null when isRecord = true
isRecord: Boolean!
isArray: Boolean!
recordTypeId: String
inheritedFromCkTypeId: String # null if attribute belongs to ckTypeId itself
}

The studio's AttributePathPicker consumes this for archive create/edit. Admin-only.

REST — /api/v1/streamData​

MethodPathDescription
POST/enable / /disableTenant-level toggle. /disable answers 409 while any archive is still Activated.
POST/archives/{archiveRtId}/activateSame as GraphQL activateArchive.
POST/archives/{archiveRtId}/disable / /enable / /retryStatus transitions.
DELETE/archives/{archiveRtId}Same as GraphQL deleteArchive.
POST/archives/{rollupRtId}/freeze / /unfreeze / /rewindRollup-only controls.
POST/archives/{rollupRtId}/recomputeOptimistic recompute of [from, to) (rtIdScope optional). Returns the job snapshot.
GET/archives/{archiveRtId}/recompute-jobsRecent recompute jobs (newest first) for debugging.
POST/archives/{archiveRtId}/insertTimeRangeBulk time-range insert, see insertTimeRange below.
GET/archives/{archiveRtId}/rollupsActive rollups referencing this archive as a source.
GET/archives/{archiveRtId}/coverageMeasured coverage of the archive's whole family (see Archive Coverage).

REST and mutations run the archive methods​

The archive lifecycle and rollup endpoints and the matching streamData mutations call the archive methods, so the three ways give the same result:

RESTMutationMethod
POST /archives/{id}/activateactivateArchiveSystem.StreamData/Archive.Activate-1
POST /archives/{id}/disabledisableArchiveSystem.StreamData/Archive.Disable-1
POST /archives/{id}/enableenableArchiveSystem.StreamData/Archive.Enable-1
POST /archives/{id}/retryretryArchiveActivationSystem.StreamData/Archive.RetryActivation-1
DELETE /archives/{id}deleteArchiveSystem.StreamData/Archive.DeleteArchive-1
POST /archives/{id}/freeze?until=freezeRollupArchiveSystem.StreamData/RollupArchive.Freeze-1
POST /archives/{id}/unfreeze?acceptGaps=unfreezeRollupArchiveSystem.StreamData/RollupArchive.Unfreeze-1
POST /archives/{id}/rewind?toBucketEnd=rewindRollupWatermarkSystem.StreamData/RollupArchive.RewindWatermark-1
  • Same contract as before. Routes, bodies and status codes stay: success is 204, a refusal of the lifecycle (for example a transition the status does not allow, STREAMDATA_INVALID_TRANSITION on the method and the mutation) is 400 with the engine message as the body, an archive that does not exist is 400 with the not-found message. The mutations keep their result types and error codes. The REST endpoints are not deprecated.
  • Every call is a method call. It is checked like a method call — the tenant of the token, the role StreamDataAdmin, the data permissions on the archive — and writes one entry to the method audit. A refusal of these checks is 403 with problem details (code: METHOD_FORBIDDEN, for a token of another tenant with parameters.reason: tenant-not-allowed); the mutations answer METHOD_FORBIDDEN. Other method failures answer their documented status codes (for example METHOD_TIMEOUT 504).
  • Behaviour change: a data permission that does not allow writing the archive now refuses these endpoints and mutations; before, only the role was checked.
  • With OCTO_METHODS__STREAMDATA__ENABLED=false the endpoints and mutations run the lifecycle directly, as before.

Authorization of the REST endpoints​

EndpointsRequires
POST /enable, POST /disable (tenant toggle)scope octo_api and the tenant role TenantManagement
Archive lifecycle: POST /archives/{id}/activate, /disable, /enable, /retry, DELETE /archives/{id}scope octo_api and the tenant role StreamDataAdmin
Rollup operations: POST /archives/{rollupRtId}/freeze, /unfreeze, /rewind, /recompute, /backfill-from-source, POST /rollups/repair (also with dryRun=true)scope octo_api and StreamDataAdmin
Columns: POST /archives/{id}/computed-columns, PUT / DELETE /archives/{id}/computed-columns/{name}, POST …/computed-columns/{name}/retry, POST …/computed-columns/{name}/repair, POST /archives/{id}/columnsscope octo_api and StreamDataAdmin
Row writes: POST /archives/{id}/insert, POST /archives/{id}/insertTimeRangescope octo_api; a batch with a manual point also needs StreamDataAdmin
Reads (GET …)scope octo_api or octo_api.read_only

On the archive lifecycle, rollup and column endpoints, a caller with the scope but without StreamDataAdmin gets 403 and nothing changes. The body names the role and carries a stable code:

{ "message": "Access is denied: this operation requires the role 'StreamDataAdmin' in the tenant. …", "code": "StreamDataAdminRequired" }

The row writes answer differently: a batch of insert or insertTimeRange with a manual point from a caller without StreamDataAdmin is refused as a whole with 403 and an error body (statusCode, statusDescription, message naming the role) without code. Nothing of the batch is written. Some point checks come before the role check: a batch with an invalid point (for example an rtId that is no runtime id) answers 400 first; others, such as the time window of an insertTimeRange point, are checked later, so such a batch can answer 403 first. Automated points need the scope only.

Breaking change

In older versions these endpoints only checked the octo_api scope, so a client without any stream-data role could activate, disable or delete archives and change rollups and columns. Such callers now get 403. Give the user or the client-credentials client that runs these calls (CI/CD jobs, scripts, octo-cli sessions) the tenant role StreamDataAdmin. Users and clients that already work with the GraphQL mutations or the archive methods have it.

The enabled state is read through the aggregate GET {tenantId}/v1/features/status (replacing the former GET /api/v1/streamData/status): it reports all four tenant capabilities the tenant delete/detach guard evaluates — streamData with { instanceEnabled, tenantEnabled }, plus communication, reporting and aiServices with { tenantEnabled } each. A read failure answers 500; the state is never reported as "disabled" when it cannot be read.

REST column endpoints run the column methods​

Since this version the column and computed-column endpoints call the column methods of System.StreamData 1.28.0, so REST, the method and the mutation make the same change:

RESTMethod
POST /archives/{id}/computed-columns?name=&formula=&resultType=&indexed=System.StreamData/Archive.AddComputedColumn-1
POST /archives/{id}/columns?path=&indexed=System.StreamData/Archive.AddColumn-1
DELETE /archives/{id}/computed-columns/{name}System.StreamData/Archive.RemoveComputedColumn-1
PUT /archives/{id}/computed-columns/{name}?formula=System.StreamData/Archive.UpdateComputedColumnFormula-1
POST /archives/{id}/computed-columns/{name}/retrySystem.StreamData/Archive.RetryComputedColumnBackfill-1
POST /archives/{id}/computed-columns/{name}/repair?from=&to=System.StreamData/Archive.RepairComputedColumn-1
  • Same contract as before. Routes, query parameters and status codes stay: add, update and remove answer 204; retry and repair answer 200 with the queued job (rtId, state, …, computedColumnName) or 204 when there is no job. A refusal of the stream-data engine is 400 with the engine message as the body, also for a path that reaches an attribute with access: Hidden. The endpoints are not deprecated and have no sunset date.
  • Every call is a method call. It is checked like a method call — the tenant of the token, the role StreamDataAdmin, the data permissions on the archive — and writes one entry to the method audit. A refusal of these checks is 403 with problem details (code: METHOD_FORBIDDEN; for a token of another tenant parameters.reason: tenant-not-allowed). A queued backfill or repair is not cancelled when the client disconnects.
  • Behaviour changes: a token of another tenant and a data permission that does not allow writing the archive now refuse these endpoints (before, only the role was checked). Updating, retrying or repairing a computed column the archive does not have answers 400 with the engine message (the update answered 500 before). A resultType number outside the enum answers 400 with code: METHOD_VALIDATION_FAILED. A change that takes longer than 60 seconds (the time limit of the methods) answers 504 with code: METHOD_TIMEOUT; the change keeps running, so check the archive or its recompute jobs before you repeat the call.
  • With OCTO_METHODS__STREAMDATA__ENABLED=false, or in a tenant whose System.StreamData is older than 1.28.0, the endpoints run the change directly, with the same tenant and data-permission checks and audit entry.

insertTimeRange​

The body is an array of points:

[{
"rtId": "65f0…",
"ckTypeId": "Basic.Energy/EnergyMeasurement",
"from": "2026-10-01T00:00:00Z",
"to": "2026-10-01T00:15:00Z",
"attributes": { "Amount.Value": 1.25, "Amount.Unit": "KWh", "DataQuality": 1 },
"origin": "manual",
"reason": "meter exchanged"
}]
  • origin is manual or automated (case-insensitive); absent means automated. reason is only allowed with manual. The writer of a manual row is taken from the caller's token, never from the body.
  • ckTypeId must be the archive's target in its unversioned form (Model/Type).
  • Every attribute value must fit its column type. An enum column takes the key or the member name (case-insensitive) and stores the key — "KWh" and 1 are the same value.
AnswerWhen
200The write result: stored, skipped, skippedByReason and skippedRows, the rows not stored (at most 1000, each with rtId, from, to, origin and reason). See Write result.
204The body is empty.
400The batch is refused and nothing is written: an invalid origin, a reason without manual, a manual write whose token names neither a subject nor a client, a ckTypeId that is not the archive's target, a window whose to is not after from, or a value that does not fit its column. The message names the point index, the column and the expected type, for an enum column with the valid names, for example point 1: column 'MeterReading' expects an integer, got text 'kWh'.
409A manual row could not be stored; the body carries the message and the write result.

Pipeline node — SaveStreamDataInArchive@1​

A PathNodeConfiguration node with a required property ArchiveRtId : OctoObjectId. The node routes each incoming StreamDataPoint to the configured archive via IStreamDataRepository.InsertAsync.

Two companions write to a TimeRangeArchive:

  • SaveTimeRangeStreamDataInArchive@1 — takes rows that already carry the source rtId, reads the window from two attribute paths, and verifies that every distinct source rtId in the batch exists before inserting.
  • SaveTimeRangeSeriesInArchive@1 — takes a whole series (a key plus its array of windowed values) and does both halves itself: it resolves or creates one anchor entity per series, then bulk-inserts every value as an archive row. Use it when the alternative would be building a runtime entity per window merely to satisfy the node above — a real ingest measured 78 rows/s that way, against 1,264 rows/s here. Before it writes anything the node checks that the archive exists, is a time-range archive, is Activated and targets the configured CK type, so a misconfigured run fails instead of leaving anchors without measurements. A value whose window is missing or does not end after it starts is skipped, and a series without a single usable window gets no anchor.

All three nodes share these options:

OptionMeaning
OriginAutomated (default — a pipeline without it writes exactly as before) or Manual.
ManualReasonOptional reason stored with every manual row of the node. Only with Origin: Manual.
ManualReasonPathSaveStreamDataInArchive@1 and SaveTimeRangeStreamDataInArchive@1: a path, relative to each item at Path, that carries the reason of that row, for example $.manualReason next to rtEntity in the update info. The CK type needs no reason attribute.
ManualReasonAttributePathSaveStreamDataInArchive@1 and SaveTimeRangeStreamDataInArchive@1: an attribute of the upstream entity that carries the reason. The CK type must declare it; prefer ManualReasonPath.
ManualReasonPropertySaveTimeRangeSeriesInArchive@1: a property of each value object that carries the reason of its row.
WriteResultPathPath the write result { stored, skipped, skippedByReason } is stored at, so a later node can branch on it. The node does not write skippedRows.
FailOnSkippedRowsFail the node when the archive did not store every row. Default false: rows not stored are reported as a warning. A manual row that could not be stored always fails the node.

The reason of a manual row is taken in this order: the per-row value from the request (ManualReasonPath / ManualReasonProperty), then the attribute (ManualReasonAttributePath), then ManualReason. Every reason option is refused unless Origin is Manual. The writer of a manual row is resolved by the platform (see Row origin).

The mesh-adapter service account holds StreamDataWriter. Targeting an inactive archive surfaces a clear pipeline error (ArchiveNotActivatedException).

SDK — IStreamDataRepository​

// Data plane
Task InsertAsync(OctoObjectId archiveRtId, StreamDataPoint point);
Task InsertAsync(OctoObjectId archiveRtId, IEnumerable<StreamDataPoint> points);
Task InsertTimeRangeAsync(OctoObjectId archiveRtId, IEnumerable<TimeRangeStreamDataPoint> points);

Task<StreamDataQueryResult> ExecuteQueryAsync(OctoObjectId archiveRtId, StreamDataQueryOptions options);
Task<StreamDataQueryResult> ExecuteAggregationQueryAsync(OctoObjectId archiveRtId, StreamDataAggregationQueryOptions options);
Task<StreamDataQueryResult> ExecuteGroupedAggregationQueryAsync(OctoObjectId archiveRtId, StreamDataGroupedAggregationQueryOptions options);
Task<StreamDataQueryResult> ExecuteDownsamplingQueryAsync(OctoObjectId archiveRtId, StreamDataDownsamplingQueryOptions options);

// Control plane (called by IArchiveLifecycleService)
Task EnsureArchiveCreatedAsync(CkArchive archive);
Task DeleteArchiveAsync(CkArchive archive);

Bulk inserts use all-or-nothing pre-validation: every point is validated before any SQL is sent; a violation throws RequiredAttributeMissingException carrying the index of the offending point — no row is written. A DB-level failure after pre-validation surfaces as exception.

Bulk Insert Semantics​

  1. Resolve archive (single lookup), status check.
  2. Pre-validate every point in the batch — required-path coverage, type compatibility, path resolution. Stops at the first violation.
  3. On violation → throw with the offending index. No row written.
  4. On success → single multi-row INSERT … ON CONFLICT … execution.

Pipeline callers see batch success or full failure; partial-commit scenarios are limited to transient DB failures (operational, see Reconciliation below).

Retention​

Retention is partition-based and per-archive (work in progress — design captured here; some attributes are not yet exposed in the create form).

  • DDL: archive tables are PARTITIONED BY DATE_TRUNC('day', timestamp). Drop-partition is metadata-only on CrateDB.
  • RawRetentionMs on the Archive base type defines the retention horizon. null = retain forever.
  • The ArchiveRetentionScheduler (IHostedService, hourly) drops partitions older than now() - RawRetentionMs per archive, per tenant. Failures are isolated; one bad archive does not block the rest.

For downsampling-style retention (raw rows folded into a coarser archive before deletion), use a RollupArchive pointing at the source archive — the rollup is the long-term store while the raw archive's retention can be aggressive.

Reconciliation​

CkArchive entities live in MongoDB; archive tables live in CrateDB. There is no shared transaction. The lifecycle service keeps the two reconcilable without 2PC:

  1. All DDL is idempotent (IF EXISTS / IF NOT EXISTS).
  2. Operation order is Crate-first, Mongo-last: Activate runs CREATE TABLE, then flips Status in Mongo. Delete runs DROP TABLE, then soft-deletes the entity. Mongo is the source of truth.
  3. Every data-plane call checks Status == Activated before touching Crate. While step 1 has run but step 2 has not, the API rejects with ArchiveNotActivatedException.
  4. On startup the ArchiveReconciler enumerates Activated archives per tenant and (re-)provisions any missing CrateDB tables. Drift in the other direction (table without entity) is logged but not auto-dropped.

Concurrency​

ScenarioBehavior
Two parallel Activate on the same archiveSerialized via RepositoryDistributedLockService. The second call observes Activated and returns idempotently.
Disable while inserts are in flightIn-flight inserts complete. New inserts after the flip raise ArchiveNotActivatedException.
Delete while inserts are in flightSame as Disable, plus the DROP TABLE may retry once with a short backoff if the table is briefly locked.
Activate fails mid-DDLStatus → Failed. EnsureArchiveCreatedAsync is idempotent (CREATE TABLE IF NOT EXISTS), so retry is safe.
Bulk insert on disabled archiveWhole batch rejected on the single status lookup.

Exception Catalog​

All in Meshmakers.Octo.Runtime.Contracts.StreamData. Common base: StreamDataException (extends RuntimeRepositoryException). Surfaced via GraphQL error.extensions.OctoDetails and via REST status codes.

ExceptionThrown when
StreamDataExceptionBase — generic StreamData failure.
StreamDataNotEnabledExceptionInstance or tenant flag is false on an operation that requires it.
ArchiveNotFoundExceptionarchiveRtId does not resolve to an Archive entity.
ArchiveNotActivatedExceptionArchive exists but Status ≠ Activated on insert / query.
ArchiveSchemaImmutableExceptionAn update of an activated archive removes a column or changes its type or the target type.
RollupSchemaImmutableExceptionAn update of an activated rollup changes its aggregations, bucket, alignment, time zone or sources.
ArchivePathInvalidExceptionA CkArchiveColumn.Path cannot be resolved against TargetCkTypeId.
ArchiveColumnTypeUnsupportedExceptionAn attribute type cannot be mapped to a CrateDB column type.
RequiredAttributeMissingExceptionInsert lacks a value for a required: true scalar path. Carries the offending point index.
ArchiveActivationFailedExceptionDDL execution failed during activation. Wraps the underlying SQL error.
InvalidArchiveStateTransitionExceptionLifecycle mutation called against an incompatible status.
RollupSourceInUseExceptiondeleteArchive invoked on an archive that is still listed as a source of a rollup.
RollupSourceMissingExceptionA declared source archiveRtId does not exist or is soft-deleted.
RollupSourceNotActivatedExceptionA declared source archive exists but is not Activated.
RollupSourcesRequiredExceptionA rollup declares no source at all.
DuplicateRollupSourceExceptionThe same source archive is listed more than once.
RollupSourceSpanInvertedExceptionA bounded validity span has ValidFrom >= ValidTo.
RollupSourceSpanOpenEndConflictExceptionMore than one source has an open start, or more than one an open end.
RollupSourceSpanOverlapExceptionTwo validity spans overlap.
RollupSourceSpanNotOnBucketBoundaryExceptionA span boundary is not on the rollup's bucket grid in its reference time zone.
RollupSourceTargetTypeMismatchExceptionA source targets a different CK type than the rollup.
RollupSourcePathMissingExceptionAn aggregation path/function pair does not resolve on one of the sources.
RollupSourceCycleException / RollupCycleExceptionThe declared sources form a cycle, or the rollup lists itself.
RollupSourceDeclarationConflictExceptionThe deprecated SourceArchiveRtId disagrees with a non-empty Sources list.
RollupBucketIntervalExceptionA source's granularity is incompatible with the rollup's bucket size / alignment.

Observability​

Metrics​

MetricTypeTags
streamdata.archive.countGaugetenant, status
streamdata.archive.status_transitionsCountertenant, archive, from, to
streamdata.archive.activation_duration_msHistogramtenant, archive, outcome
streamdata.insert.duration_msHistogramtenant, archive, batch_size_bucket
streamdata.insert.pointsCountertenant, archive
streamdata.insert.required_violationsCountertenant, archive
streamdata.query.duration_msHistogramtenant, archive, query_type
streamdata.query.rows_returnedHistogramtenant, archive, query_type
streamdata.crate.connections.openGauge(instance-wide)
streamdata.crate.retention_partitions_droppedCountertenant, archive
streamdata.crate.rollup_rows_insertedCountertenant, rollup_archive

Traces​

Activity sources: Meshmakers.Octo.StreamData (top-level operations) and Meshmakers.Octo.StreamData.Crate (DB calls). Span attributes: streamdata.archive.rtid, streamdata.archive.target_cktype, streamdata.tenant.

Audit trail​

Status transitions are emitted as RtEvent records through IEventRepository with source = RtEventSourcesEnum.StreamData. The triggering user is encoded in the event message; auto-transitions use system:reconciliation. The studio's archive details view exposes the history via the standard event query path.

Creating an Archive​

From the CLI​

# Tenant-level enable (required once per tenant)
octo-cli -c EnableStreamData

# Archives are runtime entities — create them through the studio, GraphQL,
# or by rt-importing a runtime-model YAML. Then:
octo-cli -c ActivateArchive -id 69fda707d47638c68edc7fea

See octo-cli — ActivateArchive and related archive commands in the sidebar for the full command surface.

From the Studio​

Navigate to Repository → Stream Data Archives. The list shows every archive on the active tenant with a status badge and per-row actions (Activate, Disable, Enable, Retry, Delete, Copy ID). The New Archive, New Rollup, and New Time-Range entry points walk through the create flow with the AttributePathPicker for column selection.

See Studio: Archives for the UI walkthrough.

From GraphQL​

# 1. Create the archive via the auto-generated runtime mutation
mutation {
runtime {
systemStreamDataRawArchives {
create(input: {
rtWellKnownName: "EnergyMeterArchive",
targetCkTypeId: "Industry.Energy/EnergyMeter",
columns: [
{ path: "voltage", required: true, indexed: true },
{ path: "current", required: true, indexed: true },
{ path: "powerFactor", required: false, indexed: false }
]
}) { item { rtId } }
}
}
}

# 2. Activate
mutation {
streamData {
activateArchive(rtId: "65d5c447b420da3fb1238201") {
rtId
status
}
}
}

Best Practices​

  1. One archive per concern. Different retention, different query patterns, different consumers → different archives.
  2. Be explicit about required. Required scalars become NOT NULL columns and are validated app-side before insert.
  3. Index sparingly. Indexes cost storage and insert throughput. Default to indexed; opt out for columns that are read but never filtered.
  4. Roll up early. A RollupArchive is far cheaper to query over long horizons than a raw scan.
  5. Pick alignment for the use case. Energy / EDA workflows want calendar alignments (monthly, weekly); engineering telemetry usually wants FixedSize.
  6. Freeze before bulk imports. When backfilling a source archive's history, freeze any dependent rollups, finish the import, then unfreeze with acceptGaps: false (or rewind the watermark) to re-aggregate cleanly.
  7. Soft-delete first. Disable an archive to confirm no consumer breaks before deleting.

See Also​