Hacker News new | ask | show | jobs
by marcc 5466 days ago
But Redis should have at least as much RAM as you have data and will only use the data from RAM. You cannot swap or store it on a slower disk, while Mongo can use a disk file.

Redis can backup or journal to disk, but this is just so the data is persistent between restarts, not used in queries or runtime.

* Updated based on comments: I originally wrote that redis requires as much ram as data (technically more) but I'm correcting this to state that Redis CAN use disk, but Salvatore, the man behind redis, publicly states that he does not recommend it as a solution.

2 comments

This is incorrect. Redis can swap out to virtual memory when it runs out of RAM. Although, it should be leveraged with some care (http://news.ycombinator.com/item?id=2606096)
Thank you for the link. I actually do remember reading that, and I guess I completely forgot it was even possible. After reading about it, I told myself that redis will be in-memory only for the solution I was using it for. I'd definitely be curious to see some real world performance numbers for redis using the disk VM before considering it an option.
Ah okay, that makes a lot more sense. Not sure who downvoted you but thanks for explaining it.
I did because it was wrong.
Technically it was wrong but practically it was not. see: http://news.ycombinator.com/item?id=2606096

In particular: "I trust Redis-on-disk every day less." --antirez (author of redis)

which he then qualifies in the comments as some slim use-case where it makes sense to have redis persist data to disk.

In short, it's not the intended use-case and you damned well better know what you are doing.