You can call the PutTimeseriesData operation provided by Tablestore to write multiple rows of time series data at the same time. Time series data consists of metadata and data. If you do not define the time series metadata before you write time series data, the system automatically extracts the metadata of the time series and creates an index for the metadata.
In the TimeSeries model of Tablestore, a two-dimensional time series table is used to store time series data. Each row represents the data at a point in time in a time series. The time series identifiers and timestamp are the primary key columns of the row, and the data points of the time series under the timestamp are the data columns of the row. A row can contain multiple data columns. For more information, see Overview.
Usage notes
We recommend that you evaluate the design of time series tables and check the total number of time series when you write time series data. In a short time series, only one row or a few rows of time series data exist. If a time series table contains a large number of short time series, you may find that the volume of time series metadata is large. Tablestore creates an index for the metadata of each time series. The total volume of metadata is calculated by assuming that the metadata size of each time series is 4 KB.
To delete time series metadata, you can configure time to live (TTL) to automatically delete the metadata. You can also call the DeleteTimeseriesMeta operation to manually delete the time series metadata. If you use Tablestore SDKs, TimeseriesKey specifies the time series identifiers.
For more information about the billing of time series data, see Billable items of the TimeSeries model.
Features
You can call the PutTimeseriesData operation to write multiple rows of time series data at the same time. If a row already exists, data in the existing row is deleted and new data is written.
When you write time series data, you must specify time series identifiers and data in the time series. If you do not define metadata for a time series, the system automatically extracts the metadata of the time series based on the data that is written.
Methods
You can write time series data by using the Tablestore console, CLI, or SDKs.
The features that are supported vary based on the method that you use to write time series data.
Before you write time series data, make sure that the following preparations are made:
A time series table is created. For more information, see Operations on time series tables.
If you write time series data by using Tablestore SDKs, an OTSClient instance is initialized. For more information, see Initialize an OTSClient instance.
If you write time series data by using the Tablestore CLI, the Tablestore CLI is downloaded and started, and the information about the instance that you want to access is configured. For more information, see Download the Tablestore CLI and Start the Tablestore CLI and configure access information.
Use the Tablestore console
Use the Tablestore CLI
Use Tablestore SDKs
FAQ
References
After you write time series data, you can perform the following operations:
Query time series data. For more information, see Query time series data.
Execute SQL statements to query and analyze time series data after you create a mapping table for a time series table. For more information, see Use SQL to query time series data.
Use Tablestore Sink Connector to migrate data from a Kafka data source to a time series table of Tablestore. For more information, see Data synchronization to time series tables.
You can manage time series metadata, such as retrieving time series, updating the properties in time series metadata, and deleting time series metadata. For more information, see Manage time series metadata.
To visualize time series data, you can connect Tablestore to Grafana. For more information, see Connect Tablestore to Grafana.