Transaction processing on aws DynamoDB between read and write

Viewed 179

I am struggling to fix transaction issue between read and write.

logically, my code follow it below.

  1. get data from DynamoDB (read DDB)
  2. merge DDB data with requested data (execute logic in code)
  3. 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.

0 Answers
Related