Persistent Redis containers
By default, Redis Server saves snapshots of the data on disk using a binary file called dump.rdb
as configured in the default configuration file. The Redis containers we've created so far are not persistent. For example, if the container is removed or stopped all the data saved by the container is lost. Sometimes we would want to have a copy of the database even after the container exits. Redis provides an option to alter the offline database file location (and name) so that we can backup/archive the latest database before the container exits. This provides a very good disaster recovery mechanism because all we need to backup is a single compact file which can be easily transferred and restored in a different location. In the previous chapter, we have learnt to use the host's storage to build scalable storage spaces called volumes which can be managed outside the running container from the host's filesystem. The following steps show how to use volumes to create...