Which Redis persistence method offers the best balance between data durability and write performance?
Consider how often data is saved and the impact on write speed.
AOF with fsync every second provides a good trade-off by saving data frequently enough to avoid large data loss, while not slowing down writes as much as fsync on every write.
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?
Think about what happens to data when persistence is off and the server restarts.
With persistence disabled, all data is stored only in memory. After a restart, memory is cleared, so GET key1 returns nil.
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
appendonly yes appendfsync everysec save 900 1 save 300 10 save 60 10000
Check which appendfsync option balances durability and performance.
Setting appendonly yes with appendfsync everysec enables AOF persistence with fsync every second, minimizing data loss and keeping performance reasonable.
You want to optimize Redis for high write throughput but still keep data safe in case of crashes. Which approach is best?
Think about balancing disk writes frequency and snapshot overhead.
Using AOF with fsync every second reduces disk I/O overhead compared to always fsync, while RDB snapshots provide backups. This balances throughput and durability.
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?
Consider how appendfsync everysec works during crashes.
appendfsync everysec flushes data to disk every second, so up to one second of writes can be lost if a crash happens before the flush.