Creating a Store
Scenarios
You will create a store, a table, and indexes on the KVS console.
Notes and Constraints
- A store name must be 16 to 52 characters long. It can only include numbers (0–9), letters (a–z, A–Z), and hyphens (-), and it cannot start or end with a hyphen (-). It must be globally unique across tenants. A store name must be in the format of {user-defined-prefix}-{selected-region-name-on-the-console}-{account-ID}, for example, exampleprefix-cn-north-4-exampledomainid.
- Store names are case-insensitive. If you have a store named, for example, exampleprefix-cn-north-4-exampledomainid, you cannot create a new one named, for example, Exampleprefix-cn-north-4-exampledomainid because KVS will take them as the same one, leading to the creation failure.
- Each account can create up to 25 stores.
Procedure
- Log in to the KVS console.
- In the navigation pane, choose Stores.
- In the upper right corner of the page, click Create Store.
- In the Store Details area, configure parameters as instructed in Table 1.
Figure 1 Store Details page
Table 1 Store parameters Type
Parameter
Description
Store Details
Store Name
Mandatory
The name of a store. A store name must be 16 to 52 characters long. It only accepts numbers (0–9), letters (a–z, A–Z), and hyphens (-) and cannot start or end with a hyphen (-). It must be globally unique across tenants.
A store name must be in the format of {user-defined-prefix}-{selected-region-name-on-the-console}-{account-ID}.
NOTICE:You only need to specify a prefix. {selected-region-name-on-the-console} and {account-ID} are automatically specified.
- In the Basic Configuration area, select a billing mode. For details about the billing modes, see Table 2.
Figure 2 Basic Configuration page
- Configure table parameters as instructed in Table 3.
Figure 3 Table Details page
Table 3 Table parameters Type
Parameter
Description
Table Details
Name
Mandatory
The name of a table. A table name must be 3 to 52 characters long and must be unique store-wide. Numbers (0–9), letters (a–z and A–Z), hyphens (-), and underscores (_) are allowed.
Shard Key
Mandatory
A shard key must be 1 to 63 characters long and cannot start with an underscore (_). Numbers (0–9), letters (a–z and A–Z), hyphens (-), and underscores (_) are allowed.
Sort Key
Optional
A sort key must be 1 to 63 characters long and cannot start with an underscore (_). Numbers (0–9), letters (a–z and A–Z), hyphens (-), and underscores (_) are allowed.
- (Optional) This step is only required for the provisioned billing mode. In the Provisioned Throughput area, configure parameters shown in Table 4.
The provisioned read/write throughput of a table is determined by the average KV item size, the number of KV items read/written per second, average size of local secondary index items, and the number of local secondary index items read/written per second.
You can use the calculator to estimate the read and write throughputs by clicking Throughput Calculator and configure parameters shown in Figure 5. For details about the parameters, see Table 5. After the parameters are configured, click OK. The calculated values are automatically synchronized to Read Throughput and Write Throughput as shown in Figure 4.
Table 4 Provisioned throughput parameters Type
Parameter
Description
Provisioned Throughput
Read Throughput
- Value range: 1 to 50000 (unit: RCU)
NOTE:
Up to 100,000 RCUs can be provisioned for each user in a region.
- Read throughput = ROUNDUP(Average KV item size in KB/4) × KV items read per second + ROUNDUP(Average size of local secondary index items in KB/4) × Local secondary index items read per second
Write Throughput
- Value range: 1 to 50000 (unit: WCU)
NOTE:
Up to 100,000 WCUs can be provisioned for each user in a region.
- Write throughput = ROUNDUP(Average KV item size in KB) × KV items written per second + ROUNDUP(Average size of local secondary index items in KB) × Local secondary index items written per second
Table 5 Throughput Calculator parameters Parameter
Example Value
Description
Average KV Item Size
100
- Required
- Enter the provisioned average KV size, in KB.
KV Items Read per Second
10
- Required
- Enter the number of KV items to be read per second.
KV Items Written per Second
10
- Required
- Enter the number of KV items to be written per second.
Average Size of Local Secondary Index Items
100
- Required
- Enter the provisioned average size of local secondary index items, in KB.
Local Secondary Index Items Read per Second
10
- Required
- Enter the number of local secondary index items to be read per second.
Local Secondary Index Items Written per Second
10
- Required
- Enter the number of local secondary index items to be written per second.
Read Throughput
500
- The value is automatically calculated. The unit is RCU.
- Read throughput = ROUNDUP(Average KV item size in KB/4) × KV items read per second + ROUNDUP(Average size of local secondary index items in KB/4) × Local secondary index items read per second
Write Throughput
2000
- The value is automatically calculated. The unit is WCU.
- Write throughput = ROUNDUP(Average KV item size in KB) × KV items written per second + ROUNDUP(Average size of local secondary index items in KB) × Local secondary index items written per second
- Value range: 1 to 50000 (unit: RCU)
- In the Secondary Index area, create secondary indexes. KVS allows you to create local and global secondary indexes.
- Click Create Local Secondary Index and configure parameters as instructed in Table 6. Confirm the configuration and click OK.
Figure 6 Local Secondary Indexes
Table 6 Local secondary index parameters Type
Parameter
Description
Create Local Secondary Index
Name
Mandatory
The name of a local secondary index. It must be 1 to 255 characters long. Numbers (0–9), letters (a–z and A–Z), hyphens (-), underscores (_), and periods (.) are allowed. An index name cannot be XPriIndex.
Sort Key
Mandatory
A sort key must be 1 to 63 characters long and cannot start with an underscore (_). Numbers (0–9), letters (a–z and A–Z), hyphens (-), and underscores (_) are allowed.
Abstract Field
Optional
An abstract field in the local secondary index. You can create multiple abstract fields in an index. An abstract field must be 1 to 63 characters long and cannot start with an underscore (_). Numbers (0–9), letters (a–z and A–Z), hyphens (-), and underscores (_) are allowed.
- Click Create Global Secondary Index and configure parameters as instructed in Table 7. Confirm the configuration and click OK.
Figure 7 Global Secondary Indexes
Table 7 Global secondary index parameters Type
Parameter
Description
Create Global Secondary Index
Name
Mandatory
The name of a global secondary index. It must be 1 to 255 characters long. Numbers (0–9), letters (a–z and A–Z), hyphens (-), underscores (_), and periods (.) are allowed. An index name cannot be XPriIndex.
Shard Key
Mandatory
A shard key must be 1 to 63 characters long and cannot start with an underscore (_). Numbers (0–9), letters (a–z and A–Z), hyphens (-), and underscores (_) are allowed.
Sort Key
Optional
A sort key must be 1 to 63 characters long and cannot start with an underscore (_). Numbers (0–9), letters (a–z and A–Z), hyphens (-), and underscores (_) are allowed.
Read Throughput
Value range: 1 to 50000 (unit: RCU) This field is only valid in the provisioned billing mode.
Write Throughput
Value range: 1 to 50000 (unit: WCU) This field is only valid in the provisioned billing mode.
Abstract Field
Optional
An abstract field in the global secondary index. You can create multiple abstract fields in an index. An abstract field must be 1 to 63 characters long and cannot start with an underscore (_). Numbers (0–9), letters (a–z and A–Z), hyphens (-), and underscores (_) are allowed.
- Click Create Local Secondary Index and configure parameters as instructed in Table 6. Confirm the configuration and click OK.
- Confirm the settings and click OK.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot