Skip to content

Commit 616195d

Browse files
Documentation edits made through Mintlify web editor
1 parent a2aa423 commit 616195d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

usage/use-case-examples/prioritized-sync.mdx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,26 @@ title: "Prioritized Sync"
33
description: "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."
44
---
55

6+
<Info>
7+
Note that this strategy is specifically to prioritize data on initial sync, and cannot be used for incremental sync after that.
8+
</Info>
9+
610
## Overview
711

812
The general approach is as follows:
913

1014
1. Define how many priority types you want - typically only two are needed: "high priority" and "the rest"
15+
1116
2. Create a sync bucket for each priority type
17+
1218
3. Use [client parameters](/usage/sync-rules/advanced-topics/client-parameters) to control which priorities you want the client to sync
1319

1420
## Example
21+
1522
Suppose we have two tables: `lists` and `todos` (as per the standard todolist demo app [schema](/integration-guides/supabase-+-powersync#create-the-demo-database-schema)). Further, suppose we want the sync priority to behave as follows:
1623

1724
1. First, sync all the user's lists, enabling us to render the initial screen in the app
25+
1826
2. Then, sync the user's todos
1927

2028
Below are the sync rules that will enable this:
@@ -36,7 +44,7 @@ bucket_definitions:
3644
It is recommended to set Client Parameters in the [Diagnostics App](https://github.com/powersync-ja/powersync-js/tree/main/tools/diagnostics-app) to verify functionality at this point:
3745
3846
<Frame>
39-
<img src="/images/usage/use-case-prioritized.png"/>
47+
<img src="/images/usage/use-case-prioritized.png" />
4048
</Frame>
4149
4250
If everything checks out, you can then proceed to implement the client parameter switching accordingly in your app.

0 commit comments

Comments
 (0)