AWS Certified Developer Associate DVA-C01 – Question243

An application adds a processing date to each transaction that it receives. The application writes each transaction to an Amazon DynamoDB table by using the PutItem operation. Each transaction has a unique ID (transactionID). Sometimes the application receives transactions more than once.
A developer notices that duplicate transactions in DynamoDB have the latest processing date instead of the date when the transaction was first received. Duplicate records happen infrequently, and most of the transactions are unique.
What is the MOST cost-effective solution that the developer can implement to ensure that PutItem does not update an existing record?

A.
Call the GetItem operation first to confirm that the record does not exist. Then call PutItem.
B. Enable the TTL attribute on the DynamoDB table.
C. Implement a conditional put by using the attribute_exists(transactionID) condition expression.
D. Implement a conditional put by using the attribute_not_exists(transactionID) condition expression.

Correct Answer: B