What is Event-driven architecture (EDA)? System Design for Product Managers — Part 6

What is Event-driven architecture (EDA)? Example of Event-driven architecture (EDA)

Shailesh Sharma
3 min readApr 24

Event-driven architecture (EDA) is a software architecture pattern where the system responds to events or messages produced by various systems or components within the system. EDA is an alternative to the traditional request-response model, where one component of the system requests data or services from another component.

In EDA, events are generated by different parts of the system and are processed asynchronously by other components. These events trigger actions, which can include updating a database, sending a notification, or triggering a workflow. The EDA architecture provides a highly scalable and flexible solution that can adapt to changing business requirements.

The EDA architecture has a number of advantages for product managers. First, it allows for real-time processing of events, which can be critical for certain use cases such as fraud detection or real-time analytics. Second, it provides a highly scalable architecture that can handle large volumes of data and traffic. Finally, EDA can provide better fault tolerance and resiliency as compared to other architectures, as failures in one component can be isolated and the rest of the system can continue to function normally.

An example of EDA can be seen in a stock trading application. In such an application, a stock price change is an event that triggers a number of actions. When the stock price changes, the system generates an event that is processed by various components. These components can include a notification service that sends an alert to the trader, a data service that updates the stock price in the database, and a trading algorithm that uses the new stock price to make a trading decision.

The following is an example of how EDA can be implemented in a stock trading application:

  1. Event Generation: When a stock price changes, the system generates an event. This event contains information about the stock, the new price, and the time of the event.
  2. Event Processing: The event is processed asynchronously by various components within the system. One component may be responsible for updating the stock price in the database, while another component may be responsible for triggering a notification to the trader.
  3. Notification Service: The notification service receives the event and sends a notification to the trader. The notification may be in the form of an email, SMS, or push notification.
  4. Data Service: The data service receives the event and updates the stock price in the database. This ensures that the system has the most up-to-date information on the stock price.
  5. Trading Algorithm: The trading algorithm receives the event and uses the new stock price to make a trading decision. The algorithm may decide to buy or sell the stock based on various factors such as the stock’s historical performance, the trader’s risk tolerance, and the current market conditions.

--

--

Shailesh Sharma