What Is Event-Driven Architecture?
Event-driven architecture structures systems around the production, detection, and reaction to events. Instead of services calling each other directly, they emit events (OrderPlaced, UserRegistered) that other services react to. This decouples producers from consumers and enables scalable, resilient systems.
How Event-Driven Architecture Works
When an order is placed: the Order service emits OrderPlaced. The Email service sends a confirmation. The Inventory service reserves stock. The Analytics service records the sale. Each reacts independently — adding a new service doesn't modify existing ones. If Email service is down, the event waits in the queue.
Key Concepts
- Events — Records of things that happened — immutable, past tense (OrderPlaced, not PlaceOrder)
- Event Bus/Broker — Infrastructure that routes events to interested consumers — Kafka, RabbitMQ, Amazon EventBridge
- Eventual Consistency — Services update asynchronously — the system converges to a consistent state over time
- Event Choreography — Services react to events independently — no central coordinator
Frequently Asked Questions
Event-driven vs request/response?
Request/response for synchronous operations where you need an immediate answer. Event-driven for operations that can happen asynchronously and shouldn't block the caller.