nerdexam
Amazon

DVA-C02 · Question #677

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…

The correct answer is D. Implement a conditional put by using the attribute_not_exists(transactionID) condition expression. Using a conditional PutItem with the condition expression attribute_not_exists(transactionID) ensures that the item is only inserted if it does not already exist, preventing overwrites of existing records. This approach avoids the extra read cost of a GetItem call and is more…

Submitted by diego_uy· Mar 5, 2026Development with AWS Services

Question

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?

Options

  • ACall the GetItem operation first to confirm that the record does not exist. Then call PutItem.
  • BEnable the TTL attribute on the DynamoDB table.
  • CImplement a conditional put by using the attribute_exists(transactionID) condition expression.
  • DImplement a conditional put by using the attribute_not_exists(transactionID) condition expression.

How the community answered

(47 responses)
  • A
    11% (5)
  • B
    2% (1)
  • C
    6% (3)
  • D
    81% (38)

Explanation

Using a conditional PutItem with the condition expression attribute_not_exists(transactionID) ensures that the item is only inserted if it does not already exist, preventing overwrites of existing records. This approach avoids the extra read cost of a GetItem call and is more cost-effective.

Community Discussion

No community discussion yet for this question.

Full DVA-C02 Practice