Snapshot takes the data as it exists at one moment in time & writes it to the disk, will be written to the file referenced as “dbfilename”.
There are 5 steps to initiate snapshots.
BGSAVE : When redis client initiate BGSAVE, redis will create a fork so that child process will write a the snapshot to the disk where master interacts with commands.
SAVE : When redis client initiate SAVE, redis will stop responding any commands until snapshot completes
From Configuration Files:
Example : Configuration as SAVE 60 10000
BGSAVE will be called if 10000 writes occure within 60 seconds
SHUTDOWN : When redis client sends a SHUTDOWN, redis will perform SAVE operations, blocks all operations, shutdowns later.
Sync with other Redis : If a Redis server connects to another server, it issues SYNC, then master Redis will start BGSAVE.