Say that I want to make frequent updates to an object in DynamoDB, and I've implemented optimistic locking where we (1) read the document; (2) perform some operations including a version increment; and (3) do a conditional put where the condition is that the version hasn't changed.
If I had thousands of these kinds of requests happening, would I ever run into a situation where two put operations (x and y) proceed in parallel, both pass the condition, x finishes first, and then y overwrites what x just did? I've heard that MongoDB prevents multiple operations from changing a document at the same time, but I have no idea if the same is true for DynamoDB.
Originally, I was going to use transactWrite
for this, but since it isn't enabled for global tables and that is a requirement, I'm wondering if optimistic locking will be sufficient.