Event Driven Architectures
May 25, 2020
Event-Driven Microservices are a form of microservices architecture in which the collaboration between the microservices mostly follows an event-driven paradigm, relying on a streaming platform capable of receiving and propagating the data representation of events.
Fundamental Concepts
In computing, an event is an action or occurrence that results in a state change relevant to a software system, often originating asynchronously from the external environment. Typically, systems handle events synchronously, determining their program flow. Software that changes its behavior in response to events is said to be event-driven.
An event-driven architecture (EDA) is a distributed, asynchronous software architecture pattern that integrates applications and components through the production and handling of events. By tracking events, we don’t miss anything of significance related to the business domain.
EDAs are loosely coupled. The producer of an event does not know which systems may be affected or what actions may take place as a result of the event.
EDAs can be relatively complex given their inherent asynchronous, distributed processing. As with any distributed architecture, issues may occur due to a lack of responsiveness, performance issues, or failures with event mediators and event brokers.
An EDA chains a series of events together to complete a feature flow. For example, when a customer is making a payment to buy something on a website, you are expecting to get your order invoice generated and to get an email as soon as the payment is complete. Event-driven architecture helps to rope in all of these events so that making a payment can trigger another task to complete the order flow.
Building systems around an EDA simplifies horizontal scalability in distributed computing models and makes them more resilient to failure. This is because application state can be copied across multiple parallel snapshots for high-availability. New events can be initiated anywhere, but more importantly propagate across the network of data stores updating each as they arrive. Adding extra nodes becomes trivial as well: you can simply take a copy of the application state, feed it a stream of events and run with it.
The following articles will describe in more detail the main elements of Event-Driven Architetures: