Database services in the persistent data storage, data backup can do both, but also aspects of data transmission.
There are two main ways:
A. Create a snapshot
Mysql snapshot
of Mysql dump tool, you can export data to a .sql file by this sql file, it can be used for data recovery.
$ mysqldump -h xxx -uroot -p databasename > ~/data_backup/database.sql
Redis of rdb
Redis client Transmit save / bgsave instruction, creates rdb file
127.0.0.1:6379> save
127.0.0.1:6379> bgsave
II. Record writes logs (inset / update / delete)
Mysql's binlog
Redis of aof