Retention policy characteristics

Hello,
I am pretty new to TimescaleDB, but got some questions about retention policies.

If I am implementing a retention policy for example to delete old data from a hypertable if it is older then 5 days. How is this handled by Timescale. If the task to run the retention policy, so deleting old data, kicks in. Does this impact the performance? Could hardware usage on CPU, or RAM ramp up? I would guess that the retention policy is handled as a background task. So given a low priority and also not really intensive for hardware usage but I am not sure.
How is it handled if at the same time new data comes in and old data is deleted? I would guess this is buffered in some kind of way.

Thanks a lot already!

Retention policies in TimescaleDB are designed to efficiently manage the deletion of old data from hypertables. They are indeed handled as background tasks, and the impact on performance is generally minimal if configured properly.

Timescale Documentation | Create a data retention policy

Timescale supports writing data in the same way as PostgreSQL(supports data consistency), using INSERT , UPDATE , INSERT ... ON CONFLICT , and DELETE .
Timescale Documentation | About writing data

Feel free to post if you are facing any issue.

So if I understand correctly new data is put into a recent chunk and retention policies are deleting older chunks. These two tasks don’t work on the same blocks of data?
Kind of similar to Elastic Search I imagine.

No, the deletion process will occur as a background task, eliminating any concerns regarding concurrency, as it will be handled seamlessly. Consequently, the removal won’t impede the insertion process.

But the removal won’t impede the insertion because they are on different chunks of data right?

yes, I think you should read this blog from TimescaleDB, hopefully it will clear your all queries.

How TimescaleDB Solves Common PostgreSQL Problems in Database Operations With Data Retention Management

2 Likes