In Tablestore, you can call the QueryTimeseriesMeta operation to retrieve time series based on conditions, the UpdateTimeseriesMeta operation to update time series metadata, and the DeleteTimeseriesMeta operation to delete time series metadata. After you retrieve time series, you can manage the time series metadata based on your business requirements. For example, you can delete and update time series metadata.
Overview
Before you write time series data, you can define time series metadata. If you do not define time series metadata before you write time series data, the system automatically extracts the metadata of the time series and creates an index for the metadata.
After time series metadata is generated, you can manage the time series metadata based on your business requirements. The following table describes the features that you can use to manage time series metadata.
Feature | Description |
Retrieve time series | You can call the QueryTimeseriesMeta operation to retrieve time series based on the metric name, data source, tag, update time, or property, or based on a combination of multiple conditions. |
Update time series metadata | You can call the UpdateTimeseriesMeta operation to update time series metadata, such as the properties in time series metadata. The properties in time series metadata are stored in the _attributes column. You can update the properties in time series metadata for which the time to live (TTL) is set to -1. The value of -1 indicates that data never expires. Note For more information, see TTL of time series data. |
Delete time series metadata | You can call the DeleteTimeseriesMeta operation to delete multiple time series metadata records at a time. Important When you delete time series metadata, the data in the time series is not deleted. You can call the GetTimeseriesData operation to query data in the time series by specifying time series identifiers. |
Methods
You can manage time series metadata by using the Tablestore console, Tablestore CLI, or Tablestore SDKs.
The features that are supported vary based on the method that you use to manage time series metadata.
Before you manage time series metadata, make sure that the following preparations are made:
A time series table is created and time series data is written to the time series table. For more information, see Operations on a time series table and Write time series data.
If you manage time series metadata by using Tablestore SDKs, an OTSClient instance is initialized. For more information, see Initialize an OTSClient instance.
If you manage time series metadata 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
FAQ
References
After you retrieve time series, you can query time series data that meets specific conditions in the time series. For more information, see Query time series data.
If you want to automatically delete time series metadata that you no longer need or extend the retention period of time series metadata, you can configure the TTL for time series metadata. For more information, see TTL of time series data.