Architecture Decision Record

ADR-0015: Stream Topology Is Small Fixed Sets with Subject-Prefix Partitioning

Status: Accepted · Date: 2026-03-06

Status: Accepted

Date: 2026-03-06

Context

BSFG needs a durable per-zone storage topology that remains understandable, keeps operational overhead bounded, and still allows differentiated retention and filtering. Facts are heterogeneous: operational process facts, audit/protocol facts, and document-reference facts do not have identical lifecycle requirements. Large artifacts also require bucket organization that aligns with subject taxonomy without exploding operational complexity.

The topology must answer two related questions:

Options Considered

Option Description Benefits Drawbacks
Single stream and single bucket Place every fact in one stream and every artifact in one object bucket.

|

| | One stream and bucket per domain kind | Create separate streams and buckets for each subject kind such as batch, asset, alarm, lot, and recipe. |

|

| | Topology per producer or zone-pair | Partition streams and buckets by sender, receiver, or replication lane. |

|

| | Small fixed stream set + subject-prefix partitioning + bucket-per-subject-kind (Selected) | Use a small fixed stream set per zone, partition facts by subject prefix, and organize object buckets by subject kind. |

|

|

Decision

Each zone uses a small fixed set of streams:

facts.operational
facts.audit
facts.documents

Facts are partitioned within those streams by subject prefix, for example:

facts.operational.batch
facts.operational.asset
facts.operational.alarm

facts.audit.protocol
facts.audit.security

facts.documents.file
facts.documents.record

This keeps stream count small while still allowing filtering, retention separation, and future growth through subject naming rather than stream multiplication.

Large artifacts are stored in bucket-per-subject-kind object stores, for example:

batch-files
asset-files
alarm-files
document-files
lot-files
recipe-files

Artifact buckets are therefore aligned to subject taxonomy, while fact streams remain aligned to retention and operational class.

Consequences

Benefits:

Tradeoffs: