I want to write items to DynamoDB using AWS Lambda written in Java. I use the following code to write to DynamoDB one record at a time:
public void writeToDynamoDB() {
AmazonDynamoDB client = AmazonDyanmoDBClientBuilder.defaultClient();
Map<String, AttributeValue> itemValues = new HashMap<>();
itemValues.put("partitionKey", new AttributeValue("123"));
client.putItem("DynamoDBTable", itemValues);
}
But it turns out that I need to write the records in batches. How can I do it. Is there any modification I can make to this code?