Courseiva

SAA-C03 Design Resilient Architectures Practice Question

An event consumer sometimes processes the same SQS message more than once due to timeouts and retries. The consumer must ensure the payment is not charged twice. What design choice best addresses this requirement?

⚠ Common exam trap

Many exam-takers assume SQS provides exactly-once delivery or that increasing the visibility timeout is a reliable solution, but the exam tests understanding that SQS is at-least-once and that idempotency is the correct architectural pattern to handle duplicates.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Make the payment operation idempotent by using an idempotency key and skipping side effects when the key indicates the payment already succeeded.

Making the payment operation idempotent using an idempotency key ensures that even if the same SQS message is processed multiple times due to timeouts and retries, the payment will only be charged once. The consumer checks the idempotency key before executing the payment; if the key indicates the payment already succeeded, the consumer skips the side effect. This pattern directly addresses the requirement of not charging twice without relying on SQS's at-least-once delivery guarantee.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Assume messages are processed exactly once because SQS uses durable storage.

    Why it's wrong here

    SQS provides at-least-once delivery, not exactly-once. Durable storage ensures messages are not lost, but it does not prevent redelivery when a consumer fails to delete, when the visibility timeout expires, or when the network experiences a partition. For standard queues, duplicate processing can occur under normal conditions, so assuming exact-once from durability alone will lead to incorrect business outcomes.

  • ✓

    Make the payment operation idempotent by using an idempotency key and skipping side effects when the key indicates the payment already succeeded.

    Why this is correct

    Idempotency ensures that repeated processing attempts produce the same result. The consumer should use a stable idempotency key (for example, a business transaction ID) and record completion in durable storage. If the key already indicates the payment succeeded, the consumer skips charging again.

  • ✗

    Increase the consumer visibility timeout to several days so messages are not redelivered.

    Why it's wrong here

    A longer visibility timeout only postpones redelivery; it does not eliminate it. If the consumer crashes or fails to process the message within the timeout, the message becomes visible again and is redelivered, causing a duplicate attempt. Additionally, an overly long timeout delays the detection of stuck messages and prevents other consumers from picking up work, making the system slower to recover and potentially leaving messages in the queue for days without progress.

  • ✗

    Delete the message immediately even if processing fails validation.

    Why it's wrong here

    Deleting a message as soon as it is received, even when validation fails, suppresses legitimate retries and can permanently lose records of transactions that need correction. This approach also fails to prevent duplicates: if the message was redelivered earlier due to a visibility timeout or if a previous attempt is still in flight, the side effect (e.g., a payment) could still be executed more than once. Proper idempotency, rather than proactive deletion, is required to handle both retries and duplicates safely.

About these practice questions

One of 935 original SAA-C03 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This SAA-C03 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SAA-C03 exam.