Question
Couchbase N1QL Pagination: Consistency Issues with Concurrent Updates
Lax Lane
0 reputation · 06 Jan 2021, 11:32 UTC
49.4K views0
Goal
Retrieve a large dataset in pages while maintaining a stable order of rows.
Constraints & Uncertainty
LIMIT/OFFSET scans all preceding rows, leading to linear time for high offsets. Keyset pagination avoids this but its snapshot consistency during concurrent inserts, updates, or deletes is not fully documented. Without guaranteed consistency, pages may contain duplicates or skip records.
Questions
- Does keyset pagination provide a snapshot‑consistent view of the dataset when documents are mutated concurrently?
- Is there a documented method in Couchbase N1QL to enforce snapshot consistency for paginated results?
- How does the engine’s query planner treat LIMIT/OFFSET versus keyset pagination under version 7.x in terms of consistency guarantees?