All Products
Search
Document Center

Tablestore:TableOptions

Last Updated:Aug 01, 2024

Specifies optional configurations of a table, including the time to live (TTL) of data and the maximum number of versions.

Data structure

message TableOptions {
    optional int32 time_to_live = 1; 
    optional int32 max_versions = 2; 
    optional int64 deviation_cell_version_in_sec = 5; 
    optional bool allow_update = 6;
}

Parameter

Type

Required

Description

time_to_live

int32

No

The period for which data in the table is retained. This period is the validity period of data. If the retention period of data exceeds the TTL, the data expires. Tablestore automatically deletes expired data.

The value of this parameter must be greater than or equal to 86400. A value of 86400 specifies 1 day. You can also set this parameter to -1, which specifies that data never expires.

max_versions

int32

No

The maximum number of versions that can be retained for data in attribute columns of the data table. If the number of data versions in an attribute column exceeds the value of MaxVersion, the system deletes data of earlier versions.

deviation_cell_version_in_sec

int64

No

The maximum version offset between the timestamp of written data and the current system time. The difference between the version number and the time at which the data is written must be less than or equal to the maximum version offset. Otherwise, an error occurs when the data is written.

The valid version range of data in an attribute column is calculated by using the following formula: Valid version range = [max{Data written time - Max Version Offset, Data written time - TTL value}, Data written time + Max Version Offset).

allow_update

bool

No

Specifies whether to allow data writes by calling the UpdateRow operation. The default value is true, which specifies that data writes are allowed by using UpdateRow.

If you want to use the TTL feature of search indexes, you must set this parameter to false.