Now that you have a good understanding of virtual machines it's time to turn our attention to another
one of the computer services which is containers which has grown a lot in recent years with the rise
of Docker as as a standard for a lot of the industry now.
And what are containers where essentially it's a standardised packaging for software and dependencies.
I think in a virtual machine I typically have my operating system I install my packages online store
all my dependencies on and I try to make sure that configuration works with a container.
I kind of preview all that work.
Make sure everything works together.
Then when I want to run it I just schedule it to run on a machine that's capable of running docker containers.
It's also a way to isolate apps from each other and it works across both Linux and Windows servers and
allows separate apps to share the same OS Colonel.
Now what's given the rise to this and ultimately its application modernization because there are a lot
of issues with monolithic applications of recent store all our application code into a single server
minor code changes then require us to fully compile test in the application becomes a single point of
failure let's say one of those boxes there the different colors you see on screen one of those pieces
goes wrong at will potentially takes down the entire system and the application is difficult and often
expensive to scale.
So the answer to this is to break it apart into what we call micro services where each service has its
own individual application if you will and can be scaled separately there's this concept of 12 fact
applications.
You make the app independently scalable stateless and highly available by design and helps to compare
and contrast these because when you think about monolithic Well it's very simple to deploy into modular
refactoring and vertical scaling technology monocultural some of the themes we see that when you look
at micro services it's all about partial deployments again deploying the piece of the entire application
that I need as needed strong module boundaries horizontal scaling is the big difference.
So with containers and this is something to account for on some of the exams is if I want to scale out
horizontally.
Containers are very very good for that because I can just scale out that particular service that I need
to as opposed to with monolithic again.
If typically you know somebody comes and wants to scale the application you just add in more CPE you
add in more memory to the virtual machine to scale it.
And the other big thing with micro services allows for a diverse set of technology you know from a stack
point of view let's then look at some of the keys to micro services.
First of all we have functional decomposition as you can see by now all those services tightly coupled
together that error prone become individual services.
That's the first part of everything.
Then we look at a horizontal scale scale what we need to not what we don't.
This could mean that for virtual machines if we've got an application that's a mixture of services we
scale the virtual machines horizontally a scale set we could scale the containers we could use service
functions we can kind of choose what we want to use that in addition now we can choose to decouple the
data much more efficiently I can pick the best database for the service.
So if service one would make better use of Oracle we can do that service too as a sequel service three
as maybe service for God as a sequel there but it could be like Mongo D.B. or cosmos or something like
that so you can really start to see the benefits that containers provide.
In addition to just the speed and efficiency when you deploy a container they deploy very very quickly
when compared to a virtual machine they're up and running very quickly and again they're not as error
prone because everything has been tested all the dependencies a couple together.
So we deploy the container.
We're good to go.
So the jewelers home it's containers versus virtual machines.
Well again on the left if you remember from the virtual machines module where the hardware on the bottom
hypervisor and then we deployed the operating system an application in each virtual machine with docker
containers on the right we still have our server.
So that's our hardware.
Now that could be run in say VM ware or hyper v or could be an Azure Virtual Machine before it gets
to the operating system there.
So again operating system here is like Windows or Linux then we run the docker engine on top of that.
But now we can just deploy our application so you can see we're scaling and scheduling the applications
we don't have to keep scaling out that underlying operating system.
That's not to say you don't have docking nodes underneath that scale out to support the applications.
That's obviously going to happen we have to have enough CPE you memory et cetera to kind of make all
the magic happen but once you've kind of figured out how to manage that service and things like Azure
Cuban any service make it very easy now you can focus on the application itself and and scaling that
out.