Snapshot Backup
Snapshot backups in Redis are taken using the SAVE and BGSAVE commands.
1. SAVE: The SAVE command is a synchronous operation that blocks Redis while it creates a snapshot of the dataset. During this time, Redis won’t respond to other commands, so it’s typically not recommended for production systems.
Syntax: SAVE
Example:
redis-cli
127.0.0.1:6379> SAVE
OK
2. BGSAVE: The BGSAVE command is an asynchronous operation that creates a snapshot in the background, allowing Redis to continue serving other requests during the backup process.
Syntax: BGSAVE
Example:
redis-cli
127.0.0.1:6379> BGSAVE
Background saving started
Complete tutorial on Backup in Redis
A Redis backup is a copy of the Redis dataset that is saved to a separate location, typically on disk, to provide a means of data recovery.
- Redis provides several commands and mechanisms to perform backups, including snapshots and persistence options.
- While Redis is known for its high performance and low latency, it’s important to have a backup strategy in place to ensure data durability and recoverability in case of data loss or system failures.
Contact Us