Redis configuration – data management
To manage data in Redis, it's important to understand the application we are trying to build. Since the gossip server is meant to be a Config server, the reads are will be more than the writes. Redis provides a couple of data persistence mechanisms that we have already dealt with in the previous chapters, and the current section can act as a refresher. The mechanisms that Redis provides are the following:
The RDB option
The AOF option
VM over commit memory (LINUX environments only)
The RDB option
The RDB option provides a mechanism to take a snapshot of the data at regular intervals. Since this is a periodic activity, which dumps the data into the dump.rdb
file, it makes it a good option to take data backups. For our current application, the configuration in the redis.conf
file for RDB can be one of the following:
save 60 10
: This will save data every 1 minute if 10 keys have changedsave 900 10
: This will save data every 15 minutes if 1 key has changed