1e41f4b71Sopenharmony_ci# Introduction to ArkData 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ci 4e41f4b71Sopenharmony_ci## Function 5e41f4b71Sopenharmony_ci 6e41f4b71Sopenharmony_ciArkData provides data storage, management, and sync capabilities. For example, you can store the Contacts application data in database for secure management and shared access, and synchronize the contacts information with a smart watch. 7e41f4b71Sopenharmony_ci- Unified data definition: OpenHarmony provides unified data definitions, including the data types and structs, for different applications and devices. 8e41f4b71Sopenharmony_ci 9e41f4b71Sopenharmony_ci- Data storage: provides capabilities for persisting user preference data, key-value (KV) store data, and relational database (RDB) store data. 10e41f4b71Sopenharmony_ci 11e41f4b71Sopenharmony_ci- Data management: provides efficient data management capabilities, including permission management, data backup and restore, and dataShare framework. 12e41f4b71Sopenharmony_ci 13e41f4b71Sopenharmony_ci- Data sync: provides data sync across devices. For example, distributed data objects support sharing of memory objects across devices, and distributed databases support database access across devices. 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ciThe database stores created by an application are saved to the application sandbox directory. When the application is uninstalled, the database stores are automatically deleted. 16e41f4b71Sopenharmony_ci 17e41f4b71Sopenharmony_ci 18e41f4b71Sopenharmony_ci## Working Principles 19e41f4b71Sopenharmony_ci 20e41f4b71Sopenharmony_ciThe data management module includes preferences, KV data management (KV-Store), relational data management (RelatoinalStore), distributed data object (DataObject), cross-application data management (DataShare), and unified data management framework (UDMF). The interface layer provides standard JavaScript APIs for application development. The Frameworks & System service layer implements storage and sync of component data, and provides dependencies for SQLite and other subsystems. 21e41f4b71Sopenharmony_ci 22e41f4b71Sopenharmony_ci**Figure 1** Data management architecture 23e41f4b71Sopenharmony_ci 24e41f4b71Sopenharmony_ci 25e41f4b71Sopenharmony_ci 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_ci- **Preferences**: implements persistence of lightweight configuration data and supports subscription of data change notifications. Preferences are used to store application configuration information and user preference settings and do not support distributed sync. 28e41f4b71Sopenharmony_ci 29e41f4b71Sopenharmony_ci- **KV-Store**: implements read, write, encryption, and manual backup of data in KV stores and notification subscription. When an application needs to use the distributed capabilities of a KV store, KV-Store sends a sync request to DatamgrService, which implements data sync across devices. 30e41f4b71Sopenharmony_ci 31e41f4b71Sopenharmony_ci- **RelationalStore**: implements addition, deletion, modification, query, encryption, manually backup of data in RDB stores, and notification subscription. When an application needs to use the distributed capabilities of an RDB store, RelationalStore sends a sync request to DatamgrService, which implements data sync across devices. 32e41f4b71Sopenharmony_ci 33e41f4b71Sopenharmony_ci- **DataObject**: independently provides distributed capabilities for data objects. **DatamgrService** implements temporary storage of the object data, which is still required after the application (either the application of your device or cross-device application) is restarted. 34e41f4b71Sopenharmony_ci 35e41f4b71Sopenharmony_ci- **DataShare**: provides the data provider-consumer mode to implement addition, deletion, modification, and query of cross-application data on a device, and notification subscription. **DataShare** is not bound to any database and can interact with RDB and KV stores. You can also encapsulate your own databases for C/C++ applications.<br>In addition to the provider-consumer mode, **DataShare** provides silent access, which allows direct access to the provider's data via the DatamgrService proxy instead of starting the provider. Currently, only the RDB stores support silent access. 36e41f4b71Sopenharmony_ci 37e41f4b71Sopenharmony_ci- **UDMF**: defines the language and data standards for cross-application and cross-device data interaction, improving data interaction efficiency. The UDMF provides secure and standard data transmission channels and supports different levels of data access permissions and lifecycle management policies. It helps implement efficient data sharing across applications and devices. 38e41f4b71Sopenharmony_ci 39e41f4b71Sopenharmony_ci- **DatamgrService**: implements sync and cross-application sharing for other components, including cross-device sync of **RelationalStore** and **KV-Store**, silent access to provider data of **DataShare**, and temporary storage of **DataObject** data. 40