Pagination cursor instability during concurrent index writes
0 reputation · 02 Nov 2024, 20:46 UTC
FaunaDB utilizes opaque cursors for pagination, where the after and before values are derived from index tuples and timestamps. While these cursors are intended to be stable, the behavior of the pagination sequence becomes unpredictable when high-throughput writes modify the index between subsequent paginated requests.
In environments with concurrent inserts, there is uncertainty regarding whether the cursor's timestamp-based ordering can guarantee that no documents are skipped or duplicated when the index is mutated mid-stream. Current driver implementations require the application to manage cursor invalidation manually, as there is no built-in mechanism to ensure a consistent snapshot across multiple pages.
- Does FaunaDB provide a mechanism to ensure pagination consistency across pages during concurrent writes?
- How does the system handle cursor positioning when a write operation affects the index ordering immediately before a new page request?