What is microservice and how it is different from monolith architecture?
“Culture does not change because we desire to change it. Culture changes when the organization is transformed — the culture reflects the realities of people working together everyday.”– Frances Hesselbein
Nowdays we hear lot about the term microservices. What it is?, Why companies are talking about it?, How were we implementing the things before and how microservice is different from it? These might be the question arising in your mind. Ok! hold on for some minutes, everything will be cleared.
First of all let us know more about what Monolith is?
In the recent last decade, we used to package softwares in a single blocks which under the hood uses various libraries, codes for performing tasks as a unit. In such a case if we had to make any code change, we had to examine if all the other part of the code are compatible with the new change or not. This in a way takes a lot of time. This framework is called Monolith. Another disadvantage of such architecture is scalability, wait.. wait what scalability is and why do we need it?
Over the time the number of users using out product might increase and one standalong application might not be able to handle all the workload, so for that we increase the replica of out application with load balancer facing upfront which direct the traffic to any of the replica.
So the scalability issue with monolith is that we are required to have the replica of the whole application as a unit, which might use high computation and is costly to implement.
Microservice solves these issue, know why? let’s find out
Microservice is somewhat same as monolith but here we divide out whole software/product into number of services. Lets take example of flipkart. Flipkart as a product has various modules such as for billing, catalog, user account, all combined give us flipkart as a product.
So there might be a case when users using out product catalog section might be large as compared to billing. So in that case there is no meaning to scale the whole application. Here we might have to scale only the product catalog section only not the billing part. That one of the advantage of the microservice architecture.
Now where docker and kubernetes comes!
Implementing the microserice with the container technology like Docker and container orchasteration tech like kubernetes is quite easy as scaling out the application becomes seamessly easy and what we dont have to look for scalability issue, kubernetes does the things for us.
This blog is first in the long series of blog that is about to come. In this series I’’ll talk about what things originated from monolith architecture to kubernetes and what are the developnent tooks place in between and how cloud computing comes in the way.
Will continue other stuffs in the other part of this series..