Design a solution for consistent storage pagination
Define the pagination requirements.
- Consistent response for paginated APIs.
- Consistent input params (page input) for paginated APIs.
- Consistent cursor generation.
- Possibility to get a cursor to any arbitrary item in the response.
- Possibility to paginate forward and backwards from a given cursor.
- Possibility to know whether there are more pages. (to both forward and backward)
- Possibility to define the sort order.
- Consistent filter params.
- Possibility to know the total number of items with the given filter. (optional)
Tasks
- Identify the APIs to update and their references.
- Finad a way to make the impact on clients as minimal as possible.
- Add pagination support for missing APIs.
- Create a simple Python client that abstracts most of the pagination details. (optional)
- Better performance and smart pagination using a cache. (optional)
- Create Consistent object IDs for efficient caching. (optional)
Proposed solution (first draft)
- Solution using a Paginator instance
- BasePagination class based solution
- Decorator based solution
Edited by Jayesh