database-relational-overview.md 1.7 KB
Newer Older
A
annie_wangli 已提交
1
# RDB Overview
Z
zengyawen 已提交
2

A
annie_wangli 已提交
3
The relational database (RDB) manages data based on relational models. With the underlying SQLite database, the RDB provides a complete mechanism for managing local databases. To satisfy different needs in complicated scenarios, the RDB offers a series of methods for performing operations such as adding, deleting, modifying, and querying data, and supports direct execution of SQL statements.
Z
zengyawen 已提交
4

A
annie_wangli 已提交
5
## Basic concepts
Z
zengyawen 已提交
6

A
annie_wangli 已提交
7
- **RDB**
Z
zengyawen 已提交
8

A
annie_wangli 已提交
9
  A type of database created on the basis of relational models. The RDB stores data in rows and columns. A RDB is also called RDB store.
Z
zengyawen 已提交
10

A
annie_wangli 已提交
11
- **Predicate**
Z
zengyawen 已提交
12

A
annie_wangli 已提交
13
  A representation of the property or feature of a data entity, or the relationship between data entities. It is mainly used to define operation conditions.
Z
zengyawen 已提交
14

A
annie_wangli 已提交
15
- **Result set**
Z
zengyawen 已提交
16

A
annie_wangli 已提交
17
  A set of query results used to access data. You can access the required data in a result set in flexible modes.
Z
zengyawen 已提交
18

A
annie_wangli 已提交
19
- **SQLite database**
Z
zengyawen 已提交
20

A
annie_wangli 已提交
21
  A lightweight open-source relational database management system that complies with Atomicity, Consistency, Isolation, and Durability (ACID).
Z
zengyawen 已提交
22

A
annie_wangli 已提交
23
## Working Principles
Z
zengyawen 已提交
24

A
annie_wangli 已提交
25
The RDB provides common operation APIs for external systems. It uses the SQLite as the underlying persistent storage engine, which supports all SQLite database features.
Z
zengyawen 已提交
26

A
annie_wangli 已提交
27
**Figure 1** How RDB works
Z
zengyawen 已提交
28

A
annie_wangli 已提交
29
![how-rdb-works](figures/how-rdb-works.png)
Z
zengyawen 已提交
30

A
annie_wangli 已提交
31
## Default Settings
Z
zengyawen 已提交
32

A
annie_wangli 已提交
33 34 35
- The default RDB logging mode is Write Ahead Log (WAL).
- The default data flushing mode is **FULL** mode.
- The default size of the shared memory used by an OpenHarmony database is 2 MB.
Z
zengyawen 已提交
36

A
annie_wangli 已提交
37
## Constraints
Z
zengyawen 已提交
38

A
annie_wangli 已提交
39
- A maximum of four connection pools can be connected to an RDB to manage read and write operations.
Z
zengyawen 已提交
40

A
annie_wangli 已提交
41
- To ensure data accuracy, the RDB supports only one write operation at a time.