Redis persistence
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.