Minimizing SQS Data Loss During Downtime
Short answer
AC Increase the message retention period and attach a dead-letter queue to minimize data loss.
Question
Key Takeaways
The core concept is SQS durability during unavailability; the trap is assuming DLQs handle expired messages or that visibility timeouts affect persistence.
This question addresses how to prevent data loss in Amazon SQS when applications experience downtime. The correct solutions involve extending message retention and utilizing dead-letter queues for recovery.
Common mistake: Many candidates choose B (Visibility Timeout) or D (Delay Queue), confusing message delivery timing with message storage duration.
Expert Analysis
Why the Answer Is Correct
To minimize data loss, you must ensure messages survive the downtime period. Increasing the message retention period (A) directly extends the time messages stay in the queue before expiration, preventing deletion while the app is down. Attaching a dead-letter queue (C) allows failed or unprocessed messages to be routed there after maximum receive counts are exhausted, preserving them for manual inspection or reprocessing rather than permanent deletion.
Why the Other Options Are Wrong
Increasing the visibility timeout (B) only delays when a processed message becomes visible again; it does not prevent expiration if the app is completely down. Using a delay queue (D) postpones initial delivery but does not extend the overall retention period. Reducing processing time (E) helps throughput but does not solve the problem of messages expiring during extended downtime.
Community Comment Notes
The community majority correctly identified AC, though some argued against C because DLQs typically require message processing attempts. However, as noted by users like matt200, DLQs are crucial for preventing data loss from failed deliveries. One user altonh incorrectly claimed C is invalid because messages go to DLQ only if processed, missing that SQS can move messages to DLQ based on receive count even if they are never successfully 'completed'.
Official Reference
- https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-retention.html
- https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queue.html
These links open the official vendor documentation in a new tab.
Exam Strategy
Always distinguish between message visibility/delivery controls and message persistence/retention settings when dealing with data loss scenarios.
Frequently Asked Questions
Does increasing visibility timeout prevent data loss?
Can DLQs save messages that expire due to downtime?
Community Votes
62% of anonymous learners picked answer AC. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 5 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 5
-
matt200 👍 3To minimize data loss for the application consuming messages from an Amazon SQS queue, the following two solutions are most effective: A. Increase the message retention period: By increasing the message retention period, you ensure that messages remain in the queue for a longer duration before being automatically deleted. This provides more time for the application to recover from downtime and process the messages, thereby reducing the chance of data loss due to message expiration. C. Attach a dead-letter queue (DLQ) to the SQS queue: A DLQ can be used to capture messages that cannot be processed successfully. When messages fail to be processed after a certain number of attempts (as defined by the redrive policy), they are moved to the DLQ. This allows you to investigate and handle these messages separately, preventing data loss.
-
altonh 👍 2It cannot be C. Messages go to DLQ only if processed. But if the message is not processed at all and it expires, then it will be deleted from the queue.
-
axantroff 👍 1In my opinion, A is obvious and one of the two correct answers. Additionally, I checked B, C, and D in more detail, and they basically do not make sense as they do not contribute in any way to handling messages that were just delayed. See the documentation for reference: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-delay-queues.html https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html https://aws.amazon.com/what-is/dead-letter-queue/ So, only E remains as another valid option. It makes sense because the faster we are able to process events, the less likely we are to violate the expiration policy
-
HagarTheHorrible 👍 1Increasing the message retention period (A) ensures messages are available longer, while attaching a dead-letter queue (C) allows recovery and reprocessing of unprocessed messages, effectively minimizing data loss.
-
aragon_saa 👍 1Answer is AC
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All DEA-C01 Questions
Access 100 questions with complete answers and detailed explanations.
View Full DEA-C01 Practice Test →