# Event-Carried State Transfer

> Include all relevant state data in the event so consumers don't need to call back to the source.

- **Category**: Event Driven Architecture
- **Subcategory**: core
- **Canonical URL**: https://designpattern.fyi/patterns/event_carried_state_transfer/

---

## Description
**Context**: Services consume events from other services. With Event Notification, consumers must call back to the source to get full data, which increases coupling, latency, and load on the source service.

**Problem**: How can consumers be fully decoupled from the producer without needing to call back for additional data?

**Solution**: Include all the data that consumers need directly in the event payload. When an event is published, it carries the full state (or a relevant subset) that consumers require for their processing. Consumers maintain their own local copy of the data by processing these events, eliminating the need for synchronous callbacks. This is essentially building a local read-only replica of the source data through events.



## Use Cases
Use when consumers need full data from the producer and you want to eliminate callback coupling and improve availability.





## Trade-offs


### Advantages

- Consumers do not need to call back to the source, improving availability and reducing latency

- Consumers maintain local copies of the data they need, enabling autonomous operation

- Reduces load on the source service from callback requests

- Enables consumers to work even when the source service is unavailable




### Considerations & Drawbacks

- Larger event payloads increase bandwidth and storage requirements

- Events become a public API that must be versioned carefully

- Data in consumer replicas is eventually consistent with the source

- More data in events increases coupling between producer and consumer schemas







---
**Reference**: [Original Source](https://microservices.io/patterns/data/event-driven-architecture.html)

