1
00:00:01,940 --> 00:00:08,380
So in this session we are going to discuss about Redis Clustering.  So Redis Clustering needs a minimum

2
00:00:08,440 --> 00:00:11,910
of six servers.  In order for you to set up Redis Cluster.

3
00:00:12,660 --> 00:00:12,930
Okay.

4
00:00:12,940 --> 00:00:19,210
The reason why we need six servers are, we need  minimum of 3 Masters and we need  minimum of 3

5
00:00:19,210 --> 00:00:20,560
Slaves.

6
00:00:20,560 --> 00:00:25,580
So here you see on the screen, we have Master one and then we have Master two and Master three.

7
00:00:25,810 --> 00:00:32,850
And each of these masters are replicating its data to its corresponding slaves.

8
00:00:32,850 --> 00:00:40,940
Now what happens when a Master goes down.  Ok when a Master goes down in that case its corresponding Slave

9
00:00:40,940 --> 00:00:46,530
is going to become the Master and the Cluster will continue working.

10
00:00:46,550 --> 00:00:50,180
Now what happens at the same time one of the Slave Node goes down.

11
00:00:51,200 --> 00:00:55,000
So basically Slave Node goes down, there is not going to be any change.

12
00:00:55,010 --> 00:01:02,870
Everything is going to continue working as it is.  Only when the Master is down, Slave takes care of the

13
00:01:02,870 --> 00:01:04,300
role of Master.

14
00:01:04,730 --> 00:01:14,770
However if a Slave goes down, you do not notice anything.

15
00:01:14,780 --> 00:01:19,910
Now let's talk about some of the key points of Redis Clustering.

16
00:01:19,960 --> 00:01:23,860
So as you see here Redis Cluster is a Multiple Master Architecture.

17
00:01:24,070 --> 00:01:30,790
So basically we have multiple masters and now we are no longer limited to the ability of having a Single

18
00:01:30,790 --> 00:01:39,460
Master.  Unlike we had in the case of Sentinels and internally data is partitioned into 16000 buckets

19
00:01:39,580 --> 00:01:44,320
and each server keeps or holds some number of buckets.

20
00:01:44,320 --> 00:01:52,300
So in this case since we had three servers. 16000 buckets are going to be divided by 3 because that's

21
00:01:52,300 --> 00:01:55,000
the total number of Master Nodes we have.

22
00:01:55,090 --> 00:02:01,360
And then whatever the number comes, that is the number which each of them Master Node is going to hold

23
00:02:01,360 --> 00:02:03,000
In terms of buckets.

24
00:02:03,430 --> 00:02:06,310
So what happens when you perform a write operation.

25
00:02:06,310 --> 00:02:11,610
So when you perform a write  operation.  Keys # values determined

26
00:02:12,110 --> 00:02:16,940
And that's how they come to know which is the Master Server,  which is holding that data.

27
00:02:16,940 --> 00:02:20,600
So again this is internal working and this is something that you don't need to worry about.

28
00:02:20,600 --> 00:02:26,090
This is how data is or how the processing is taken care internally.

29
00:02:26,090 --> 00:02:34,460
So basically your data is partitioned into total number of available nodes.

30
00:02:34,460 --> 00:02:38,810
Now if we talk about pros of setting up
Redis Cluster.

31
00:02:39,200 --> 00:02:47,330
So basically you can see this is highly scalable and it has the ability to scale up to 1000 nodes. Performance

32
00:02:47,330 --> 00:02:52,890
in Redis Cluster is very good,  because you have Multiple Masters and if  one of them master goes down,  the

33
00:02:52,890 --> 00:03:01,010
other Slave is going to take care of the role of Master.  Now when we talk about some of the Cons.

34
00:03:01,070 --> 00:03:05,120
So basically we need  minimum of 6 Servers,  in order to set up a Cluster.

35
00:03:05,640 --> 00:03:05,940
OK.

36
00:03:05,960 --> 00:03:10,940
If you are having one node or only two nodes, in that case you won't be able to set up a Cluster.

37
00:03:11,120 --> 00:03:16,790
So from the Infrastructure Point of view,  Yes,  you need more number of servers,  in order to set up Redis

38
00:03:16,790 --> 00:03:17,450
Cluster.

39
00:03:18,230 --> 00:03:23,240
And once you are on Redis cluster and you want to downgrade to Redis Sentinel or whatever.

40
00:03:23,240 --> 00:03:25,920
You won't be able to do that.

41
00:03:26,000 --> 00:03:32,210
So once you are on Redis cluster,  you have to stay on Redis cluster.  So in next session we will discuss

42
00:03:32,210 --> 00:03:38,450
about setting up Redis Cluster and we will also set up Redis Cluster in a demo environment and we will

43
00:03:38,450 --> 00:03:40,520
see how it is going to function.
