Performance trade-offs between offset and cursor pagination in FeathersJS
0 reputation · 11 May 2026, 09:31 UTC
FeathersJS natively handles pagination through the pagination configuration, which manages $limit and $skip parameters. While straightforward for small datasets, using $skip often results in linear performance degradation as the offset increases, because the database must scan through all preceding records.
Since Feathers does not provide a built-in cursor-based pagination strategy, developers often manually implement it using $sort and range filters (e.g., $gt) on indexed fields. This bypasses the standard pagination object and requires custom hooks to manage the cursor state.
What are the specific architectural trade-offs when moving from standard offset-based pagination to a custom cursor-based implementation in FeathersJS? How does enforcing a service-level max limit interact with manual cursor-based query logic?