0

In dynamoDB, can the value of the sort key be changed after the item is written to the table?

For example, I have a sort key counts, am I able to do incr updates on counts if it was being used as a sort key for GSI or LSI?

My understanding was that if counts was used as sort key for the primary key, it won't be mutable. Is that also the case for GSI and LSI?

niyruu
  • 5
  • 3

1 Answers1

2

For an index it's different, you can update those values. However, you will incur 2X your write costs on the index, as DynamoDB will do a DeleteItem and then a PutItem on replicating the data. So if you decide to use that access patterns, ensure you provision your index adequately to avoid any throttling caused by having an under provisioned index.

Leeroy Hannigan
  • 11,409
  • 3
  • 14
  • 31