So my playbook here is to ask if direct addressing is really needed and then, when it isn't, switch to using cursors.
So my playbook here is to ask if direct addressing is really needed and then, when it isn't, switch to using cursors.
Most frameworks have some kind of cursor implementation. Laravel's docs do a good job describing theirs: https://laravel.com/docs/8.x/pagination#cursor-pagination
So on the first page load, the server will send the records and a cursor that contains the info {'lastId': 32} and when the user requests page two, they'll have to send the cursor {'lastId': 32} so the server knows where to start.
In practice, the cursors are usually encoded and appended to the URLs.
You can never calculate what page 2 should be, you have to know what the last item on page 1 was, because that dictates where to start on page 2.
Additionally, it hurts users when the data is changing beneath them. Rows can appear twice or disappear as you move between pages.
As a developer without a specific requirement if the time is short (it always is) I create a paged navigation using the defaults of the framework I'm using. Then the customer might or might not ask for a search filter. If frameworks defaulted on search filters I'd give customers them first and paged navigation if requested.