Skip to Content

DVA-C02: How to Configure AWS Lambda to Detect Changes in DynamoDB Table

Learn how to use AWS Lambda to process changes in a DynamoDB table with a serverless application. Find out the best way to connect the Lambda function to the DynamoDB stream.

Table of Contents

Question

A developer is working on a serverless application that needs to process any changes to an Amazon DynamoDB table with an AWS Lambda function.

How should the developer configure the Lambda function to detect changes to the DynamoDB table?

A. Create an Amazon Kinesis data stream, and attach it to the DynamoDB table. Create a trigger to connect the data stream to the Lambda function.

B. Create an Amazon EventBridge rule to invoke the Lambda function on a regular schedule. Conned to the DynamoDB table from the Lambda function to detect changes.

C. Enable DynamoDB Streams on the table. Create a trigger to connect the DynamoDB stream to the Lambda function.

D. Create an Amazon Kinesis Data Firehose delivery stream, and attach it to the DynamoDB table. Configure the delivery stream destination as the Lambda function.

Answer

C. Enable DynamoDB Streams on the table. Create a trigger to connect the DynamoDB stream to the Lambda function.

Explanation

The correct answer is C. Enable DynamoDB Streams on the table. Create a trigger to connect the DynamoDB stream to the Lambda function.

To process any changes to a DynamoDB table with a Lambda function, the developer should use DynamoDB Streams, which is a feature that captures data modification events in DynamoDB tables. Each event is represented as a stream record, which contains information such as the type of change, the timestamp, and the affected attributes.

The developer can enable DynamoDB Streams on the table and specify the type of information to be written to the stream. The developer can then create a trigger to connect the DynamoDB stream to the Lambda function. The trigger allows the Lambda service to poll the stream and invoke the function synchronously with an event that contains stream records. The function can then process the records and perform any additional actions.

The other options are incorrect for the following reasons:

  • Option A is incorrect because it involves unnecessary complexity and cost. Creating a Kinesis data stream and attaching it to the DynamoDB table would require additional steps and resources, such as enabling Kinesis Adapter for DynamoDB Streams, configuring Kinesis Data Streams settings, and paying for Kinesis Data Streams throughput. This option would also introduce additional latency in processing the changes.
  • Option B is incorrect because it does not detect changes to the DynamoDB table in real time. Creating an EventBridge rule to invoke the Lambda function on a regular schedule would require polling the DynamoDB table from the function to detect changes. This option would also incur additional read capacity units and increase the possibility of missing or duplicating changes.
  • Option D is incorrect because it uses the wrong service for processing changes. Creating a Kinesis Data Firehose delivery stream and attaching it to the DynamoDB table would require enabling Kinesis Adapter for DynamoDB Streams and configuring Kinesis Data Firehose settings. However, Kinesis Data Firehose is designed for loading streaming data into destinations such as Amazon S3, Amazon Redshift, or Amazon Elasticsearch Service, not for invoking Lambda functions.

The latest AWS Certified Developer – Associate DVA-C02 certification actual real practice exam question and answer (Q&A) dumps are available free, which are helpful for you to pass the AWS Certified Developer – Associate DVA-C02 exam and earn AWS Certified Developer – Associate DVA-C02 certification.

AWS Certified Developer - Associate DVA-C02 Exam Questions and Answers