Is it possible that fetching resource pages could ...
# dev
l
Is it possible that fetching resource pages could be volatile?
r
Hi @ljnic - could you define volatile in this context?
l
returning a duplicate resource in a later bundle
r
@ljnic Yes, if data us updated while iterating through pages, we could see duplicate data appear later in the search. We actually have a pretty in-depth discussion of the tradeoffs of implementing keyset pagination here: https://github.com/medplum/medplum/discussions/1231
Using the
Connection
api for graphQL (defined by the FHIR spec) , you can mitigate some, but not all of these issues. I'd refer you to the discussion for more information about the tradeoffs
l
Hey @rahul1 I just mean using the count and offset params
seems like duplicates appear if you're not using a sort param
r
I see. yes, a basic search doesn't guarantee a sort order, so you may get a different ordering between calls
Using a sort isi the best mitigation
159 Views