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
- Layers of “exactly-once” 1
- Broker — Kafka transactions / SQS FIFO dedup ID 2
- Consumer — idempotency key store (DynamoDB) 3
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.
Layers of “exactly-once”
- Broker — Kafka transactions / SQS FIFO dedup ID
- Consumer — idempotency key store (DynamoDB)
- Projection — CQRS read model version column
CQRS + event sourcing on AWS
| Piece | Service |
|---|---|
| Event log | Kinesis / MSK / EventBridge archive |
| Command side | Lambda + Aurora |
| Read model | DynamoDB / OpenSearch |
| Replay | New consumer group / replay archive to SQS |
Replay strategies: rebuild read model from offset 0; use version vectors / optimistic locking on projections.
What to do this week
- Add
event_idunique constraint on projection table. - Test replay in staging—measure duplicate suppression.
- Read microservices patterns guide for outbox.
What this guide doesn’t cover
Saga orchestration—canonical microservices post.
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.