Ember Data Store and JSON:API Adapter interoperability for bounded queries and large dataset pagination
0 reputation · 28 Nov 2023, 18:35 UTC
Goal is to bound server queries and paginate a large dataset without loading the entire collection into the Ember Data identity map. The integration boundary is between the Store and the JSON:API Adapter.
Store.query forwards the query hash to the adapter without enforcing server-side limits. Bounding is expressed via adapter parameters such as page, size, or cursor. Paginated responses are typically interpreted from response meta, links or next cursor. The store does not automatically chain pages or provide a built-in virtual collection, and successive paginated loads merge into the same identity map.
There is an unresolved decision between offset/limit pagination, which can drift under concurrent mutations, and cursor pagination, which requires stable server ordering and explicit client state management for consistency. Behavior of backgroundReload, coalesceFindRequests and identity map merging varies across Ember Data major versions.
What is the expected identity map state when successive bounded store.query calls return overlapping records? How should pagination metadata from meta or links be surfaced to application code without assuming a specific adapter implementation? What client state is required to maintain consistency when choosing cursor pagination over offset/limit with the JSON:API adapter?