The last video we introduced this idea of Docker and we said that Docker makes it really easy to start
up and run our different programs.
We're not going to start to talk about Cuban eddies now as they talk about communities.
We're not going to immediately see why Docker and Cuban natives are so nice together.
It's not going to be immediately evident and you might be sitting there saying at the very end of this
video.
Wait why do we care about Docker again.
Tell me about that.
Well don't worry.
All this stuff is going to become more evident in due time for it now.
Let's just focus a little bit on Cuba natives and see how it solves one of those issues that we ran
into a little bit earlier when we were talking about scaling our application.
OK so first off what is Cuban net is Cuban natives is a tool for running a bunch of different containers
together when we make use of Cuban natives.
We're going to give it some configuration files these configuration files are going to tell Cuban eddies
about the different containers that we want to run in our application.
Cuban eddies is then going to create these containers that are going to run our programs for us and
it's going to handle communication or essentially network requests between all these different containers
as well so we can really imagine Cuban entities as a tool to run some different programs and make communication
between those programs very easy and straightforward of course just giving you a verbal definition of
this or a real verbal description is not super helpful.
So let's take a look at a diagram and better understand what Cuba needs is all about the Cuban eddies
we create something called a cluster a cluster is a set of different virtual machines.
It can have as few as one virtual machine like what you see right here or it can have many hundreds
or thousands of virtual machines.
All these different virtual machines we refer to as nodes they are all managed by something called a
master Master is essentially a program that's going to manage everything inside of our cluster all the
different programs that are running all the different aspects of these virtual machines and many other
things.
We are going to tell Cuban cities to run some programs for us when we do so it's going to take our program
and then more or less randomly assign it to be executed by one of these notes.
And again remember a node is really just a virtual machine.
Let's take a look at what this would really look like in practice so we are going to create some configuration
files that are going to provide some very explicit directions to Cuba net on what we wanted to do so
we might write a configuration file that says run two copies of our postal service and also make sure
that we can very easily access these post services after they have been created.
So you and I are going to write that configuration file and then feed it into this master thing.
Master is going to read that configuration file and then try to implement all the steps we've written
out inside there.
So in this case it's going to attempt to create two different copies of our post service wrapped up
inside of containers these will be randomly assigned again more or less randomly.
There actually is some science to it.
We can imagine right now they will be assigned to be executed by some different virtual machines or
nodes inside of our cluster now in this scenario we're kind of back in the same problem we had before
where it could potentially be really hard for something like our event bus to figure out in how to reach
out to say this copy of the postal service and that postal service.
So the big thing that Cuban 80s does for us is give us the ability to just kind of arbitrarily send
requests or communicate between these different services with some kind of third party thing that we
are going to create so in short you can kind of imagine down here that we're going to create something
inside of our cluster that we can just send requests to and it will automatically figure out how to
write requests off to the appropriate service that is running inside of application.
So for example let's imagine that we've got a copy of the Postal Service on Node 1 or virtual machine
number one one on number two.
And then our event bus is over here on number three.
If we were not using Cuban eddies we would have to somehow teach the event bus how to directly reach
out over to this second virtual machine.
And more specifically the postal service running on it and we'd have to figure out how to do the same
thing to have it reach out to this first virtual machine.
And the postal service running on there as well.
And again as we discussed in the last couple of videos that is not what we want to do.
So instead we will simply teach our event bus how to reach out to this very common communication channel
if we send a request off to this very common communication channel we can then be guaranteed that it
will be sent off or forwarded on to every copy of our postal service.
And so we don't have to worry about all these intricate connection details or stuff like that.
We can simply say make a request to the service and Cuba needs is going to take care of everything from
there.
So the big reason that you and I are using Cuban eddies around micro services is that it's going to
make communication very easy and straightforward.
It's also going to make creating services like launching new copies and scaling the number of copies
are running very easy and straightforward as well.
Now this whole idea of having our services communicate with each other you might be sitting there and
saying wait Steven I thought we didn't want our services to communicate directly with each other.
Well yes.
Remember we are not using synchronous communication between our services.
But there still are programs that ultimately do have to talk with each other inside of our micro services
applications.
We still need to have our services communicate with some common event us.
We need to make sure at some point time that our services can also communicate with say a database that
it's being assigned to it and having this common communication channel is going to make that process
a lot easier and more straightforward OK.
So that's just a very brief introduction to Cuban natives and why we care about it in the world of micro
services.
They're going to take a pause right here and then start to discuss Docker a little bit more and get
more familiar with it in just a moment.