Skip to main content

Event

An immutable fact that something has occurred. Events represent state changes that have already happened and cannot be rejected.

Naming Convention

Events use past tense naming - they describe what happened:

  • OrderCreated
  • StockReserved
  • PlayerRegistered
  • FundsDeposited

Event vs Command vs Notification

AspectEventCommandNotification
TensePastImperativePresent
PersistedYesNo (transient)No (transient)
SequencedYesYes (expected)No
RejectableNoYesN/A
ExampleOrderCreatedCreateOrderCompensationRequired

In Angzarr

Events are wrapped in an EventPage containing:

  • Sequence number (position in aggregate timeline)
  • Timestamp
  • Payload (or PayloadReference for large events)

Events are stored in the Event Store and are the source of truth for aggregate state.

Internal vs External Events

Events can originate from:

  • Internal decisions: Aggregate processed a command and decided to emit events
  • External facts: Saga or external system reporting something that already happened

External facts use a FactSequence marker instead of a sequence number. The idempotency key (Cover.external_id) propagates through the entire system, enabling:

  • Deduplication at every coordinator
  • Full traceability from external system to all downstream effects
  • Consistent handling across sagas, process managers, and projectors