Jeff’s Note #
Unlike generic exam dumps, ADH analyzes this scenario through the lens of a Real-World Lead Developer.
For DVA-C02 candidates, the confusion often lies in choosing the right asynchronous messaging service for ordered, exactly-once processing. In production, this is about knowing exactly how Amazon SQS FIFO queues enable guaranteed ordering and deduplication, versus SNS or Kinesis which have different guarantees. Let’s drill down.
The Certification Drill (Simulated Question) #
Scenario #
Stellar Retail Inc. recently migrated a core order fulfillment app to AWS EC2 instances. The UI autoscaling works perfectly, but the backend system responsible for submitting shipping instructions to warehouse workers has reliability issues. Duplicate shipping requests sometimes appear, and other times, requests are lost or processed out of order. Shipping request payloads are never larger than 250 KB and each request takes approximately 5 to 10 minutes to complete.
The lead developer needs to rearchitect the backend to prevent duplicate shipping requests and to ensure processing always respects the arrival order.
The Requirement: #
Improve the reliability of shipping request delivery and processing by ensuring no duplication and strict order preservation.
The Options #
-
A) Create an Amazon Kinesis Data Firehose delivery stream to process the requests. Create an Amazon Kinesis Data Stream. Modify the application to write the requests to the Kinesis Data Stream.
-
B) Create an AWS Lambda function to process the requests. Create an Amazon Simple Notification Service (Amazon SNS) topic. Subscribe the Lambda function to the SNS topic. Modify the application to write the requests to the SNS topic.
-
C) Create an AWS Lambda function to process the requests. Create an Amazon Simple Queue Service (Amazon SQS) Standard queue. Set the SQS queue as an event source for the Lambda function. Modify the application to write the requests to the SQS queue.
-
D) Create an AWS Lambda function to process the requests. Create an Amazon Simple Queue Service (Amazon SQS) FIFO queue. Set the SQS queue as an event source for the Lambda function. Modify the application to write the requests to the SQS queue.
Google adsense #
leave a comment:
Correct Answer #
D
Quick Insight: The DVA-C02 Imperative #
Lambda processing from an SQS FIFO queue is the go-to pattern for guaranteed exactly-once processing with strict message ordering.
Standard queues provide “at-least-once” delivery, letting duplicates slip through, and SNS does not guarantee order or deduplication.
Kinesis can guarantee ordering per shard but requires significant complexity and does not natively trigger Lambda per message in order without custom scaling.
Content Locked: The Expert Analysis #
You’ve identified the answer. But do you know the implementation details that separate a Junior from a Senior?
The Expert’s Analysis #
Correct Answer #
Option D
The Winning Logic #
- FIFO Queues guarantee strict ordering and exactly-once message processing at the queue level. This matches the business need to avoid duplicate requests and ensure the exact sequence of shipping requests is maintained.
- When configured as an event source, Lambda processes messages in batches respecting the order for a FIFO queue, maintaining sequence integrity.
- The message group ID mechanism further allows parallel processing of independent ordered streams.
- The request size limit (256 KB for SQS) aligns with the payload size, making the FIFO queue a viable choice.
- Using Lambda ensures serverless processing with scalable concurrency and automatic retries.
The Trap (Distractor Analysis) #
-
Why not A (Kinesis Data Streams)?
While Kinesis can preserve order within shards, it requires managing shards, shard iterators, and checkpointing logic. Also, deduplication must be handled in the application layer. The complexity is higher, and there is no native deduplication or strict exactly-once processing guarantee. -
Why not B (SNS Topic)?
SNS is a pub/sub system that fans out messages indiscriminately and does not guarantee message ordering or deduplication. Lambda invocations triggered by SNS can happen concurrently and duplicates or out-of-order events may occur. -
Why not C (SQS Standard Queue)?
Standard queues provide “at-least-once” delivery and best-effort ordering. This means duplicates and out-of-order messages are possible, not meeting the requirement to prevent duplicates or ordered processing.
The Technical Blueprint #
# Create an SQS FIFO queue with content-based deduplication enabled
aws sqs create-queue --queue-name shipping-requests.fifo \
--attributes FifoQueue=true,ContentBasedDeduplication=true
# Sample Lambda event source mapping CLI command
aws lambda create-event-source-mapping \
--function-name ProcessShippingRequestsLambda \
--batch-size 10 \
--event-source-arn <SQS_FIFO_QUEUE_ARN> \
--maximum-concurrency 5
The Comparative Analysis #
| Option | API Complexity | Performance | Use Case |
|---|---|---|---|
| A (Kinesis) | High (shard management, checkpointing) | High throughput, but complex to guarantee order/deduplication | Streaming data, analytics pipelines |
| B (SNS) | Low | Low latency fanout; no ordering guarantees | Broadcast notifications, pub/sub |
| C (SQS Standard) | Low | High throughput, but no guaranteed order or deduplication | Loose order message processing |
| D (SQS FIFO) | Low | Moderate throughput (~300 TPS per message group) with ordering & deduplication | Exactly-once, ordered processing |
Real-World Application (Practitioner Insight) #
Exam Rule #
For the exam, always pick SQS FIFO when you see requirements for ordered, exactly-once, and deduplicated asynchronous processing.
Real World #
In scenarios where massively parallel ordered streams are needed, Kinesis might be used, but only with extensive custom processing. For simple FIFO reliability patterns, SQS FIFO + Lambda is the easiest and most reliable.
(CTA) Stop Guessing, Start Mastering #
Disclaimer
This is a study note based on simulated scenarios for the DVA-C02 exam.