Hi, welcome to another CodeSpace tutorial. In this tutorial
we'll see water micro services and how to implement micro service architecture and want of the advantages and
disadvantages of using such architectures
Micro service also known as fine-grained service-oriented architecture are loosely coupled
application or services that talk to each other mainly over HTTP protocols so that the system becomes more
reliable, robust, and makes code less brittle
Let's take the example of online shopping platform and assume that the platform has five main components
customer online charts and view items, add to cart, checkout and billing
back-end finance processing,
shipping and service delivery
Now in any monolithic application all the five components will be written in a single application say a Java war file
using different packages for each modules and deployed in a single high-performance server
Now each time some small changes are made for finance team the whole application needs to be compiled and tested and then deployed to production
environment and if any bug occurs or suppose the database went down or any network issue occurred the whole system will not be accessible
But in micro service all the five components can be written in any language like Java, .net, PHP or node.js
and deployed in different servers
These modules or components can be further divided into more granular components and
an individual or a small team can own the whole end-to-end flow from designing writing codes testing and deploying. All the modules talk to each other
through HTTP rest-apis and if any changes are made in finance module it can be tested
separately and then deployed without testing the other four components
also
If the finance or the service delivery system went down users can still browse different items and order it without having any difficulty
Now coming to scaling perspective
Micro service architecture are easy to scale in respect to cost efficiency compared to monolithic application.
In monolithic application we need to scale and replicate the whole system under a load balancer suppose for such application
We are using i7 processor with 32 GB RAM
But the single system is not able to take the load of online search component
for this we need to replicate same type of server and deploye the whole application under a load balancer
So the cost of the server will be multiplied by nearly 2
Now if we are using a micro service application we can have different servers configuration says search is deployed in
i5 processor +16 GB RAM server and other 4 components are in for small
i3 + 2 gb ram configuration server and during peak hours another i5 + 16 GB server can be put together
To balance the load of the search component without increasing the size of other 4 components
Also Finance and shipment service can be kept off and discarded when not in use
This type of auto scaling and load balancing can be easily achieved using cloud computing
I have already made a video on how to use Amazon AWS cloud computing for links. You can check the description below
But every coin has two sides. Some of the disadvantages of using
microservice application is log maintenance. For debugging and analytics log need to be put together from different servers and
This can be achieved using elastic log stash or fileBeat. Also each team or individual should have adequate knowledge of
Designing, implementing, coding, testing and deploying. That's all for this video
You are watching CodeSpace tutorial
and I am Gourab. Follow me on Facebook on this URL and don't forget to subscribe and
hit the notification bell icon to get notified for upcoming video tutorials. If you have any queries then comment below. Thanks for watching this video
