If you request more than 100 items, BatchGetItem returns a ValidationException with the message "Too many items requested for the BatchGetItem call." Is there any way to process more than 100 items in dynamoDB through batchGetItems.
With a single BatchGetItem request the maximum number of items to get is 100, as documented by AWS:
A single operation can retrieve up to 16 MB of data, which can contain as many as 100 items.
[…]
Important
If you request more than 100 items, BatchGetItem returns a ValidationException with the message "Too many items requested for the BatchGetItem call."
There is also no pagination available as it is for actions like Query. What you could do is to implement pagination yourself so you make one BatchGetItem request per 100 items. If you go down this route, you should also make sure to properly handle the UnprocessedKeys.
While it's not clear what your use case for fetching more than 100 items at once from DynamoDB is, your problem could be a sign for a poor DynamoDB schema design. Depending on your use case redesigning your schema and/or using an action like Query might be a better choice.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With