2.7.8 TimescaleDB

TimescaleDB is a database designed for handling time-series data (data that changes over time), such as metrics, sensor readings, or logs. It is built as an extension of PostgreSQL.

How TimescaleDB Stores Data:

TimescaleDB stores data in a structure called a hypertable.

This design allows TimescaleDB to efficiently manage large amounts of time-based data.

Chunks

Retention Policy

A retention policy controls how long data is kept in the database. Default is 3 months period set.

Example concept:

Compression Policy

A compression policy reduces storage usage for older data. Default is compress chunks after 14 days.

Typical usage:

How TimescaleDB Works

When data is inserted:

When data is read:

What is time_bucket?

time_bucket is a concept used to group data into fixed time intervals (also called resolution).

For example:

Instead of looking at every individual data point, data is grouped into these time buckets.

How time_bucket Affects Native Data

So:

Within each time bucket:

Example concept:

Resolution

Resolution (bucket size) determines how detailed the data appears:

Summary

Note: This section gives a concise overview of TimescaleDB. For more detailed information, see the TimescaleDB documentation.