All Products
Search
Document Center

Tablestore:Basic data operations

Last Updated:Jun 23, 2026

Tablestore supports writing, reading, and deleting data through the Tablestore console, SDKs, and CLI. This topic describes the available methods and their applicable scenarios.

Write data

You can write data to data tables by inserting a single row, updating a single row, or writing multiple rows at a time. You can also specify a custom data version number and use conditional updates to set write conditions. For more information, see Write data.

Method

Description

Scenario

Insert a single row of data

Writes a single row of data. If the row already exists, Tablestore deletes all versions of data in all columns from the existing row and writes new data.

Suitable for writing a small amount of data.

Update a single row of data

Adds or removes an attribute column in a row, deletes a specific version of data from an attribute column, or updates the value of an existing attribute column.

If the row does not exist, a new row is added.

Suitable for updating a small amount of data.

Write multiple rows of data at the same time

Writes multiple rows of data to one or more tables at a time.

Suitable for writing, deleting, or updating a large amount of data, or performing a combination of these operations at a time.

Read data

You can read data from data tables by reading a single row, reading multiple rows at a time, or reading rows whose primary key values fall within a specific range. You can also specify columns to return, apply filters, and specify a version range or a specific version of data to return. For more information, see Read data.

Method

Description

Scenario

Read a single row of data

Reads a single row of data.

Suitable when all primary key column values of the target row are known and only a small number of rows need to be read.

Read multiple rows of data at the same time

Reads multiple rows of data from one or more tables at a time.

Suitable when all primary key column values of the target rows are known and the number of rows is large, or when you want to read data from multiple tables.

Read data whose primary key values are within a specific range

Reads data whose primary key values fall within a specific range.

Suitable when the range or prefix of primary key values of the target rows can be determined.

Delete data

You can delete data from data tables by deleting a single row or deleting multiple rows at a time. You can also use conditional updates to set delete conditions. For more information, see Delete data.

Method

Description

Scenario

Delete a single row of data

Deletes a single row of data. If the specified row does not exist, the data table remains unchanged.

Suitable for deleting a small amount of data.

Delete multiple rows of data at the same time

Deletes multiple rows at a time based on primary key information.

Suitable for deleting a large amount of data.

References

  • Configure conditions for writing or deleting data. For more information, see Conditional updates.

  • Perform atomic operations to read or write one or more rows of data. For more information, see Local transactions.

  • Collect real-time statistics for online applications, such as page view (PV) counts on posts. For more information, see Use the atomic counter feature.

  • Filter data that meets specific conditions during read operations. For more information, see Filters.

  • Automatically delete data whose retention period exceeds the specified time to live (TTL) value. For more information, see Data versions and TTL.