Persistence
RDB
  • RDB (Redis Database): The RDB persistence performs point-in-time snapshots of your dataset at specified intervals
  • # Edit /usr/local/etc/redis.conf to configure save, restart redis
    
    CONFIG get dir # find the location of dump.rdb, /usr/local/var/db/redis
    SAVE # manually save a dump.rdb file
    
    save 60 1000 # dump the dataset to disk every 60 seconds if at least 1000 keys changed
                
    AOF
  • AOF (Append Only File), logs every write operation received by the server, that will be played again at server startup, reconstructing the original dataset
  • # Edit /usr/local/etc/redis.conf, change "appendonly no" to "appendonly yes", restart redis
    # once you set appendonly yes in redis.conf, and restart Redis, it will load data from AOF file instead of dump.rdb
                
    No Persistence
  • be able to disable persistence completely
  • RDB + AOF
  • combine both AOF and RDB in the same instance
  • Reference
  • Redis Persistence
  • Redis Knowledge Base
  • Redis Commands
  • Redis Documentation