Our team of 5 members are managing a microservice architecture that currently includes around 200 Java Spring boot microservices, with approximately 50 new services being added each year. We follow domain-driven design principles and use Spring Cloud Gateway as the entry point, integrating with various systems. Our typical flow looks like this:
Client -> Client Integration Service -> System X Integration Service -> System X
Communication is handled via REST and queue services.
AsWe're encountering several challenges as the number of microservices grows, we're finding it increasingly difficult to maintain them. For example, upgrading to a newer version of Java took us 5 sprints, highlighting the challenges of managing upgrades and deployments across so many services.:
Additionally, some microservices are running thin, with only one or two REST endpoints. To address this, we're considering transitioning to a modular monolith architecture to introduce reusability and potentially reduce overhead.
- Maintenance Overhead: Upgrading to a newer version of Java required 5 sprints, primarily due to deprecated objects and the need to update the entire codebase. This process highlighted the difficulty in managing upgrades and deployments across many services.
- Thin Services: Some microservices are running with only one or two REST endpoints, which seems inefficient. This raises questions about whether consolidating them into a modular monolith could improve reusability and reduce overhead.
- Resource Consumption: The resource usage of numerous microservices compared to a modular monolith architecture is also a concern, as it affects scalability and operational costs.
I've researched Spring Modulith and modular architecture, but found a lot of controversial discussions suggesting that microservices are inherently better. Tools like Renovate Bot are useful for upgrading simple dependencies, but significant updates like Java require changes across the entire codebase, especially if deprecated objects are involved. On the other hand, the resource consumption of numerous microservices compared to a modular monolith also raises questions.
Question:
- Given these challenges, would transitioning to a modular monolith architecture help manage the increasing number of microservices, improve reusability, and streamline maintenance?