Skip to content
Technology transformation expertise firm · ARDIANE Group Innovate, secure, succeed

Glossary

Event-driven architecture: definition and event-based exchange models

Domain

Engineering

In brief

Event-driven architecture makes applications communicate through events: one system publishes the fact that a change has occurred, and those interested in that fact react to it without the emitter having to know them. The expression covers several models, which Martin Fowler distinguished in an article of 7 February 2017.

Page contents

Definition of event-driven architecture

In “event-driven architecture”, the adjective means “driven by events”. The expression is one of common usage: Martin Fowler opens the article he devotes to it, “What do you mean by “Event-Driven”?” (martinfowler.com, 7 February 2017), with an observation: those who talk about events mean fairly different things.

In common usage, event-driven architecture refers to a system whose components communicate by publishing and consuming events. An event records a fact that has occurred: an order confirmed, an address changed. The emitter does not need to know who will read it. An intermediary, a message broker or an event streaming platform, such as RabbitMQ or Apache Kafka, can receive them and deliver them to subscribers.

Several applications can thus react to the same fact, independently of one another, and an additional application can subscribe without the emitter being modified. The use of events falls under the rules of exchange set by IT urbanisation.

Notification, state transfer, event sourcing, CQRS: the models Fowler separates

The article reports on a workshop in which the author took part with colleagues. He draws from it four models that the same word covers.

Model Principle Trade-off noted in the article
Event notification A system signals a change. The event may carry only a little data, and the recipient calls the emitter back if it needs more The overall flow is written in no program and becomes difficult to follow
Event-carried state transfer The event carries the changed data. The recipient keeps its own copy and no longer queries the source Duplicated data, complexity shifted onto the recipient
Event sourcing Every change of state is recorded as an event, and the state is rebuilt by replaying the log Tricky replay when a result depends on an external system, event formats that evolve
CQRS Separate data structures for reading and for writing The complexity of two models to maintain

CQRS, Fowler writes, does not strictly speaking belong to events: it is also practised without them.

Water meter readings published as events

Suppose a water utility equipped with smart meters. At each reading, the collection system publishes a “reading taken” event, which carries the meter identifier, the date and the value. Three applications subscribe to it: billing, leak detection and the customers’ online account area. Each keeps its own copy of the readings without querying the collection system: this is event-carried state transfer.

Three trade-offs come with this set-up. Depending on the delivery guarantees configured in the tool, the same reading may arrive twice, or after a more recent reading, and each subscriber must tolerate this. To explain an incorrect bill, the path of an event across several applications has to be reconstructed, which is made easier by the tracing described in our article on distributed systems observability. Finally, the event format becomes a contract between teams. Two public specifications help to write it: AsyncAPI, to describe the exchanges, and CloudEvents, to describe events in a common way.

Event-driven architecture, command, message queue, microservices: not to be confused

An event is not a command. The former states a fact and expects no response; the latter asks for an action. Fowler warns against the event that serves as a disguised command, when the emitter actually expects the recipient to act.

A message queue is a means of transport, which carries commands as well as events. Its presence does not say which model the system applies.

Microservices architecture splits an application into separately deployable services. These services exchange through direct calls or through events, and neither choice entails the other.

Complex event processing refers, in common usage, to detecting patterns in a stream of events. It is a form of processing, which can rely on an event-driven architecture without being the same thing.

The mode of exchange is chosen flow by flow, between event, API call and file; our page IT architecture sets out the criteria.

FAQ

Frequently asked questions

Another question? Ask us

What does event-driven mean?

Event-driven means driven by events. An event-driven architecture makes applications communicate through events: one system publishes the fact that a change has occurred, and the interested systems react to it. The expression is one of common usage and covers several distinct models.

Event or command: how to tell them apart?

An event states a fact that has already happened, for example a changed address, without asking anything of those who receive it. A command asks a recipient to carry out an action. In his article of 7 February 2017, Martin Fowler warns against the event used as a disguised command, when the emitter actually expects an action from the recipient.

What does event sourcing consist of?

Event sourcing consists of recording every change of state in a system as an event, so that the state can be rebuilt by replaying these events. Martin Fowler gives a version control system as an example: the commit log is the event store, the working copy is the state. According to the same article, event sourcing does not require asynchronous processing.

Does an event-driven architecture require microservices?

Event-driven architecture and microservices architecture are two distinct notions, neither of which requires the other. Microservices architecture splits an application into separately deployable services, which can exchange through direct calls or through events. Monolithic applications can also communicate with each other through events.

A project to bring to completion?

A first conversation is enough to understand your challenge, identify the right people and tell you frankly what we can bring.