未验证 提交 db075df5 编写于 作者: O openharmony_ci 提交者: Gitee

!13669 [翻译完成】#I64P7R

Merge pull request !13669 from Annie_wang/PR12085
# Distributed Data Management<a name="EN-US_TOPIC_0000001096920663"></a>
# Distributed Data Management
## Introduction<a name="section11660541593"></a>
**About the Subsystem**
## Introduction
The Distributed Data Management subsystem can persistently store various structured data of a single device and also supports data synchronization and sharing across devices. In this regard, you can seamlessly integrate distributed application data among different devices, ensuring consistent user experience in the same application across these devices.
**Distributed Data Management Subsystem**
The Distributed Data Management subsystem can persistently store various structured data of a single device. It also supports data synchronization and sharing across devices. With the Distributed Data Management subsystem, application data can be seamlessly processed across devices, ensuring consistent user experience for the same application across devices.
- Local data management
This module allows you to store and access structured data on a single device. It uses the SQLite engine to provide the relational database \(RDB\) and preferences database. With these databases, you can persistently store and access app data using different models.
This module allows you to store and access structured data on a single device. It uses the SQLite engine to provide the relational database (RDB) and preferences database. With these databases, you can persistently store and access app data using different models.
- Distributed data service
- DDS
This service can synchronize data across devices, so that users can access consistent data on different devices. DDS isolates data based on a triplet of the account, app, and database. DDS synchronizes data between trusted devices to provide the cross-device data access capability.
The distributed data service (DDS) can synchronize data across devices, so that users can access consistent data on different devices. The DDS isolates data based on a triplet of the account, application, and database. DDS synchronizes data between trusted devices to provide the cross-device data access capability.
**Architecture of the Subsystem**
**Architecture**
**Figure 1** Architecture<a name="fig4460722185514"></a>
**Figure 1** Architecture
![](figures/en-us_image_0000001115748088.png)
![](figures/Distributed_data_management_architecture.png)
## Directory Structure<a name="section161941989596"></a>
## Directory Structure
Level 1 and 2 directories of the distributed data management subsystem are as follows:
Level 1 and 2 directories of the distributed data management subsystem:
```
distributeddatamgr/ # Distributed data management
├── appdatamgr # Local data management
└── distributeddatamgr # Distributed Data Service
third_party/ # Open-source software
├── flatbuffers # flatbuffers code
└── sqlite # SQLite code
distributeddatamgr/ # Distributed Data Management subsystem
├── appdatamgr # Local data management
└── distributeddatamgr # DDS
│ ├── frameworks # Framework code
│ │ ├── common # Common utility class
│ │ ├── innerkitsimpl # Implementation of APIs between components
│ │ ├── jskitsimpl # Implementation of JS APIs
│ │ ├── libs # Implementation of DB code
│ │ └── native # Implementation of internal APIs
│ ├── interfaces # API code
│ │ ├── inner_api # Declaration of internal APIs
│ │ ├── innerkits # Declaration of APIs between components
│ │ └── jskits # Declaration of JS APIs
│ └── services # Service layer code
│ └── distributeddataservice # DDS implementation
└── objectstore # Distributed data object directory
├─frameworks # Framework code
│ ├─innerkitsimpl # Implementation of APIs between components
│ └─jskitsimpl # Implementation of JS APIs
└─interfaces # API code
├─innerkits # Declaration of APIs between components
└─jskits # Declaration of JS APIs
│third_party/ # Open-source software
├── flatbuffers # FlatBuffers code
└── sqlite # SQLite code
```
## Usage<a name="section1312121216216"></a>
## Usage
### Local Data Management<a name="section129654513264"></a>
### Local Data Management
- Relational database \(RDB\)
- RDB store
Some basic concepts are as follows:
Basic concepts are as follows:
- **RDB**
......@@ -53,41 +73,45 @@ third_party/ # Open-source software
A set of query results used to access the data. You can access the required data in a result set in flexible modes.
- **SQLite database**
- **SQLite**
A lightweight RDB in compliance with the atomicity, consistency, isolation, and durability \(ACID\) properties. It is an open-source database.
A lightweight RDB in compliance with the atomicity, consistency, isolation, and durability (ACID) properties. It is an open-source database.
- Preferences database
Some basic concepts are as follows:
Basic concepts are as follows:
- **Key-value database**
- **KV store**
A database that stores data in key-value pairs. The **key** indicates keyword, and **value** indicates the corresponding value.
A database that stores data in key-value (KV) pairs. The **key** indicates a keyword, and **value** indicates the corresponding value.
- **Non-relational database**
A database not in compliance with the atomicity, consistency, isolation, and durability \(ACID\) database management properties of relational data transactions. Instead, the data in a non-relational database is independent and scalable.
A database not in compliance with the ACID database management properties of relational data transactions. Instead, the data in a non-relational database is independent and scalable.
- **Preference** **data**
- **Preference data**
A type of data that is frequently accessed and used.
### DDS
The DDS implements database collaboration across devices for applications. The DDS isolates data based on a triplet of the account, application, and database. The DDS synchronizes data between trusted devices, delivering a consistent data access experience on different devices.
### Distributed Data Service<a name="section1961602912224"></a>
### KV Data Model
DDS provides apps with the capability to store data in the databases of different devices. It uses the KV data model.
A KV store is a type of NoSQL database. Data in this type of database is organized, indexed, and stored in the form of KV pairs.
- **KV data model**
The KV data model is suitable for storing service data that does not involve too many data or service relationships. It provides better read and write performance than the SQL database. The KV data model is widely used in distributed scenarios because it handles conflict more easily in database version compatibility and data synchronization. The distributed database is based on the KV data model and provides KV-based access interfaces.
KV is short for key-value. The KV database is a type of NoSQL database. Data in this type of database is organized, indexed, and stored in the form of key-value pairs.
### Distributed Data Object
The KV data model is suitable for storing service data that does not involve too many data or service relationships. It provides better read and write performance than the SQL database. The KV data model is widely used in distributed scenarios because it handles conflict more easily in database version compatibility and data synchronization. The distributed database is based on the KV data model and provides KV-based access interfaces.
The distributed data object management framework is an object-oriented in-memory data management framework. It provides APIs for basic data object management, such as creating, querying, deleting, modifying, and subscribing to in-memory objects. Moreover, it provides distributed capabilities to implement data object collaboration for the same application between multiple devices that form a Super Device.
The **Distributed Data Object** module provides JS APIs to help you use distributed data objects like using local data objects. The distributed data objects support basic data types, such as number, string, and Boolean, as well as complex data types, such as array and nested basic types.
## Repositories Involved<a name="section1371113476307"></a>
## Repositories Involved
Distributed Data Management subsystem
......@@ -95,7 +119,8 @@ distributeddatamgr\_appdatamgr
distributeddatamgr\_distributeddatamgr
distributeddatamgr\_objectstore
third\_party\_sqlite
third\_party\_flatbuffers
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册