Published: Last updated:

Event-Driven Architecture

Event-Driven Architecture (EDA) is a paradigm where the flow of the application is controlled by events — for example, "customer has ordered" or "inventory low." Instead of systems waiting for each other (synchronous), they react to these events with a time delay (asynchronous).

This leads to an extreme decoupling of systems: The webshop does not need to know how the shipping system works — it only publishes the event "order completed" and leaves the rest to the infrastructure.

graph LR
    A[Webshop] -- Event: Ordered --> B(Message Broker)
    B --> C[Logistics]
    B --> D[Accounting]
    B --> E[CRM / Marketing]
    C --> C1[Shipping Label]
    D --> D1[PDF Invoice]
    E --> E1[Follow-up Mail]

Anti-Patterns: The House of Cards Syndrome

In synchronous architectures (request-response), the failure of a single small sub-system often leads to the standstill of the entire process. If the invoicing system is slow, the checkout in the webshop aborts because it waits for the response. This limits scalability and makes the system vulnerable to load peaks.

The Reactive Organisation

  1. Message Broker / Event Bus: Use of specialised middleware (e.g. RabbitMQ, Kafka, or NATS) that securely stores and distributes events.
  2. Pub/Sub Pattern: Senders (publishers) and receivers (subscribers) do not know each other. This allows adding new systems at any time without changing existing code.
  3. Eventual Consistency: Acceptance that data does not have to be exactly the same everywhere at every millisecond, as long as it "eventually" becomes consistent.
  4. Resilience through Buffering: If a receiver system is offline, the events are buffered in the broker and processed later as soon as the system is back online.
  5. Audit Log by Design: Since every event is recorded, you automatically get a complete history of all business transactions (Event Sourcing).

The Advantage: High Scalability

Events can be processed in parallel on a massive scale. Load peaks in the frontend are smoothed by the event bus, so that the backend systems can continue working stably at their own pace.

FAQ

Is EDA not much harder to debug than synchronous calls?

It requires different tools (Distributed Tracing). But the ability to replay events makes it even easier in complex scenarios to find and fix errors.

What does Eventual Consistency mean for our business?

In practice, usually only a delay of milliseconds. It means, for example, that the customer receives their confirmation email only one second after clicking — but in return, the purchase process never aborts just because the mail server is currently busy.

Reference Guide

  • Designing Data-Intensive Applications: Martin Kleppmann on the foundations of modern data architectures. O'Reilly
  • Building Event-Driven Microservices: Adam Bellemare on EDA in practice. O'Reilly
  • Reactive Manifesto: The principles for elastic and resilient systems. reactivemanifesto.org

Related Topics

Open Points