Prioritized Sync
In some scenarios, you may want to sync tables using different priorities. For example, you may want to sync a subset of all tables first to log a user in as fast as possible, then sync the remaining tables in the background.
Note that this strategy is specifically to prioritize data on initial sync, and cannot be used for incremental sync after that.
Overview
The general approach is as follows:
-
Define how many priority types you want - typically only two are needed: “high priority” and “the rest”
-
Create a sync bucket for each priority type
-
Use client parameters to control which priorities you want the client to sync
Example
Suppose we have two tables: lists
and todos
(as per the standard todolist demo app schema). Further, suppose we want the sync priority to behave as follows:
-
First, sync all the user’s lists, enabling us to render the initial screen in the app
-
Then, sync the user’s todos
Below are the sync rules that will enable this:
It is recommended to set Client Parameters in the Diagnostics App to verify functionality at this point:
If everything checks out, you can then proceed to implement the client parameter switching accordingly in your app.
Was this page helpful?