We have a microservice written in node.js & we use dynamoDB for data storage. Value is stored in json format against key. In update service call, we fetch value for a ke
Just released at 2018 re:invent, see the native transaction support in javascript sdk usage here: https://aws.amazon.com/blogs/aws/new-amazon-dynamodb-transactions/
Recently there is an npm package that provides implementation of DynamoDb optimistic locking. See Dynameh. You can check that out.
You can do atomic updates such as incrementing a number straight on Dynamo without reading, incrementing, updating. For more information see this
Are both updates updating the same field? If so you can add a condition to the update that the old value equal what you read. That way if you try to save the 2nd new value, this condition will fail and it won't perform the 2nd update. See this