Performing asynchronous requests to DynamoDB

Until now, we have used a synchronous DynamoDB client to make requests to DynamoDB. Synchronous requests block the thread unless the operation is not performed. Due to network issues, sometimes it can be difficult for the operation to get completed quickly. In that case, we can go for asynchronous client requests so that we submit the requests and do some other work.

Getting ready

To get started with this recipe, you should have your workstation ready with the Eclipse IDE.

How to do it…

Asynchronous client is easy to use:

  1. First, we need to instantiate the AmazonDynamoDBAsync class:
    AmazonDynamoDBAsync dynamoDBAsync = new AmazonDynamoDBAsyncClient(new ProfileCredentialsProvider());
  2. Next, we need to create the ...

Get DynamoDB Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.