I’ve used redis before but have encountered a sticky situation. We have a redis server with 6 databases. We’ve maxed out our maxmemory and it’s a hodpepodge of applications on this single instance. One of our applications which has logic where it should not EVER evict a key from a specific database (lets say it’s db4). I don’t believe you can tell Redis to have a policy like don’t ever evict from this db, can you?
I could see two solutions but have questions on both:
- create a replica of db4 that has sufficient memory so that keys in the replica will never evict. Is there a way to prevent eviction in this new db? Once caught up, point app to new redis instance and make replica standalone. Would that work?
- stop writes to redis instnace; dump all the databases via SAVE (can’t save a single database) and bring up in new instance, delete out the other databases and point app to this new redis instance.