Hello and welcome to this lecture. This is a quick introduction to
Etsy for beginners. If you already know
about hcd feel free to skip this video and head
over to the next video where we discuss about etsad in
kubernetes.
We start with a basic introduction to what a key
value story is and how it is different from traditional databases how
to quickly get started with hcd and how
to use the client tool to operate at CV.
Later in this course when we cover High availability. We
will discuss about what it means to be a distributed system.
How at City Works in a cluster mode what raft
protocol is and what are the best practices around the
number of nodes in an hcd cluster?
So what is hcd?
It is a distributed reliable key value store
that is simple secure and fast.
So let's break it up.
So what is a key Value Store traditionally databases
have been in a tabular format? You must
have heard about SQL or relational databases the
store data in the form of rows and
columns.
For example here is a table that stores information regarding
few individuals.
The row represents each person and the column represents
the type of information being stored.
Now say we want to add additional details about this individuals. Say
for example salary, so we add
an additional column.
Doing so impacts the entire table and all of
the individuals in them.
We then add salary details to this column.
However, not all of them are working.
So those cells remain empty?
We're then required to store great information. So
we add a new column and update these students with
their respective grades again, only students
have grades. So the corresponding fields for adults
are empty.
Every time a new information needs to be added. The
entire table is affected and leads to
a lot of empty cells.
A key Value Store stores information in
the form of documents or pages. So each
individual gets a document and all information
about that individual is stored within that file.
These files can be in any format or structure
and changes to one file does not affect the others.
The working individuals can have their files with salary fields and
the students can have their pages with grades only.
You can add additional details to any of these documents without
having to update other similar documents.
While you could store and retrieve simple key and values
when your data gets complex, you typically
end up transacting in data formats like Json
or ammo.
It's easy to install and get started with etcd
download the binary extracted and run.
Download the relevant binary of four you operating system from the
GitHub release Pages extracted and
run the hcd executable.
When you run hcd it starts a service
that listens on Port 2379 by default.
You can then attach any clients to the Etsy
service to store and retrieve information.
A default client that comes with LCD is
the LCD control client.
The hcd control client is a command line
client for hcd you can use it to store and retrieve
key value pairs.
To store a key value pair run the LCD control
set key one command followed by the value
value 1 this creates an entry
in the database with the information.
To retrieve the store data run the
LCD control getkey1 command.
To view more options run the hcd control
command without any arguments.
You might come across different versions of commands while exploring LCD
and related articles online. So it's important to understand
the history of hcd releases. So, you know, what changed
when
So the first version of hcd versions 0.1
was released in August 2013. The official
stable version 2.0 was released
in February 2015. And
this is when the raft consensus algorithm was
really designed and it's supported more than 10,000 rides
per second and in January 2017
at CD released version 3 with
a lot more optimizations and performance improvements.
And finally in November 2018, that's
when the STD project I was incubated in cncf.
So what's most important here is to note the
change between version 2 and version 3 so
version 2 had been used a lot
and with version 3 there
were a lot of changes made. So the API version's changed
between version 2 and version 3 so that means
the HD cuddle commands change as well. So that's what I'm
going to talk about.
next
so the set and get commands. I showed earlier where for version 2 and
1 work for version 3 your hcd cuddle
command is configured to work with V2 and V3
at the same time.
So how do you find out what version at cdcudl is
configured to work with run the LCD cuddle
version command and it should tell
you if it's said to V2 or V3 now in this output, you
can see the actually cuddle version itself, which is V3. So
that's the first line. However, the API version
is too. So remember that there are two types of
versions. So one is the LCD cuddle utility itself. And
the other is the API that it is configured to
work with which will either be two or three. So this means in
the current state it means that it's configured to work with
V2. And so if you run the LCD cuddle
command without any options, then it lists
all the commands that it supports and these are for version two
and note that with newer versions
of etsy. The default. API version is set to
read three so you might want to check what version it
is set to using this version command before starting to
run the city commands.
So to change HD cuddle to work with
the API version 3 either set the environment
variable called Etsy cuddle underscore API
to three for each command. So right before
you run the command or you can export it as
an environment variable for the entire session using the export command.
So that way you don't have to add it before each
time. The command is run now also note that with we
three version is now a command and
not an option as it was with we too
so in V2 you had to run Dash version and
now so that was an option now, it's a command so
you just run version.
now running STD cuddle command now
lists the command in the API version
3
So with version 3 now the command
to set a value is Etsy cuddle put
and the command to get a value
is Etsy cuddle get
and there are many other changes as well in a
number of other commands, but that's kind
of a high level on how it CD Works in a city
cuddle works. All right, so that's that's all for now in a
later video. We will explore how to set up HD in
an ha environment and how it works with kubernetes. So thanks
for watching and I'll see you in the next one.