There is a Redisson java framework which implements hash Map
object with entry TTL support. It uses hmap
and zset
Redis objects under the hood. Usage example:
RMapCache<Integer, String> map = redisson.getMapCache('map');
map.put(1, 30, TimeUnit.DAYS); // this entry expires in 30 days
This approach is quite useful.