Sub topic 5
Event Notification Versus Event-Carried State Transfer
This chapter assumes you know request/response APIs, basic database transactions, and the producer, consumer and broker roles from earlier chapters. It compares two ways to decide what goes inside an event.
Two ways to shape an event
Every event must answer one design question: how much data does it carry? The two common answers are called event notification and event-carried state transfer.
- Event notification is a small event that says something happened. It holds an identifier and little else. A consumer that needs details calls back to the producer.
- Event-carried state transfer is an event that holds the data consumers need. Consumers do not call back. They keep their own copy of what they need.
Here is the same fact written both ways.
{
"id": "6f1c2d9e-3b7a-4c55-9d0e-1a2b3c4d5e6f",
"type": "order.placed",
"version": 1,
"occurredAt": "2026-11-26T11:00:00Z",
"data": {
"orderId": "o-1"
}
}The notification above carries only orderId. The state-transfer version below carries the customer and the total as well.
{
"id": "6f1c2d9e-3b7a-4c55-9d0e-1a2b3c4d5e6f",
"type": "order.placed",
"version": 1,
"occurredAt": "2026-11-26T11:00:00Z",
"data": {
"orderId": "o-1",
"customerId": "c-9",
"totalCents": 4599
}
}How each style behaves
With a notification, the consumer fetches the order after it receives the event. This adds a synchronous call, which brings back the runtime coupling that events are meant to remove.
Comparing the trade-offs
| Concern | Event notification | Event-carried state transfer |
|---|---|---|
| Event size | Small | Larger |
| Producer availability | Consumer needs the producer to be up | Consumer works without the producer |
| Data freshness | Callback returns current state | Event holds state as of its creation |
| Coupling | Consumer depends on the producer's API | Consumer depends on the event schema |
| Consumer data | No local copy needed | Consumer keeps and maintains a copy |
| Sensitive data | Stays at the producer | Spreads to every consumer |
Common errors
- Stale callbacks. A consumer processes
order.placedten minutes late. The callback returns the order as it is now, which may already be cancelled. The consumer must handle states it did not expect. - Callback load. If 20 consumers each call back, one event produces 20 requests against the producer. A burst of events can overload it.
- Bloated events. Teams add every field "just in case." Each added field becomes part of the contract, so later changes are harder (see the schema chapter).
- Leaked private data. A state-transfer event sent to a shared topic reaches every subscriber. Include only the fields consumers have a reason to see.
- Treating the copy as the source of truth. The consumer's copy can lag behind the producer. Plan for eventual consistency.
Choosing between them
Use notification when the data is large, changes often, is sensitive, or the consumer only needs a trigger. Use state transfer when consumers must keep working while the producer is down, or when many consumers need the same data and callbacks would pile up.
A middle path is common. The event carries the fields most consumers use, and rare consumers call back for the rest.
Exercise
A shipping service consumes order.placed and must keep creating shipments even when the order service is down for maintenance. Which event style should it use, and what must the shipping service store?
Show answer
Event-carried state transfer. The event should include the shipping address, items and any other fields shipping needs. The shipping service stores a local copy of that data, so it does not call the order service. It must accept that its copy reflects the order as of the event and may lag later changes.
Exercise
Why can a notification event make a late-processed event misleading?
Show answer
The consumer fetches current state after the event arrives, not the state at the time of the event. If the order changed in between, the consumer sees data that does not match what the event described, so it must handle that case.