Redis uses AOF (Append Only File) for a specific reason related to data persistence. What is the main goal of using AOF in Redis?
Think about how Redis can recover data after a restart.
AOF logs every write operation so Redis can replay these commands to rebuild the dataset after a restart, ensuring data durability.
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?
Think about Redis's safety checks when loading persistence files.
If the AOF file is corrupted, Redis will detect this and refuse to start to avoid loading inconsistent data. Manual repair or recovery is needed.
Choose the correct Redis configuration line to enable AOF persistence and set fsync policy to sync every second.
Check the exact spelling and values for enabling AOF and fsync policy.
To enable AOF, 'appendonly yes' is required. To fsync every second, the correct setting is 'appendfsync everysec'.
You notice your Redis AOF file is growing very large. Which method safely reduces the AOF file size while preserving all data?
Think about a Redis command designed to optimize AOF files safely.
BGREWRITEAOF rewrites the AOF file in a compact form by removing redundant commands, preserving all data safely.
After running BGREWRITEAOF, you notice the AOF file size did not decrease as expected. What is the most likely reason?
Consider what affects the size of the rewritten AOF file.
If the dataset contains many large keys or complex data, the rewritten AOF file may not be much smaller because all data must be saved.