0
0
Redisquery~20 mins

Persistence and performance trade-off 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
Understanding Redis Persistence Options

Which Redis persistence method offers the best balance between data durability and write performance?

ARDB snapshots taken at intervals
BAOF with every write fsync
CAOF with fsync every second
DNo persistence enabled
Attempts:
2 left
💡 Hint

Consider how often data is saved and the impact on write speed.

query_result
intermediate
2:00remaining
Result of Redis Command with Persistence Disabled

Assuming Redis is running with persistence disabled, what will be the result after a server restart if the following commands were executed before restart?

SET key1 value1
SET key2 value2

What will be the value of GET key1 after restart?

Anil
B"value1"
CError: key not found
D"value2"
Attempts:
2 left
💡 Hint

Think about what happens to data when persistence is off and the server restarts.

📝 Syntax
advanced
2:00remaining
Identify the Correct Redis Configuration for Minimal Data Loss

Which Redis configuration snippet ensures minimal data loss while maintaining reasonable performance?

save 900 1
save 300 10
save 60 10000
appendonly yes
appendfsync everysec
Redis
appendonly yes
appendfsync everysec
save 900 1
save 300 10
save 60 10000
A
appendonly yes
appendfsync always
save 900 1
save 300 10
save 60 10000
B
appendonly yes
appendfsync everysec
save 900 1
save 300 10
save 60 10000
C
appendonly yes
appendfsync no
save 900 1
save 300 10
save 60 10000
D
appendonly no
save 900 1
save 300 10
save 60 10000
Attempts:
2 left
💡 Hint

Check which appendfsync option balances durability and performance.

optimization
advanced
2:00remaining
Optimizing Redis for High Write Throughput with Persistence

You want to optimize Redis for high write throughput but still keep data safe in case of crashes. Which approach is best?

AEnable RDB snapshots only with frequent saves
BDisable persistence and rely on replication only
CEnable AOF with appendfsync always
DEnable AOF with appendfsync everysec and tune RDB snapshot intervals
Attempts:
2 left
💡 Hint

Think about balancing disk writes frequency and snapshot overhead.

🔧 Debug
expert
2:00remaining
Diagnosing Data Loss Despite Persistence Enabled

A Redis server has appendonly yes and appendfsync everysec set, but after a crash, some recent writes are lost. What is the most likely cause?

Aappendfsync everysec allows up to 1 second of data loss on crash
BThe AOF file was corrupted and Redis could not recover it
CRDB snapshots overwrite the AOF file causing data loss
DRedis was running without enough memory causing eviction
Attempts:
2 left
💡 Hint

Consider how appendfsync everysec works during crashes.