WEBVTT - This file was automatically generated by VIMEO

0
00:00:00.200 --> 00:00:03.600
Hello and welcome to this lecture. This is a quick introduction to

1
00:00:03.200 --> 00:00:06.400
 Etsy for beginners. If you already know

2
00:00:06.400 --> 00:00:09.300
 about hcd feel free to skip this video and head

3
00:00:09.300 --> 00:00:12.500
 over to the next video where we discuss about etsad in

4
00:00:12.500 --> 00:00:13.000
 kubernetes.

5
00:00:13.600 --> 00:00:16.300
We start with a basic introduction to what a key

6
00:00:16.300 --> 00:00:20.100
 value story is and how it is different from traditional databases how

7
00:00:19.100 --> 00:00:22.000
 to quickly get started with hcd and how

8
00:00:22.100 --> 00:00:24.800
 to use the client tool to operate at CV.

9
00:00:25.500 --> 00:00:28.700
Later in this course when we cover High availability. We

10
00:00:28.700 --> 00:00:31.500
 will discuss about what it means to be a distributed system.

11
00:00:31.500 --> 00:00:34.800
 How at City Works in a cluster mode what raft

12
00:00:34.800 --> 00:00:37.200
 protocol is and what are the best practices around the

13
00:00:37.200 --> 00:00:39.100
 number of nodes in an hcd cluster?

14
00:00:40.400 --> 00:00:41.800
So what is hcd?

15
00:00:42.400 --> 00:00:45.600
It is a distributed reliable key value store

16
00:00:45.600 --> 00:00:47.700
 that is simple secure and fast.

17
00:00:48.400 --> 00:00:49.400
So let's break it up.

18
00:00:50.200 --> 00:00:54.300
So what is a key Value Store traditionally databases

19
00:00:53.300 --> 00:00:56.400
 have been in a tabular format? You must

20
00:00:56.400 --> 00:01:00.300
 have heard about SQL or relational databases the

21
00:00:59.300 --> 00:01:02.200
 store data in the form of rows and

22
00:01:02.200 --> 00:01:02.800
 columns.

23
00:01:03.400 --> 00:01:06.600
For example here is a table that stores information regarding

24
00:01:06.600 --> 00:01:07.600
 few individuals.

25
00:01:08.400 --> 00:01:11.700
The row represents each person and the column represents

26
00:01:11.700 --> 00:01:13.700
 the type of information being stored.

27
00:01:14.400 --> 00:01:18.300
Now say we want to add additional details about this individuals. Say

28
00:01:17.300 --> 00:01:20.200
 for example salary, so we add

29
00:01:20.200 --> 00:01:21.200
 an additional column.

30
00:01:22.300 --> 00:01:25.100
Doing so impacts the entire table and all of

31
00:01:25.100 --> 00:01:26.400
 the individuals in them.

32
00:01:26.900 --> 00:01:29.300
We then add salary details to this column.

33
00:01:29.900 --> 00:01:32.100
However, not all of them are working.

34
00:01:32.900 --> 00:01:34.600
So those cells remain empty?

35
00:01:35.500 --> 00:01:38.500
We're then required to store great information. So

36
00:01:38.500 --> 00:01:41.500
 we add a new column and update these students with

37
00:01:41.500 --> 00:01:44.500
 their respective grades again, only students

38
00:01:44.500 --> 00:01:47.500
 have grades. So the corresponding fields for adults

39
00:01:47.500 --> 00:01:48.100
 are empty.

40
00:01:48.800 --> 00:01:51.600
Every time a new information needs to be added. The

41
00:01:51.600 --> 00:01:54.400
 entire table is affected and leads to

42
00:01:54.400 --> 00:01:56.100
 a lot of empty cells.

43
00:01:56.900 --> 00:01:59.600
A key Value Store stores information in

44
00:01:59.600 --> 00:02:02.300
 the form of documents or pages. So each

45
00:02:02.300 --> 00:02:05.400
 individual gets a document and all information

46
00:02:05.400 --> 00:02:08.800
 about that individual is stored within that file.

47
00:02:09.800 --> 00:02:12.500
These files can be in any format or structure

48
00:02:12.500 --> 00:02:15.200
 and changes to one file does not affect the others.

49
00:02:16.200 --> 00:02:19.400
The working individuals can have their files with salary fields and

50
00:02:19.400 --> 00:02:22.400
 the students can have their pages with grades only.

