Ajay Gupta
Ajay Gupta

Reputation: 157

Cassandra TTL data not working

I have old data (last 1 year) in Cassandra. I then alter the table structure adding TTL of 30 days. Will TTL (default_time_to_live = 2592000) delete my one year back old data or not?

Upvotes: 0

Views: 312

Answers (1)

Alex Ott
Alex Ott

Reputation: 87109

From documentation:

If the value is greater than zero, TTL is enabled for the entire table and an expiration timestamp is added to each column. A new TTL timestamp is calculated each time the data is updated and the row is removed after all the data expires.

So the TTL for data will be set only if you update them, but will not touch the old data.

This description of how data is deleted would be also helpful.

Upvotes: 3

Related Questions