typescriptaws-lambdadynamodb-queriesamazon-dynamodb-index

what is the most efficient way to update bulk data inside DynamoDB rather than scan and query


I've got a table containing loads of category keys. I want to update some of these categories by a bulk request(e.g. update key#1, key#3 ) and the table schema is as follows:

PK SK
key#1 name#1
key#2 name#2
key#4 name#4

as you can see there is no key#3 inside the table. I want to write an efficient query to update ( key#1, key#3 ), according to my request which is a bulk one.
so I want the most efficient way for doing this and simultaneously I don't want my updates to fail without being noticed.

so I want to know if there are any more efficient ways rather than the above three?
and if my latest approach would be a good one or not.
and what are the pros and cons of doing that?


Solution

  • After lots of digging, I found no straight solutions for this one. But we can somehow simulate it using conditional expressions and utilizing native programming language's features like multithreading, multiprocessing, and similar.

    Here are what I've found: