I have the following columns and its purpose.
id
-> stores the timestamp of modificationauthorName
-> saves the user name who have modifiedauthorEmail
-> saves the user email who have modifiedversion
-> value denoting the version numberData
-> a JSON object
Here, version
can be considered as auto increment field which is incremented when modification happens.
The DynamoDB has partition key as id which is timestamp.
I want to create a GET API which orders all the records by version in descending order and applies a limit governed by pageSize constant.
Currently the architecture I thought of was by sending LastEvaluatedKey
in response along with the data and next api call would pass this LastEvaluatedKey
which will be my ExclusiveStartKey
in the scan operation.
The issue as per my understanding is that the records cannot be ordered across multiple partitions.
Is there a way through which this can be achieved?