An RDB snapshot is a point-in-time copy of the Redis database saved to disk. It captures the data at a specific moment, allowing recovery later.
Click to reveal answer
intermediate
How does Redis create RDB snapshots?
Redis creates RDB snapshots by forking the process and saving the data to a dump file without blocking clients for long.
Click to reveal answer
beginner
What is the default file name for Redis RDB snapshots?
The default file name for Redis RDB snapshots is "dump.rdb".
Click to reveal answer
intermediate
When does Redis trigger automatic RDB snapshots?
Redis triggers automatic RDB snapshots based on configured rules like number of changes and time intervals set in the configuration file.
Click to reveal answer
beginner
What is the main advantage of using RDB snapshots?
RDB snapshots provide a compact, point-in-time backup of data that can be used for fast recovery and disaster recovery.
Click to reveal answer
What does an RDB snapshot represent in Redis?
AA log of client connections
BA live stream of all commands executed
CA backup of only keys with expiration
DA point-in-time copy of the database saved to disk
✗ Incorrect
An RDB snapshot is a point-in-time copy of the Redis database saved to disk.
Which file does Redis use by default to store RDB snapshots?
Aredis.log
Bappendonly.aof
Cdump.rdb
Dsnapshot.rdb
✗ Incorrect
Redis saves RDB snapshots by default in the file named dump.rdb.
How does Redis create an RDB snapshot without blocking clients for long?
ABy forking the process to save data in the background
BBy pausing all clients until saving finishes
CBy saving data incrementally every second
DBy sending data to a remote server
✗ Incorrect
Redis forks the process to save the snapshot in the background, minimizing client blocking.
What triggers Redis to create automatic RDB snapshots?
AConfigured rules based on time and number of changes
BEvery client connection
CManual commands only
DWhen memory usage exceeds a limit
✗ Incorrect
Redis creates automatic snapshots based on configured rules like time intervals and number of key changes.
What is a key benefit of using RDB snapshots?
AReal-time replication of data
BFast recovery from a compact backup
CLogging all commands executed
DEncrypting data in memory
✗ Incorrect
RDB snapshots provide a compact backup that allows fast recovery of data.
Explain what an RDB snapshot is and how Redis creates it.
Think about how Redis saves data without stopping clients.
You got /4 concepts.
Describe when and why Redis triggers automatic RDB snapshots.
Consider what settings control snapshot timing.
You got /4 concepts.
Practice
(1/5)
1. What is the primary purpose of an RDB snapshot in Redis?
easy
A. To increase the speed of Redis commands
B. To save the current state of the database at a specific point in time
C. To permanently delete all data from Redis
D. To replicate data to another Redis instance in real-time
Solution
Step 1: Understand what RDB snapshots do
RDB snapshots capture the exact data stored in Redis at a certain moment, creating a backup file.
Step 2: Compare options with snapshot purpose
Only To save the current state of the database at a specific point in time describes saving the database state at a point in time, which matches the snapshot function.
Final Answer:
To save the current state of the database at a specific point in time -> Option B
Quick Check:
RDB snapshot = point-in-time save [OK]
Hint: Snapshots save data state at one moment, like a photo [OK]
Common Mistakes:
Confusing snapshots with real-time replication
Thinking snapshots delete data
Assuming snapshots speed up commands
2. Which Redis command creates an RDB snapshot immediately and blocks the server until done?
easy
A. SAVE
B. BGSAVE
C. RESTORE
D. FLUSHDB
Solution
Step 1: Recall Redis commands for snapshots
SAVE blocks Redis and saves the snapshot immediately; BGSAVE saves in background without blocking.
Step 2: Match command to blocking immediate save
Only SAVE matches the description of immediate blocking snapshot creation.
Final Answer:
SAVE -> Option A
Quick Check:
Immediate blocking snapshot = SAVE [OK]
Hint: SAVE blocks Redis to save snapshot immediately [OK]
Common Mistakes:
Choosing BGSAVE which is non-blocking
Confusing RESTORE with saving snapshots
Thinking FLUSHDB saves data
3. Given the following Redis commands executed in order:
BGSAVE
SET key1 value1
SAVE
SET key2 value2
Which keys will be present in the RDB snapshot created by the SAVE command?
medium
A. Neither key1 nor key2
B. Only key2
C. Only key1
D. Both key1 and key2
Solution
Step 1: Understand timing of BGSAVE and SAVE
BGSAVE starts background save but does not block; SET key1 happens after BGSAVE starts, so key1 may or may not be in that snapshot.
Step 2: SAVE blocks and saves immediately after SET key1
SAVE runs after SET key1 but before SET key2, so the snapshot from SAVE includes key1 but not key2.
Final Answer:
Only key1 -> Option C
Quick Check:
SAVE snapshot = keys before SAVE command [OK]
Hint: SAVE snapshot includes keys set before it runs [OK]
Common Mistakes:
Assuming BGSAVE snapshot includes key1 for sure
Thinking SAVE snapshot includes key2 set after it
Confusing background and immediate saves
4. You run the command BGSAVE but receive an error: "Background save already in progress". What is the best way to fix this?
medium
A. Run FLUSHALL to clear all data and then run BGSAVE
B. Restart the Redis server to clear the background save
C. Run SAVE instead to block and save immediately
D. Wait for the current background save to finish before running BGSAVE again
Solution
Step 1: Understand the error cause
The error means a background save is already running; Redis does not allow multiple concurrent BGSAVE commands.
Step 2: Choose the proper fix
Waiting for the current BGSAVE to finish is the correct approach; running SAVE blocks but is not necessary, restarting or flushing data is extreme and unnecessary.
Final Answer:
Wait for the current background save to finish before running BGSAVE again -> Option D
Quick Check:
Only one BGSAVE at a time allowed [OK]
Hint: Only one BGSAVE runs at once; wait before retrying [OK]
Common Mistakes:
Restarting server unnecessarily
Running SAVE without need
Flushing data to fix save error
5. You want to ensure Redis creates an RDB snapshot every 5 minutes only if at least 100 keys changed. Which configuration snippet correctly sets this behavior in redis.conf?
hard
A. save 300 100
B. save 100 300
C. save 5 100
D. save 300 5
Solution
Step 1: Understand Redis save syntax
The syntax is save <seconds> <changes>, meaning save if at least <changes> keys changed in <seconds> seconds.
Step 2: Match 5 minutes and 100 changes
5 minutes = 300 seconds, so save 300 100 means save every 300 seconds if 100 keys changed.
Final Answer:
save 300 100 -> Option A
Quick Check:
save seconds changes = save 300 100 [OK]
Hint: save syntax: save seconds changes (time then count) [OK]
Common Mistakes:
Swapping seconds and changes values
Using minutes instead of seconds
Misunderstanding save triggers
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.