Search code examples
redisredis-cluster

Can I have 2 stage redis backup using free redis?


I am new to redis, still reading doc, hope you could help me here.

I need a 2-stage database solution:

  • At local devices, there is a database cluster. It has several primaries and several replicas. To my understanding each primary or replica normally has a portion of the whole data set. This is called data sharding.
  • At cloud, there is another database replica. This cloud replica backs up the whole data set.

I like to use free redis for this solution, not enterprise version.

Is this achievable? From what I read so far, it seems that there is no problem if the cloud replica is just like local replica to back up a portion of data set. So I want to know whether I can use the cloud database to back up the whole cluster.

Thanks!


Solution

  • Nothing prevents you from having a replica hosted in the cloud, but each Redis cluster node is either a master responsible of a set of key slots (shards) or a replica of a master; in a multi-master scenario there is no way to have a single replica covering different master nodes.

    With the goal of having your entire cluster data replicated in the cloud, you should configure and host there one additional Redis replica per each master node. To avoid those new replicas to ever become masters themselves, you can set their cluster-replica-no-failover configuration property accordingly in their redis.conf files:

    cluster-replica-no-failover yes

    In all cases, please note that replication is not a backup solution and you may want to pair your setup with a proper Redis persistence mechanism.