关于redis的持久化方案
Redis中所有的key和value默认加载到内存中,为了数据的不丢失,把数据进行持久化,通常会把数据落地磁盘。
第一种持久化方案(默认rdb)
In the example below the behaviour will be to save:
# after 900 sec (15 min) if at least 1 key changed
# after 300 sec (5 min) if at least 10 keys changed
# after 60 sec if at least 10000 keys changed
对于数据不敏感,可以用这种方式,可以会丢数据,但效率高。(减少I/o操作)。
第二种持久化方案 (aof 快照式)
修改redis.conf
对数据特别敏感,保证不能丢数据。效率低(增加I/o操作)