Redis persistence

来自WHY42
Riguz留言 | 贡献2021年6月28日 (一) 13:23的版本 (建立內容為「Redis提供如下的持久化机制: ;RDB (Redis Database): The RDB persistence performs point-in-time snapshots of your dataset at specified intervals. ;AOF (A…」的新頁面)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

Redis提供如下的持久化机制:

RDB (Redis Database)
The RDB persistence performs point-in-time snapshots of your dataset at specified intervals.
AOF (Append Only File)
The AOF persistence logs every write operation received by the server, that will be played again at server startup, reconstructing the original dataset. Commands are logged using the same format as the Redis protocol itself, in an append-only fashion. Redis is able to rewrite the log in the background when it gets too big.
No persistence
If you wish, you can disable persistence completely, if you want your data to just exist as long as the server is running.
RDB + AOF
It is possible to combine both AOF and RDB in the same instance. Notice that, in this case, when Redis restarts the AOF file will be used to reconstruct the original dataset since it is guaranteed to be the most complete.