All right my friends in this video we're going to try to answer a very simple question What is a micro
service.
To answer this question we're first going to do a quick review on how you are probably building servers
right now.
So right now you are probably familiar with a monolithic architecture.
This is probably how your building servers right now in a monolithic server.
We have all of our code needed to implement our application inside of one single code base and we deploy
that code base as one discrete unit so we might imagine that with a monolithic server we have some requests
coming from a user's browser or mobile device that will flow into our application and go through maybe
some pre processing middleware then maybe it goes off to some router that router might then inspect
the request and decide to send it off to some very specific feature to be further processed.
So maybe in this case it goes off to feature a feature a might decide to read or write some data out
of a database eventually formulate a response and then send a response back to whoever made the request
so if we had to characterize a monolithic server we might say the following We might summarize it with
this sentence right here.
We would say that a model it contains all the routing all the middle where's all the business logic
and all the database access code required to implement all features of our application.
So that would characterize a monolith let's not take this diagram right here.
We're going to make one or two changes to it and that will then summarize or characterize what micro
services are all about.
So here's how we would characterize micro services.
We would say that a single micros service contains all of the routing all the middleware is all the
business logic and database access required to implement one feature of our application.
That is the big difference.
So a monolith has all the code needed to implement every feature of our application.
A micro service has all the code needed to implement just one feature.
Let's take a look at this in a more visual format.
All right.
I know this diagram is a bit crazy but it's very similar to the one we were looking at just a moment
ago.
So with this micro service architecture we've now split off all these different features and wrap them
up inside of their own little personalized services.
The very important thing here to understand is that each of these services are entirely self-contained
so service right here has all of the code required to make feature a work correctly.
It has its own middleware it's got its own router and it even over here kind of surprisingly will have
its own database as well.
The nice thing about this approach is that if for some reason if every other feature or every other
service inside application crashes or just mysteriously disappears a portion of our app is still going
to work just fine.
As service say is 100 percent standalone it doesn't necessarily require any other service to work correctly.
All right.
So that is a very basic kind of introduction to answering this question of what is a micro Service are
working definition for right now is going to be that a micro service contains all of the code required
to make one feature work correctly.
Now that we've got a working definition we're going to take a quick pause right here and continue in
just a moment.