The architecture of an application should follow business requirements and be sufficient to accommodate the necessary speed of change.
Dividing the system into multiple services brings many challenges. However, it also brings the benefit of increasing team autonomy, influencing delivery time in line with business desires. It is important to be mindful of the potential risks and challenges to ensure that the benefits justify the effort.
Key points about distributed systems (microservices):
- Each service should have as much isolation as possible.
Avoid generating coupling between services that are costly to maintain. Excessive coupling in an integrated codebase is a complicated business, and distributed coupling further increases the difficulty level.
- Understand what should exist within each service.
The strategic design of Domain Driven Design (DDD) can be very inspiring for understanding this topic. Try to understand the main delimited contexts and ensure high cohesion.
- Systematization for defining service contexts.
Avoid creating a new service solely based on a particular team’s perspective.
- Maintain effective communication
- Here, we need to rely even more firmly on the documentation pillar and ensure that information navigates through teams to maintain maximum convergence with the principles defined for the product.
- Manage the level of freedom in choosing stacks to address problems caused by service.
We suggest having a closed set of stacks that can be revisited occasionally to understand if it still provides what is necessary.
- Have a well-defined view of the performance, scalability, and resilience requirements of each integration between multiple services.
- Promote debates for a conscious decision-making process regarding integration between services.
In addition to the protocol, the definition between synchronous and asynchronous carries many issues, especially in an asynchronous call.
- Be careful when dealing with transactions.
Transactions in a distributed environment can be very complicated. Therefore, it is important to make well-informed decisions regarding this topic.