1.redis持久化方案
rdb:可以设置间隔多长时间保存一次(Redis不用任何配置默认的持久化方案)
优点:让redis的数据存取速度变快
缺点:服务器断电时会丢失部分数据(数据的完整性得不到保证)
aof:可以设置实时保存
优点:持久化良好,能包装数据的完整性
缺点:大大降低了redis系统的存取速度
2. 主从复制:
使用了心跳检测机制,主从复制必须使用rdb持久化方式
从服务器一般是只读的,保证主服务器和从服务器的数据一致性