Microservices is a software architecture model.this model consiste of decomposing a monolith application into multiple smaller services are very tightly focused on doing one thing and doing it well.Each is individually deployable and composed then a single application independent from other services.
A monolith application is where functionalities of the application is packaged together as a single unit. This unit can be a war,jar,ear or other kind of archive.
Advantages of Monolithic Applications
There are a few advantages of this style of application :
- Faster initial development : With one application, its easy to conceptualize and have the code in one place,easy to add additional features, especially when the application is relatively small.
- Well known : Little user confusion (e.g new apps on the same platform would be more easily found by users to the existing apps). Users wouldn’t have to learn about different application, but would be focused towards one application.
- Improved integration : Features could integrate with each other well and easily, as there is only one user table.
- User interface similarity : All of the pieces of the application would look very similar, so it would be obvious it’s all part of one system.
- Easy sharing : a single archive can be shared with all the team and during the life cycle of the project.
Disadvantages of Monolithic Applications
This section describes the issues with a monolithic application.
- Domain Expertise : Different teams are responsible for different layers in a monolith application. A presentation-layer team fro exemple gets specialized in UI technologies, but has little knowledge in application or database access layer.So when a new feature is needed to add ans involves all the layers of the application, it requires to multiple teams to coordinate to deliver a new feature. This increase the time a feature takes from conception to delivery.
- Limit technology choices : Monolith application limits the technology choices by forcing a layer to be implemented using one framework.For exemple if the business logic is implemented using spring framework, the hall layer has to be implemented by the same framework.
- Releases: As the monolith application is packages in one archive(jar, war, ear….), making even a small change in any layer of the application requires to deploy all the application and pause all production.
- Development effort : As monolith application grows continually by adding new features,extends others and rarely remove old functionalities.This make code complex to maintain and add new features,multiple teams requires to handle different functionalities of different layers and frequently coordinate as the entire layer is developed as a strong coupled component.
Microservices is a software architecture style that make application more flexible to deploy and update .Each service of the system run and deployable independently, on its own process without impacting the other processes.
Lets look some characteristics of an application using this style of architecture.
- Single Responsibility :A microservice is responsible for one and only one capability or functionality in all the system .
- Individuality deployable : Each microservice can independently deployed and updated without impacting the system.
- Technology and tools choice : The tream can build and implement each micro service using different technologies and tools event different databases.For exemple it can build a microservices in java EE and other in phyton or NodeJs. A service that requires to store data is a RDBMS can use mySql databse or other that need to store documents can choose mongoDB. It depends on witch technology is suitable to the functionality that the service is responsible for .Also on the team decision.