ECST — Event-Carried State Transfer
Architecture-version applicability
| Architecture version | Status | Notes |
|---|---|---|
| V2 | Adopted | Established as the default cross-service event shape. |
| V3 | Adopted | Combined with event-sourced persistence and the shared Service Bus backbone. |
| V4 | Not reviewed | A V4 baseline has not been incorporated into this documentation set. |
Problem
In a choreographed, event-driven platform (§ 8), consumers of a domain event often need context about the subject to act — an incident’s tenant, severity, current owner, source alerts. Two anti-patterns emerge:
- Thin events — publish only
{aggregateId, changeType}and force every consumer to call back into the producer to fetch context. Creates a chatty, synchronous coupling and makes the producer a hotspot. - Fat events with everything — publish the entire aggregate on every change. Wasteful, hard to evolve, and leaks internal state.
ECST is the middle path: events carry the state consumers need to act, without becoming a mirror of the aggregate.
Solution
Every domain event carries a consumer-required state snapshot in its payload — enough for the majority of consumers to act without a callback.
Structure:
- Event metadata — CloudEvents envelope (
id,type,source,subject,time,correlationId,causationId). - Aggregate identity —
{aggregateId, aggregateType, sequence}. - State snapshot — the fields consumers are known to need. Curated per event type; documented in the AsyncAPI spec (ADR-0005).
- Change delta — what changed in this event (before / after or just after).
Design rules:
- Curate the snapshot to the union of consumer needs, not the aggregate’s full state.
- Version the schema — evolve additively where possible (Schema Evolution).
- Never include secrets, tokens, or unredacted PII.
- Publishers and consumers agree the contract via AsyncAPI; the event store is the aggregate’s source of truth.
When to use
- All ION domain events published to the shared Service Bus event backbone.
- Any cross-context communication between bounded contexts.
Not for:
- Command messages (targeted, request-shaped) — those are intent, not state.
- Very large state (blob-scale) — use a reference + external store (see the C-6 blob-reference trigger in the V4 capacity plan for a scaling variant).
Consequences
Positive
- Consumers can act on the event alone — no synchronous callback.
- Producer is not a runtime hotspot for consumer reads.
- Enables independent evolution of consumers.
- Replays are self-contained — the event carries what it needed at the time.
Negative
- Event payloads grow — throughput sizing must account.
- Snapshot curation is a design decision — get it wrong and add a new consumer requires a schema change.
- Schema evolution discipline is mandatory (Schema Evolution).
Failure modes
- Snapshot too thin — consumers still call back; you recreated the anti-pattern.
- Snapshot too fat — throughput cost + PII risk.
- Version drift — producers and consumers on different schema versions; break.
References
references/Architecture- Event Sourcing.mdreferences/Event Sourcing- Design.md- ADRs: 0004 — Choreography over orchestration, 0005 — CloudEvents + AsyncAPI, 0006 — Event sourcing
- Related patterns: Idempotent Write, Schema Evolution
Applied in
- All ION domain events (incident, investigation, ticket, customer-collaboration bounded contexts)
- Watchtower → Cogs event handoff
- Cogs → Pigeon notification triggers
- Watchtower → Veritas dashboard projections