Redis AOF Persistence Configuration Guide
This guide explains Redis AOF persistence settings, including default options, the three synchronization strategies (no, always, everysec), and practical recommendations such as enabling AOF on slaves for critical data while keeping masters free of persistence work.
The article starts with a promotional invitation to follow the “DevOps Architecture Practice” account and share the post to receive daily technical content.
It then introduces Redis persistence via the Append‑Only File (AOF) mechanism, noting that the default setting is appendonly no, which writes data to disk asynchronously and may lose the latest changes after a crash.
If stronger durability is required, the appendonly mode should be enabled so that every write operation is recorded in the appendonly.aof file, which is replayed on startup to rebuild the dataset. The AOF file name can be set with appendfilename appendonly.aof.
The default synchronization policy is appendfsync everysec, which performs an fsync every second, balancing performance and safety.
Redis provides three AOF synchronization strategies:
no : No explicit fsync; the operating system decides when to flush data, offering the best performance but the weakest durability.
always : An fsync is performed after every write to the AOF file, ensuring maximum safety at the cost of significant performance loss.
everysec : An fsync is executed once per second (the default), which is generally the best compromise between speed and reliability.
For most scenarios, everysec is recommended; use no only when performance is critical and data loss is acceptable, or always when absolute data safety is required.
Simple summary:
Masters should avoid any persistence work, including both snapshots and AOF, to keep them lightweight.
For critical data, enable AOF on a slave with the everysec synchronization policy.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Practical DevOps Architecture
Hands‑on DevOps operations using Docker, K8s, Jenkins, and Ansible—empowering ops professionals to grow together through sharing, discussion, knowledge consolidation, and continuous improvement.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
