So friends to begin, this particular skill, the very first thing that I want to
talk to you about is something known as red.
And no, I'm not talking about when a SWAT team happens to raid someone's house.
What we're actually talking about here is a redundant array of independent
discs.
Now the core component of this technology is in that first letter right here,
redundant.
What we're talking about here is how we can actually implement redundancy.
Now, raid in the context that we're talking about, one of the primary
advantages is that it gives us fault tolerance. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
advantages is that it gives us fault tolerance.
So maybe you've heard the expression two is one and one is none.
What exactly are we referring to here?
Well, quite simply, what we would like to have would be at least two copies of
our data.
And the reason why we say two is one is because we can't treat that as a
minimum.
Whereas when we say one is none, if you only have one copy of your data,
whether right or wrong it is kind of assumed that you have no copies of your
data because that is the nature of computing.
Things become corrupt. Things get overwritten accidentally. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Things become corrupt. Things get overwritten accidentally.
If you only have one copy, well, that is a very fragile state of affairs.
Now realistically, do you absolutely have to have multiple copies of all the
data in your possession?
Well, the reality is not really, but if that data is valuable to you or if that
data happens to be sensitive,
then this is certainly a strategy that we want to employ.
Now very often, what people might do is maybe they go and they have a USB stick
and any data they want backed up,
they just copy to this removable drive so that if their primary computer
happens to break,
then they still have access to that data via the USB. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
then they still have access to that data via the USB.
Similarly, another well-known and well-used strategy is to utilize the cloud.
So this could be pictures on your phone that you want to backup and save to
your cloud account.
Maybe it's some sensitive documents that type of thing.
The cloud provides us a solution for fault tolerance.
But as you may expect, that is not the only solution that we can use and the
one that we're
going to be focusing on is this one right here, reds.
Now the way red is going to operate is that it's going to have to use multiple
discs in conjunction together.
Now how many discs do you need? Well, that really depends on the type of WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Now how many discs do you need? Well, that really depends on the type of
rate that you want to be implementing. Now straight up, just to say that you
can have
red controlled via something known as a hardware controller.
This tends to offer better performance, but in the case of what we are doing
right here,
we're going to be implementing RAID in software pretty much by using the Linux
kernel.
So let me just talk to you very briefly about some of the different RAID
implementations that we can use,
as well as why we would want to use them before we actually get to implementing
the solution via
Ansible. So the very first implementation that I want to talk to you about is WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Ansible. So the very first implementation that I want to talk to you about is
one called RAID 0.
This is otherwise known as striping your data. You may hear this term.
And the thing about this particular implementation is that it happens to give
you
zero fault tolerance. So that sounds like a bit of a bummer.
Why then would we want to have a solution that is not going to give us any
backups?
Well, in the case of RAID 0, whilst it does not give us any backups,
it does give us a performance boost. Let me show you how this actually operates
.
Let's say we have one hard disk right here. And over here, we have a second WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Let's say we have one hard disk right here. And over here, we have a second
hard disk.
Now traditionally, if you just happen to be working with one disk on its own,
then as the data is being written to disk piece by piece by piece,
then what is happening is that the data is effectively being written sequ
entially
one by one by one by one. Now imagine we wanted to write that data across two
different drives.
The cool thing is that what we can actually do is we can have partial pieces of
the data
be written to two different drives in parallel. So a piece of the data gets
written here and at
the same time a piece of the data gets written here. Similarly, when we want to WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
the same time a piece of the data gets written here. Similarly, when we want to
read that particular
piece of data, we can connect to both drives at the same time and access that
data in parallel.
But of course, the big disadvantage is is let's maybe say this particular drive
fails
and it becomes unusable, then effectively you happen to have lost all the data
on both drives
because quite simply one device has only got partial data. So if you destroy
one, then effectively
you're left with this kind of useless drive with half written data. So WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
you're left with this kind of useless drive with half written data. So
certainly this is not the
type of read that you would use if you wanted to preserve sensitive and very
important data.
What you could do is maybe use the next implementation. This one is known as
RAID 1 and pretty much what this does is this gives us one copy of our data.
This is otherwise
known by the name of mirroring pretty much we're going to have an exact mirror
of the data of one
disk. So again, let's say we have one disk right here and a second disk right
here as one piece of WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
here as one piece of
data is written onto this particular disk. The exact same data is then written
onto this disk
and pretty much this process just continues on and on and on. So say for
example, you happen to
write a very important document and you save that document, it's going to be
written to this drive
as well as this drive right here. The effect of that therefore is that let's
maybe say this drive
happens to fail, it becomes completely unusable, then the good news is is that
you have an exact
copy of all of the data on this disk which is still in play and as such you can WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
copy of all of the data on this disk which is still in play and as such you can
just throw this
old drive away by a brand new one and then write a copy of that data onto this
drive right here.
So again, we have two copies once more. Now, another very popular
implementation is one known as
RAID 5 and this one actually requires not two disks but at least three disks
and pretty much this data
is going to be written in a round Robin format. What does that actually mean?
So let's maybe say we
have our three disks, let's go with disk number one here, here we have disk WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
have our three disks, let's go with disk number one here, here we have disk
number two and at the
very end we have disk number three. So let's say we have a whole bunch of data
that we want to write,
what we don't want to do is to write the first chunk of data here and then the
second one and
then the third so on so forth instead like I say we want to implement that
round Robin
functionality. So pretty much what we would do is we would write the first
chunk of data here,
then we would move to the next device and write the second piece of data here
and then we would
write the third piece of data here. This is what I mean with a round Robin WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
write the third piece of data here. This is what I mean with a round Robin
format. So we're splitting
the data up across the three drives. Now the crucial point to note is that the
next piece of data
written is something going to be known as a parity bit and this really is just
a special piece of
data that is going to be used for the reconstruction of the full data should
one drive happen to fail.
You don't have to worry about the specifics of how this is implemented, just
understand is that
this is what it does. So basically the fourth time we write a parity bit here
and then we go and
write the fourth piece of data and then the fifth piece of data and then the WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
write the fourth piece of data and then the fifth piece of data and then the
sixth piece of data
and then what is going to come next? We're going to write our parity bits right
here and again this
just keeps repeating. We write the seventh bit here, the eighth bit of data
here, the ninth bit of
data here and then you guessed it, we're going to write our parity bits and
this is just going to
keep repeating and repeating. So the advantage of this implementation is that
it's going to give us
great performance because the data is written across multiple disks and it's
still going to give us
that fault tolerance. Now the reality is there are many more types of read WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
that fault tolerance. Now the reality is there are many more types of read
implementation. We can
have read 10, read 6, so on and so forth but these are just some of the more
well-known implementations
that are commonly seen. So now we have a rough idea about the type of read
levels that we have
as well as the general purpose and functionality of reads. How about we begin
implementing read
on our devices utilizing Ansible?