Event-Driven Architecture

Overview

Event-driven architecture (EDA) uses events to decouple producers from consumers. A producer emits a fact, and one or more consumers react asynchronously.

Event Flow Model

sequenceDiagram participant OrderService participant Broker participant InventoryService participant NotificationService OrderService->>Broker: OrderCreated Broker->>InventoryService: OrderCreated Broker->>NotificationService: OrderCreated

Production Example

A retail platform publishes order lifecycle events through a broker such as Kafka.

{ "eventType": "OrderCreated", "eventId": "evt-90af", "orderId": "ord-1452", "occurredAt": "2026-09-06T10:30:00Z", "customerId": "cust-2009", "items": 3 }

Inventory and notification services subscribe independently. New consumers can be added without changing the producer.

Reliability Patterns

Common Pitfalls

Key Takeaways