What method offered to guarantee data durability in Redis?

905 views Asked by At

I checked Redis and I am curious how the database (which stores all data in volatile memory) offer data durability on system crash situation.

3

There are 3 answers

1
Fernando Diaz Garrido On

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

0
Tom Clarkson On

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.

0
Tobias P. On

Have a look at the different persistence options in redis and how they guaranteee which level of durability