O'Reilly logo

AWS Certified Developer - Associate Guide by Bhavin Parmar, Vipul Tankariya

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Conditional writes

You can perform write operations in a DynamoDB table using PutItem, UpdateItem, and DeleteItem. By default, these operations are unconditional in nature; this means that when you perform write operations using these statements, they overwrite an existing item with the same primary key value specified in the operation.

If you do not want to overwrite an existing item, or write an item only based on a specific condition, you can use conditional write with these operations. Conditional write succeeds only in case it meets an expected condition, otherwise, it returns an error. Conditional writes can be used in multiple scenarios.

Example scenarios when conditional writes can be used:

  • You want to write an item using the PutItem ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required