Ross Bush
Ross Bush

Reputation: 15175

Is there a batch size limit to CreateBatchWrite()

When attempting to upload ~30,000 users into a dynamodb table using the Amazon.DynamoDBv2 wrapper for .net, not all records made it, however, there was no exception either.

 var userBatch = _context.CreateBatchWrite<Authentication_User>();
 userBatch.AddPutItems(users);
 userBatch.ExecuteAsync();

Approximately 2,500'ish records were written to the table. Has anyone found a limit to number or size of batch inserts?

Upvotes: 0

Views: 566

Answers (2)

Ross Bush
Ross Bush

Reputation: 15175

I exited the process after the return from ExecuteAsync(). That was the problem. When I let it run I can see the data slowly build up. However, in the bulk insert I used a Task.Wait() because there was nothing to do until the records had been loaded. However, Iridium's answer above assited me with the second issue that revolved around ProvisionedThroughput exceptions.

Upvotes: 0

Iridium
Iridium

Reputation: 23721

From the documentation (emphasis mine):

When using the object persistence model, you can specify any number of operations in a batch.

Upvotes: 1

Related Questions