Search code examples
amazon-dynamodbaws-java-sdk

batchLoad on a Global Secondary Index in Dynamo


Is there a way to perform a batch Load from a table in DynamoDB using the Global Secondary index?

The batchLoad API accepts only HashKeys, and the queryPage API only lets you pass in a single key.


Solution

  • BatchLoad uses BatchGetItem behind the scenes. BatchGetItem can only read from the base table, and not from indexes (LSI, GSI). Therefore, you will need to run multiple Query operations in parallel on your GSI to achieve a similar effect.