All Products
Search
Document Center

Tablestore:Write time series data

Last Updated:Apr 25, 2025

Time series data consists of two parts: metadata and data. Metadata records the identifiers and property information of the time series, while data records all data points of the time series (including the time when the data points are generated and the corresponding data values). This topic describes how to write time series data.

Overview

You can write time series data in the Tablestore console or by using Tablestore SDKs or the Tablestore CLI. If the row data that you want to write already exists, the existing row data is deleted first, and then the new row data is written.

When you write time series data, you must specify the time series metadata and time series data. If the time series does not exist, the metadata is automatically extracted from the time series data being written, and the corresponding time series is created.

Usage notes

When you write time series data, you should properly evaluate the design of the time series table and pay attention to the total number of time series. If there are many short time series in the table (that is, only one or a few rows of time series data in a time series), you may see that the storage usage of the time series metadata is relatively large. This is because Tablestore currently builds an index for the metadata of each time series and calculates the total storage usage of metadata based on 4 KB per time series.

Procedure

You can predefine time series in a time series table and write time series data to the time series table in the Tablestore console.

  1. Go to the Instance Management page.

    1. Log on to the Tablestore console.

    2. In the top navigation bar, select a resource group and a region.

    3. On the Overview page, click the instance alias or click Manage Instance in the Actions column of the instance.

  2. On the Instance Details tab, click the Time Series Tables tab.

  3. On the Time Series Tables tab, click the name of the time series table and select the Query Data tab, or click Manage Data in the Actions column of the time series table.

  4. (Optional) Create a time series.

    1. On the Query Data tab, click Add Time Series.

    2. In the Add Time Series dialog box, add time series metadata.

      fig_datatimeseries

      The following table describes the parameters.

      Parameter

      Description

      Metric Name

      The name of the physical quantity or metric for the data in the time series, such as cpu or net, which specifies that the CPU usage or network usage is recorded in the time series.

      Data Source

      The data source that generates the time series.

      Tag

      The tag of the time series. You can specify multiple key-value pairs of the String type as the tags.

      Property

      The attribute column of the time series, which is used to record some attribute information about the time series.

    3. Click Add.

      You can query the time series in a new time series table 1 minute after the time series table is created.

  5. Insert data to the table.

    1. Click Insert Data.

    2. In the Insert Data dialog box, configure the Time and Attribute Column parameters.

      image

    3. Click OK.

Development integration

You can use the following Tablestore SDKs or the Tablestore CLI to write time series data.

Billing

For more information, see Billable items of the TimeSeries model.

FAQ