The TimeSeries model uses time series tables to store time series data. A single time series table supports high-concurrency writes and queries, offering low-cost storage for petabytes of data. This topic describes how to create and manage time series tables.
Usage notes
You can create a maximum of 64 tables in a single instance. This limit includes data tables, secondary indexes, time series tables, Lastpoint indexes, and analytical stores. For more information about limits, see Limits of the TimeSeries model.
NoteA time series table consists of a time series metadata table and a time series data table. Therefore, a single time series table counts as two tables against the instance limit.
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.
You can customize time series identifiers, use data fields as primary key fields, and create Lastpoint indexes and analytical stores in the following regions: China (Hangzhou), China (Shanghai), China (Beijing), and China (Zhangjiakou).
Features
The following table describes the features that are supported by time series tables.
Feature | Description |
Create a time series table | When you create a time series table, you must specify configurations for the table and its time series metadata. You can also customize the time series identifier, define data fields as primary key fields, create an analytical store, and create a Lastpoint index based on your business requirements. |
Update a time series table | Modify a time series table's time to live (TTL) and update the settings for its time series metadata, such as the metadata TTL and whether its attributes can be updated. |
List time series tables | List the names and configurations of all time series tables in the current instance. |
Describe a time series table | Query the configuration details of a time series table, such as its TTL and status, and its time series metadata configurations, such as the metadata TTL and whether its attributes can be updated. |
Delete a time series table | Delete a specified time series table. |
Procedure
Create a time series table
Follow these steps to create a time series table in the Tablestore console.
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 alias of an instance or click Manage Instance in the Actions column for the instance.
On the Instance Details tab, click the Time Series Tables tab.
On the Time Series Tables tab, click Create Time Series Table.
NoteYou can also click Generate Demo with One Click to create a test table with sample data to quickly experience the features. For a newly created test table, the system performs specific initialization operations. You may need to wait tens of seconds for the time series to appear.
In the Create Time Series Table dialog box, configure the parameters for the time series table.
Parameter
Description
Time series table name
The name of the time series table. The name must be unique within the instance.
The name must be 1 to 128 characters long, contain only letters, digits, and underscores (_), and start with a letter or an underscore (_).
The table name must not be the same as that of any existing data table, secondary index, or other time series table in the current instance.
Time to live (TTL)
The retention period for data in the time series table, in seconds. The minimum value is 86400 (1 day). You can set this parameter to -1 to indicate that the data never expires.
The system automatically deletes data points that exceed the specified TTL.
NoteThe system determines the generation time of data based on the user-provided time column, not the time when the data is written to the table.
Time series identifier
NoteThis parameter is configurable only when you enable Custom Time Series Identifiers and Primary Key.
By default, a time series identifier consists of a metric name, a data source, and tags. You can define a custom time series identifier to meet your specific business requirements.
A custom time series identifier field name must be 1 to 128 bytes in length, contain only lowercase letters, digits, and underscores (_), and cannot start with a digit.
You can specify a maximum of six custom time series identifier fields.
Click Add Time Series Identifier to add multiple custom identifier fields. To remove a field, click the
icon next to it.ImportantYou cannot modify custom time series identifier fields after the table is created. Proceed with caution.
Primary key fields
NoteThis parameter is configurable only when you enable Custom Time Series Identifiers and Primary Key.
If your business requires storing different time series data for the same time series identifier and timestamp, you can configure data fields as part of the primary key.
A primary key field name must be 1 to 128 bytes in length, contain only lowercase letters, digits, and underscores (_), and cannot start with a digit.
You can specify a maximum of four data fields as primary key fields.
The data type of a primary key field can be STRING or INTEGER.
Click Add Primary Key Field to add multiple primary key fields. To remove a field, click the
icon next to it.ImportantYou cannot modify the primary key fields after the table is created. Proceed with caution.
Create analytical store
An analytical store is designed for long-term storage and analysis of time series data. It helps you store time series data at a low cost and enables fast queries and analytics.
By default, the option to create an analytical store is enabled. Configure it based on your business requirements.
If you do not need an analytical store, disable the Create Analytical Store switch.
To create a default analytical store, keep the Create Analytical Store switch enabled.
To create a custom analytical store, keep the Create Analytical Store switch enabled, turn on the Advanced Settings switch, and configure the Name and TTL.
Create Lastpoint index
A Lastpoint index is designed to quickly retrieve the latest state of each time series in a table. This is useful for fetching the most recent data point from monitored targets.
By default, the option to create a Lastpoint index is disabled. Configure it based on your business requirements.
If you do not need a Lastpoint index, keep the default setting.
To create a Lastpoint index, enable the Create LastPoint Index switch and specify a LastPoint Index Name.
NoteThe index name must be 1 to 128 bytes in length, can contain letters, digits, and underscores (_), and cannot start with a digit.
The total number of Lastpoint indexes and analytical stores in a time series table cannot exceed 10.
Click Create.
After the 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
icon to refresh the list.
Manage time series tables
Use the following procedures to manage your time series tables.
Task | Description |
List time series tables | On the Time Series Tables tab, view all time series tables in the instance. |
Update the data TTL |
|
Update the metadata TTL |
|
Update metadata attribute settings |
|
Describe a time series table |
|
Delete a time series table |
|
Development integration
Feature | Method |
Create a time series table | |
Update a time series table | |
List time series tables | |
Describe a time series table | |
Delete a time series table |
next to Data Lifecycle.
next to TTL of Time Series Metadata.