Exam DVA-C02 All QuestionsBrowse all questions from this exam
Question 97

A developer has designed an application to store incoming data as JSON files in Amazon S3 objects. Custom business logic in an AWS Lambda function then transforms the objects, and the Lambda function loads the data into an Amazon DynamoDB table. Recently, the workload has experienced sudden and significant changes in traffic. The flow of data to the DynamoDB table is becoming throttled.

The developer needs to implement a solution to eliminate the throttling and load the data into the DynamoDB table more consistently.

Which solution will meet these requirements?

    Correct Answer: A

    To mitigate throttling and ensure consistent data loading into the DynamoDB table, refactoring the Lambda function into two functions and using an Amazon SQS queue as a buffer is a robust solution. The first function transforms the data and pushes it to the SQS queue. The second function is triggered by the SQS queue to load the data into DynamoDB, thereby decoupling the transformation and loading processes. This buffering mechanism helps control the flow of data into DynamoDB, reduces the risk of throttling, and smooths out traffic spikes.

Discussion
ihebchorfiOption: A

A. Refactor the Lambda function into two functions. Configure one function to transform the data and one function to load the data into the DynamoDB table. Create an Amazon Simple Queue Service (Amazon SQS) queue in between the functions to hold the items as messages and to invoke the second function. By breaking the Lambda function into two separate functions and using an SQS queue to hold the transformed data as messages, you can decouple the data transformation and loading processes. This allows for more controlled loading of data into the DynamoDB table and helps eliminate throttling issues.

MrTeeOption: D

This solution will allow the developer to store the incoming data into the DynamoDB table more consistently without being throttled. By splitting the Lambda function into two functions, the first function can store the data into the DynamoDB table and exit quickly, avoiding any throttling issues. The second function can then process the data and update the items after the data is stored in DynamoDB using a DynamoDB stream to invoke the second function. Option A is also a good option but not the best solution because it introduces additional complexity and cost by using an Amazon SQS queue.

robotgeek

Sorry but when you say "the first function can store the data into the DynamoDB table and exit quickly, avoiding any throttling issues" I dont understand your point

[Removed]

I disagree... the order of the function with this option makes NO sense. I go with A

[Removed]

The issue is between S3 to DynamoDB this is where we need to fix the bottleneck. So configuring two functions to work on the data after it has been uploaded to DynamoDB makes no sense.

Ashwinvdm22

The problem I have with option D is that it is adding more lad on the DynamoDB table. What is the need to insert the item and then update the item later. This is performing two operation on every item just to get it into the correct state. I would go with option A since it is not performing two operations on the DB and hence reducing the load which will help with throttling.

peekingpickerOption: B

Why not B ? DynamoDB can autoscale the RCU and WCU

NagasoracleOption: A

Answer : A SQS can be configured to invoke Lambda. https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-lambda-function-trigger.html

SD_CSOption: B

I do not feel refactoring the data transformation and loading would help here as I do not think the number of concurrent calls to the DB would decrease because of this. Autoscaling DynamoDB would seem a more potent option to me.

SerialiDrOption: A

A. Refactor the Lambda function into two functions, using an Amazon SQS queue to manage the data flow, and/or B. Turn on auto scaling for the DynamoDB table to automatically adjust its write capacity based on traffic patterns. Both A and B address the core issue of managing write throughput to the DynamoDB table to prevent throttling. Option A provides a way to smooth out data flow and manage write requests more effectively, while option B allows the table to scale its capacity automatically in response to changing traffic, although with potential limitations in response speed to sudden traffic spikes. Combining these approaches could provide an even more robust solution.

KarBiswaOption: A

Off course A & D are options but here after inserting the data further we cannot modify because one extra writing cost will incur rather using queue lambda can poll the transformed data

DushankOption: A

Refactoring the Lambda function into two functions and introducing an Amazon Simple Queue Service (Amazon SQS) queue between them would provide a buffering mechanism. The first Lambda function would transform the data and push it to the SQS queue. The second Lambda function would be triggered by messages in the SQS queue to write the data into DynamoDB. This decouples the two operations and allows for more controlled and consistent data loading into DynamoDB, helping to avoid throttling.

jiparkOption: A

the requirement is Lambda function load data to DynamoDB. D is incorrect : "DynamoDB stream invoke Lambda" - the order is reversed.

SerialiDrOption: A

This solution addresses the need to eliminate throttling and ensure consistent data loading into the Amazon DynamoDB table by separating the transformation and loading processes into two different functions. Using an Amazon SQS queue to hold items as messages between the two functions helps manage the flow of data and prevents overloading the DynamoDB table, thereby eliminating throttling issues.

BrisunOption: A

A is correct as it requires to write to DynamoDB "more consistently". Option B can solve the problem too but the writing won't be consistent as the traffic will go up and down instantly. In reality, I will probably do Option B only.

TluszczykOption: B

"A" would be optimal, but without backoff algorithm the lambda division and SQS won't affect the throttling. However Dynamo can autoscale https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/AutoScaling.html

65703c1Option: A

A is the correct answer.

nderOption: B

we are trying to stop throttling...

dexdinh91Option: B

I think B

jingle4944

Lambda functions can be triggered by SQS: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-lambda-function-trigger.html

Balliache520505Option: B

I don't believe that option A is correct because an Amazon SQS queue wouldn't invoke a Lambda function; in any case, the Lambda function would be configured to retrieve messages from the SQS queue. For that reason, I believe option B would be the correct choice in this case.

Chicote

ESTAS BIEN PENDEJO