Bookmarks

Domain event

A fact that has already happened in the domain and matters to the business, for example “the order has shipped”; recorded in the past tense.

Also: domain event, domain-level event, event of the domain model

checked 8 Nov

All terms

A domain event is a way of telling the rest of the system that something has already happened in the domain: not “send an email”, but “the order has shipped”. The event records an accomplished fact and carries the context — what exactly happened, when, and with which data.

How an event is named and what it carries

An event name is a phrase in the past tense in the language of the domain: OrderShipped, OrderPlaced, PaymentReceived. The data of an event does not change: it records a fact, so the event log can be used to reconstruct and verify what exactly happened in the system.

pythonThe OrderShipped event — the order has been handed to the delivery service
OrderShipped(    order_id=100123,    shipped_at="2026-11-06T10:15:00Z",    boxes=2,)
PartExample
NameOrderShipped — the order has been handed to the delivery service
Timethe moment the fact occurred
Dataorder number, delivery address, contents of the parcels

How an event differs from a command

A command expresses an intention and may fail (“create an order”); an event is an accomplished fact that can no longer be undone. That is why commands are named with an imperative verb and events in the past tense.

Where domain events are used

  • an aggregate publishes an event after a successful change — this way the side effects on other aggregates are stated explicitly;
  • handlers within the same bounded context continue the process;
  • facts interesting to other contexts are carried outside the service as integration events — they are published only after the transaction commits successfully.

Where the term comes from

Evans’s 2003 book has no separate domain event pattern: practice added it. Do not confuse it with Martin Fowler’s 2005 article Domain Event: for him, that is the name for a record of an incoming influence on the system, on which event sourcing is built.

Sources

the term is written from these pages

Verified 8 Nov

Not to be confused with

what it is mixed up with and how it differs

  • CQRScommand query responsibility segregation

    CQRS separates reads and writes; domain events are often published on the write side to update the read models.

  • event sourcing

    In event sourcing an event is not a notification of a fact but the record itself: the state of an aggregate is derived from the chain of such events.

  • message queue

    A message queue is a delivery transport, a domain event is a concept of the domain model; integration events travel through a broker.

In depth in the references

where the topic is covered in detail