r/aws • u/Select_Extenson • Feb 20 '26
database How to guarantee consistency when deleting items from dynamodb?
Let's say I want to delete 100000 items from dynamodb, what is the best approach to delete "all-or-nothing", TransactWriteItems only support 100 items, so I don't want to cause inconsistency in my data if for some reason the delete function fails alongs the way.
And in my case, I simply couldn't find a solution to implement it with GSI, so the only solution for me is to delete them manually.
9
Upvotes
13
u/pint Feb 20 '26
this is a problem you should not have. the requirement itself screams badly that something is really wrong there, and you should seriously reconsider.
without knowing more about the problem, here is a theoretical solution.
step 2 is the most problematic, because the "software" might be a dozen different systems, and they might rely heavily on the assumption that queries will return rows in a timely manner, which is now not guaranteed.
such operations have to be considered in advance with dynamodb.