I checked Redis and I am curious how the database (which stores all data in volatile memory) offer data durability on system crash situation.
What method offered to guarantee data durability in Redis?
879 views Asked by eonil AtThere are 3 answers
Saving to disk happens on a timer, so with a single node there is potential to lose writes since the last save.
If you don't want to lose anything if a node crashes, set up a slave node so all changes are mirrored as they happen. Losing data is much less likely if it requires multiple nodes to fail at the same time.
You also have the option of saving really often or in log form, and the disk storage model in the next version offers some more options, but any system that has to do a disk write before a command is considered successful will be a lot slower than one that is allowed to keep changes in memory until a background save system catches up.
Have a look at the different persistence options in redis and how they guaranteee which level of durability
From what I understand Redis writes the database to disk from time to time, for this reason it doesn't provide 100% crash recovery by design