All Products
Search
Document Center

Tablestore:TimeSeries model quick start

Last Updated:Sep 09, 2026

The TimeSeries model is designed for time series data, making it ideal for scenarios such as Internet of Things (IoT) device monitoring, device data collection, and machine monitoring. It provides high-concurrency writes and queries, and offers low-cost storage for petabytes of data. This topic shows you how to use the TimeSeries model in the Tablestore console.

Important

To use the TimeSeries model with a command-line tool, see Use the TimeSeries model with a command-line tool.

Notes

The TimeSeries model is supported in the following regions: China (Hangzhou), China (Shanghai), China (Beijing), China (Zhangjiakou), China (Ulanqab), China (Shenzhen), China (Chengdu), China (Hong Kong), Japan (Tokyo), Malaysia (Kuala Lumpur), Germany (Frankfurt), Indonesia (Jakarta), UK (London), US (Silicon Valley), US (Virginia), SAU (Riyadh - Partner Region), and Singapore.

Features such as Lastpoint index, time series analytics storage, custom time series identifiers, and data fields as primary keys are available only in the China (Hangzhou), China (Shanghai), China (Beijing), and China (Zhangjiakou) regions. To use these features, create your instance in one of these regions.

Prerequisites

  1. You have activated the Tablestore service. For more information, see Activate Tablestore.

  2. A TimeSeries model instance has been created.

    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 Create Instance for TimeSeries Model.

    4. In the Create Instance for TimeSeries Model dialog box, select an instance specification, enter an instance name, and add an instance description.

    5. Click OK.

Procedure

Step 1: Create a time series table

Create a time series table to store time series data.

For information about the sample scenario and table schema, see Sample scenario.
  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 name 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 Create Time Series Table.

    Note

    You can also click Generate Demo with One Click to create a sample table with sample data to quickly try out the features. It may take a few seconds for a new time series to appear as the system initializes the sample table.

  4. In the Create Time Series Table dialog box, set Time Series Table Name to car_example and keep the default settings for other parameters.

  5. Click Create.

    After the time series table is created, you can view the table on the Time Series Tables tab. If the new table does not appear in the list, click the fig_tablestore_002 icon to refresh the time series table list.

Step 2: Write data

Write data to the time series table. Time series data consists of metadata and data points. If you do not create metadata beforehand, the system automatically extracts it from the data you write.

  1. On the Time Series Tables tab, click the time series table name and then click the Query Data tab. Alternatively, click Manage Data in the Actions column of the time series table.

  2. (Optional) Create a time series.

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

    2. In the Add Time Series dialog box, add metadata for the time series, such as the metric name and data source.

      In this example, set Metric Name to car_tsdata, select a Data Source, and in the Tag section, add a filter condition where the key is car_model, the operator is =, and the value is model_A. Then, click Add.

    3. Click Add.

  3. Insert data.

    1. In the Actions column of the time series that you want to manage, click Query Data.

    2. Click Insert Data.

      The system automatically obtains the metadata of the selected time series.

    3. In the Insert Data dialog box, set the time and attribute columns.

      Set the metric name to car_tsdata. Add a tag whose key is car_model and value is model_A. Set the time to February 5, 2025, 00:00:00. The required attribute columns include: vin_id (string), model (string, value model_A), speed (double, value 75.90), gps (string, value 30.23,52.78), current_mileage (double, value 10), remaining_oil (double, value 20), available_mileage (double, value 198), and tire_pressure (double, value 2.4). After you configure the parameters, click OK.

    4. Click OK.

Step 3: Query time series data

Query data from a time series within a specified time range.

To query data in a table by using SQL, see Query time series data by using SQL.
If you are not sure about the information of the time series to query, you can retrieve time series by specifying multiple conditions. For more information, see Retrieve time series.
  1. On the Query Data tab of the time series table, find the time series that you want to query and click Query Data in the Actions column.

  2. Set query conditions.

    1. By default, query results are sorted in ascending order of time. To query data in descending order, set Reverse Chronological Order to Yes.

    2. Select a query method and specify a time range.

  3. Click Query.

    Data that meets the query conditions is displayed on the Query Data tab. The query results can be displayed in a list or a chart.

Use a Lastpoint index

A Lastpoint index allows you to quickly retrieve the latest data point for each time series in a time series table.

  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 name or click Manage Instance in the Actions column of the instance.

  2. Go to the management page of the time series table.

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

    2. On the Time Series Tables tab, click the name of the time series table.

  3. Create a Lastpoint index.

    1. On the Basic Information tab of the management page of the time series table, click Create Lastpoint Index.

    2. In the Create Lastpoint Index dialog box, set the Lastpoint index name and synchronization mode.

      For example, set Lastpoint Index Name to lastpoint_car_example, set Synchronization Mode to Full Synchronization, and then click Create.

    3. Click Create.

  4. Query data by using the Lastpoint index.

    1. In the Actions column of the Lastpoint index, click Query.

    2. In the Search dialog box, set Mode to Range Search and keep the default settings for other parameters.

      By default, the start primary key values for _#h, _m_name, _data_source, and _tags are set to the minimum, and the end primary key values are set to the maximum.
    3. Click Query.

      The data that meets the query conditions is displayed in the Lastpoint Index section on the Basic Information tab.

Retrieve time series

If you are unsure of the exact metric name or data source for a time series, you can search for it by specifying multiple conditions.

  1. On the Query Data tab of the time series table, click Query Time Series in the upper-right corner.

  2. In the Query Data dialog box, enter the metric name or data source of the time series, and then click Add to specify matching conditions for tags, attributes, or update time.

    The condition in this example is used to query all time series that contain the tag car_model=model_A.

  3. Click OK.

    The data that meets the query conditions is displayed on the Query Data tab.

Sample scenario

In an Internet of Vehicles (IoV) scenario, vehicles use sensors to report time series data to the cloud. Storing, querying, and analyzing this data enables business features such as vehicle status reports, vehicle locating, traffic management, and trajectory projection. This topic uses a time series table in an IoV scenario as an example to describe how to create a time series table and perform read and write operations. The time series table stores vehicle trajectory data.

Parameter

Type

Description

_m_name

String

The name of the metric, which indicates the physical quantity or monitoring metric measured by the time series data.

_data_source

String

The identifier of the data source that generates the time series. This field can be left empty.

_tags

String

Tags for the time series, defined as one or more key-value pairs of the string type.

_time

Integer

The time when the data is reported.

vin_id

String

The unique vehicle identification number (VIN).

model

String

The vehicle model.

speed

Double

The current speed.

gps

String

The GPS coordinates of the vehicle, in the format latitude,longitude. The latitude must be a value from -90 to 90, and the longitude must be a value from -180 to 180. For example, 30.23,52.78.

current_mileage

Double

The current mileage.

remaining_oil

Double

The remaining fuel.

available_mileage

Double

The remaining drivable distance.

tire_pressure

Double

The tire pressure data.

Related documents

For more information about Lastpoint indexes, see Lastpoint index.