0

I'm new to Redis, but lately they've started to promote the idea of using Redis as a general purpose persistent db, instead of mainly for cache. I think this would be a good fit for an app I want to write.

The issue is: I need more memory (let's say 3Gb) than what I'll have available in RAM (say, 2Gb). Redis runs entirely in RAM if I'm not mistaken ("data sets can't be larger than memory"). However, most of the data will only need to be seldomly accessed. I need all data to persist, but I'd need >1Gb present all time, the rest could be evicted.

Question: Only using Redis, is it possible to have a larger data set persist as disk storage, but only load a subset of keys to RAM and evict less-frequently-used keys as needed to make space for new less-frequenly-used keys? I don't want to evict keys and then have them deleted or not stored in disk storage.

Apparently, there used to be a swap or virtual memory option, but it's now deprecated.

flen
  • 101
  • 1
  • It doesn't seem to be possible... disk storage seems to be just for images of the whole db. It's a pity, but one can always pair it up with another disk based db – flen Jun 25 '22 at 05:52
  • we can not usually help with your [capacity planning](https://serverfault.com/questions/384686/can-you-help-me-with-my-capacity-planning) but if you already aware of this, that you want redis, then you might also want to use a server with enough capacity for handling this. I would think since this is a more relevant question for stackoverflow.com, because in the end IMHO you seems to try to fix a [x and y problem](https://faq-database.de/doku.php?id=en:x-and-y-problem) redis might work for you but consider other options. maybe a standard database with a sql Db might a option – djdomi Jun 25 '22 at 07:28
  • @djdomi Thanks! I was in doubt as to whether I should post it there, but thought it could make more sense to post it here. On second thought, I think Redis employees monitor SO, not sure if it they also monitor other SE stacks. But in regard to my question, it may be possible after all: https://redis.com/redis-enterprise/technology/redis-on-flash/ – flen Jun 25 '22 at 07:41

0 Answers0