user602525
user602525

Reputation: 3264

How do I determine if a write succeeded with amazon DynamoDB?

If I do a putItem() which returns a result structure, how do I determine if the write succeeded or failed?

Upvotes: 3

Views: 1336

Answers (1)

yegor256
yegor256

Reputation: 105083

AWS RESTful API is using HTTP status codes for identification of problems. PutItem returns HTTP code 200 if your item was accepted by DynamoDB for writing. All APIs (incl. PHP and Java) parse these codes and throw exceptions if it's not 200.

Keep in mind, that code 200 doesn't mean that you can immediately read this item from DynamoDB. It only means that it's accepted for writing. Read more about DynamoDB consistency models.

Upvotes: 3

Related Questions