# What Do You Mean by “Event-Driven”?

URL:: https://martinfowler.com/articles/201701-event-driven.html
Author:: martinfowler.com
## Highlights
> Event Notification
> This happens when a system sends event messages to notify other systems of a change in its domain. A key element of event notification is that the source system doesn't really care much about the response. ([View Highlight](https://instapaper.com/read/1411951770/16378672))
> Event notification is nice because it implies a low level of coupling, and is pretty simple to set up. It can become problematic, however, if there really is a logical flow that runs over various event notifications. ([View Highlight](https://instapaper.com/read/1411951770/16378678))
> This can make it hard to debug and modify such a flow. ([View Highlight](https://instapaper.com/read/1411951770/16378681))
> Event-Carried State Transfer
> This pattern shows up when you want to update clients of a system in such a way that they don't need to contact the source system in order to do further work. A customer management system might fire off events whenever a customer changes their details (such as an address) with events that contain details of the data that changed. A recipient can then update it's own copy of customer data with the changes, so that it never needs to talk to the main customer system in order to do its work in the future. ([View Highlight](https://instapaper.com/read/1411951770/16378784))
> An obvious down-side of this pattern is that there's lots of data schlepped around and lots of copies. But that's less of a problem in an age of abundant storage. What we gain is greater resilience, since the recipient systems can function if the customer system is becomes unavailable. We reduce latency, as there's no remote call required to access customer information. We don't have to worry about load on the customer system to satisfy queries from all the consumer systems. But it does involve more complexity on the receiver, since it has to sort out maintaining all the state, when it's usually easier just to call the sender for more information when needed. ([View Highlight](https://instapaper.com/read/1411951770/16378786))
> Event-Sourcing
> The core idea of event sourcing is that whenever we make a change to the state of a system, we record that state change as an event, and we can confidently rebuild the system state by reprocessing the events at any time in the future. The event store becomes the principal source of truth, and the system state is purely derived from it. For programmers, the best example of this is a version-control system. The log of all the commits is the event store and the working copy of the source tree is the system state. ([View Highlight](https://instapaper.com/read/1411951770/16378789))
> CQRS
> Command Query Responsibility Segregation (CQRS) is the notion of having separate data structures for reading and writing information. ([View Highlight](https://instapaper.com/read/1411951770/16378791))
---
Title: What Do You Mean by “Event-Driven”?
Author: martinfowler.com
Tags: readwise, articles
date: 2024-01-30
---
# What Do You Mean by “Event-Driven”?

URL:: https://martinfowler.com/articles/201701-event-driven.html
Author:: martinfowler.com
## AI-Generated Summary
None
## Highlights
> Event Notification
> This happens when a system sends event messages to notify other systems of a change in its domain. A key element of event notification is that the source system doesn't really care much about the response. ([View Highlight](https://instapaper.com/read/1411951770/16378672))
> Event notification is nice because it implies a low level of coupling, and is pretty simple to set up. It can become problematic, however, if there really is a logical flow that runs over various event notifications. ([View Highlight](https://instapaper.com/read/1411951770/16378678))
> This can make it hard to debug and modify such a flow. ([View Highlight](https://instapaper.com/read/1411951770/16378681))
> Event-Carried State Transfer
> This pattern shows up when you want to update clients of a system in such a way that they don't need to contact the source system in order to do further work. A customer management system might fire off events whenever a customer changes their details (such as an address) with events that contain details of the data that changed. A recipient can then update it's own copy of customer data with the changes, so that it never needs to talk to the main customer system in order to do its work in the future. ([View Highlight](https://instapaper.com/read/1411951770/16378784))
> An obvious down-side of this pattern is that there's lots of data schlepped around and lots of copies. But that's less of a problem in an age of abundant storage. What we gain is greater resilience, since the recipient systems can function if the customer system is becomes unavailable. We reduce latency, as there's no remote call required to access customer information. We don't have to worry about load on the customer system to satisfy queries from all the consumer systems. But it does involve more complexity on the receiver, since it has to sort out maintaining all the state, when it's usually easier just to call the sender for more information when needed. ([View Highlight](https://instapaper.com/read/1411951770/16378786))
> Event-Sourcing
> The core idea of event sourcing is that whenever we make a change to the state of a system, we record that state change as an event, and we can confidently rebuild the system state by reprocessing the events at any time in the future. The event store becomes the principal source of truth, and the system state is purely derived from it. For programmers, the best example of this is a version-control system. The log of all the commits is the event store and the working copy of the source tree is the system state. ([View Highlight](https://instapaper.com/read/1411951770/16378789))
> CQRS
> Command Query Responsibility Segregation (CQRS) is the notion of having separate data structures for reading and writing information. ([View Highlight](https://instapaper.com/read/1411951770/16378791))