Search code examples
cachingredisaerospikeaerospike-ceaerospike-loader

Aerospike set expiration date for specific field


I have an Aerospike cache consists of list of data with value of json like structure.

example value: {"name": "John", "count": 10}

I was wandering if it is possible to set an expiration time for only the count field and reset it after some time.


Solution

  • Aerospike doesn't support such functionality out of the box. You would have to code this (hence your other post I guess: Best way to update single field in Aerospike). You can add filters to only do this based on metadata of the record (the last update time of the record, accessible through Expressions) or any other logic and it should be super efficient and performant to then let a background ops query do the work.