All Products
Search
Document Center

Tablestore:Basic data operations

Last Updated:Mar 05, 2024

After you create a time series table, you can call the PutTimeseriesData operation or use TimeseriesWriter to write time series data. You can also migrate data from Apache Kafka to time series tables in Tablestore. After you write time series data to time series tables, you can call the QueryTimeseriesMeta operation to retrieve time series, or call the GetTimeseriesData operation or execute SQL statements to query time series data.

Write time series data

After you create a time series table, you can use a suitable method to write time series data to the time series table based on your business scenario.

Manage time series metadata

Before you write time series data, you can define the time series metadata. If you do not define the 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. You can retrieve time series based on the specified conditions or specify whether to allow updates on the time series metadata. For more information, see Manage time series metadata.

  • If you are unsure about the information about the time series that you want to query, such as the metric name and data source, or you want to query time series that meet specific conditions, you can call the QueryTimeseriesMeta operation to specify multiple conditions to retrieve time series.

  • If you want to update the properties in time series metadata, you can call the UpdateTimeseriesMeta operation to update time series metadata.

    Important

    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.

  • If you no longer require specific time series metadata, you can call the DeleteTimeseriesMeta operation to delete time series metadata in a batch.

    You can also configure the TTL parameter for time series metadata to automatically delete time series metadata that you no longer require. For more information, see TTL of time series data.

Query time series data

After you write time series data to time series tables, you can call the GetTimeseriesData operation to query time series data that meet the specified conditions in the time series. For more information, see Query time series data.

You can also create a mapping table for a time series table and execute SQL statements to query time series data. For more information, see Use SQL to query time series data.

FAQ