Skip to main content

AI & assistant-friendly summary

This section provides structured content for AI assistants and search engines. You can cite or summarize it when referencing this page.

Summary

Exactly-once is a myth end-to-end—but idempotent consumers plus event stores get you close. CQRS read models on DynamoDB streams, Kinesis, and EventBridge replay semantics.

Key Facts

  • CQRS read models on DynamoDB streams, Kinesis, and EventBridge replay semantics
  • June 2026 truth: AWS messaging is at-least-once unless you engineer Kafka EOS or FIFO dedup—and your database write must still be idempotent
  • Benchmark pattern (hypothetical workload) — order service with CQRS on DynamoDB + Kinesis, 8K events/sec, idempotent consumer dedup via conditional writes reduces duplicate side-effects from 1
  • 2% to 0
  • 001%, replay of 72-hour window completes in 47 minutes on 12 Lambda parallel consumers

Entity Definitions

Lambda
Lambda is an AWS service discussed in this article.
S3
S3 is an AWS service discussed in this article.
Aurora
Aurora is an AWS service discussed in this article.
DynamoDB
DynamoDB is an AWS service discussed in this article.
EventBridge
EventBridge is an AWS service discussed in this article.
SQS
SQS is an AWS service discussed in this article.
SNS
SNS is an AWS service discussed in this article.
OpenSearch
OpenSearch is an AWS service discussed in this article.

Exactly-Once, CQRS, and Event Sourcing Replay on AWS

Quick summary: Exactly-once is a myth end-to-end—but idempotent consumers plus event stores get you close. CQRS read models on DynamoDB streams, Kinesis, and EventBridge replay semantics.

Key Takeaways

  • CQRS read models on DynamoDB streams, Kinesis, and EventBridge replay semantics
  • June 2026 truth: AWS messaging is at-least-once unless you engineer Kafka EOS or FIFO dedup—and your database write must still be idempotent
  • Benchmark pattern (hypothetical workload) — order service with CQRS on DynamoDB + Kinesis, 8K events/sec, idempotent consumer dedup via conditional writes reduces duplicate side-effects from 1
  • 2% to 0
  • 001%, replay of 72-hour window completes in 47 minutes on 12 Lambda parallel consumers
Exactly-Once, CQRS, and Event Sourcing Replay on AWS
Table of Contents

June 2026 truth: AWS messaging is at-least-once unless you engineer Kafka EOS or FIFO dedup—and your database write must still be idempotent.

Symptom → mechanism → AWS control

Production symptomMechanismAWS control
Duplicate charges on retryAt-least-once delivery without idempotencyDynamoDB idempotency keys, SQS FIFO deduplication
Stale read model after replayProjection lag during catch-upKinesis enhanced fan-out, dedicated projection workers
Unbounded event store growthAppend-only without compactionDynamoDB TTL on snapshots, S3 archival via Firehose

Opinionated take: Exactly-once is a consumer contract—implement idempotent writes on DynamoDB and treat Kinesis as at-least-once, not a magic guarantee.

Benchmark pattern (hypothetical workload) — order service with CQRS on DynamoDB + Kinesis, 8K events/sec, idempotent consumer dedup via conditional writes reduces duplicate side-effects from 1.2% to 0.001%, replay of 72-hour window completes in 47 minutes on 12 Lambda parallel consumers.

Layers of “exactly-once”

  1. Broker — Kafka transactions / SQS FIFO dedup ID
  2. Consumer — idempotency key store (DynamoDB)
  3. Projection — CQRS read model version column

CQRS + event sourcing on AWS

PieceService
Event logKinesis / MSK / EventBridge archive
Command sideLambda + Aurora
Read modelDynamoDB / OpenSearch
ReplayNew consumer group / replay archive to SQS

Replay strategies: rebuild read model from offset 0; use version vectors / optimistic locking on projections.

AWS services map

NeedServiceSkip when
Durable event logKinesis Data StreamsSimple CRUD with PostgreSQL
Idempotent side-effectsDynamoDB conditional writesFire-and-forget SNS notifications
Read model rebuildLambda + DynamoDB GSI projectionsSingle-table OLTP with no projections

What to do this week

  1. Add event_id unique constraint on projection table.
  2. Test replay in staging—measure duplicate suppression.
  3. Read microservices patterns guide for outbox.

More in This Track

Part of the Engineering Guides library (June 2026).

What this guide doesn’t cover

Saga orchestration—canonical microservices post.

PP
Palaniappan P

AWS Cloud Architect & AI Expert

AWS-certified cloud architect and AI expert with deep expertise in cloud migrations, cost optimization, and generative AI on AWS.

AWS ArchitectureCloud MigrationGenAI on AWSCost OptimizationDevOps

Recommended Reading

Explore All Articles »