Database management
Databases in LindormTSDB isolate data between projects and provide lifecycle features such as cold/hot data tiering and TTL-based retention.
What is a database?
Each running LindormTSDB instance manages one or more databases with data isolated between them. Each database contains multiple time series tables. The data hierarchy in LindormTSDB is shown as follows:
For term definitions, see the Glossary.
To store data for unrelated projects that require isolation, create a separate database for each project and configure the corresponding access control policies. To access data across databases, you must have the required permissions for the target database.
Manage databases
LindormTSDB supports the following SQL operations for managing databases:
|
Actions |
Description |
SQL syntax |
|
Create |
Creates a new database in LindormTSDB. Note
You must grant permissions for the new database to users, as they have no access by default. |
|
|
Delete |
Deletes an existing database. |
|
|
Modify properties |
Modifies the properties of an existing database, such as the cold/hot data boundary and TTL. |
|
|
Query properties |
Displays the structure of an existing database. |
Manage database lifecycle
A database is a collection of time series tables. You can group time series tables with a similar business context into the same database for data isolation. LindormTSDB provides the following database-level features:
Set cold/hot data tiering policy
You can set a cold/hot data boundary at the database level. The system automatically archives data based on this boundary.
Set data retention policy (TTL)
You can set a time to live (TTL) for data at the database level. LindormTSDB automatically deletes data older than the specified TTL.
You can set the TTL when you create a database using the CREATE DATABASE statement.
-
Timestamps in time series data typically fall into two categories:
-
event time: The time when the real-world event corresponding to the data point actually occurred. The timestamp in the time series data model described in Time series data elements refers to event time.
-
ingestion time: The time when the data point is written to the database.
Both the data tiering and data retention policies are based on event time. Policies based on ingestion time are not supported.
-
-
If you configure both a cold/hot data boundary and a TTL, LindormTSDB also deletes archived cold data that exceeds the TTL.
-
If you write data with a timestamp that exceeds the TTL, the write operation succeeds, but you cannot query the data.
FAQ
For more information, see LindormTSDB FAQ.
Data written but not queryable
Check whether a TTL is set for your data. If the timestamp of the written data exceeds the TTL, the data is deleted immediately after the write, resulting in an empty query result.
Delays in data archiving and TTL cleanup
Cold data archiving and TTL-based data cleanup in LindormTSDB are performed by asynchronous compaction tasks and might not take effect immediately. If the compaction queue has many tasks, cleanup tasks may need to wait.