In the previous section, we saw that microservices are completely independent of other services in the system and run in their own processes. As per this definition, there are certain attributes that define microservices to be completely independent from other components. Let’s first look at what the core attributes are:
- Isolated functionality: Don’t try to achieve too much within a single microservice. Instead, design it for only one reason and do that well. This means that the design should try and avoid any dependency on any other part of the functionality. This part is extremely important in my opinion as it lays the foundation for the rest of the attributes.
- Isolated data and state: Each service owns its data and its state. It does not share ownership with any other application or part.
- Independent deployment: A cumulative effect of the preceding points. This helps you with continuous deployment.
- Technology adoption: This is easier when the first two points have been taken care of, since there is no longer an impact on any of the existing modules. The beauty here lies in the fact that you could have two different versions of a microservice in two different technologies. Extremely beneficial.
- Consistency and resiliency: It has to be impeccable. If you can’t rely on a service to return within a speculated period or rely on it to be always available, then the whole purpose of it is lost.