Expiring data with time-to-live
Columns and tables support an optional expiration period called TTL (time-to-live); TTL is not supported on counter columns. Define the TTL value in seconds. Data expires once it exceeds the TTL period and is then marked with a tombstone. Expired data continues to be available for read requests during the grace period, see gc_grace_seconds. Normal compaction and repair processes automatically remove the tombstone data.
The database storage engine can only encode TTL timestamps through
Use CREATE TABLE or ref:reference:cql-commands/alter-table.adoc[ALTER TABLE] to define the default_time_to_live property for all columns in a table. If any column exceeds TTL, the entire row is deleted.
For details and examples, see Expiring data with TTL example.