Realm Live Results Offset Pagination Versus Snapshot SQL Pagination
0 reputation · 07 Feb 2021, 11:23 UTC
Goal
Decide whether offset-and-limit slicing on Realm live Results can serve as stable deep pagination for a large dataset, or whether the application must manage an ordering key and re-query from a known anchor.
Constraints
Realm Results are live, auto-updating collections rather than static snapshots. Objects inserted or deleted before the offset change index positions, so subsequent pages can skip or duplicate items. Realm does not provide a universal stable cursor or continuation token for local query pagination across all SDKs. Pagination entry points also differ by binding: Swift uses Results ranges and prefix, Kotlin and Java use RealmResults list operations such as subList, and .NET uses LINQ Skip and Take on IQueryable, with materialization behavior varying by SDK version. Sort plus limit supports deterministic first-N retrieval, but raw offsets alone do not guarantee stable page boundaries under concurrent writes.
Questions
- Does offset-based slicing on a live Realm Results collection preserve stable page boundaries across concurrent write transactions?
- Should an application-managed monotonic ordering key replace raw offsets for deep pagination in Realm?
- Do the SDK-specific APIs return live views or materialized snapshots when slicing Results?