I have the following table in DynamoDB:
Table: Person
Attributes: person_id, firstName, lastName, age, birthday
Partition Key: person_id
My problem is: I need to query all the people that are between a certain age, for instance age > 18 AND age < 45.
However, I need strong consistency in my query, therefore, I cannot use a Global Secondary Index.
In this case what would be the best/possible solutions?
I would suggest you to use
scanoperation since you want to achieve filtering but you are not aware of the partition Key. In java, you can follow the below guide for scanning the table and using filter expressions. https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ScanJavaDocumentAPI.html