2

I am running a PostgreSQL database that is logging state-of-health information for a number of systems. At the moment, it is running on a standard PostgreSQL server, but it seems like TimescaleDB has some usable features for this setup.

Most of the systems are logged directly, so the data are stored just after it has been collected. But some of the systems are not always on-line. They will log data locally when they are off-line, then when they are on-line, the collected data will be downloaded and inserted into the database. Will this pattern cause any problems for TimescaleDB? In some of the documentation, it seems to be important that data are written in time order.

3
  • 1
    In some of the documentation, it seems to be important that data are written in time order. I think that this is told about the case when the timepoint used is the insertion time, not time value in inserted data.
    – Akina
    Commented Oct 14, 2021 at 8:45
  • 1
    In some of the documentation .... I would expect quote and deep link to the part of the documentation referenced here. Commented Oct 14, 2021 at 14:04
  • timescaledb is a collection of tools and methods. It matters which ones you are using.
    – jjanes
    Commented Oct 14, 2021 at 23:59

1 Answer 1

3

Timescale splits the data into "child table" called chunks across the time.

The chunks are based on time interval, and you can choose the time interval.

If you want to compress your data, you can add compression policies that can run every X hours to compress the data older than X time interval.

The problem can come if systems get off-line for more than the X time interval that you're start compressing.

Let's say you have chunks of 1 day and you compress data after 7 days. If your system gets off-line for 8 days, it will try to insert data on compressed chunks then it can become an issue. You'll need to decompress the chunk to insert the data and recompress later.

If this is a common usage of your systems, you can choose for smaller chunks like 4 hours and then it will be smaller amounts of data that can be easily decompressed and recompressed again. The compression will not be that great because it will have too many chunks but that is the trade off the decisions :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.