All Products
Search
Document Center

Tablestore:Get started with the TimeSeries model

Last Updated:May 09, 2026

The TimeSeries model is designed for time series data, making it ideal for scenarios like IoT device monitoring and machine data collection. It supports high-concurrency writes and queries, and provides low-cost storage for petabytes of data. This topic explains how to use the TimeSeries model in the Tablestore console.

Important

To use the TimeSeries model with the CLI, see Use the TimeSeries model with the CLI.

Usage notes

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

Features such as Lastpoint index, analytical storage for time series, 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 TimeSeries model instance in one of the specified regions.

Before you begin

  1. Activate Tablestore. For more information, see Activate Tablestore.

  2. Create a TimeSeries model instance.

    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 type, enter an instance name, and add an instance description based on your business needs.

    5. Click OK.

Procedure

Step 1: Create a time series table

Create a time series table to store your time series data.

For more 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 for 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 test table with sample data to quickly try out the feature. The system initializes the new test table, so you may need to wait a few moments for the time series data to appear.

  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.

    image

  5. Click Create.

    After the time series table is created, you can view it 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 list of time series tables.

    image

Step 2: Write data

Write time series data to the time series table. Time series data consists of metadata and data points. If metadata for a time series does not exist, the system automatically creates it when you write the data.

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

  2. (Optional) Add a new time series.

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

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

      image

    3. Click Add.

  3. Insert data.

    1. In the Actions column of the target time series, click Query Data.

    2. Click Insert Data.

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

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

      image

    4. Click OK.

Step 3: Query time series data

Query data points for a specific time series within a specified time range.

To query data from the table by using an SQL query, see Use SQL to query time series data.
You can search for a specific time series by specifying multiple conditions. For more information, see Search for a time series.
  1. On the Query Data tab of the time series table, find the target time series and click Query Data in the Actions column.

  2. Set the query conditions.

    1. By default, query results are sorted by time in ascending order. To sort data in reverse chronological order, set Reverse Chronological Order to Yes.

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

  3. Click Query.

    The matching data is displayed on the Query Data tab. You can view the results as 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 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 for the instance.

  2. Go to the time series table management page.

    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 time series table management page, click Create Lastpoint Index.

    2. In the Create Lastpoint Index dialog box, set a name for the Lastpoint index and select a synchronization method.

      image

    3. Click Create.

  4. Use the Lastpoint index to query data.

    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.

      The start primary key defaults to the minimum value and the end primary key defaults to the maximum value for _#h, _m_name, _data_source, and _tags.

      image

    3. Click Query.

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

Search for a timeline

You can find a specific time series by searching with multiple conditions, such as its measurement name or data source.

  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 measurement name or data source for the time series. You can also click Add to set matching conditions for tags, properties, or update times.

    The conditions in the following figure are used to query all time series that have the tag car_model=model_A.

    image

  3. Click OK.

    The time series that meet the conditions are displayed on the Query Data tab.

Sample scenario

In an Internet of Vehicles (IoV) use case, vehicle sensors report time series data to the cloud. By storing, querying, and analyzing this data, you can build applications for vehicle status reports, vehicle positioning, traffic management, and trajectory tracking. This topic uses an IoV scenario to demonstrate how to create a time series table and manage its data. The table, named car_example, stores vehicle data, primarily vehicle trajectory information. The table schema is detailed below.

Parameter

Type

Description

_m_name

String

The measurement name. It represents the physical quantity or metric that the time series data measures.

_data_source

String

The data source. It identifies the source of the time series data. This field can be empty.

_tags

String

The tags for the time series. You can define multiple string key-value pairs.

_time

Integer

The time when the data is reported.

vin_id

String

The Vehicle Identification Number (VIN), which uniquely identifies the vehicle.

model

String

The vehicle model.

speed

Double

The current speed.

gps

String

The GPS coordinates of the vehicle in latitude,longitude format. The latitude must be between -90 and +90, and the longitude must be between -180 and +180. For example, 30.23,52.78.

current_mileage

Double

The current mileage.

remaining_oil

Double

The remaining fuel.

available_mileage

Double

The remaining driving range.

tire_pressure

Double

The tire pressure data.

Related documents

For more information about the Lastpoint index, see Lastpoint index.