So in this session we are going to discuss about Redis Clustering. So Redis Clustering needs a minimum
of six servers. In order for you to set up Redis Cluster.
Okay.
The reason why we need six servers are, we need minimum of 3 Masters and we need minimum of 3
Slaves.
So here you see on the screen, we have Master one and then we have Master two and Master three.
And each of these masters are replicating its data to its corresponding slaves.
Now what happens when a Master goes down. Ok when a Master goes down in that case its corresponding Slave
is going to become the Master and the Cluster will continue working.
Now what happens at the same time one of the Slave Node goes down.
So basically Slave Node goes down, there is not going to be any change.
Everything is going to continue working as it is. Only when the Master is down, Slave takes care of the
role of Master.
However if a Slave goes down, you do not notice anything.
Now let's talk about some of the key points of Redis Clustering.
So as you see here Redis Cluster is a Multiple Master Architecture.
So basically we have multiple masters and now we are no longer limited to the ability of having a Single
Master. Unlike we had in the case of Sentinels and internally data is partitioned into 16000 buckets
and each server keeps or holds some number of buckets.
So in this case since we had three servers. 16000 buckets are going to be divided by 3 because that's
the total number of Master Nodes we have.
And then whatever the number comes, that is the number which each of them Master Node is going to hold
In terms of buckets.
So what happens when you perform a write operation.
So when you perform a write operation. Keys # values determined
And that's how they come to know which is the Master Server, which is holding that data.
So again this is internal working and this is something that you don't need to worry about.
This is how data is or how the processing is taken care internally.
So basically your data is partitioned into total number of available nodes.
Now if we talk about pros of setting up Redis Cluster.
So basically you can see this is highly scalable and it has the ability to scale up to 1000 nodes. Performance
in Redis Cluster is very good, because you have Multiple Masters and if one of them master goes down, the
other Slave is going to take care of the role of Master. Now when we talk about some of the Cons.
So basically we need minimum of 6 Servers, in order to set up a Cluster.
OK.
If you are having one node or only two nodes, in that case you won't be able to set up a Cluster.
So from the Infrastructure Point of view, Yes, you need more number of servers, in order to set up Redis
Cluster.
And once you are on Redis cluster and you want to downgrade to Redis Sentinel or whatever.
You won't be able to do that.
So once you are on Redis cluster, you have to stay on Redis cluster. So in next session we will discuss
about setting up Redis Cluster and we will also set up Redis Cluster in a demo environment and we will
see how it is going to function.