Database / ValKey Interview questions
What is AOF persistence in Valkey?
AOF (Append Only File) persistence logs every write command, in order, to a file as it happens, and rebuilds the dataset by replaying that log on startup.
How aggressively the log is flushed to disk is controlled by appendfsync: always fsyncs after every write for maximum durability, everysec fsyncs roughly once per second as a balance of safety and speed, and no leaves flushing to the operating system.
Because the log only grows, Valkey periodically runs BGREWRITEAOF to compact it into the smallest set of commands that reproduce the current dataset, keeping restart time and disk usage under control.
More Related questions...