Event-Driven Architecture: When to Use It and When Not To

What event-driven architecture is, event notification vs event-carried state vs event sourcing, brokers like Kafka, benefits, pitfalls and when to avoid it.

Published November 27, 2026

In an event-driven architecture, components announce that something happened ("OrderPlaced") and other components react, instead of calling each other directly. Done well, it decouples teams, absorbs traffic spikes and makes it easy to add new behaviour without touching existing code. Done badly, it produces invisible chains of reactions nobody can debug. This article helps you decide where events fit.

The concept

An event is an immutable fact about the past, named in past tense. Producers publish events to a broker (Kafka, RabbitMQ, AWS SNS/SQS/EventBridge, Google Pub/Sub, NATS) without knowing who consumes them. Consumers subscribe and react on their own schedule. This inverts dependencies: the orders module does not need to know that billing, email, analytics and inventory all care about new orders.

There are several styles. Event notification sends a thin message ("order 123 placed") and consumers call back for details. Event-carried state transfer includes the data consumers need, so they can keep local copies and avoid calls. Event sourcing goes furthest: the event log itself is the system of record, and current state is rebuilt by replaying events. Each step adds decoupling and power, and also complexity.

The basic shape

Orders servicepublishes OrderPlacedEvent brokerKafka topic: ordersBillingcharge cardInventoryreserve stockEmailsend confirmationAnalyticsupdate dashboards
One event, many independent reactions; the producer knows none of them.

Flavours of event-driven design

StylePayloadCouplingComplexity
Event notificationIDs onlyConsumers call back the producerLow
Event-carried state transferFull relevant dataLow; consumers keep local copiesMedium
Event sourcingEvery state change, the log is truthLowHigh
CQRS (often paired)Separate write and read models fed by eventsLowHigh

When it fits

Use events when…Avoid or limit when…
Several parts must react to the same factYou need an immediate answer (use a request/response call)
Work can happen later (emails, indexing, analytics)Strong consistency across steps is required right now
Traffic is spiky and must be bufferedThe team lacks tracing and broker operations experience
Teams need to add consumers independentlyThe flow is simple and linear inside one module
Integrating many systemsDebuggability matters more than decoupling for this flow

The outbox pattern: publishing reliably

A classic bug is writing to the database and then publishing an event; if the process crashes in between, the event is lost (or published for a rolled-back write). The transactional outbox fixes this: write the event to an outbox table in the same transaction as the business change, and have a relay (a poller or change-data-capture like Debezium) publish outbox rows to the broker.

BEGIN;
  INSERT INTO orders (id, customer_id, total) VALUES ('o-123', 42, 1999);
  INSERT INTO outbox (id, topic, payload) VALUES (gen_random_uuid(), 'orders',
    '{"type":"OrderPlaced","order_id":"o-123","total":1999}');
COMMIT;
-- relay: SELECT ... FROM outbox WHERE published_at IS NULL → publish → mark published

Practical examples

An event schema with versioning

Include an id for deduplication, a type, a version and a timestamp.

{
  "event_id": "8b1c6f0e-...",
  "type": "OrderPlaced",
  "version": 2,
  "occurred_at": "2026-11-27T10:15:03Z",
  "data": { "order_id": "o-123", "customer_id": 42, "total": 1999, "currency": "INR" }
}

Idempotent consumer

Brokers deliver at least once, so consumers must tolerate duplicates.

def handle(event):
    with db.transaction():
        if db.exists("SELECT 1 FROM processed_events WHERE event_id = %s", event["event_id"]):
            return
        reserve_stock(event["data"]["order_id"])
        db.execute("INSERT INTO processed_events (event_id) VALUES (%s)", event["event_id"])

Laravel: dispatching domain events in-process first

Start with in-process events; move to a broker when consumers need to be separate.

// app/Events/OrderPlaced.php is a plain event class
OrderPlaced::dispatch($order);
// app/Listeners/SendOrderConfirmation.php implements ShouldQueue for async handling

Common mistakes

  • Publishing events after commit without an outbox, losing events on crashes.
  • Non-idempotent consumers that double-charge or double-email on redelivery.
  • Using events for request/response interactions, then building polling to wait for "replies".
  • No schema versioning, so a producer change breaks unknown consumers.
  • No tracing or correlation IDs, making a chain of events impossible to follow.

Key takeaways

  • Events are immutable facts; producers do not know their consumers.
  • Choose the lightest style that works: notification, state transfer, or event sourcing.
  • Use the outbox pattern and idempotent consumers for reliability.
  • Keep synchronous calls where an immediate answer or strong consistency is needed.

FAQ

Kafka or RabbitMQ?

Kafka is a durable, replayable log built for high throughput and stream processing. RabbitMQ is a flexible message broker with rich routing and per-message acknowledgement. Choose by whether you need replay and streaming (Kafka) or task queues and routing (RabbitMQ).

Is event sourcing required for event-driven architecture?

No. Most event-driven systems use ordinary databases and publish events; event sourcing is a specialised pattern for domains that benefit from a full audit log and temporal queries.

How do I debug event chains?

Propagate a correlation ID through every event and use distributed tracing (OpenTelemetry) so one user action can be followed across consumers.

More Architecture articles