Microservices is a type of architecture with a single goal: to avoid complexity.
Most of the books define microservices as an alternative architecture for building applications, while they offer a great way to to decouple components within an application boundary. In microservice paradigm, each component is a full but miniature application with focus on producing a single business task in compliance to the single responsibility principle.
Microservices is an application architectural style in which an application is composed of many discrete, network-connected components called microservices. Microservices architecture focuses on HTTP and JSON protocols to communicate, therefore you may write microservices with any programming language.
Benefits of microservices:
- agility and productivity
- accelerate delivery by minimizing communication among people
- reduce the scope and risk of changes
Important Note: Because reuse create dependencies, which make it harder harder for the team to work independently, microservices value independence over reuse among services. (reuse within a service is still valued).
When do you know you are doing microservices well?
When you take one service, make a change and deploy it into production without having to touch everything else.
Principles of microservices
- Modelled around business domain
- Culture of automation
- Hide implementation details
- Decentralize all the things
- Deploy independently
- Consumer first
- Isolate failure
- Highly observable
Disadvantages of microservices
While following microservices architecture guidelines it is easy writing an individual microservices, but in the same time operationalizing and scaling it is difficult.
- A microservice is a small and autonomous service that works well together with another microservice.
- The prefix micro in microservice refers to the granularity of the internal components, and not to the granularity of the exposed interfaces.