ADR-0004 — Event-Carried State Transfer as the event-shape default
Forces / Drivers
- Requirement / Constraint:
../context/requirements.md#nfr-4-latency— NFR-4 End-to-end latency < 5 min under normal load; back-queries add hop count and tail latency.../context/requirements.md#nfr-2-reliability— NFR-2 Reliability; consumers must not depend on producer availability.../context/constraints.md#tc-2-external-api-rate-limits— TC-2 External API rate limits (Sentinel 75 writes / 5 min per subscription; Cloudflare 1,200 / 5 min; AbuseIPDB 1,000 / day). Internal back-queries to producers that themselves proxy external systems would compound throttling.../context/capacity-model.md— 400 domain events/s peak at 1000-cust envelope. WithNsubscribers per event, thin-notification events would produce400 × Nback-query RPS on each producer.
- Principle(s) embodied:
§ 7 Event-Carried State Transfer,§ 5 No direct service-to-service calls. - WAF pillar optimized:
performance-efficiency(primary);reliability,operational-excellence(secondary).
Context
ADR-0001 chose event-driven microservices; ADR-0003 chose choreography as the cross-system collaboration model. Both leave one question open: what shape are the events?
Within event-driven architecture there are three common event shapes:
- Notification events (thin). The event says “something happened, ID N, kind K”. Consumers that want the details call the producer’s REST API to fetch them. This is the classic pub/sub notification pattern.
- Event-Carried State Transfer (ECST). The event carries the state consumers need to act. Consumers do not call producers back. Producers control what state they publish; consumers project it locally as needed.
- Event sourcing at the wire. The event log itself is the source of truth; consumers subscribe to the log and project. This overlaps heavily with ECST but is scoped to persistence (see ADR-0006).
ECST is the choice made here. Event sourcing (ADR-0006) is a compatible, layered choice on top: an event-sourced service naturally publishes ECST events off its append-only log.
The primary force is the ADR-0003 rationale itself. Choreography survives producer degradation only if consumers do not require the producer to be up in order to act. A thin-notification model would resurrect the very coupling ADR-0001 and ADR-0003 rejected — services back-calling each other for data, availability chains, and cascading failure. In a choreography-first platform, notification events without state = synchronous coupling in disguise.
The secondary force is the external-integration rate ceiling (../context/capacity-model.md#subsystem-capacity-budgets). Sentinel’s 75 writes / 5 min per customer subscription is a hard cap. If a producer’s REST API proxies the same downstream (as Watchtower does for Sentinel), then every internal back-query for context re-consumes the same customer-scoped quota that live ingestion + write-back already contests. Fat events (ECST) push that quota-consuming read to the ingestion moment, once per event, instead of once per subscribing consumer per lookup.
The tertiary force is fan-out amplification. At the 1000-cust peak of 400 domain events/s, each event fanning out to a handful of subscribers under a thin-notification model would drive back-query RPS on producers into the low thousands — a load producers would then have to size for, contradicting independent-scaling (§ 14).
There is one legitimate exception: very large payloads (raw log dumps, screenshots, attachments) that would violate broker message-size ceilings (Service Bus and Event Hubs both cap around 1 MB per message). For those, a blob-reference pattern applies: the event carries the identifier and location, the blob lives in Azure Storage with lifecycle-matched retention. This is a bounded exception, not a general fallback.
Decision
ION V2 adopts Event-Carried State Transfer (ECST) as the default event shape for all cross-service, cross-system events:
- Events carry the state consumers need to act. Consumers do not call producers back for details. Producers decide what state is included in each event type.
- Schemas are versioned and discoverable via CloudEvents envelopes and AsyncAPI descriptions (ADR-0005). Breaking changes are treated as breaking API changes on the
Trilateral API(§ 10). - Size budget is explicit. Working targets per the capacity model (
../context/capacity-model.md#demand-inputs):- Incident payload: ~8 KB
- Alert payload: ~3 KB
- Entity payload: ~1 KB
- Domain event (state transition): ~2 KB
- Blob-reference is the bounded exception — used only when a payload exceeds the broker per-message ceiling (Service Bus / Event Hubs ~1 MB) or when the payload is materially larger than the working size targets. Blob lifecycle mirrors event retention (hot 6 mo / cold 1 yr per
../context/capacity-model.md#service-targets). - Sensitive-field discipline. PII and other sensitive fields carried in ECST events inherit the broker’s encryption posture; per-field encryption or tokenisation is required where broker-at-rest encryption alone is insufficient for compliance (
../context/constraints.md#bc-3-compliance).
Alternatives considered
- Option A — Notification events + REST back-query to producer. Rejected. Reintroduces producer availability as a runtime dependency of every consumer, defeating ADR-0003 choreography. Back-query fan-out at 1000-cust peak drives producers into low-thousands RPS for data they already know. Producers must size for the sum of all subscribers’ read patterns, contradicting independent scaling. Internal back-queries that proxy external systems (Watchtower → Sentinel) compound against external per-customer throttling.
- Option B — Notification events + a shared read model (BFF-style materialised view). Rejected. A cross-system shared read store becomes a god-object that must know every system’s schema; adds a new system that itself needs DR + scaling + ownership; the read model becomes the availability chain the choreographed platform was designed to avoid. The BFF pattern is retained for UI aggregation (
§ 13) but not for cross-service data delivery. - Option C — Event sourcing + on-demand consumer projection. Not rejected; scoped separately. Event sourcing (ADR-0006) is the persistence pattern; ECST is the wire pattern. They compose: an event-sourced service emits ECST events off its log. This ADR chooses ECST as the wire default independent of whether the emitting service is itself event-sourced.
- Option D — Hybrid per-event: thin notification for high-frequency low-value events, fat ECST for state changes. Rejected as a rule. It creates per-event decision fatigue (“does this event need to be thin?”), forces every consumer to reason about which shape it’s receiving, and produces two different failure modes on the same platform. The blob-reference exception covers the one case (oversize payloads) where thin plus out-of-band delivery is genuinely needed.
Rationale
The chosen shape wins because it makes choreography’s consumer autonomy actual rather than nominal, and it turns the platform’s dominant cost centres from producer read APIs (unmanaged, unshared) into broker throughput + event storage (managed, shared, sized in ../context/capacity-model.md).
- Consumer autonomy. A consumer with the event has everything it needs to decide. No producer call. No producer availability dependency. Choreography’s failure-containment property (ADR-0003) becomes real: if Watchtower’s Sentinel ingestion path degrades, existing enrichment / triage / ticketing on already-published events proceeds unaffected.
- Fan-out cost bounds. With ECST, doubling the number of subscribers to
incident.enricheddoubles broker outbound bandwidth (a well-understood, elastic axis) and adds zero load to producers. With thin notifications, doubling subscribers doubles producer read RPS (a service-owned, hard-to-elastic axis). At 1000-cust peak this is the difference between “add messaging units on the shared Service Bus” and “resize the incident-owner service”. - External-throttle containment. Producer back-queries that proxy external systems (Watchtower ↔ Sentinel, Kingsman ↔ Recorded Future) would re-consume external customer-scoped quotas per subscriber lookup. ECST forces those reads to happen once, at ingestion, then the event is the source of truth for every consumer.
- Compatibility with event sourcing. ADR-0006 (Event Sourcing as persistence strategy) becomes a natural evolution: an event-sourced service’s append log is its ECST feed. No impedance mismatch between the persistence pattern and the wire pattern.
- Compatibility with volatility containment. ADR-0002 requires that a producer’s schema be stable and versioned; ECST honours that by making the event schema the contract. Producers can refactor their internal storage freely as long as their emitted schema is stable — the very independence the decomposition exists to create.
Consequences
Positive
- Consumers never wait on producers for state; producer degradation is contained.
- Producer read APIs are not sized for the sum of subscribers’ read patterns.
- New subscribers add broker fan-out cost, not producer read load.
- Events are self-describing → replayability and audit are natural (feeds ADR-0006 Event Sourcing).
- Aligns with
Trilateral API(§ 10) — events are first-class contracts, not thin pointers. - Bounds internal-cross-service load against external ceilings: TC-2 throttles apply once per ingestion, not once per subscriber lookup.
Negative
- Larger events. ~1.9 MB/s peak ingress at 1000-cust envelope (
../context/capacity-model.md#derived-processing-load) is dominated by ECST payload width. Absorbs into broker sizing but is a real cost. - Broker + event-store storage grows with event size × retention. ~416 GB/mo of domain event body + ~551 GB/mo of alert + entity + incident payloads at 1000-cust plan (
../context/capacity-model.md#data-volume-and-lifecycle). - Sensitive-data surface widens. PII travels in every event, not just in producer-controlled query responses. Requires broker encryption at rest, network isolation, and per-field encryption / tokenisation for the highest-sensitivity fields.
- Schema evolution discipline is non-optional. A breaking change to an event schema now breaks every consumer, not just “the orchestrator” (see ADR-0005 CloudEvents + AsyncAPI and
../patterns/schema-evolution.md). - Broker message-size ceiling (~1 MB) forces the blob-reference pattern for outliers. Requires blob-lifecycle discipline (must match event retention).
- Consumer-side idempotency is required — at-least-once delivery + full state in event means duplicate events cannot cause duplicate side-effects. See
../patterns/idempotent-write.md.
Neutral / follow-ups
- Blob-reference pattern for outsized payloads — to be documented as a first-class pattern in
../patterns/. - Schema evolution catalogue — backward + forward compatibility rules per event type; enforced at CI.
- Sensitive-field policy — which fields require per-field encryption / tokenisation; documented in
../well-architected/security/data-protection/. - Event size ceiling per event type — publish and enforce (CI check) so the working size budget stays working.
WAF Pillar Impact
- Primary pillar:
performance-efficiency— consumers scale independently of producers; producers do not size for aggregate subscriber read load; broker (elastic) carries fan-out cost instead of producer read APIs (inelastic). - Secondary pillars:
reliability— consumers unaffected by producer degradation; failure containment (ADR-0003) becomes actual, not nominal.operational-excellence— event schemas are the contract; ownership of an event is clear; adding a subscriber does not require producer-team coordination.
- Trade-offs:
- Sacrifices thin-event simplicity for fatter, self-describing events.
- Sacrifices lower broker storage cost for consumer autonomy.
- Requires strict schema-evolution and sensitive-field discipline.
- Adds the blob-reference exception + its lifecycle discipline for outlier payloads.
References
../references/Event Sourcing- Design.md— the V3 event-model design that assumes ECST-shaped events on the wire.../references/Event Sourcing- Event Model.md— ION’s event-type inventory and per-event content shape.../references/Architecture- Event Sourcing.md— architectural rationale for events-as-contracts.../references/Design Pattern- Schema Evolution.md,../references/Design Pattern- Idempotent Write.md— the two discipline patterns ECST hard-depends on.../references/Design Pattern- Handling Dual Writes.md— dual-write hazard when producers own both their storage and their event publication.- External: Martin Fowler, “What do you mean by ‘Event-Driven’?” — origin of the ECST terminology and its contrast with notification events.
Related ADRs
- Depends on:
- Enables:
- ADR-0005 — CloudEvents + AsyncAPI as event schema standard (schema discipline ECST hard-depends on).
- ADR-0006 — Event Sourcing as persistence strategy (event-sourced service naturally emits ECST events).
- Related: