Back to all terms
S1S2S3
State & Archadvanced

Event-Driven Architecture

An architectural style where the flow of the program is determined by events—state changes that are produced, detected, consumed, and reacted to by loosely coupled services.

Also known as: EDA, Event-Based Architecture, Reactive Architecture

Description

Event-Driven Architecture (EDA) is a software design paradigm in which the production, detection, and consumption of events drive all system behavior. Rather than services calling each other directly via synchronous request-response, they communicate by emitting and reacting to events. An event represents a significant change in state—'OrderPlaced', 'PaymentProcessed', 'InventoryReserved'—and is an immutable record of something that happened. This fundamentally shifts system design from imperative orchestration to reactive choreography.

EDA systems typically consist of event producers, an event backbone (Kafka, EventBridge, NATS), and event consumers. Events flow through the backbone, where they can be filtered, transformed, and routed to interested consumers. This enables powerful patterns: event sourcing (storing all events as the source of truth), CQRS (separating read and write models), and sagas (coordinating multi-step distributed transactions). The architecture naturally supports horizontal scaling because consumers can be added independently.

The benefits of EDA include extreme loose coupling, natural auditability (every state change is recorded), and the ability to replay events for debugging or rebuilding state. The challenges are significant: eventual consistency means the system may not reflect the latest state immediately, debugging distributed event chains requires correlation IDs and distributed tracing, and designing events as stable contracts that can evolve without breaking consumers demands careful schema management with tools like Avro, Protobuf, or a schema registry.

Prompt Snippet

Design the order processing pipeline as a choreography-based EDA using Apache Kafka with Confluent Schema Registry for Avro-encoded events. Define domain events (OrderCreated, PaymentAuthorized, InventoryReserved, OrderFulfilled) as versioned Avro schemas with a compatibility mode set to BACKWARD. Each service owns its consumer group and projects events into its local read model. Implement distributed tracing via OpenTelemetry with a correlation ID propagated in Kafka headers, and use Kafka Streams for real-time event aggregation into an analytics materialized view.

Tags

architectureevent-drivendistributed-systemsmessagingscalability