1
00:00:00,180 --> 00:00:07,200
One of the advantages of ElasticSearch is that it's easily scalable, we can replicate it easily in

2
00:00:07,210 --> 00:00:14,050
communities we deploy replicated database applications, always using stateful set component.

3
00:00:14,400 --> 00:00:14,970
Why?

4
00:00:15,180 --> 00:00:22,010
Because Stateful Said has an additional mechanism that helps manage the replicas in the cluster database.

5
00:00:22,440 --> 00:00:31,530
For example, it gives a master database and the slave databases their own sticky identities, so each

6
00:00:31,530 --> 00:00:35,880
replica knows its role even after it dies and gets recreated.

7
00:00:36,450 --> 00:00:43,440
It also supports directly addressing the master for right requests using a service name.

8
00:00:43,890 --> 00:00:51,480
And this is important because Master is the only one allowed to write to the data so that no data inconsistency

9
00:00:51,480 --> 00:00:52,020
happens.

10
00:00:52,290 --> 00:01:00,270
Stateful said also supports reattaching the right storage to the restarted pod when he dies, because

11
00:01:00,270 --> 00:01:06,990
instead of all applications, as the name suggests, each pod will have a state and when it restarts,

12
00:01:06,990 --> 00:01:10,920
it will need the old state to continue from where it left off.

13
00:01:11,290 --> 00:01:17,640
And since the state is stored in the volume with external storage, it's important that the same storage

14
00:01:17,820 --> 00:01:26,340
with the previous state gets reattached to the same pod when it dies and gets recreated so that it can

15
00:01:26,340 --> 00:01:29,610
load its previous state and continue where it left off.

16
00:01:30,150 --> 00:01:33,390
In comparison, deployment doesn't care about all this stuff.

17
00:01:33,630 --> 00:01:36,660
It manages and replicate stateless applications.

18
00:01:36,930 --> 00:01:42,240
So when parts of such application restart, they always start from a fresh new state.

19
00:01:42,540 --> 00:01:45,440
Also, there is no master or slave in the set up.

20
00:01:45,450 --> 00:01:53,700
Each pod replica of stateless application is identical, so there's no complexity of replicating these

21
00:01:53,700 --> 00:01:54,660
kind of applications.

22
00:01:55,260 --> 00:01:59,310
And that's the difference between deployment and stateful, said component's.
