DVA-C02 Exam QuestionsBrowse all questions from this exam

DVA-C02 Exam - Question 53


A developer is using an AWS Lambda function to generate avatars for profile pictures that are uploaded to an Amazon S3 bucket. The Lambda function is automatically invoked for profile pictures that are saved under the /original/ S3 prefix. The developer notices that some pictures cause the Lambda function to time out. The developer wants to implement a fallback mechanism by using another Lambda function that resizes the profile picture.

Which solution will meet these requirements with the LEAST development effort?

Show Answer
Correct Answer: A

Setting the image resize Lambda function as a destination of the avatar generator Lambda function for events that fail processing is the solution that requires the least development effort. This is because it leverages AWS Lambda Destinations, which provides built-in support for routing failed asynchronous invocation results to a predetermined destination, such as another Lambda function. This method does not require additional coding or configuration for error handling, retries, or queue management, making it the simplest and most efficient solution for the task.

Discussion

17 comments
Sign in to comment
March2023Option: A
Mar 24, 2023

Wouldn't A be the Least Effort

jingle4944Option: A
Sep 27, 2023

Previously, you needed to write the SQS/SNS/EventBridge handling code within your Lambda function and manage retries and failures yourself. With Destinations, you can route asynchronous function results as an execution record to a destination resource without writing additional code. https://aws.amazon.com/ru/blogs/compute/introducing-aws-lambda-destinations/

jayvarma
Aug 11, 2023

Option B is the right answer. Can someone say why B cannot be the right answer for this question? Option A fails when there are huge amounts of requests coming to the lambda functions. There is every chance for lambda to throw ProvisionedThrougputExceeded Exception because of the throttling issues. Which is almost the similar reason why Option C will also fail at some point. However, you could use SNS but it is not the best solution. Definitely Option B.

rlnd2000Option: B
May 21, 2023

B is the best option in my opinion, I agree with Nagendhar and junrun3 explanations and because decoupling using SQS is a best practice, I think when they say ... with the LEAST development effort that imply following the best practices in AWS.

umer1998
Jun 25, 2023

I agree with B because I am considering scalability in my mind if we have thousands/millions of requests at the same time. because of the quota limit, the lambda can fail if we continuously call two functions (step function) together, which may result in another function doing a throttling issue. If we pass the message to the SQS, our function will never face this issue with throttling. and since the question asks us to do the least development efforts. Separation of concerns will make development easier.

[Removed]Option: A
Jul 18, 2023

A is a simplest solution https://aws.amazon.com/ru/blogs/compute/introducing-aws-lambda-destinations/ https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-async-destinations

jipark
Jul 30, 2023

your explanation looks correct. Lambda "Denstination" seems exact solution for this. it explains how to handle success, failed case.

KarBiswaOption: A
Dec 17, 2023

Least development effort no emphasis on orchestration

KarBiswa
Feb 24, 2024

https://aws.amazon.com/ru/blogs/compute/introducing-aws-lambda-destinations/ this link justifies the answer

fabiomonta18
Jun 15, 2024

The article says "For each execution status such as Success or Failure you can choose one of four destinations: another Lambda function, SNS, SQS, or EventBridge." It hink for this reason the correct one is B.

fabiomonta18
Jun 15, 2024

I mean, which destination other then SQS can you set in this case?

AWSdeveloper08Option: B
Jul 21, 2023

I agree with the explanation for option B. Scalability is the key

ScherbakovMike
May 31, 2023

SQS or SNS can be assigned as 'TargetArn' in the 'DeadLetterConfig'. I think, D variant is more appropriate: in case of timeout (image is too large), there will be push to SNS and to subscribed resizing function. Subscribed resizing function writes the resized image to S3 and original Lambda function processes the resized image again.

backfringeOption: A
Jul 27, 2023

least amount of effort to set up destination on failure events to REsize Lambda

ninomfr64Option: A
Aug 19, 2023

A is the easiest option https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-async-destinations

appuNBablu
Sep 23, 2023

A, because we can map another Lambda function as destination alongside (SQS, SNS, Event Bridge)

JonalbOption: A
Oct 27, 2023

A. Defina a função Lambda de redimensionamento de imagem como um destino da função Lambda do gerador de avatar para os eventos que falham no processamento

vipyodha
Mar 26, 2024

B is right. A.wrong because Lambda Function Chaining: While Lambda function chaining is possible, it would require modifying the avatar generation Lambda function to include the resize function as a destination for failed events. This might involve additional coding and potentially more complex error handling within the Lambda function.

Tluszczyk
Jul 17, 2024

With AWS Lambda destinations you don't need to interact with code to change this

65703c1Option: A
May 21, 2024

A is the correct answer.

fabiomonta18Option: B
Jun 15, 2024

This seems to be a tricky one. It's true that you can set Lambda destination, but you better set SQS as destination, exactly what the article suggests, go check it. The correct one is B. https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-async-destinations

PrinceMughalOption: A
Jun 24, 2024

I will go with A as it is the simplest solution among other three option