DVA-C02 exam dumps

DVA-C02 practice question 27 of 399

AWS Certified Developer - Associate. Associate level, Amazon Web Services. Free question with the correct answer and a full explanation.

DVA-C02 Question 27

Select 2

You are developing a serverless application that processes customer orders using an AWS Lambda function. The function retrieves messages from an Amazon SQS queue. Occasionally, the function encounters transient network errors while processing some messages. To ensure a fault-tolerant design, you want to minimize message loss and prevent repeated attempts from overwhelming downstream systems. Which combination of actions should you take?

  1. A

    Implement retries with exponential backoff in the Lambda function.

  2. B

    Configure an Amazon SQS Dead-Letter Queue (DLQ) for the original queue.

  3. C

    Set up a static delay for retries in the Lambda function.

  4. D

    Enable long polling on the SQS queue to reduce the number of empty responses.

  5. E

    Use an SQS FIFO queue instead of a standard queue to avoid duplication of messages.

Show answer and explanation

Correct answers: A, B

Explanation

To design a fault-tolerant system, retries with exponential backoff help handle transient issues gracefully by preventing overwhelming downstream systems. Configuring a Dead-Letter Queue ensures that messages that cannot be processed after multiple retries are not lost, enabling developers to inspect and handle them later. These approaches are best practices for building resilient, fault-tolerant applications using Amazon SQS and AWS Lambda.

  • A. Correct.

    Implementing retries with exponential backoff helps handle transient errors by gradually increasing the delay between retry attempts, reducing pressure on downstream systems and improving fault tolerance.

  • B. Correct.

    Configuring an Amazon SQS Dead-Letter Queue ensures that messages that cannot be processed after the maximum retry attempts are not lost but can be examined and handled later.

  • C. Incorrect.

    Using a static delay for retries is not optimal because it does not adapt to the nature of transient issues, potentially causing unnecessary delays or overwhelming downstream systems.

  • D. Incorrect.

    Enabling long polling reduces costs and improves efficiency by reducing the number of empty responses, but it does not address the problem of message retries or fault tolerance in this scenario.

  • E. Incorrect.

    Switching to an SQS FIFO queue is unnecessary unless strict ordering or deduplication is required, and it does not directly address retries or handling failed messages.

Timed practice exam

Take a DVA-C02 practice test under exam conditions

65 questions in 130 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam