DVA-C02 exam dumps

DVA-C02 practice question 29 of 399

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

DVA-C02 Question 29

Single answer

You are developing a serverless application where an AWS Lambda function processes user-uploaded images. The processing involves resizing the images and saving them to an Amazon S3 bucket. Due to the potential for high traffic and unpredictable upload patterns, you want to ensure that the Lambda function is not overwhelmed and that each upload is processed reliably without blocking the user's upload request. Which pattern should you use?

  1. A

    Use a synchronous pattern and call the Lambda function directly from the client application.

  2. B

    Use an asynchronous pattern by placing a message in an Amazon SQS queue, which triggers the Lambda function.

  3. C

    Use a synchronous pattern with an Amazon API Gateway to invoke the Lambda function and wait for the response.

  4. D

    Use an asynchronous pattern by placing an event notification in the S3 bucket to trigger the Lambda function.

Show answer and explanation

Correct answer: B

Explanation

An asynchronous pattern using Amazon SQS is ideal for this scenario because it decouples the upload request from the processing logic. SQS ensures reliable message delivery and enables the Lambda function to process messages at its own pace, thereby avoiding being overwhelmed during periods of high traffic. This approach also improves client-side performance by not blocking the upload request.

  • A. Incorrect.

    Calling the Lambda function directly with a synchronous pattern would tie up the client application until the processing is complete, which can lead to timeouts or poor user experience under high traffic.

  • B. Correct.

    Using an asynchronous pattern with Amazon SQS decouples the image upload request from the processing logic. The queue ensures reliable delivery of messages to the Lambda function and prevents it from being overwhelmed during traffic spikes.

  • C. Incorrect.

    Using API Gateway with a synchronous pattern still requires the client to wait for the Lambda function to complete processing, which does not address the traffic or load concerns.

  • D. Incorrect.

    An asynchronous event notification from S3 could trigger the Lambda function, but S3 notifications are not as reliable as SQS when it comes to ensuring message delivery and handling retries.

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