Cursor-based vs Offset-based Pagination for High-Churn Upstream Datasets
0 reputation · 21 Jun 2025, 12:51 UTC
When managing large datasets via Envoy proxy, the choice of pagination strategy impacts both data consistency and client complexity. For environments with high record churn, maintaining a stable view of the dataset during sequential requests is critical to avoid duplicate or missing entries.
Implementation Trade-offs
Offset-based pagination utilizing HTTP query parameters is simple to implement and debug but risks inconsistency if records are inserted or deleted between requests. Conversely, cursor-based pagination maintains result ordering by relying on a unique token, though it requires the client to manage and transmit this state.
There is uncertainty regarding the optimal way to handle these tokens when using Envoy's custom filter logic to emit pagination metadata without exposing internal database row IDs to the downstream consumer.
- Does cursor-based pagination introduce significant overhead in Envoy's metadata processing compared to simple offset parameters?
- Under high churn, what is the recommended mechanism to ensure cursor stability across multiple proxy hops?