Offset-based pagination inconsistencies during rolling deployments
0 reputation · 04 Mar 2022, 15:00 UTC
FeathersJS utilizes a default offset-based pagination mechanism using skip, limit, and page query parameters. During a rolling deployment of a small application, multiple instances of the service may run concurrently against a shared database store.
Because offset-based pagination relies on the number of rows skipped, concurrent insertions or deletions occurring during the transition period can result in duplicate records or missed items across pages. If a record is inserted while a client is navigating from page 1 to page 2, the shift may cause an item to appear in both result sets.
How does the FeathersJS service handle pagination consistency when the underlying dataset shifts during a stateless rolling update? Is there a built-in configuration to switch to cursor-based pagination to ensure stable results without manual hook-based logic?