Relative Content

Tag Archive for amazon-dynamodbdynamodb-queriesamazon-dynamodb-index

DynamoDB V2 Enhanced SDK to get only one record matching a partition key

I have a DynamoDB table that has a partition key and a sort key.
In my Java code I need to get one (and only one) record with a partition key if that record exists.
Currently I am using DynamoDB V2 Enhanced SDK and I do this by getting ALL records that match this partition key.
However, if there are lots of records (say, 100,000) with the same partition key, the query could take quite long, when in fact I only need one record and not the rest of queried items(say, 99,999 items) .