exam questions

Exam AWS Certified Developer - Associate DVA-C02 All Questions

View all questions & answers for the AWS Certified Developer - Associate DVA-C02 exam

Exam AWS Certified Developer - Associate DVA-C02 topic 1 question 362 discussion

A developer manages an application that writes customer orders to an Amazon DynamoDB table. The orders use customer_id as the partition key, order_id as the sort key, and order_date as an attribute. A new access pattern requires accessing data by order_date and order_id. The developer needs to implement a new AWS Lambda function to support the new access pattern.

How should the developer support the new access pattern in the MOST operationally efficient way?

  • A. Add a new local secondary index (LSI) to the DynamoDB table that specifies order_date as the partition key and order_id as the sort key. Write the new Lambda function to query the new LSI index.
  • B. Write the new Lambda function to scan the DynamoDB table. In the Lambda function, write a method to retrieve and combine results by order_date and order_id.
  • C. Add a new global secondary index (GSI) to the DynamoDB table that specifies order_date as the partition key and order_id as the sort key. Write the new Lambda function to query the new GSI index.
  • D. Enable DynamoDB Streams on the table. Choose the new and old images information to write to the DynamoDB stream. Write the new Lambda function to query the DynamoDB stream
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
tomchandler077
Highly Voted 10 months ago
C Global Secondary Index (GSI) allows you to specify a completely different partition key and potentially a different sort key from those on the main table. This flexibility is crucial when you need to support additional access patterns that aren't directly supported by the existing table's key structure. In this scenario, specifying order_date as the new partition key and order_id as the sort key in a GSI will enable efficient querying based on these attributes. Lambda Function Querying GSI: Once the GSI is set up, the Lambda function can perform efficient query operations directly on this index to fetch records based on order_date and order_id, which is much more efficient than scanning the entire table.
upvoted 5 times
...
dombox
Most Recent 9 months, 3 weeks ago
Selected Answer: C
C is correct
upvoted 3 times
...
rdiaz
9 months, 3 weeks ago
Selected Answer: C
C is the correct answer
upvoted 2 times
...
[Removed]
10 months ago
C is the correct answer
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago