I am repeatedly doing an operation which creates a record in my Cassandra table at every iteration. However, for my purposes I only need a limited number of the most recent results stored. Stale rows are not interesting, and also the database would quickly inflate in size because the operation is meant to run many times a second over many days.
I am essentially using the Cassandra table as a buffer. That is by design.
Is there a way to set Cassandra to have a limit on how many rows a table can have, and drop old rows automatically with minimum performance impact when new rows are pushed?
My codebase is in Python so I'd prefer a Python solution.
Use can use TTL. It will automatically delete the rows as the time mentioned in TTL
Keep only newest N rows in Cassandra