Event-Driven Order Processing Architecture on AWS

Checkout API with Cognito, an EventBridge backbone with an SQS queue and DLQ, a Step Functions saga coordinating payment and fulfillment Lambdas, DynamoDB order and inventory state, and SNS notifications.

Explore diagram

Explore on mobile. Create and edit manually or with AI on a computer.

Event-driven order processing AWS architecture diagram with API Gateway, EventBridge, SQS, Step Functions saga, Lambda services, DynamoDB, and SNSExplore diagram

Event-driven order processing AWS architecture diagram with API Gateway, EventBridge, SQS, Step Functions saga, Lambda services, DynamoDB, and SNS. Open the image to explore this ready-made diagram.

Overview

The checkout API publishes order events to Amazon EventBridge, which routes them to Amazon SQS. EventBridge Pipes polls the queue and starts the Step Functions saga coordinating payment, inventory, and fulfillment. DynamoDB stores order and inventory state, and Amazon SNS sends customer notifications.

Components

  • Ingress: API Gateway with Cognito accepts authenticated orders and publishes an order-created event.
  • Event Backbone: EventBridge routes events; SQS with a DLQ guarantees durable, retryable delivery.
  • Orchestration: EventBridge Pipes starts the saga from SQS; Step Functions sequences payment and fulfillment with compensation on failure.
  • Fulfillment: Dedicated Lambdas handle payment capture and stock reservation plus shipment creation.
  • State: DynamoDB holds canonical order and inventory records; SNS fans notifications to customers.

Order Flow

  1. A customer submits an order; the checkout API authenticates and publishes it to EventBridge.
  2. EventBridge routes the event to SQS; EventBridge Pipes polls the queue and starts the saga.
  3. The saga invokes the adjacent payment and fulfillment services.
  4. Payment records the order and fulfillment reserves inventory in DynamoDB.
  5. Fulfillment publishes status updates to customers through SNS.

Customize First

  • Tune the saga steps and compensation for your payment, tax, and fraud requirements.
  • Add idempotency keys and a redrive policy on the DLQ before production.
  • Tap the event bus into Firehose/S3 for an analytics lake when you need BI and replay.

Related AWS guides

Use these practical explanations to compare services, failure boundaries, and operating tradeoffs before adapting the architecture.

Design rationale

Decisions that shape this architecture

1

Publish acceptance before completing fulfillment

The checkout path records or emits an order-created fact and returns without waiting for every downstream service. Callers receive an order state, not a promise that fulfillment already finished.

2

Use routing and buffering for different jobs

EventBridge routes domain events to interested consumers. SQS protects the saga worker with buffering, delivery retries, and dead-letter handling.

3

Make compensation a first-class workflow

A saga must define what happens when payment succeeds but inventory or fulfillment fails. Step Functions makes those transitions and compensating actions inspectable.

Before production

Operational checks

Use idempotency keys at order intake and every retried side effect.

Define timeouts and compensation for payment, reservation, and fulfillment.

Track order state transitions with correlation IDs across services.

Own a DLQ redrive process that cannot duplicate completed business actions.

Scope and tradeoffs

What this diagram does not solve

Eventual consistency becomes user-visible

Order status may move through pending states while work completes. Product UX and support tooling need to explain and inspect those states.

Exactly-once business behavior is designed, not provided

Queues and functions can deliver or execute more than once. Durable idempotency and conditional state changes prevent duplicate charges and reservations.

Common questions

Frequently asked questions

Why use a saga for order processing?

A saga coordinates several local transactions and defines compensating actions when a later step fails, without requiring one distributed database transaction.

Why are EventBridge and SQS both shown?

EventBridge provides event routing and fan-out. SQS provides consumer buffering, backpressure, controlled retries, and a dead-letter queue.

Where should the canonical order status live?

The order store should record explicit, conditional state transitions. Events communicate changes, but they should not leave support teams without a queryable current state.

Keep exploring

Explore the library
Serverless multi-tenant SaaS AWS architecture diagram with CloudFront, WAF, Cognito, API Gateway, Lambda, EventBridge, SQS, DynamoDB Streams, and S3
SaaS Backendadvanced

Serverless Multi-Tenant SaaS Architecture on AWS

This architecture combines a protected synchronous API with a durable asynchronous work path. Tenant identity travels from Cognito into application authorization, domain events decouple background work, and DynamoDB plus S3 provide scalable tenant state and assets.

Explore the architecture
Asynchronous AWS file processing diagram with S3 input, SQS job and dead-letter queues, Lambda processor, S3 results, and DynamoDB status
Getting Startedbasic

Asynchronous File Processing Pipeline on AWS

This design makes success and exhausted retries visible without complicating the upload path. S3 protects source files, SQS buffers work, a dead-letter queue isolates failed jobs, and separate result and status stores make completion observable.

Explore the architecture
AWS IoT diagram with IoT Core and Kinesis feeding S3, Athena, and QuickSight history alongside Lambda, OpenSearch, EventBridge, and SNS alerts
IoT Analyticsadvanced

IoT Telemetry and Analytics Platform on AWS

This architecture gives telemetry two clear destinations: durable history for fleet analysis, and a stream-processing path for operational search and threshold alerts. Each path has its own freshness target and recovery behavior.

Explore the architecture

Ready-made AWS diagram

Explore this AWS architecture

Open the diagram from this guide and explore how it works. Create and edit manually or with AI on a computer.

Explore diagram