We would discuss the 8 fundamental principles of microservices architecture. They are:
- Modeled around business domain
- Adapt an automation approach
- Hide internal implementation details
- Highly Observable
- Decentralization
- Independent deployment
- Customer-centric
- Failure Isolation
1. Modeled around business domain
By making microservices application centered around business domain, some stability would be created. This ensures that the requirements for their functionality does not change frequently. Also, the allows the developers to focus more on the the system logic and and operability rather than on particular technology set. Additionally, the makes it possible for the services to directly reflect the business requirements.
2. Adapt an automation approach
Since microservices approach tends to create more moving parts than a corresponding monolith, it is necessary to have a way to ensure coherent communication flow within the system.Therefore, automation becomes a very important part of the microservice application life cycle. A DevOps approach is normally adopted with Continuous Integration/Continuous Delivery(CI/CD) along a single pipeline.
Development practices such as test automation, automated deployment and configuration management enables enterprise system to scale more efficiently and improve service coordination as well.
3. Hide internal implementation details
This is essential to maintain loose coupling between interacting services in an enterprise application. In this way, the services only the needed functions required to communicate with other services without providing access to internal details. This is achieved by bounded contexts based on Domain Driven Design(DDD).
4. Highly Observable
An important part of application life cycle management is monitoring. In case of microservices, due to the distributed nature of the services, there is need to provide a monitoring solution to record the operation and performance of the system. Such a solution provides an aggregated view of the system and give needed statistics which may included number of instances. resource utilization, traffic and others. Logging can also be used to maintain historical data of the service operation.
5. Decentralization
This principle is based on the requirement that individual services need to be developed, managed and maintained autonomously. This means that the relevant business logic of a service should be kept within the service themselves. As such, choreography-based pattern is favored over orchestration.
A decentralized design conforms to Conway’s law that states: “any organization that designs a system will produce a system whose structure is a copy of the organization’s communication structure”
6. Independent deployment
I think this is the primary principle of the microservices architecture. Hence, it is this concept of independent-deployability that give microservices the most edge over monolith.This means that the service can be deployed without influencing or be influenced by the operation of other services.
7. Customer-centric
Since services are created to be used, it is necessary to make the consumption of these services as seamless as possible for the consumers. This requires involvement of the customers in the service development life cycle by use of a feedback system. Another way would be the use of proper documentation which can be achieved using API frameworks such as the Swagger. Also, a service discovery feature could be integrated to ensure easy access to the services.
8. Failure Isolation
I would say that is another very key benefit of microservices. This means that a failure of a single services not affect the operation of other services. In addition to that, this failure could easily be discovered and managed in a considerably short period of time. Since failures are not cascaded, the overall application uptime could be maximized.Some techniques to achieve this includes timeouts and circuit breakers.