The Wayback Machine - https://web.archive.org/web/20261117140349/https://www.geeksforgeeks.org/system-design/event-driven-architecture-system-design/

Event-Driven Architecture (EDA)

Last Updated : 17 Nov, 2026

Event-Driven Architecture (EDA) is a software design approach in which application components communicate by producing and reacting to events that represent significant actions or state changes.

  • Supports asynchronous and near-real-time processing.
  • Reduces direct dependencies between application components.
  • Uses messaging infrastructure such as brokers, queues, topics, and event streams for event delivery.

Example: In an e-commerce application, placing an order generates an OrderPlaced event that triggers payment processing, inventory updates, and customer notifications.

Components of Event-Driven Architecture

EDA consists of several components that work together to generate, distribute, and process events.

broker

The diagram illustrates how events travel from producers to consumers through a messaging intermediary.

  • Event Source: Originates events through user actions, sensor readings, or system state changes.
  • Event: Represents a significant occurrence within the system.
  • Event Producer: Creates and publishes events to the messaging infrastructure.
  • Event Broker: Receives and routes events according to subscriptions or configured routing rules.
  • Event Consumer: Receives events and initiates the required operations.
  • Event Handler: Executes specific business logic in response to an event.

An event typically contains an event type that describes what happened, a payload containing relevant data, a timestamp indicating when it occurred, and a unique event ID for identification and tracking.

How Event-Driven Architecture Works

Consider an e-commerce application where an order is processed using event-driven communication.

broker2

The following steps explain how an order event is generated and processed:

  • A customer places an order through the application.
  • The order service creates and publishes an OrderPlaced event to the event broker.
  • The broker distributes the event to the subscribed services.
  • The payment service processes the payment and publishes a PaymentCompleted event upon success.
  • Other services consume the relevant events to perform inventory updates and send customer notifications.

Messaging Patterns in EDA

Messaging patterns determine how events are delivered, stored, and consumed across distributed systems.

  • Publish-Subscribe: Multiple independent subscribers can receive and process the same event.
  • Queue-Based Delivery: Messages are distributed among competing consumers to share processing workloads.
  • Event Streaming: Events are stored in a persistent log, allowing consumers to track their positions and replay retained events.

Real-World Applications

EDA is commonly used in applications that need to respond to frequent changes and process distributed workloads.

  • Financial Services: Fraud detection, transaction monitoring, and payment processing.
  • E-commerce: Order management, inventory updates, and shipment tracking.
  • IoT Systems: Sensor data processing, device monitoring, and automated alerts.
  • Online Gaming: Player actions, matchmaking, and game-state updates.

Benefits of EDA

EDA provides several advantages when designing distributed applications.

  • Allows consumers to scale independently based on their workloads.
  • Isolates temporary consumer failures from other services.
  • Enables the addition of new consumers without modifying existing producers.
  • Handles temporary traffic spikes through event buffering.
  • Supports integration between applications built using different technologies.

Limitations of EDA

EDA introduces challenges in maintaining reliability, consistency, and system visibility.

  • Increases architectural complexity due to distributed components.
  • Events may be processed out of order due to parallel execution or retries.
  • Services may temporarily hold inconsistent data due to eventual consistency.
  • Lost or duplicate events require reliable delivery and idempotent processing mechanisms.
  • Makes debugging and tracing distributed operations more challenging.
Comment

Explore