[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-05。"],[],[],null,["# About AOF persistence\n\nThis page provides an overview of AOF persistence for Memorystore for Valkey.\n\nMemorystore for Valkey also supports RDB persistence, but you must choose either the\nAOF or RDB persistence mode, because both can't be enabled at the same time. For\ninformation about choosing between the two persistence modes, see [Persistence overview](/memorystore/docs/valkey/persistence-overview).\n\nFor the best possible instance availability, we recommend using a [highly available instance](/memorystore/docs/valkey/ha-and-replicas)\nin addition to enabling persistence.\n\nTo learn how to enable, disable, and monitor AOF persistence, see [Manage persistence](/memorystore/docs/valkey/manage-persistence).\n\nAOF persistence overview\n------------------------\n\nThe AOF persistence mode prioritizes data durability. It durably stores data by\nrecording every write command to a log file called the AOF file. If a system\nfailure or restart occurs, the server replays AOF file commands sequentially to\nrestore your data. Unlike RDB persistence, AOF persistence can't be paused.\n| **Note:** If you [enable or disable AOF persistence](/memorystore/docs/valkey/manage-persistence#enable_aof_persistence_for_an_existing_instance) for an existing instance, then the instance might need to perform [maintenance](/memorystore/docs/valkey/about-maintenance).\n\n### Sync setting\n\nThe sync setting (`appendfsync`) for the AOF persistence mode determines how\noften the cached data in memory is saved to durable storage. We recommend\nkeeping the sync setting at 1 second, which is the default. Syncing every second\nprovides the best compromise between instance performance, and data durability.\n\nBefore the AOF logs are saved to durable storage, they are stored in memory by the operating system, and\nif a system failure or restart occurs during this time, the writes in memory can\nbe lost. The sync setting lets you choose how often data is saved to durable\nstorage, and provides the following options:\n\n- `always` - This option saves data to storage for every write.\n- `everysec` - This option saves data to storage every second.\n- `no` - This option relies on the operating system to flush data to disk on its own schedule, which typically happens every 30 seconds.\n\nChoosing to sync for every write provides the best data durability, however this\ncomes with a performance tradeoff. We recommend syncing every second, which\nprovides both good data durability and performance."]]