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 a piece of data in the data store.
Motivations/solutions
Many web applications store the short-lived session data in memory. This has serious issues if the node crashes or when some system fault occurs. To solve this problem, caching of the session data...