With the advent of artificial intelligence and the Internet of Things, the IT service market is changing drastically. These and other evolutions have made business and IT agility a top priority. Cloudification, decentralisation, decoupling, reactiveness and asynchronous communication have all made the need for agility even more clear. In this blog post, we’ll examine how Event-Driven Architecture (EDA) can help your organisation fulfil that need.
Build for change
At its core, Event-Driven Architecture is a popular asynchronous distributed architecture pattern that turns data-centric models into event-centric models. The data is still important, but events will play a more important role, increasing your organisation’s agility. Purpose-built components (such as microservices) receive and process events, and asynchronously communicate these with each other. This makes small adaptions to circumstances not only possible, but the desired way of working.
Mediators and brokers
EDA can be represented using two different topologies, depending on whether the architecture uses a central mediator. The mediator topology is most often used when several distinct steps must be orchestrated using a central mediator. The broker topology, on the other hand, is more likely to be used for relatively simple event flows that do not require a central mediator.
The mediator topology consists of a central mediator, an event queue, an event channel, and the event processors. The queue sends events to the mediator, which sends them to the appropriate event channels where they are handled by the processors. A mediator topology also distinguishes initial events, such as a moved customer, from processing events like updated data or a sent email. Thanks to asynchronous communication, these events can run in parallel.
The broker topology does not use a central mediator. Instead, the broker component will contain all event channels. This means that the event processor itself is responsible for forwarding new events. Events can also be sent to locations where there will be no response, if they are intended for new features.
In Event-Driven Architecture, communication consists of events that indicate the state of an object. Examples include a change in a shipping address or the addition of a new user’s ID. These events are often called business events, since they describe a business action. It is vital that they describe the essence of the activity, because they bring the IT and business a lot closer together. They make it possible for both sides to understand each other a lot better.
EDA also makes it possible to monitor the entire business process flow, instead of just a single business process. Each event has its own timestamp, so monitoring tools can be used to track them. Thanks to timeline functionalities, performance can be analysed, and bottlenecks can be identified quickly and with pinpoint precision.
Using events also means that the different components of an application can be decoupled. This vastly increases both performance and security. Components no longer have to wait for each other or share data when it isn’t necessary. It also inverts the responsibility of data handling from the data sources to the services processing them.
However, you will need to pay special attention to the contracts with the components. We recommend an agreement on the data standard format to be used and a versioning policy to make sure that they are aligned from the start.
Complexity and flexibility
Event-Driven Architecture responds to the need for flexibility and scalability, but it can also lead to an increase in complexity. When not implemented correctly, distributed architecture patterns like EDA can lead to distributed architecture issues, like lack of responsiveness or the logic to reconnect to a broker in case of a failure. It also takes some effort to get started with EDA: determining the correct events requires maintaining a transactional unit of work.
Nevertheless, using Event-Driven Architecture is still highly recommended in most cases. It offers unparalleled potential for flexibility and scalability, which vastly improves your organisation’s agility on both the IT and the business side. Its asynchronous and decoupled nature also improves both efficiency and security. In short, EDA gives your infrastructure the flexibility that is required nowadays, while making it more resilient.