Capping Feature in AS

@ankit.kothana

You can do this without using the TTL feature. Are you checking the cap value? If so then you’re already doing a read so you can use another bin to hold the expiration. Check this bin on the read and reset to 0 if expired, using the write policy to prevent another increment from occurring at the same time. You can also write a UDF to combine this into a single server-side operation if you don’t want to do a read. You’ll also probably need to write a quick background query to periodically scan through records and delete expired ones that aren’t being used anymore.

@bbulkow

We requested this feature last year: Maintain TTL value on record update or add fixed-timestamp expiration (3.10.0)

One of the issues is that the smallest TTL value is 1 second, which means a record with many increments per second will reset the expiration indefinitely. The read + write op was the only solution.