---
title: "Data Rules"
description: "Data Rules vs Sync Rules"
permalink: /docs/build/data-model-configuration/data-rules/
---
# Data Rules

<Info title={"Data Rules vs Sync Rules"}>

Data rules are a combination [sync rules](/docs/build/data-model-configuration/data-rules/sync-rules-v2/) and [Access Control Lists](/docs/build/data-model-configuration/data-rules/data-acls-limit-access-to-data/) (ACLs), specified in a single XML document. If your app is currently using sync rules v2 without data rules, we recommend migrating to data rules. Please see [this guide](/docs/build/data-model-configuration/data-rules/migrate-to-data-rules/) which outlines the migration process.

</Info>

<Warning title={"Details matter with data rules"}>

Data rules is an advanced feature where implementation details can have a significant impact on [app performance](/docs/technical/improving-app-performance/), sync performance, as well as the design of your [data model](/docs/get-started/journeyapps-fundamentals/what-is-the-data-model/).

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

</Warning>

### 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:

- [data buckets](/docs/build/data-model-configuration/data-rules/data-buckets/)

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

- [sync rules v2](/docs/build/data-model-configuration/data-rules/sync-rules-v2/)

To limit user read/write access to data (whether that data is on the user's device or accessed via [`OnlineDB`](/docs/get-started/journeyapps-fundamentals/accessing-the-database/#onlinedb)), developers can specify data ACLs. Read more about them here:

- [data acls limit access to data](/docs/build/data-model-configuration/data-rules/data-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.

![Default data\_rules.xml file](./media/spaces-2f9tchlr67elhbojpvhhud-2fuploads-2f23fbpn8eiwewcnunolee-2fdata-rules-oxide-1e83f254.png)
