00:00:00
foreign
00:00:08
in this video we'll talk about
00:00:10
microservices now to understand
00:00:12
microservices let's go back to 1970s
00:00:15
that's why when the computers were new
00:00:17
so in 1970s we were trying to solve
00:00:20
simple problems with the help of
00:00:21
computers maybe scientific problems but
00:00:24
then they were simple into this term now
00:00:26
after the successful use of computers
00:00:29
for the scientific and research purpose
00:00:31
we thought can we use it for commercial
00:00:32
use as well and that's where in early
00:00:35
90s or late 90s A lot of people a lot of
00:00:38
companies started using softwares and
00:00:40
computers for their internal use also
00:00:42
we've also got social media websites in
00:00:45
early 2000 but now if you try to
00:00:47
understand the entire ecosystem or if
00:00:49
you try to understand the world of
00:00:50
softwares everywhere in fact everything
00:00:53
in the world is happening with the help
00:00:56
of softwares if you want to book a cab
00:00:58
you will use a software if you want to
00:01:00
transfer money you will use software if
00:01:02
you want to buy something online or if
00:01:04
you want to buy something you will use a
00:01:06
software that right so if everything is
00:01:09
done with the help of a software which
00:01:11
we normally call them as applications
00:01:13
what normally happens is we build a
00:01:15
particular website now that's what we
00:01:17
call them we build a website and in that
00:01:19
particular website you will be having
00:01:21
all the services now when you talk about
00:01:23
Services what exactly it means now
00:01:25
imagine a shopping website example if
00:01:28
you go to Amazon you get a lot of
00:01:30
features there right on Amazon you can
00:01:32
basically search for a product you can
00:01:34
buy a product you can basically add a
00:01:36
product to a cart and then you can buy a
00:01:38
product you can pay for that online and
00:01:41
also as a seller I can sell my own
00:01:44
devices or I can sell my own things on
00:01:47
Amazon because it's also a Marketplace
00:01:49
so basically Amazon itself is a huge
00:01:52
software which has a lot of different
00:01:54
Services right now if you want to build
00:01:57
this website by yourself what you will
00:01:58
do is you have a traditional mindset of
00:02:01
course one of the best thing about
00:02:02
building a software nowadays is we think
00:02:04
about creating different modules so what
00:02:07
you do is you break down the entire
00:02:09
project into small parts in fact that's
00:02:11
how we think right so if I want to build
00:02:13
a website I will just break down the
00:02:14
services into small modules I will work
00:02:17
on one particular module and also that's
00:02:19
what we also suggest right so if you
00:02:21
have a big team you can divide your big
00:02:23
team into small groups so let's say if
00:02:25
you have 50 people working on a one big
00:02:27
project you can have uh you can have
00:02:30
five different teams of 10 or maybe 10
00:02:32
different teams of five members and then
00:02:34
this people will work on one particular
00:02:36
feature right and that's how you can
00:02:39
build this amazing website like Amazon
00:02:40
or amazon.com to buy something now the
00:02:43
thing is the approach is actually coming
00:02:45
from the software development field now
00:02:47
when you build a normal software what
00:02:48
are your tendency so we have a software
00:02:50
which works on the desktop in fact when
00:02:52
I started my career I started in that
00:02:54
zone you can just write the application
00:02:56
which works on a particular machine
00:02:59
right so what you do is you structure
00:03:02
your entire application for one device
00:03:04
now that's what we do in the web world
00:03:06
as well even if you have multiple teams
00:03:09
they are working on different Services
00:03:10
they are still one package right so in
00:03:15
maybe in Java or in other languages what
00:03:17
you do is you create a package right you
00:03:18
create let's say in Java we create a bar
00:03:20
file or a jar file you will put all the
00:03:23
services in this particular wall file
00:03:25
and then you will deploy this on a cloud
00:03:27
or on any server the problem is you have
00:03:30
a lot of services here on once one
00:03:33
system
00:03:34
so let's talk about some advantages of
00:03:35
doing this the advantage of doing this
00:03:37
type of architecture which we normally
00:03:38
call them as monolithic application or
00:03:41
the monolithic architecture where you
00:03:43
have everything in one place all the
00:03:46
services right of course they are
00:03:48
designed by other members you can simply
00:03:50
group them you can form a particular
00:03:52
package and you can deploy it so the
00:03:54
good thing is you know what is happening
00:03:56
with the application what are the
00:03:57
drawbacks there are multiple drawbacks
00:03:59
with this type of architecture the first
00:04:01
one is team dependencies so let's say if
00:04:03
all your team your 10 teams are working
00:04:05
together to make all these features they
00:04:07
have to actually dependent on each other
00:04:09
they should know when you are going to
00:04:11
go for the next release right so of
00:04:13
course with every release you go for a
00:04:15
version so you have to specify okay I
00:04:17
got a new feature but let me know when I
00:04:19
can push this feature in the product so
00:04:21
that we can deploy the entire project
00:04:22
the second one is the scalability let's
00:04:25
say if you talk about Amazon itself in
00:04:27
fact we can take this example or we can
00:04:29
take this concept for multiple examples
00:04:30
multiple domains but if you stick to
00:04:32
Amazon here let's say there's a sale
00:04:34
going on now if you know that tomorrow
00:04:36
there will be a huge sale maybe for some
00:04:39
Festival some some other event what do
00:04:41
you think which of the services will be
00:04:43
needed scalability here in the minority
00:04:45
calculation what happens is if you know
00:04:47
that there's a sale going on or there
00:04:48
will be sale happening next week what
00:04:50
you will do is you will scale your
00:04:51
application in multiple systems right
00:04:54
maybe you will try to do vertical
00:04:55
scaling by adding more servers or more
00:04:58
RAM power or you can do the horizontal
00:05:02
scaling so basically you will have the
00:05:04
same application and having multiple
00:05:06
instances of them see in terms of sale
00:05:09
it's not like you will get new users or
00:05:11
you will get a lot of new users you will
00:05:13
get a lot of new sellers what you will
00:05:15
get is more searches you will get more
00:05:18
payments so instead of scaling the
00:05:20
entire application don't you think we
00:05:22
should be scaling only the small modules
00:05:24
there so that's what we want right we
00:05:26
want to use this particular service so
00:05:28
instead of scaling the entire monetary
00:05:30
application we can we should be able to
00:05:32
scale that Individual Services next one
00:05:35
what if you have a big application and
00:05:37
if you think we will build this
00:05:39
application using uh as a one minute
00:05:41
application the thing is you have to
00:05:43
stick to one technology maybe if you're
00:05:45
using Java for the entire application
00:05:47
you have to stick to Java even if you
00:05:50
have a new team who says Okay I want to
00:05:52
work on node.js they can't because you
00:05:54
are building one big application which
00:05:56
will create one particular package which
00:05:58
will go to one particular server what
00:05:59
you can do is if you have a different
00:06:01
Services here you can actually create
00:06:04
different services using different
00:06:06
Technologies
00:06:07
right so that's one of the advantage we
00:06:09
want and that can be done with the help
00:06:11
of microservices so each service which
00:06:13
I'm talking about here they are called
00:06:15
micro Services the advantages if you
00:06:19
have 10 teams they can divide the entire
00:06:22
project into small Services one thing to
00:06:24
remember here each service here should
00:06:26
be self-contained they should be able to
00:06:28
deploy it separately and also they
00:06:30
should be scaled separately they should
00:06:33
not be dependent on some other services
00:06:34
so each service here will be called
00:06:37
microservices now since they are
00:06:38
microservices we can create them in any
00:06:40
technology we want so one service can be
00:06:42
done with Java second service can be
00:06:44
done with node.js and now since there
00:06:46
are multiple Services you can scale them
00:06:48
the way you want maybe if you have 10
00:06:50
Services I want to take this fifth and
00:06:51
sixth service and I want let's say 10
00:06:54
instance of them I want the second
00:06:55
service to have five instances so I can
00:06:58
Scale based on the service requirement
00:06:59
not for the entire application and also
00:07:01
since they had separate Services even if
00:07:03
some service goes down it will not
00:07:05
affect the entire application now in
00:07:07
terms of monetary application if you
00:07:09
make one change it is not working it
00:07:11
will crash the entire application that's
00:07:13
not the case with microservices so
00:07:16
basically what is microservice they are
00:07:18
Individual Services which are
00:07:19
self-contained they can run as a
00:07:22
individual service and maybe let's say
00:07:24
if I want to go for go to Amazon if I
00:07:26
say I want to search for the products
00:07:28
that's one service I want to create a
00:07:30
new account that's once service I want
00:07:32
to sell a particular product that's one
00:07:34
service so these are your micro Services
00:07:36
now everything looks good on paper right
00:07:39
we are saying that microservices are
00:07:40
great do we have any challenges there
00:07:42
the thing is yes now since we have
00:07:44
multiple Services how these services
00:07:46
will communicate it's not like they
00:07:48
can't but then it's difficult to
00:07:49
configure them okay and you will be
00:07:52
doing that only once you have to use
00:07:54
service discoveries you have to use API
00:07:56
Gateway which will stand in front of all
00:07:59
the services
00:08:00
and you will be also having some
00:08:02
resilience system in between what if
00:08:04
some service failed do we have a field
00:08:06
support there and creating a
00:08:08
microservice is not just about writing
00:08:10
code okay it's also about creating the
00:08:11
architecture before you write a single
00:08:14
line of code how do you design your
00:08:16
system how do you create those Services
00:08:17
that's also important and if you don't
00:08:20
design your microservices properly
00:08:21
ultimately you are creating a worst
00:08:24
system of Monolithic application now one
00:08:27
of the question might be how this
00:08:28
Services communicate so they basically
00:08:30
uses uh HTTP request or response to
00:08:33
communicate between each other of course
00:08:35
they will be having endpoints to
00:08:36
communicate and also we have to also
00:08:38
think about security because now since
00:08:40
you have a different Services if a
00:08:42
customer sends a request which Services
00:08:44
you have to go to and does that
00:08:46
particular user has uh access to to do
00:08:49
that so that's the challenges of
00:08:51
microservices but it's an awesome thing
00:08:53
big companies they are using
00:08:55
microservices on big level so that's it
00:08:57
from this video I will try to create
00:08:58
more videos on microservices the problem
00:09:00
implementation let me know in the
00:09:01
comment section your thoughts on
00:09:02
microservices and that's it from this
00:09:04
video if you want bye