51
00:02:23.400 --> 00:02:26.500
You can add additional details to any of these documents without

52
00:02:26.500 --> 00:02:28.800
 having to update other similar documents.

53
00:02:30.400 --> 00:02:33.400
While you could store and retrieve simple key and values

54
00:02:33.400 --> 00:02:36.400
 when your data gets complex, you typically

55
00:02:36.400 --> 00:02:39.500
 end up transacting in data formats like Json

56
00:02:39.500 --> 00:02:40.300
 or ammo.

57
00:02:41.600 --> 00:02:44.200
It's easy to install and get started with etcd

58
00:02:44.200 --> 00:02:47.300
 download the binary extracted and run.

59
00:02:48.100 --> 00:02:51.400
Download the relevant binary of four you operating system from the

60
00:02:51.400 --> 00:02:54.200
 GitHub release Pages extracted and

61
00:02:54.200 --> 00:02:55.800
 run the hcd executable.

62
00:02:56.400 --> 00:02:59.300
When you run hcd it starts a service

63
00:02:59.300 --> 00:03:02.500
 that listens on Port 2379 by default.

64
00:03:02.500 --> 00:03:05.700
 You can then attach any clients to the Etsy

65
00:03:05.700 --> 00:03:07.900
 service to store and retrieve information.

66
00:03:08.800 --> 00:03:11.700
A default client that comes with LCD is

67
00:03:11.700 --> 00:03:13.200
 the LCD control client.

68
00:03:13.900 --> 00:03:16.400
The hcd control client is a command line

69
00:03:16.400 --> 00:03:19.900
 client for hcd you can use it to store and retrieve

70
00:03:19.900 --> 00:03:20.900
 key value pairs.

71
00:03:21.400 --> 00:03:24.600
To store a key value pair run the LCD control

72
00:03:24.600 --> 00:03:27.500
 set key one command followed by the value

73
00:03:27.500 --> 00:03:30.400
 value 1 this creates an entry

74
00:03:30.400 --> 00:03:31.800
 in the database with the information.

75
00:03:32.900 --> 00:03:35.000
To retrieve the store data run the

76
00:03:35.900 --> 00:03:37.900
 LCD control getkey1 command.

77
00:03:38.800 --> 00:03:41.300
To view more options run the hcd control

78
00:03:41.300 --> 00:03:42.800
 command without any arguments.

79
00:03:43.700 --> 00:03:46.900
You might come across different versions of commands while exploring LCD

80
00:03:46.900 --> 00:03:49.400
 and related articles online. So it's important to understand

81
00:03:49.400 --> 00:03:52.700
 the history of hcd releases. So, you know, what changed

82
00:03:52.700 --> 00:03:53.100
 when

83
00:03:53.700 --> 00:03:56.900
So the first version of hcd versions 0.1

84
00:03:56.900 --> 00:03:59.800
 was released in August 2013. The official

85
00:03:59.800 --> 00:04:02.700
 stable version 2.0 was released

86
00:04:02.700 --> 00:04:05.700
 in February 2015. And

87
00:04:05.700 --> 00:04:08.700
 this is when the raft consensus algorithm was

88
00:04:08.700 --> 00:04:12.300
 really designed and it's supported more than 10,000 rides

89
00:04:11.300 --> 00:04:15.100
 per second and in January 2017

90
00:04:14.100 --> 00:04:18.000
 at CD released version 3 with

91
00:04:17.100 --> 00:04:20.600
 a lot more optimizations and performance improvements.

92
00:04:21.400 --> 00:04:24.400
And finally in November 2018, that's

93
00:04:24.400 --> 00:04:28.300
 when the STD project I was incubated in cncf.

94
00:04:29.400 --> 00:04:32.600
So what's most important here is to note the

95
00:04:32.600 --> 00:04:35.900
 change between version 2 and version 3 so

96
00:04:35.900 --> 00:04:38.700
 version 2 had been used a lot

97
00:04:38.700 --> 00:04:41.600
 and with version 3 there

98
00:04:41.600 --> 00:04:44.600
 were a lot of changes made. So the API version's changed

99
00:04:44.600 --> 00:04:47.200
 between version 2 and version 3 so that means

100
00:04:47.200 --> 00:04:50.100
 the HD cuddle commands change as well. So that's what I'm

101
00:04:50.100 --> 00:04:50.500
 going to talk about.

102
00:04:51.600 --> 00:04:52.200
next

