RDB stands for Redis Database Backup, which is a snapshot file format used to save the state of the Redis database to disk.
Click to reveal answer
beginner
What is the purpose of 'save intervals' in Redis RDB configuration?
Save intervals define when Redis automatically creates a snapshot of the database based on time and the number of changes made.
Click to reveal answer
intermediate
How is a save interval configured in the Redis configuration file?
Using the 'save' directive, for example: save 900 1 means save after 900 seconds if at least 1 key changed.
Click to reveal answer
intermediate
What happens if you set multiple save intervals in Redis?
Redis will save the database snapshot if any of the conditions are met, for example: save 900 1 save 300 10 save 60 10000 means save after 900 seconds if 1 change, or 300 seconds if 10 changes, or 60 seconds if 10000 changes.
Click to reveal answer
intermediate
How can you disable automatic RDB snapshots in Redis?
By removing all 'save' directives from the configuration file or commenting them out, Redis will not create automatic snapshots.
Click to reveal answer
What does the Redis configuration line 'save 600 100' mean?
ASave the DB every 600 seconds regardless of changes
BSave the DB every 100 seconds if at least 600 keys changed
CSave the DB every 100 seconds regardless of changes
DSave the DB every 600 seconds if at least 100 keys changed
✗ Incorrect
The format is 'save ', so it saves after 600 seconds if 100 or more keys changed.
If you want Redis to never save snapshots automatically, what should you do?
ASet 'save 1 1' in the config
BSet 'save 0 0' in the config
CRemove or comment out all 'save' lines
DSet 'save 3600 1000' in the config
✗ Incorrect
Removing or commenting out all 'save' lines disables automatic snapshots.
Which of these is NOT a valid Redis save interval configuration?
Asave 60 0
Bsave 300 10
Csave 60 10000
Dsave 900 1
✗ Incorrect
The number of changes must be greater than zero; 'save 60 0' is invalid.
What file does Redis create when it saves an RDB snapshot?
Adump.rdb
Bredis.rdb
Csnapshot.rdb
Dsave.rdb
✗ Incorrect
Redis saves snapshots to a file named 'dump.rdb' by default.
If Redis is configured with 'save 900 1' and 'save 300 10', when will it save?
AOnly after 300 seconds if 10 changes
BAfter 900 seconds if 1 change OR after 300 seconds if 10 changes
COnly after 900 seconds if 1 change
DAfter 300 seconds regardless of changes
✗ Incorrect
Redis saves if any save condition is met.
Explain how Redis uses save intervals to create RDB snapshots.
Think about how Redis decides when to save based on time and changes.
You got /5 concepts.
Describe how to disable automatic RDB snapshots in Redis and why you might want to do that.
Consider what happens if Redis never saves snapshots automatically.
You got /3 concepts.
Practice
(1/5)
1. What does the Redis save configuration option control?
easy
A. The port Redis listens on
B. The maximum memory Redis can use
C. When Redis automatically saves snapshots of the dataset
D. The password required to connect to Redis
Solution
Step 1: Understand the purpose of save in Redis
The save option defines intervals for automatic snapshot saving.
Step 2: Identify what save controls
It controls when Redis saves data snapshots based on time and changes.
Final Answer:
When Redis automatically saves snapshots of the dataset -> Option C
Quick Check:
RDB save intervals = automatic snapshot timing [OK]
Hint: Remember: save sets snapshot save timing [OK]
Common Mistakes:
Confusing save with memory limits
Thinking save sets connection ports
Assuming save controls authentication
2. Which of the following is the correct syntax to save Redis data every 300 seconds if at least 10 keys changed?
easy
A. save 10 300
B. save 300 10
C. save 300,10
D. save 10;300
Solution
Step 1: Recall Redis save syntax
The syntax is save <seconds> <changes> without commas or semicolons.
Step 2: Match the correct order
Time in seconds comes first, then number of changes.
Final Answer:
save 300 10 -> Option B
Quick Check:
Correct syntax = save seconds changes [OK]
Hint: Syntax is: save seconds changes (space separated) [OK]
Common Mistakes:
Swapping seconds and changes order
Using commas or semicolons instead of spaces
Omitting one of the two required values
3. Given the Redis config lines: save 900 1 save 300 10 What happens if 5 keys change within 400 seconds?
medium
A. Redis does not save a snapshot because 10 changes were not reached
B. Redis saves a snapshot after 300 seconds because 10 changes are needed
C. Redis saves a snapshot immediately after 5 changes
D. Redis saves a snapshot after 900 seconds because 1 change triggers it
Solution
Step 1: Analyze each save interval
First interval: save every 900 seconds if at least 1 change. Second interval: save every 300 seconds if at least 10 changes.
Step 2: Check conditions for 5 changes in 400 seconds
5 changes < 10, so second interval not triggered. 900 seconds not reached yet, so first interval not triggered either.
Final Answer:
Redis does not save a snapshot because 10 changes were not reached -> Option A
Quick Check:
5 changes in 400s does not meet any save condition [OK]
Hint: Check each interval separately for time and changes [OK]
Common Mistakes:
Assuming 5 changes triggers 10-change interval
Ignoring the time condition for the first interval
Thinking Redis saves immediately after changes
4. You wrote this Redis config line: save 60,5 Why does Redis ignore this setting?
medium
A. Because commas are invalid; spaces must separate values
B. Because 5 changes is too low to trigger saving
C. Because 60 is not a valid time value
D. Because save intervals must be in milliseconds
Solution
Step 1: Check syntax of save line
Redis requires space-separated values, not commas.
Step 2: Understand why commas cause ignoring
Commas make the line invalid, so Redis skips it.
Final Answer:
Because commas are invalid; spaces must separate values -> Option A
Quick Check:
Use spaces, not commas in save intervals [OK]
Hint: Use spaces, never commas, between save parameters [OK]
Common Mistakes:
Thinking commas are allowed separators
Believing time must be in milliseconds
Assuming low changes disables saving
5. You want Redis to save a snapshot if either: - 5 keys changed in 60 seconds - OR 100 keys changed in 900 seconds Which configuration lines achieve this?
hard
A. save 900 5\nsave 60 100
B. save 5 60\nsave 100 900
C. save 60 100\nsave 900 5
D. save 60 5\nsave 900 100
Solution
Step 1: Match time and changes correctly
Format is save <seconds> <changes>. So 60 seconds and 5 changes is save 60 5. 900 seconds and 100 changes is save 900 100.
Step 2: Verify both conditions are separate lines
Each condition must be on its own save line.
Final Answer:
save 60 5
save 900 100 -> Option D
Quick Check:
Time first, changes second per line [OK]
Hint: Write each interval on its own line: save seconds changes [OK]
Common Mistakes:
Swapping seconds and changes
Putting both intervals on one line
Using commas or semicolons instead of spaces
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.