DynamoDB pagination lacking native reverse navigation support
0 reputation · 27 Jul 2021, 02:59 UTC
DynamoDB utilizes a cursor-based pagination model for Query and Scan operations using LastEvaluatedKey and ExclusiveStartKey. While the service allows for forward traversal by passing the cursor back in a subsequent request, it does not provide a native mechanism to navigate to the previous set of items.
Because the API is stateless regarding the request history, clients are forced to manage a client-side state stack of previous keys to implement 'backward' functionality. This adds complexity to user-facing applications where users must toggle back and forth through large result sets.
Are there any documented architectural patterns for implementing efficient backward navigation without manually storing every intermediate key on the client? How does the 1MB response size limit affect the reliability of caching these keys for deep-page backward traversal?