Data Rules

Data Rules vs Sync Rules

Data rules are a combination sync rules and Access Control Lists (ACLs), specified in a single XML document. If your app is currently using sync rules v2, we recommend migrating to data rules. Please see this guide which outlines the migration process.

Details matter with data rules

Data rules is an advanced feature where implementation details can have a significant impact on app performance, sync performance, as well as the design of your data model.

Please be sure to understand the constraints and implications of your data rules before deploying them to an environment with active users.

Overview

Data rules allow developers to determine programmatically (1) what data should sync to devices for offline access, and (2) what kind of read and write access a user should have to data (applies to online and offline access).

To define data rules, you need to understand the concept of data buckets:

pageData Buckets

To limit data synched to devices, developers can specify sync rules. Read more about sync rules here:

pageSync Rules - Limit data synced to devices

To limit user read/write access to data (whether that data is on the user's device or accessed via OnlineDB), developers can specify data ACLs. Read more about them here:

pageData ACLs - Limit access to data

Data rules combine the above two objectives by letting developers specify both sync rules and data ACLs in one XML file, namely data_rules.xml, which is available in OXIDE once your app has data rules enabled.

Last updated