I am struggling to fix transaction issue between read and write.
logically, my code follow it below.
- get data from DynamoDB (read DDB)
- merge DDB data with requested data (execute logic in code)
- put data to DynamoDB (write DDB)
I found out that it could be issue by transaction sometimes. Server receives two request almost the same time. If a request data is A, the other data is B and original data is O. I expected final data is A+B+C. but, two requests read the same data(execute logic 1 at the same time), it is B+C.
any solutions on aws DynamoDB sdk options? or any other solutions to resolve this issue? I appreciate it.