Events vs Commands vs Notifications Explained
On this page
Learning Objective
Distinguish an event from a command and from a query, explain why events are immutable past-tense facts rather than instructions, and choose deliberately between a thin notification event and a fat event-carried-state-transfer event.
Concept Explanation
An event is a statement that something happened, in the past, that cannot be taken back. OrderPlaced, PaymentCaptured, AddressChanged, SubscriptionCancelled. The grammar matters more than it looks: past tense signals that the fact is already true and the producer is not asking anyone's permission. A command, by contrast, is an instruction aimed at a specific recipient, expressed in the imperative: PlaceOrder, CapturePayment, ChangeAddress. A command can be rejected, because the work has not happened yet. An event cannot be rejected, because it already has.
That distinction sounds pedantic until you watch a system get it wrong. A message named SendConfirmationEmail published to a broker looks like an event but is really a command wearing an event's clothes, and it reintroduces exactly the coupling events were supposed to remove: the producer has decided what the consumer should do, which means the producer once again knows about the consumer's responsibilities. Publish OrderPlaced instead and let whichever service owns email decide that an email is warranted. The test is simple: if the name tells a consumer what to do, it is a command; if it tells consumers what is true, it is an event.
A third category is worth separating out: the query, a request for information that changes nothing. Events, commands, and queries map to three distinct intents, and the CQRS phase later in this course is essentially about taking the command and query distinction seriously at the architectural level rather than only at the naming level.
Events also differ enormously in how much they carry. A notification event is thin: it says OrderPlaced with an orderId and little else, and any consumer that needs details calls back to the order service to fetch them. This keeps the event small and keeps the producer free to change its internal model, but it reintroduces a synchronous dependency at read time and can produce a stampede of callbacks when a popular event fans out. Event-carried state transfer is the opposite: the event carries a full copy of the relevant state, so consumers need no callback at all and can maintain their own local replica of the data they care about. This maximizes decoupling and consumer autonomy, at the cost of larger messages, duplicated data, and a much heavier schema contract that is harder to evolve.
Beyond those two sits the event-sourcing event, covered from the next phase onward, which is a different animal again: it is not primarily an integration message but the authoritative record of a state change, stored permanently and replayed to reconstruct state. Many mature systems deliberately keep two vocabularies: fine-grained internal domain events used for event sourcing inside one service boundary, and coarser-grained public integration events published outward, so that internal model changes do not leak into every other team's consumers. Conflating those two roles, publishing raw internal domain events as the public contract, is one of the most common and most expensive mistakes in event-driven design.
| Message Type | Grammar | Recipient | Can It Be Rejected? | Example |
|---|---|---|---|---|
| Command | Imperative, present tense | One specific handler | Yes - it has not happened yet | CapturePayment |
| Event | Past tense | Zero to many subscribers | No - it already happened | PaymentCaptured |
| Query | Interrogative | One specific handler | Not applicable - changes nothing | GetOrderStatus |
| Notification event | Past tense, thin payload | Subscribers, who then call back for detail | No | OrderPlaced { orderId } |
| Event-carried state transfer | Past tense, full payload | Subscribers, who need no callback | No | OrderPlaced { orderId, items, total, shippingAddress } |
Worked Example: One Business Moment Modeled Three Ways
The same moment, a customer placing an order, produces three very different systems depending on which message shape is chosen. Only the second and third are actually events.
// (1) WRONG: a command dressed as an event. The producer has decided what
// each consumer should do, so the coupling it was trying to remove is back.
{
"type": "SendOrderConfirmationEmail",
"to": "customer@example.com",
"template": "order_confirmation_v3"
}
// (2) NOTIFICATION EVENT: thin, cheap, stable schema. Any consumer needing
// detail must call GET /orders/9f12 - a synchronous dependency at read time.
{
"type": "OrderPlaced",
"eventId": "3f1c8a1e-...",
"orderId": "9f12",
"occurredAt": "2026-03-04T10:22:31Z"
}
// (3) EVENT-CARRIED STATE TRANSFER: fat, self-contained. Consumers build
// their own local read models and never call back, but the schema is now a
// heavy contract that many teams depend on.
{
"type": "OrderPlaced",
"eventId": "3f1c8a1e-...",
"eventVersion": 2,
"orderId": "9f12",
"customerId": "c-771",
"occurredAt": "2026-03-04T10:22:31Z",
"items": [{ "sku": "KB-88", "qty": 1, "unitPriceCents": 12900 }],
"totalCents": 12900,
"currency": "USD",
"shippingAddress": { "country": "US", "postalCode": "94110" }
}Real-World Examples
- Martin Fowler's widely referenced 2017 talk and article "What do you mean by Event-Driven?" explicitly named and separated four patterns that teams were conflating under one label: event notification, event-carried state transfer, event sourcing, and CQRS. That taxonomy is now standard vocabulary in the industry precisely because so many teams had adopted "event-driven architecture" without agreeing on which of the four they meant, and then discovered their consumers had incompatible expectations about what an event should contain.
- The CloudEvents specification, a Cloud Native Computing Foundation project that reached version 1.0 in 2019 and is supported by Azure Event Grid, Knative, and Alibaba Cloud among others, standardizes exactly the envelope fields this lesson describes: id, source, type, subject, time, and data. It exists because every organization that built an event-driven platform independently invented the same metadata fields in mutually incompatible ways, which made cross-system event routing and tracing far harder than it needed to be.
Review Questions & Answers
The tense encodes who owns the decision. A past-tense fact says the producer has already committed to something being true and is broadcasting it, leaving each consumer free to decide independently what that fact means for its own responsibilities. An imperative name says the producer has already decided what the consumer should do, which means the producer is holding knowledge about consumer behavior, and that knowledge has to be updated every time consumer responsibilities change. The payload can be identical while the coupling implied by the two designs is completely different.
A thin notification is right when consumers are few, are inside the same trust and latency boundary as the producer, and need different subsets of the data, so a callback is cheap and avoids shipping a large payload nobody fully uses. It is clearly wrong when the event fans out to many consumers that would all call back simultaneously and create a thundering-herd load on the producer, when consumers must keep working while the producer is unavailable, or when the consumer needs the state as it was at the moment of the event rather than as it is now, since a callback returns current state and may have already moved on.
Every internal model change becomes a breaking change for other teams. Internal domain events tend to be numerous, granular, and shaped by the producer's own aggregate design, so refactoring that aggregate, splitting an entity, renaming a field, changing an internal state machine, is immediately visible to every external consumer. Publishing a deliberately coarser, more stable set of integration events creates an anti-corruption layer between the producer's evolving internal model and the contract other teams actually depend on.
Because it forces the correct placement of validation. If a message can be rejected, the validation must happen before it is published, inside the producer, which is where the authority to decide actually lives. Treating an event as an already-true fact means a consumer that dislikes an event has no mechanism to veto it; it can only react, compensate, or raise an alert. That constraint pushes teams to keep authoritative decision-making inside the service that owns the data, rather than spreading veto power across consumers, which is exactly the property that lets consumers be added and removed freely.