All Products
Search
Document Center

Lindorm:Manage databases

Last Updated:Feb 19, 2024

This topic describes the concepts related to databases in LindormTSDB and features that are provided by LindormTSDB for time series data.

Databases in LindormTSDB

Each running LindormTSDB instance manages one or more databases. Data is isolated between databases. Each database stores one or more time series tables. The following figure shows LindormTSDB data layers based on the concepts described in Terms.

image

If you write the data of irrelevant projects to the same LindormTSDB instance, the data of each project is logically isolated to a large extent. In this case, we recommend that you store the data of each project in a separate database and grant required permissions on the databases to different users for access control. LindormTSDB allows users that have required permissions to access data across-databases.

Time series data management based on databases

In LindormTSDB, a database is a collection of time series tables. You can store time series tables related to the same business in a separate database for data isolation. In addition, you can use the following features provided by LindormTSDB to manage data based on databases:

  • Configure a time boundary used to separate cold data and hot data for each database.

    Note

    For more information about the separated storage of cold data and hot data, see Cold data archiving.

  • Configure a time to live (TTL) for each database.

    When the time period between the point in time indicated by the timestamp of time series data and the current time is longer than the configured TTL, the time series data is considered expired and is cleared by LindormTSDB.

Important

  1. Timestamps of time series data can indicate event time or ingestion time:

    • Event time: indicates the point in time when an event that corresponds to time series data occurs. For more information about the timestamps that indicate event time, see the description of timestamp in Data models.

    • Ingestion time: indicates the point in time when time series data is written to a database.

    The cold/hot data boundary and TTL are configured based on event time. You cannot configure a cold/hot data boundary or TTL based on ingestion time.

  2. LindormTSDB runs asynchronous compaction tasks to archive cold data and clear expired data. As a result, a delay occurs when these operations are performed.

  3. If you configure a cold/hot data boundary and a TTL for a database, a task is triggered to clear archived cold data when the cold data expires.

  4. If you configure a TTL for a database and the time period between the point in time indicated by the timestamp of the data that you want to write and the current time is longer than the TTL, the data can be written to the database. However, the data cannot be retrieved during subsequent queries.

Database management by executing SQL statements

LindormTSDB allows you to perform the following operations on a database by executing SQL statements:

  • Create a database

    You can create a database in LindormTSDB. For more information about the SQL syntax used to create a database, see CREATE DATABASE.

    Note

    By default, a user does not have permissions to access a database that is newly created. To perform operations on a new database, you must be granted corresponding permissions on the database.

  • Delete a database

    You can delete a database in LindormTSDB. For more information about the SQL syntax used to delete a database, see DROP DATABASE.

  • Modify the attributes of a database

    You can modify the attributes of a database in LindormTSDB. For example, you can change the cold/hot data boundary and TTL of a database in LindormTSDB. For more information about the SQL syntax used to modify the attributes of a database, see ALTER DATABASE.

  • Query the attributes of a database

    You can query the attributes of a database in LindormTSDB. For more information about the SQL syntax used to query the attributes of a database, see DESCRIBE DATABASE.

Database management in the Lindorm console

You can use the Lindorm console to manage databases in LindormTSDB. In the Lindorm console, you can configure a cold/hot data boundary and a data retention policy for a database on the Database Management tab. The following figure shows the page on which you can configure the boundary and retention policy for a database.

Snipaste_2024-02-18_13-41-19

Important

You cannot use the Lindorm console to create or delete a database in LindormTSDB. To create or delete a database in LindormTSDB, you must execute the corresponding SQL statements.