All Products
Search
Document Center

Tablestore:TimeSeries model

Last Updated:Jan 19, 2024

Tablestore SDK for Go provides a variety of operations on time series tables and time series data for the TimeSeries model.

Note

The Tablestore TimeSeries model is designed based on the characteristics of time series data and is suitable for scenarios such as IoT device monitoring, device data collection, and machine data monitoring. For more information about the TimeSeries model, see Overview.

Operations on time series tables

To use the Tablestore TimeSeries model, you must call the CreateTimeseriesTable operation to create a time series table for storing time series data. For more information, see Create a time series table.

After you create a time series table, you can manage the time series table. 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, you can call the ListTimeseriesTable operation to query the names of all time series tables in the instance.

Query the information about a time series table

To view the configuration details of a time series table, you can call the DescribeTimeseriesTable operation to query the information about the time series table, such as the time to live (TTL) of data.

Update a time series table

To clear historical data in a time series table or extend the retention period of data, you can call the UpdateTimeseriesTable operation to modify the TTL of data in the time series table. After you modify the TTL of data in a time series table, Tablestore automatically and asynchronously clears the data that exceeds the TTL in the time series table.

Delete a time series table

If you no longer need to use a time series table to store time series data, you can call the DeleteTimeseriesTable operation to delete the time series table.

Important

You cannot restore a time series table after it is deleted. Exercise caution when you perform this operation.

Operations on time series data

After you create a time series table, you can call the PutTimeseriesData operation to write multiple rows of time series data to the time series table at a time. For more information, see Write time series data.

After time series data is written to a time series table, you can perform the following operations to query the time series data of a time series in the time series table:

  1. If you are not sure about the information about the time series that you want to query, such as the metric name and data source, you can call the QueryTimeseriesMeta operation to specify multiple conditions to retrieve the time series. For more information, see Retrieve time series.

    If the property information in time series metadata does not meet your requirements, you can update or delete the time series metadata.

    Operation

    Description

    Update time series metadata

    You can call the UpdateTimeseriesMeta operation to modify multiple properties in time series metadata at a time.

    Delete time series metadata

    You can call the DeleteTimeseriesMeta operation to delete the metadata of multiple time series at a time.

  2. You can call the GetTimeseriesData operation to query the time series data that meets specific conditions in a specific time series. For more information, see Query time series data.