0
0
Redisquery~20 mins

Combined RDB + AOF in Redis - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Redis Persistence Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Why use both RDB and AOF in Redis?
Redis supports two persistence methods: RDB snapshots and AOF logs. What is the main advantage of combining both methods for data durability?
AIt provides faster recovery by loading a snapshot and then replaying recent commands from the AOF log.
BIt reduces memory usage by storing data only in RDB files and ignoring AOF logs.
CIt disables data persistence to improve performance during peak loads.
DIt automatically compresses data to save disk space without any data loss.
Attempts:
2 left
💡 Hint
Think about how snapshots and logs complement each other in restoring data.
query_result
intermediate
2:00remaining
Result of Redis persistence config
Given this Redis configuration snippet:
save 900 1
save 300 10
save 60 10000
appendonly yes
aof-use-rdb-preamble yes

What does enabling aof-use-rdb-preamble yes do when Redis restarts?
ARedis ignores the RDB snapshot and loads only the AOF file.
BRedis loads the RDB snapshot first, then replays the AOF commands recorded after the snapshot.
CRedis disables AOF and uses only RDB snapshots for persistence.
DRedis merges RDB and AOF files into a single file for faster loading.
Attempts:
2 left
💡 Hint
Consider how the RDB preamble affects the AOF loading process.
📝 Syntax
advanced
2:00remaining
Identify the invalid Redis config line
Which of the following Redis configuration lines is invalid when combining RDB and AOF persistence?
Asave 900 1
Bappendonly yes
Caof-use-rdb-preamble maybe
Dappendfsync everysec
Attempts:
2 left
💡 Hint
Check the allowed values for aof-use-rdb-preamble.
optimization
advanced
2:00remaining
Optimizing Redis restart time with combined persistence
You want to minimize Redis restart time while ensuring no data loss. Which configuration change best achieves this when using both RDB and AOF?
AEnable <code>aof-use-rdb-preamble yes</code> and set <code>appendfsync everysec</code>.
BEnable RDB snapshots only and disable AOF.
CDisable RDB snapshots and rely only on AOF with <code>appendfsync always</code>.
DSet <code>appendfsync no</code> and rely on RDB snapshots every 60 seconds.
Attempts:
2 left
💡 Hint
Think about how the RDB preamble and AOF sync frequency affect restart and durability.
🔧 Debug
expert
2:00remaining
Why does Redis fail to load combined persistence?
A Redis server is configured with:
appendonly yes
aof-use-rdb-preamble yes
save 900 1

On restart, Redis fails with an error about AOF file corruption. Which is the most likely cause?
ARedis does not support using RDB snapshots and AOF together.
BThe <code>aof-use-rdb-preamble</code> option must be set to <code>no</code> when <code>appendonly yes</code> is enabled.
CThe <code>save</code> directive conflicts with <code>appendonly yes</code> causing a syntax error.
DThe AOF file was manually edited and the RDB preamble is corrupted.
Attempts:
2 left
💡 Hint
Consider what happens if the AOF file is manually changed.