AWS Certified DevOps Engineer – ProfessionalResilient Cloud SolutionsMedium
A company is designing a new microservices architecture where services communicate asynchronously. They need a highly available and durable messaging queue that can decouple services, handle message surges, and ensure that messages are processed exactly once, even if a consumer fails and retries. Which AWS service and configuration should the company choose?
- AAmazon SNS topic with multiple SQS Standard queue subscriptions.
- BAmazon SQS FIFO queue with message deduplication and message group IDs.
- CAmazon Kinesis Data Streams with two shards and a consumer application.
- DAmazon SQS Standard queue with long polling and a dead-letter queue (DLQ).
Show answer & explanationAnswer & explanation
Correct answer: B. Amazon SQS FIFO queue with message deduplication and message group IDs.
Amazon SQS FIFO queues guarantee exactly-once processing and message ordering, which are critical for many microservices architectures. Message deduplication ensures messages are not processed multiple times, and message group IDs maintain order within a specific group.
Why the other options are wrong
- A. SNS with SQS Standard queues would still suffer from the at-least-once delivery and lack of ordering/exactly-once processing guarantees of SQS Standard.
- C. Kinesis Data Streams are for high-throughput real-time data streaming, not primarily for decoupling individual messages with exactly-once delivery guarantees in the SQS sense.
- D. SQS Standard queues offer at-least-once delivery and do not guarantee message ordering or exactly-once processing, which is a key requirement.
SQS FIFO Queues
Amazon SQS FIFO (First-In, First-Out) queues guarantee that messages are processed exactly once, in the exact order that they are sent and received. They are designed for applications where the order of operations and exactly-once processing are critical.
- Guarantees message ordering (first-in, first-out).
- Ensures exactly-once message processing.
- Supports message deduplication to prevent duplicate deliveries.
- Uses message group IDs to maintain order within specific groups.
Memory trick: FIFO queues line up messages perfectly, delivering each one exactly once, like a meticulous postman.