diff --git a/en/application-dev/database/database-storage-guidelines.md b/en/application-dev/database/database-storage-guidelines.md index 00f56f8853b93fc058f7e66c8fb3a2517cf5d7d0..9375ed470629cba6112c1897db9f7b475d43cb3d 100644 --- a/en/application-dev/database/database-storage-guidelines.md +++ b/en/application-dev/database/database-storage-guidelines.md @@ -1,10 +1,10 @@ -# Lightweight Data Store Development +# Lightweight Data Store Development -## When to Use +## When to Use The lightweight data store is ideal for storing lightweight and frequently used data, but not for storing a large amount of data or data with frequent changes. The application data is persistently stored on a device in the form of files. Note that the instance accessed by an application contains all data of the file. The data is always loaded to the memory of the device until the application removes it from the memory. The application can perform data operations using the **Storage** APIs. -## Available APIs +## Available APIs The lightweight data store provides applications with data processing capability and allows applications to perform lightweight data storage and query. Data is stored in key-value pairs. Keys are of the string type, and values can be of the number, string, or Boolean type. @@ -14,24 +14,9 @@ Create a **Storage** instance for data operations. A **Storage** instance is **Table 1** API for creating a **Storage** instance - -
| - | -- | -- | -
|---|---|---|
| - | -- | -Obtains the Storage singleton corresponding to a file for data operations. - |
-
| - | -- | -- | -
|---|---|---|
| - | -- | -- | -
| - | -- | -- | -
|---|---|---|
| - | -- | -- | -
| - | -- | -- | -
|---|---|---|
| - | -- | -Writes data in the Storage instance back to its file through an asynchronous thread. - |
-
| - | -- | -- | -
|---|---|---|
| - | -on(type: 'change', callback: Callback<StorageObserver>): void; - |
-- | -
| - | -off(type: 'change', callback: Callback<StorageObserver>): void; - |
-- | -
| - | -- | -- | -
|---|---|---|
| - | -- | -Deletes a Storage instance from the cache and deletes its file from the device. - |
-
| - | -- | -Deletes a Storage instance from the cache to release memory. - |
-