Lets say a Redis node is configured with an eviction policy of LRU. Whenever an key-eviction takes place, is there way to know which keys are evicted?
Using this information, I would like to build a system where evicted keys are streamed to another database.
2
Answers
Did you take a look at Redis keyspace notifications. https://redis.io/docs/manual/keyspace-notifications/
With the RedisGears module you can react to these keyspace notifications.
In RedisGears 2 you can register your consumer, and then push information from there to the stream. But this is happening after the eviction has happened.
There is an extensive get started in the RedisGears repository.