Database / REDIS
What is AOF persistence in Redis?
AOF (Append Only File) persistence logs every write operation to a file as it happens, in the order it was executed, rather than periodically snapshotting the whole dataset. Recovering from an AOF file means replaying that log of commands from the start to rebuild the exact dataset state.
# redis.conf appendonly yes appendfsync everysec # fsync to disk roughly once per second
The appendfsync setting controls the durability/performance trade-off directly: always fsyncs after every write (safest, slowest), everysec fsyncs about once per second (a common middle-ground default, risking at most ~1 second of writes on a crash), and no lets the OS decide when to flush (fastest, least durable). Because a command-by-command log would grow indefinitely otherwise, Redis periodically performs AOF rewriting, compacting the log into the minimal set of commands needed to reproduce the current dataset, which keeps the file from growing unbounded while preserving the stronger durability AOF offers over RDB snapshots alone.
More Related questions...
