Rohit Chouhan
Rohit Chouhan

Reputation: 119

Can multiple thread simultaneously update records in DynamoDB?

How can we update records in DynamoDB using multiple threads? Let we have 100 of records and threads as t1, t2, t3, t4, t5 t1 attempts fist 20 records t2 next 20 and so on.. Is it possible ? if yes how?

Upvotes: 0

Views: 1049

Answers (1)

Alexander Patrikalakis
Alexander Patrikalakis

Reputation: 5205

Use the AmazonDynamoDBAsync interface and with an ExecutorFactory providing at least 5 threads. Then, submit 100 UpdateItem requests asynchronously and wait for the results to come back by iterating over the Futures and calling get().

Upvotes: 1

Related Questions