DVA-C02 exam dumps

DVA-C02 practice question 123 of 399

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

DVA-C02 Question 123

Single answer

You are developing a serverless application using AWS Lambda. The application processes images uploaded to an S3 bucket and stores the results in DynamoDB. During testing, you notice that the Lambda function occasionally exceeds the default execution timeout of 3 seconds and fails. What is the best way to handle this scenario?

  1. A

    Increase the Lambda function timeout to handle longer processing times.

  2. B

    Use AWS Step Functions to break the process into multiple smaller steps.

  3. C

    Enable S3 Event Notifications to automatically retry the Lambda function upon failure.

  4. D

    Scale the Lambda function by increasing the memory allocation.

Show answer and explanation

Correct answer: B

Explanation

When a Lambda function consistently exceeds the default execution timeout, the best approach is to restructure the workflow using AWS Step Functions. Step Functions allow you to create serverless workflows, breaking down complex processes into smaller, manageable steps. This approach improves reliability, scalability, and fault tolerance, making it the most suitable solution for this scenario.

  • A. Incorrect.

    Increasing the Lambda function timeout may temporarily fix the issue, but it does not address the root cause. Breaking the process into smaller steps is a more scalable and efficient solution.

  • B. Correct.

    Using AWS Step Functions allows you to orchestrate and break down the process into smaller steps, effectively handling longer workloads and ensuring better fault tolerance.

  • C. Incorrect.

    S3 Event Notifications can trigger retries but do not address the core issue of processing time exceeding the Lambda timeout.

  • D. Incorrect.

    Increasing the Lambda function memory allocation may improve performance to some extent but is not a reliable solution for processes that inherently require longer execution times.

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