Time series data consists of two parts: metadata and data. Metadata stores the identifiers and property information of a time series. Data stores all data points, each containing a timestamp and corresponding values.
You can write time series data to a time series table by using the Tablestore console, Tablestore SDKs, or the Tablestore CLI.
Write behavior
When you write time series data, the following rules apply:
Upsert semantics: If the row data that you want to write already exists, Tablestore deletes the existing row data first and then writes the new row data.
Auto-creation of time series: If the target time series does not exist, Tablestore automatically extracts metadata from the data being written and creates the time series.
Metadata storage considerations
If many short time series exist in the table (time series with only one or a few rows of data), metadata storage usage may be large. Tablestore builds an index for the metadata of each time series and calculates metadata storage at 4 KB per time series.
Write data in the Tablestore console
Use the Tablestore console to predefine time series and write data to a time series table.
Step 1: Go to the Instance Management page
Log on to the Tablestore console.
In the top navigation bar, select a resource group and a region.
On the Overview page, click the instance alias or click Manage Instance in the Actions column of the instance.
Step 2: Open the time series table
On the Instance Details tab, click 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.
Step 3 (optional): Create a time series
On the Query Data tab, click Add Time Series.
In the Add Time Series dialog box, configure the following parameters.
Parameter Description Metric Name The name of the physical quantity or metric for the data in the time series, such as cpuornet.Data Source The data source that generates the time series. Tag The tag of the time series. Specify one or more key-value pairs of the String type as tags. Property The attribute column of the time series. Records attribute information about the time series. Click Add.
A newly created time series becomes queryable 1 minute after the time series table is created.
Step 4: Insert data
Click Insert Data.
In the Insert Data dialog box, configure the Time and Attribute Column parameters.
Click OK.
Write data by using Tablestore SDKs or the Tablestore CLI
Tablestore SDKs
Tablestore CLI
Billing
For more information, see Billable items of the TimeSeries model.