Redis replication and redis sharding (cluster) difference

后端 未结 2 1869
庸人自扰
庸人自扰 2021-01-29 23:09
  1. Anyone know the difference between redis replication and redis sharding?
  2. What are they use for? Redis stores data in memory, how does this affect replication/sha
2条回答
  •  你的背包
    2021-01-29 23:31

    In simple words, the fundamental difference between the two concepts is that Sharding is used to scale Writes while Replication is used to scale Reads. As Alex already mentioned, Replication is also one of the solutions to achieve HA.

    Yes, they are both typically used together if you consider how shards can be replicated across nodes in a cluster.

    With regard to your third question, instead of the RAM-flush option, it is a better idea to use the Redis Append Only File (AOF). At only a minor cost (in terms of write speed), you get a lot more reliability of your writes. It is quite like the mysql binary log. The 1 fsync/second is the recommended option to use.

提交回复
热议问题