Purge pattern

Whenever there is a need to remove data after a certain period of time without any external intervention, use the TTL property while inserting records to the Cassandra column family. Instead of depending on the applications or any other external event's intervention, data can be purged off the column family by using the TTL property. The USING TTL clause in CQL can be used to achieve the same. This completely removes the burden from the applications to remove records. Once the time is over, the records are automatically removed from the Cassandra column families. This is very suitable for data items that are short lived in the data store such as session data, cached data, and so on. There are ways to report the time remaining for ...

Get Cassandra Design Patterns - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.