AWS Learning Journey

Stop Calling, Start Reacting: Event-Driven Architecture on AWS

Events vs. messages, EventBridge, SNS, SQS standard and FIFO queues, dead-letter queues, filtering, replay, idempotent consumers, retries and backoff, EventBridge Pipes, and choreography vs. orchestration.

9 min read · 1733 words
Event Driven ArchitectureAWSMicroservicesServerlessSoftware Architecture
Stop Calling, Start Reacting: Event-Driven Architecture on AWS cover image

AWS from Zero to Production — Phase 10, Part 1 of 4 · See the full series roadmap


Here’s how a lot of systems grow.

The orders service, after saving an order, calls the payment service. Then the inventory service. Then the email service. Then analytics. Then the loyalty program someone added last quarter.

Now the orders service knows about five other systems. If the email service is slow, checkout is slow. If analytics is down, orders fail. And every new feature means changing — and redeploying — the orders service.

Event-driven architecture flips this around. The orders service announces one fact — “an order was placed” — and moves on. Every interested service listens and reacts on its own. Nobody waits. Nobody needs to know who’s listening.

What you’ll walk away with


Events vs. messages

They look similar — JSON flowing between services — but they mean different things.

An event

A message (or command)

{
  "source": "acme.orders",
  "detail-type": "OrderPlaced",
  "detail": {
    "orderId": "A17",
    "customerId": "C42",
    "total": 84.20,
    "currency": "EUR",
    "placedAt": "2026-10-31T09:14:02Z"
  }
}

Design tip: Put enough data in the event that most consumers don’t need to call back to the producer — but not the whole database row. And never include secrets.


Why event-driven?

The costs


Amazon EventBridge

EventBridge is a serverless event bus: producers put events on a bus; rules match events and route them to targets.

Rules and filtering

{
  "source": ["acme.orders"],
  "detail-type": ["OrderPlaced"],
  "detail": {
    "total": [{ "numeric": [">=", 500] }],
    "currency": ["EUR", "GBP"]
  }
}

This rule matches only large EUR and GBP orders — and sends them, say, to a fraud review Step Functions workflow. Patterns support prefixes, suffixes, numeric ranges, anything-but, and existence checks.

Reliability features


Amazon SNS: publish and subscribe

Amazon SNS pushes each message to every subscriber of a topic — Lambda, SQS, HTTP endpoints, email, SMS, and mobile push.

EventBridge or SNS?

Many architectures use both.


Amazon SQS: queues

SQS (Phase 4) buffers messages until a consumer processes them. In event-driven systems, a queue in front of each consumer is a powerful pattern:

EventBridge rule ---> SQS queue ---> Lambda / ECS worker
                      (buffer, retry, DLQ)

The queue absorbs bursts, lets the consumer process at its own pace, and holds messages safely if the consumer is down.

Standard vs. FIFO

Standard queues:

FIFO queues:

Rule of thumb: Use standard queues with idempotent consumers by default. Use FIFO when order truly matters per entity — like applying account balance updates in sequence.


Dead-letter queues

Some messages fail no matter how many times you retry: malformed data, a missing record, a bug.

A dead-letter queue (DLQ) catches them after maxReceiveCount attempts, so they don’t block the queue or retry forever:

EventBridge targets, SNS subscriptions, and asynchronous Lambda invocations all support DLQs or failure destinations too. Use them everywhere.


Event filtering

Filter as early as possible, so consumers don’t pay to receive and discard events:


Event replay

Things go wrong. A consumer had a bug for six hours and processed events incorrectly. With replay, you fix the bug and process those events again:

Replay only works safely if consumers are idempotent.


Idempotent consumers

You will receive duplicates: from at-least-once delivery, retries, replays, and redrives. An idempotent consumer produces the same outcome whether a message arrives once or five times.

Techniques:

import time

import boto3
from botocore.exceptions import ClientError

table = boto3.resource("dynamodb").Table("processed-events")

def handle(event):
    try:
        table.put_item(
            Item={"eventId": event["id"], "ttl": int(time.time()) + 7 * 86400},
            ConditionExpression="attribute_not_exists(eventId)",
        )
    except ClientError as e:
        if e.response["Error"]["Code"] == "ConditionalCheckFailedException":
            return  # already processed
        raise
    award_loyalty_points(event["detail"])

Watch out: This simple version records the event before doing the work, so if award_loyalty_points fails, a retry will skip it. Production code should mark the key as in progress, then completed — and clear it on failure. Powertools for AWS Lambda has an idempotency utility that handles all of this for you.


Retry and backoff

When a call fails, retry — but carefully:

AWS SDKs retry with backoff and jitter by default. Queues and EventBridge add retries at the infrastructure level. Be careful not to multiply them — SDK retries inside Lambda retries inside queue retries can turn one failure into hundreds of attempts.


EventBridge Pipes

EventBridge Pipes connect a source to a target with optional filtering and enrichment — no glue code:

Source          Filter           Enrich               Target
DynamoDB   ->   only INSERTs ->  Lambda / API /   ->  EventBridge bus,
Stream                           Step Functions       SQS, Step Functions, ...

Sources include SQS, Kinesis, DynamoDB Streams, Amazon MQ, and Kafka. A classic use: turn DynamoDB changes into clean domain events on a bus — the transactional outbox pattern, without writing a poller.


Choreography vs. orchestration

Two ways to coordinate a multi-step business process — like order fulfillment.

Choreography

Each service reacts to events and emits its own. No central coordinator.

OrderPlaced -> Payment service -> PaymentSucceeded -> Inventory service
            -> InventoryReserved -> Shipping service -> OrderShipped

Orchestration

A central workflow tells each service what to do, and tracks state.

Step Functions: charge payment -> reserve inventory -> create shipment
                (on failure: refund payment, release inventory)

In practice

Use choreography between domains — orders, billing, shipping — and orchestration within a domain for complex processes. Phase 10, Part 2 covers the saga pattern, which uses both.


Common mistakes


Key takeaways


Quick self-check

Test yourself before moving on:

  1. Is GenerateInvoice an event or a command?
  2. A new team wants to react to every order. What changes in the orders service?
  3. When should you choose an SQS FIFO queue?
  4. A consumer had a bug for six hours. How can you reprocess those events?

Answers

  1. A command — it asks for something to be done.
  2. Nothing. They add a rule or subscription to the existing OrderPlaced events.
  3. When ordering per entity matters, and you need deduplication.
  4. Replay them from an EventBridge archive — with idempotent consumers.

What’s next

In Part 2, we go deeper into distributed system design: statelessness, caching, circuit breakers, bulkheads, throttling, eventual consistency, distributed transactions, and the saga pattern.

Choreography or orchestration — which does your team prefer? Tell me in the comments.


Share this article

LinkedIn post draft