Event-Driven Architecture
An architectural style in which components publish facts about state changes and independent consumers react through asynchronous channels.
Download Markdown (.md)Soroush’s Product Wiki · https://wiki.soroush.uk/topic/event-driven-architecture/
01What it means
Event-driven architecture organizes collaboration around events: durable or transient records that something meaningful happened. Producers emit events without directing every downstream action; brokers, streams, or channels deliver them to interested consumers. This separates the timing and deployment of participants, though they remain coupled through event meaning, schemas, and delivery guarantees.[1][2][3]
- 01State changeSomething happens
- 02ProducerPublishes event
- 03Broker or streamDelivers under guarantees
- 04ConsumersHandle retries and duplicates
- 05CompletionObserve outcomes
Participants remain coupled through meaning, schemas, and delivery guarantees.
02Why it matters
A useful business event can trigger several independent reactions, such as fulfillment, notifications, analytics, and fraud checks after an order is accepted. Producers need not call each consumer or wait for all work to finish. This can improve responsiveness, independent scaling, extensibility, and resilience to temporary consumer failure when the infrastructure and processing model are designed carefully.
03When to use it
Use event-driven architecture for asynchronous workflows, fan-out, integrations, high-volume streams, or domains where recording and reacting to changes is natural. Prefer simpler synchronous calls when a user needs an immediate answer, the workflow is small, or the team cannot yet operate distributed messaging, observability, and recovery safely.
04How it works
- Define business events as facts with clear names, ownership, meaning, and only the data consumers need.
- Choose delivery infrastructure and guarantees appropriate to ordering, durability, latency, and throughput needs.
- Publish events reliably with the state change, commonly using an outbox or equivalent atomic pattern.
- Design consumers to handle retries, duplicates, delayed delivery, schema evolution, and poison messages.
- Track correlation and causation so operators can understand workflows across asynchronous boundaries.
- Monitor lag, failure destinations, processing outcomes, and business completion rather than broker health alone.
05A practical example
When a retailer accepts an order, it publishes an OrderAccepted event. Inventory reserves stock, fulfillment creates work, loyalty awards points, and analytics updates demand forecasts independently. A delayed loyalty consumer can catch up later without blocking checkout, while idempotency prevents duplicate points when an event is retried.
06Where it breaks
Asynchrony introduces eventual consistency, nondeterministic timing, duplicate delivery, harder tracing, and more complicated testing. Events can become disguised commands or expose unstable internal data. A broker does not remove coupling; unclear semantics and careless schema changes merely make that coupling harder to see and coordinate.
Common mistakes
- Publishing vague technical events instead of stable facts that consumers can interpret consistently.
- Assuming exactly-once end-to-end processing and neglecting idempotency or deduplication.
- Updating business state and publishing its event in separate failure-prone operations.
- Building long invisible event chains without correlation, ownership, or recovery tooling.
07Sources
- What Is an Event-Driven Architecture?Amazon Web Services · Institutional architecture overviewWhat Is an Event-Driven Architecture?
- Event-Driven Architecture StyleMicrosoft Learn · Institutional architecture guideEvent-Driven Architecture Style
- Introduction to Event-Driven ArchitectureAWS Samples · Technical practice guideIntroduction to Event-Driven Architecture