Tuesday, March 28, 2017

Microservices Architecture



Microservices Architecture


The term "Microservice Architecture" has come into the picture over the last few years. These days all most all are talking about the microservices. But what is a microservice really..?? why we need it..??and when we need microservices..??

Let see first what is microservice in a simple manner using an example..

what is a Microservice.??

simply, microservices architecture is when you separate your application into smaller applications (we will call them services) that work together.


Asssume that a developing team has developed a large application (ex: online education app) where all the services (ex: login service, registration services,  student service, course service... ) have put inside one data service ( This is what we called as Monolithic Architecture).

In microservices what we do is we breakdown this large application into smaller applications as separate services (login microservice , student microservice , course microservices...). Each microservice act  as a separate end point. In a technical way it describes a particular way of designing software applications as suites of independently deployable services in different servers.

NOTE :
In Monolithic Architecture all services are composed inside one data service rather than containing architecturally separate services.

let see what is the different between monolithic and microservices...























As you see in above picture in Monolithic there is only one service that serves everything and it is hosted on one server and it is hard to scale.

But in Microservies it has different services for each functionallity and we hosted each microservice on different server and it is easy to scale.

If one microservice needs data from some other microservice this communication doing using API which are sent JSON messages.

Why we say that scaling is hard in monolithic and easy in microservices..??

Assume you are using monolithic architecture to develop your application and one service only getting lot of requests from client. Can you scale up only one service or a function in your application then..?? No..since you have put all services into one single process you could not able to scale up one specific function there. But In microservices easily we can scale up one specific service to handle lot of requests coming into it.

I hope now you have the basic idea of microservices.





No comments:

Post a Comment