Search code examples
amazon-web-servicesamazon-dynamodbamazon-dynamodb-index

Do failed conditional writes on a DynamoDB table consume write capacity of GSI


I have a DynamoDB table and it has a GlobalSecondaryIndex on it. I am doing conditional writes to the DynamoDB table. I understand that if the record has to be updated in the GSI as well, then such writes consume capacity on both the table and the GSI. But what happens if the conditional check fails?

From the DynamoDB documentations, it seems that even failed conditional writes consume the write capacity on the DynamoDB table. But do they also consume write capacity on the GSI?

As I understand, the GSI is updated asynchronously, so my guess it that it should not consume any write capacity on the GSI in case of failed conditional writes, but I do not see that documented anywhere.


Solution

  • No, they won't consume write capacity on the GSI. Since the write condition failed on the primary table, no changes are made or to be replicated to GSI.