I want to retrieve 500 items and I know their primary keys. Is calling BatchGetItem more efficient than calling GetItem in a loop in dynamodb?
yes it is. For GetItem you are going to pay the network roundtrip penalty for every item. for batch you are only going to pay it once (or 2-3-4-et times if you need to paginate).
so at 5ms per request * 500 = 2500ms extra time spend on getting the items. (5ms assumes you are in the same region as dynamo endpoint)
if you are outside of the region/aws expect this to take way more (sometimes by an order of magnitude)
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