Reputation: 1
In my project we are using single table design for storing data in multiple entities.
Now this data is primarily the configuration related data which we are querying while processing our events and for that we have to make multiple API calls to the same DynamoDB table to fetch data from multiple entities.
Is there any way that we can make one API call to fetch all the required data from multiple entities in that single DynamoDB table?
Thanking in anticipation.
We have gone through the batch get item which is provided by DynamoDB SDK but it only queries from two different tables in a single API call.
Upvotes: 0
Views: 78
Reputation: 19813
You can use BatchGetItem
which will allow you to obtain up to 100 items from the table.
You can use Query
, should all the entities share the same partition key. If they do not, your use-case could probably use a GSI where the partition key is the attribute they share in common.
You can also use PartiQL ExecuteStatement
and BatchExecuteStatement
which are SQL variants of the above options.
Upvotes: 1