1e41f4b71Sopenharmony_ci# Distributed Application Data Sync Overview
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ci
4e41f4b71Sopenharmony_ci## When to Use
5e41f4b71Sopenharmony_ci
6e41f4b71Sopenharmony_ciThe distributed application data sync allows the data of an application to be synced with other devices that are connected to form a Virtual Device. This feature enables seamless sync, modification, and query of use application data across trusted devices.
7e41f4b71Sopenharmony_ci
8e41f4b71Sopenharmony_ciFor example, when data is added, deleted, or modified for an application on a device, the same application on another device can obtain the updated data. You can use this feature in the distributed Gallery, Notepad, Contacts, and File Manager. 
9e41f4b71Sopenharmony_ci
10e41f4b71Sopenharmony_ciFor details about how to subscribe to database change notifications between different applications, see [Cross-Application Data Sharing](data-share-overview.md).
11e41f4b71Sopenharmony_ci
12e41f4b71Sopenharmony_ciThe data storage modes vary depending on the lifecycle of data to be synced:
13e41f4b71Sopenharmony_ci
14e41f4b71Sopenharmony_ci- Temporary data has a short lifecycle and is usually stored in memory. For example, distributed data objects are recommended for process data generated by game applications.
15e41f4b71Sopenharmony_ci
16e41f4b71Sopenharmony_ci- Persistent data has a long lifecycle and needs to be stored in databases. You can use RDB stores or KV stores based on data characteristics and relationships. For example, RDB stores are recommended for storing Gallery attribute information, such as albums, covers, and images, and KV stores are recommended for storing Gallery image thumbnails.
17e41f4b71Sopenharmony_ci
18e41f4b71Sopenharmony_ci
19e41f4b71Sopenharmony_ci## Basic Concepts
20e41f4b71Sopenharmony_ci
21e41f4b71Sopenharmony_ciIn a distributed scenario, cross-device collaboration demands consistent data between the devices in the same network.
22e41f4b71Sopenharmony_ci
23e41f4b71Sopenharmony_ci
24e41f4b71Sopenharmony_ciThe data consistency can be classified into the following types:
25e41f4b71Sopenharmony_ci
26e41f4b71Sopenharmony_ci
27e41f4b71Sopenharmony_ci- Strong consistency: When data is inserted, deleted, or modified on a device, other devices in the same network can immediately obtain the updated data.
28e41f4b71Sopenharmony_ci
29e41f4b71Sopenharmony_ci- Weak consistency: When data is added, deleted, or modified on a device, other devices in the same network may or may not obtain the updates. The data on these devices may be inconsistent after a certain period of time.
30e41f4b71Sopenharmony_ci
31e41f4b71Sopenharmony_ci- Eventual consistency: When data is added, deleted, or modified on a device, other devices in the same network may not obtain the updates immediately. However, data on these devices will become consistent after a certain period of time.
32e41f4b71Sopenharmony_ci
33e41f4b71Sopenharmony_ci
34e41f4b71Sopenharmony_ciStrong consistency has high requirements on distributed data management and may be used in distributed server deployment. Because mobile devices are not always online and there is no central node, the cross-device application data sync supports eventual consistency only.
35e41f4b71Sopenharmony_ci
36e41f4b71Sopenharmony_ci
37e41f4b71Sopenharmony_ci## Access Control Mechanism in Cross-Device Sync
38e41f4b71Sopenharmony_ci
39e41f4b71Sopenharmony_ciWhen data is synced across devices, access control is performed based on the device level and data security label. For details, see [Access Control Mechanism in Cross-Device Sync](access-control-by-device-and-data-level.md#access-control-mechanism-in-cross-device-sync).
40