103
00:04:53.100 --> 00:04:56.500
so the set and get commands. I showed earlier where for version 2 and

104
00:04:56.500 --> 00:04:59.400
 1 work for version 3 your hcd cuddle

105
00:04:59.400 --> 00:05:02.900
 command is configured to work with V2 and V3

106
00:05:02.900 --> 00:05:03.800
 at the same time.

107
00:05:05.500 --> 00:05:08.500
So how do you find out what version at cdcudl is

108
00:05:08.500 --> 00:05:11.800
 configured to work with run the LCD cuddle

109
00:05:11.800 --> 00:05:14.100
 version command and it should tell

110
00:05:14.100 --> 00:05:17.400
 you if it's said to V2 or V3 now in this output, you

111
00:05:17.400 --> 00:05:20.700
 can see the actually cuddle version itself, which is V3. So

112
00:05:20.700 --> 00:05:23.300
 that's the first line. However, the API version

113
00:05:23.300 --> 00:05:26.600
 is too. So remember that there are two types of

114
00:05:26.600 --> 00:05:29.500
 versions. So one is the LCD cuddle utility itself. And

115
00:05:29.500 --> 00:05:32.200
 the other is the API that it is configured to

116
00:05:32.200 --> 00:05:35.500
 work with which will either be two or three. So this means in

117
00:05:35.500 --> 00:05:38.300
 the current state it means that it's configured to work with

118
00:05:38.300 --> 00:05:41.500
 V2. And so if you run the LCD cuddle

119
00:05:41.500 --> 00:05:44.500
 command without any options, then it lists

120
00:05:44.500 --> 00:05:47.700
 all the commands that it supports and these are for version two

121
00:05:47.700 --> 00:05:50.300
 and note that with newer versions

122
00:05:50.300 --> 00:05:53.300
 of etsy. The default. API version is set to

123
00:05:53.300 --> 00:05:56.400
 read three so you might want to check what version it

124
00:05:56.400 --> 00:06:00.200
 is set to using this version command before starting to

125
00:06:00.200 --> 00:06:02.300
 run the city commands.

126
00:06:03.400 --> 00:06:06.300
So to change HD cuddle to work with

127
00:06:06.300 --> 00:06:09.300
 the API version 3 either set the environment

128
00:06:09.300 --> 00:06:12.300
 variable called Etsy cuddle underscore API

129
00:06:12.300 --> 00:06:15.200
 to three for each command. So right before

130
00:06:15.200 --> 00:06:18.100
 you run the command or you can export it as

131
00:06:18.100 --> 00:06:21.100
 an environment variable for the entire session using the export command.

132
00:06:21.100 --> 00:06:24.300
 So that way you don't have to add it before each

133
00:06:24.300 --> 00:06:28.000
 time. The command is run now also note that with we

134
00:06:27.200 --> 00:06:30.400
 three version is now a command and

135
00:06:30.400 --> 00:06:33.500
 not an option as it was with we too

136
00:06:33.500 --> 00:06:36.800
 so in V2 you had to run Dash version and

137
00:06:36.800 --> 00:06:39.300
 now so that was an option now, it's a command so

138
00:06:39.300 --> 00:06:40.000
 you just run version.

139
00:06:40.800 --> 00:06:43.300
now running STD cuddle command now

140
00:06:43.300 --> 00:06:46.500
 lists the command in the API version

141
00:06:46.500 --> 00:06:47.700
 3

142
00:06:49.700 --> 00:06:52.700
So with version 3 now the command

143
00:06:52.700 --> 00:06:55.500
 to set a value is Etsy cuddle put

144
00:06:55.500 --> 00:06:58.800
 and the command to get a value

145
00:06:58.800 --> 00:07:01.200
 is Etsy cuddle get

146
00:07:01.200 --> 00:07:04.800
 and there are many other changes as well in a

147
00:07:04.800 --> 00:07:07.400
 number of other commands, but that's kind

148
00:07:07.400 --> 00:07:10.400
 of a high level on how it CD Works in a city

149
00:07:10.400 --> 00:07:13.700
 cuddle works. All right, so that's that's all for now in a

150
00:07:13.700 --> 00:07:16.400
 later video. We will explore how to set up HD in

151
00:07:16.400 --> 00:07:19.900
 an ha environment and how it works with kubernetes. So thanks

152
00:07:19.900 --> 00:07:21.900
 for watching and I'll see you in the next one.
