Event Driven Architecture

Event-Driven Architecture is a programming design principle where a program's functionality is triggered by incoming events; for example sending a purchase order email after a customer places an order.

How does Event Driven Architecture work?

Event-driven architecture (EDA) is a software design pattern used to help build systems that are scalable and loosely coupled. Triggered events are added to a message bus to then be consumed by interested components in an asynchronous manner. EDA benefits include loose coupling, scalability and maintainability.

Real World Examples

Order processing

When an order is placed, an event on the system is triggered to process the customer's order for shipping information, payment processing and inventory management.

Authentication & Registration

When a user signs up or logs in, events get triggered for creating new accounts, verifying credentials and updating user profiles.

Notification Systems

When conditions are met, such as shipping/tracking information update or new message received, an event is triggered to send a notification via necessary means (SMS, email).

Gaming

Events are triggered all the time in gaming when players move their character, complete quests or open inventory which is what allows for real-time interactions.

Advantages of Event-Driven Architecture

Scalability

In an EDA structure, new components can be added or modified without affecting other components which helps with scalability and accommodation of new or changing business requirements.

Reliability & Fault Tolerance

In an EDA structure if one section of a system has a fault or issue other parts of the system remain unaffected in that they can still continue doing their job - for example if a purchase order email sending component is broken the order processing component can still continue processing orders and the email sending component will build up a queue of emails to send when it is back online.

Responsiveness

EDA systems are responsive due to their real-time reactions to triggered events, such as user interaction or system notifications. EDA is well suited for systems such as real time monitoring due to its event-driven responsive nature.

Loose Coupling

EDAs promote loose coupling through the use of decoupled event components. EDA components interact with each other using asynchronous events which enables them to be developed and deployed independently. This loose coupled nature allows for better scalability and flexibility.

Disadvantages of Event-Driven Architecture

Complexity

EDA systems have a different level of added complexity to non EDA structured systems due to the need for event producers, handlers and queues.

Debugging

Debugging and diagnosing bugs and issues in EDA structures can be more complicated than other systems due to asynchronous flow of EDA systems.

Ordering of Events

Maintaining the correct order of events can be difficult due to EDA’s asynchronous flow.

Read more