In the TimeSeries model, time series data is stored in time series tables to allow applications to concurrently write and read petabytes of data and reduce storage costs. When you create a time series table, you can specify the time to live (TTL) of data in the table. After you create a time series table, you can manage the time series table based on your business requirements. For example, you can query the names of all time series tables in an instance and update the configurations of a time series table.
Usage notes
You can create up to 64 tables in an instance. The tables include data tables, secondary index tables, and time series tables. For information about more limits on the TimeSeries model, see Limits on the TimeSeries model.
A time series table consists of a time series metadata table and a time series data table. Therefore, a time series table is equivalent to two tables.
The TimeSeries model is supported in the following regions: China (Hangzhou), China (Shanghai), China (Beijing), China (Zhangjiakou), China (Ulanqab), China (Shenzhen), China (Hong Kong), Germany (Frankfurt), US (Virginia), SAU (Riyadh - Partner Region), and Singapore.
Overview
Tablestore provides the CreateTimeseriesTable, ListTimeseriesTable, UpdateTimeseriesTable, DescribeTimeseriesTable, and DeleteTimeseriesTable operations to help you manage time series tables.
Before you use the TimeSeries model of Tablestore to store time series data, you must call the CreateTimeseriesTable operation to create a time series table.
When you create a time series table, you must specify a name for the time series table and specify the TTL of data in the table based on your business requirements.
After you specify the TTL of data in a time series table, Tablestore automatically deletes time series data whose retention period exceeds the TTL value in asynchronous mode. For more information, see TTL of time series data.
After you create a time series table, you can manage the time series table based on your business requirements. The following table describes the operations that you can perform on time series tables.
Operation | Description |
Query the names of time series tables | To view the existing time series tables in an instance, call the ListTimeseriesTable operation to query the names of all time series tables that are created in the instance. |
Update the configurations of a time series table | To delete historical data or extend the retention period of data in a time series table, call the UpdateTimeseriesTable operation to change the TTL of data in the time series table, change the TTL of time series metadata, or specify whether the attribute columns of time series can be modified. Important When time series metadata is retained for a period of time that exceeds the specified TTL value, Tablestore automatically deletes the metadata in asynchronous mode. The data in the time series table is not deleted. You can call the GetTimeseriesData operation to query the data in the time series table by specifying the time series identifiers.
|
Query information about a time series table | To view the configuration details of a time series table, call the DescribeTimeseriesTable operation to query the configurations of the time series table, such as the TTL of data in the time series table, table status, or configurations of time series metadata (such as whether the attribute columns of time series metadata can be modified). |
Delete a time series table | To delete a time series table from an instance, call the DeleteTimeseriesTable operation Important You cannot restore a deleted time series table. Proceed with caution. |
Methods
You can perform operations on a time series table in the Tablestore console or by using Tablestore CLI or SDKs.
The supported features vary based on the method that you use to perform operations on a time series table.
Before you perform operations on a time series table, make sure that the following preparations are made:
You have an Alibaba Cloud account or a RAM user that has permissions to perform operations on Tablestore. For information about how to grant Tablestore operation permissions to a RAM user, see Use a RAM policy to grant permissions to a RAM user.
If you perform operations on a time series table by using the Tablestore CLI or SDKs, an AccessKey pair is created for your Alibaba Cloud account or RAM user. For more information, see Create an AccessKey pair.
An instance for the TimeSeries model is created. For more information, see Create an instance for the TimeSeries model.
If you perform operations on a time series table by using Tablestore SDKs, an OTSClient instance is initialized. For more information, see Initialize an OTSClient instance.
If you perform operations on a time series table by using the Tablestore CLI, the Tablestore CLI is downloaded and started, and information about the instance that you want to access is configured. For more information, see Download the Tablestore CLI and Start the Tablestore CLI and configure access information.
Use the Tablestore console
Use the Tablestore CLI
Use Tablestore SDKs
References
After you create a time series table, you can write time series data to the table and read time series data from the table. For more information, see Basic data operations.