Pattern · Draft

Event-Driven Fan-out

Publish one event and let independent consumers react, without the producer knowing who they are.

Architecture

A producer publishes one domain event to EventBridge. Each matching rule delivers to its own SQS queue and Lambda consumer, isolating buffering, retries, and scaling. Consumers must handle duplicate deliveries safely.

Draft: this pattern is captured but not yet reviewed. The forces, trade-offs and failure modes below are a working position, not a finished one.

The problem

When a producer calls each downstream system directly, every new reaction means a code change and a redeploy. The producer accumulates knowledge of its consumers, and a slow or failing consumer drags the producer down with it.

The solution

The producer publishes a single domain event to a bus. Consumers subscribe with their own rules and queues, so new reactions are added without touching the producer. SQS sits between the bus and each processor to absorb bursts and own retries.

Forces

What pulls against what.

  • Decoupling against traceability
  • Delivery guarantees and ordering
  • Independent scaling and failure isolation
  • Event contract stability over time

On AWS

  • EventBridge
  • SQS
  • Lambda
  • Schema Registry
  • CloudWatch

Trade-offs

  • Producers stay ignorant of consumers; new consumers ship without redeploying the producer
  • Harder to trace one business action across many consumers
  • Delivery is at-least-once, so consumers must be idempotent

When not to use it

  • A single, synchronous consumer with an immediate answer
  • When a simple direct call is easier to reason about and operate
  • When exactly-once semantics are required but cannot be designed for

Failure modes

How it breaks when it breaks.

  • Poison messages cycling until the dead-letter queue fills unnoticed
  • Non-idempotent consumers duplicating side effects on redelivery
  • An event contract changed in place, breaking consumers silently