It’s not feasible to do that in a single threaded system. The main drawback of disk persistence is that you need a log of memory to keep the file buffer open and pointers. If the key you’re looking for is not on disk, you’ll get awful results, the rdb format will give you worst then Postgres performance. You have to use another file format to optimize for a larger cache