I learned about
ksuid’s at work this week, and how amazingly clever they are.
They conveniently provide UUID-like uniqueness but with a timestamp component
for stupid simple ordering and cursor-based pagination.
Here’s a simple query that can be used to paginate over a table, via ksuid.
For the first page,
For the Nth page,
$1= last evaluated id from N-1th page
This approach is directly inspired by DynamoDB’s
option on its query command.