Skill 1.1.1

Design event-driven architectures that use appropriate messaging patterns such as idempotency, ordering, and delivery guarantees (for example, by using Amazon EventBridge, Amazon SQS FIFO queues and standard queues, Amazon SNS, Amazon Kinesis with partition keys).

Key Concepts

Use SQS to buffer and absorb spikes, SNS and EventBridge for fan-out and event routing, Step Functions for orchestration with retries and compensation (saga pattern), and Kinesis for ordered streams.

Asynchronous designs let producers continue when consumers are down; DLQs capture poison messages; idempotent consumers handle at-least-once delivery.

Delivery guarantees: SQS standard queues, SNS standard topics and EventBridge deliver at least once, so a message can arrive more than once. SQS FIFO queues and SNS FIFO topics remove duplicates sent within a five-minute deduplication interval, using a deduplication ID or content-based deduplication. Because most paths are at least once, consumers should be idempotent: they record a unique message or business key (for example in a DynamoDB table with a conditional write) and skip work they have already done.

Ordering: SQS standard queues make a best effort only. FIFO queues preserve order within a message group ID, so choosing the customer or order ID as the group keeps each entity ordered while different groups are processed in parallel. Kinesis Data Streams orders records within a shard, and the partition key decides the shard, so records with the same key stay in order. EventBridge does not guarantee order.