0
0
Redisquery~20 mins

AOF (Append Only File) in Redis - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Redis AOF Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What is the primary purpose of Redis AOF?

Redis uses AOF (Append Only File) for a specific reason related to data persistence. What is the main goal of using AOF in Redis?

ATo compress the database files to save disk space
BTo log every write operation received by the server for data recovery
CTo replicate data to other Redis servers in real-time
DTo store only the latest snapshot of the database
Attempts:
2 left
💡 Hint

Think about how Redis can recover data after a restart.

query_result
intermediate
2:00remaining
What happens if Redis AOF file is corrupted?

Consider Redis configured to use AOF persistence. If the AOF file becomes corrupted, what will Redis do when it tries to load the data on startup?

ARedis will refuse to start and show an error about AOF corruption
BRedis will automatically fix the corrupted AOF file and start normally
CRedis will ignore the AOF file and start with an empty dataset
DRedis will load the last RDB snapshot instead of the AOF file
Attempts:
2 left
💡 Hint

Think about Redis's safety checks when loading persistence files.

📝 Syntax
advanced
2:00remaining
Which Redis configuration line correctly enables AOF with fsync every second?

Choose the correct Redis configuration line to enable AOF persistence and set fsync policy to sync every second.

Aappendonly yes\naof-fsync everysec
Bappendonly yes\naof-fsync no
Cappendonly no\naof-fsync everysec
Dappendonly yes\naof-fsync always
Attempts:
2 left
💡 Hint

Check the exact spelling and values for enabling AOF and fsync policy.

optimization
advanced
2:00remaining
How to reduce AOF file size without losing data?

You notice your Redis AOF file is growing very large. Which method safely reduces the AOF file size while preserving all data?

ADisable AOF and rely only on RDB snapshots
BDelete the AOF file and restart Redis to create a new one
CRun the BGREWRITEAOF command to rewrite the AOF file compactly
DManually edit the AOF file to remove old commands
Attempts:
2 left
💡 Hint

Think about a Redis command designed to optimize AOF files safely.

🔧 Debug
expert
2:00remaining
Why does Redis AOF rewrite sometimes fail to reduce file size?

After running BGREWRITEAOF, you notice the AOF file size did not decrease as expected. What is the most likely reason?

AThe AOF file was corrupted before rewriting
BRedis was not restarted after the rewrite command
CBGREWRITEAOF only works if appendonly is set to no
DThe dataset has many keys with large values that cannot be further compressed
Attempts:
2 left
💡 Hint

Consider what affects the size of the rewritten AOF file.