Agility embraces changes in the functional and non-functional requirements. When the latter happens, the architecture needs to evolve, putting architectural refactoring in evidence. Microservices is an architectural style that enables more agility in a system’s architecture, as it favors the evolution of the system by adding new operations. But it also has its liabilities: the number of services can explode, with similar ones being created. Ultimately, that harms the system’s evolution and maintenance. This work addresses these challenges by proposing a catalog of architecture refactorings to promote reusability in Microservices. These refactorings target patterns that embrace data heterogeneity in the APIs and employ metadata to enhance messages and guide processing. We evaluated the catalog with case studies of three real-world applications and conducted change impact analysis in two scenarios: adding a new data provider, and adding a new processing algorithm. The results showed that embracing heterogeneous data in the API enables a more seamless addition of new data providers, and using metadata can strongly decouple the processing algorithms from the data they use. Furthermore, the results point to other improvements in observability, scalability, and infrastructure.
Managing non-functional requirements (NFRs) is complex and has been challenging over the years. These requirements are typically used to make important architectural decisions early in the project, which can be a problem if they are uncertain or volatile. Identifying and demonstrating the existence of anti-patterns associated with the negligence and volatility of NFRs is a topic that deserves attention. This study identified five anti-patterns associated with managing NFRs and the volatility of these requirements. Based on a survey applied to 40 professionals with more than 10 years of experience, data were obtained from 144 NFRs of real projects, and important dysfunctions were identified. The mapped anti-patterns describe dysfunctions associated with: incorrect perception of needs (FALSE CERTAINTY); delayed elicitation of NFRs (LATE IDENTIFICATION); immutable NFRs (FROZEN NFR); projects that include all NFRs without validation of feasibility and impacts (FULL PACKAGE); and equal management for all NFRs (INVARIANT MANAGEMENT).