AWS BatchGetItem vs GetItem in parallel

1.9k Views Asked by At

Is there much difference (in time performance) in using BatchGetItem vs issuing several GetItem in parallel?

My code will be cleaner if I can use GetItem and just handle the parallelisation myself.

However, if there's a definite time performance advantage to BatchGetItem then I'd certainly use that.

1

There are 1 best solutions below

4
On

BatchGetItem already does its work in parallel:

In order to minimize response latency, BatchGetItem retrieves items in parallel.

Although I don't have benchmarks for you, a single BatchGetItem can get up to 100 items in parallel. Also BatchGetItem is single API call. Thus, performing one API call to get 100 items should be much faster then doing 100 individual API calls using GetItem due to just network latency.