Updated on 2025-08-28 GMT+08:00

KV Item Overview

A key-value (KV) item is the smallest unit for storing data in KVS. Each item is a document. Each item belongs to a table in a store. Each table contains one or more KV items. Each KV item has a unique identifier. Suppose you have a table for storing the employee information in a department. The information of each employee is stored in a KV item, which is uniquely identified by the employee ID.

Figure 1 KV item overview

A KV item contains mandatory and optional fields. You must specify two mandatory fields: shard key and sort key. Optional fields can be added as required.

The example below creates KV items for two employees, using SSN as the shard key and Name as the sort key. Gender, Job, and Award Records are optional fields.

Employee
{
    "SSN": 0123456789,
    "Name": "Tom",
}
{
    "SSN": 9876543210,
    "Name": "Amy",
    "Gender": "female",
    "Job": "O&M staff",
    "Award Records": "Best Employee Award"
}

You can add, update, delete, and scan KV items.

Table 1 KV item features

Feature

Description

Adding a KV item

Add a KV item to a table.

Updating a KV item

Update a KV item.

Deleting a KV item

Delete a KV item.

Scanning KV Items

Scan KV items.