Event-driven architecture
Producers, channels, and consumers carry events in near real time so consumers can respond as they occur.
Structure and behavior
Follow the arrows step by step.
Producers and consumers are less tightly coupled in time. Delivery guarantees, ordering, and duplicates depend on the broker and implementation.
Expected benefits
Near-real-time delivery lets consumers respond as events happen and keeps them decoupled from producers.
Trade-offs
Extra message hops add latency, and the origin of delays can be difficult to diagnose in production.
Without a fitting use case, its complexity can introduce too much overhead to justify adoption.
Operations and adoption guide
Synthesis, distinct from items backed by source excerpts. Validate before applying in production.
When to use
Suitable for microservice integration that reacts to changes, IoT ingestion and analysis, e-commerce order and shipping, and high-throughput asynchronous integration.
Scenario
A midsize retailer connects POS, inventory, and shipping across 500 stores. It handles thousands of sales and inventory events per second in near real time. Loose asynchronous coupling ensures a service failure does not stop all order intake. Separate order, stock, notification, and shipping services around the event broker, with replay and dead-letter monitoring.
Placement principles
- Separate producers and consumers by domain boundary
- Centrally deploy managed or self-hosted event brokers and routers based on availability and throughput
- Use StatefulSets and persistent volumes for stateful Kafka brokers
- Operate dead-letter and replay storage, schema registries, and observability storage separately
- Use near-real-time processing on the hot path and separate consumer groups for batches and analytics.
On premises
For data sovereignty, regulation, DDIL, or air-gap requirements, put brokers and the Kubernetes control plane on site and combine central control with local execution. Self-host only for clear needs such as AMQP compatibility, regulation, or very high throughput; own patching, capacity, backups, and monitoring.
Cloud
Prefer managed event brokers and serverless consumers to reduce operations. Use autoscaling, consumption pricing, and redundancy across regions and zones. Self-host only for special needs after evaluating costs, connectivity, and ownership.
Kubernetes
Consider event-triggered startup, load-based scaling, and scaling to zero when idle. Run stateful brokers with StatefulSets and PersistentVolumes, stateless consumers with Deployments and HPA, and event gateways or control planes with CRDs and Operators.
Incident response
Common incidents include consumer lag and retry storms, duplicated processing, a backed-up dead-letter queue, broker or partition imbalance, and schema incompatibility. Set error handling and bounded retries, quarantine in a dead-letter queue, trace correlation and causation IDs, run replay when appropriate, and monitor capacity, backlog, and lag.
Evidence by criterion (14 total)
Evidence availability at the time of research. Assess source accuracy and currency separately.
Definition and overviewEvidence available
Producers, channels, and consumers carry events in near real time so consumers can respond as they occur.
event producers that generate a stream of events, event consumers that listen for these events, and event channelsProblem addressedEvidence available
React to changes without scheduled updates or tight coupling, and support asynchronous, loosely coupled communication.
allows applications to communicate asynchronously through loosely coupled componentsKey components and resourcesEvidence available
Core components are event producers, event routers, and event consumers.
Event-driven architectures have three key components: event producers, event routers, and event consumers.Data and asset placementEvidence available
Place Kafka brokers that retain topic and partition state on StatefulSets with persistent volumes.
Kafka Brokers, which maintain the state of the topics and partitions also need to be deployed as StatefulSetsTypical use casesEvidence available
Common uses are application integration, sharing and democratizing data, IoT collection and analysis, and event-driven microservices.
The top 4 use cases for event-driven architecture according to a 2021 survey wereExample scenarioEvidence available
In e-commerce, a state-change event such as adding a cart item can trigger downstream order, shipping, and notification services.
an item being placed in a shopping cart on an e-commerce websiteWhen to avoid and caveatsEvidence available
Without a fitting use case, its complexity can introduce too much overhead to justify adoption.
the tradeoffs of adopting EDA – primarily overhead from its complexity – are not always worthwhile without the right use case.On premises: development, deployment, and operationsEvidence available
Data sovereignty, regulations, policy, and DDIL can require an on-site Kubernetes control plane and a hybrid of centralized control and local execution.
need the Kubernetes control plane itself to stay on-premisesCloud: development, deployment, and operationsEvidence available
Prefer a managed cloud broker to reduce operational burden and focus on application logic; consider self-hosting only for exceptional requirements.
Default to managed brokers to focus on your application logic.Kubernetes: development, deployment, and operationsEvidence available
On Kubernetes, trigger workloads from events, scale on demand, and scale to zero when idle.
build, deploy, run, and manage event driven applicationsIncident responseEvidence available
After bounded retries, quarantine failed events with their reasons in a dead-letter queue or equivalent, and replay them after resolving the cause.
Set failing events aside after a limited number of attempts – in a dead-letter queueBenefitsEvidence available
Near-real-time delivery lets consumers respond as events happen and keeps them decoupled from producers.
Events are delivered in near real time, so consumers can respond immediately to events as they occur.Drawbacks and trade-offsEvidence available
Extra message hops add latency, and the origin of delays can be difficult to diagnose in production.
Additional latency is one of the trade-offs of adopting an event-driven systemRepresentative tools and technologiesEvidence available
One example deploys Kafka and ZooKeeper as Kubernetes StatefulSets.
Kafka needs Zookeeper to be deployed as a StatefulSets in Kubernetes.Additional references (23)
- Event-Driven Architecture Style - Azure Architecture Center | Microsoft Learn ↗
- Event-Driven Architecture ↗
- 4 event-driven architecture use cases (with examples) ↗
- What Is Event-Driven Architecture? | IBM ↗
- What Is Event-Driven Architecture? Components and Patterns | SAP ↗
- What is event-driven architecture? ↗
- The Complete Guide to Event-Driven Architecture | Solace ↗
- Event-driven architecture for microservices | Red Hat Developer ↗
- Hybrid cloud and Kubernetes: ↗
- Module 9.2: Managed Message Brokers & Event-Driven Kubernetes | KubeDojo ↗
- Hybrid cloud orchestration: Modernizing on-premises infrastructure management with AWS | AWS Architecture Blog ↗
- Deployment Options ↗
- Kong Event Gateway with Kong Operator ↗
- Persistence in Event Driven Architectures ↗
- Designing Multi-Cluster Kubernetes Operators: Seamless Cloud Orchestration Across Hybrid Environments | martinuke0's Blog ↗
- Event-driven architecture for modern applications ↗
- Building for Failure: Hidden dangers in Event-Driven Systems ↗
- Resilient Design Guidance for Event Hubs and Functions - Azure Architecture Center | Microsoft Learn ↗
- The Hidden Failure Modes of Event-Driven Systems - Chris Arjona ↗
- Designing Resilient Event-Driven Systems at Scale - InfoQ ↗
- Reliable Delivery – Concepts – Event Foundation ↗
- Event-Driven Architecture: Value, Complexity, and the Trade-Offs - Westpoint ↗
- Event-Driven Architecture: What You Need to Know – Encore Blog ↗