Modular monolith: is this the trend in software architecture?
Status:: 🟩
Links:: Modular Monolith
Metadata
Authors:: Su, Ruoyu; Li, Xiaozhou
Title:: Modular monolith: is this the trend in software architecture?
Date:: 2024
URL:: http://arxiv.org/abs/2401.11867
DOI:: 10.48550/arXiv.2401.11867
Su, R., & Li, X. (2024). Modular monolith: Is this the trend in software architecture? (arXiv:2401.11867). arXiv. https://doi.org/10.48550/arXiv.2401.11867
Recently modular monolith architecture has attracted the attention of practitioners, as Google proposed "Service Weaver" framework to enable developers to write applications as modular monolithic and deploy them as a set of microservices. Google considered it as a framework that has the best of both worlds and it seems to be a trend in software architecture. This paper aims to understand the definition of the modular monolith in industry and investigate frameworks and cases building modular monolith architecture. We conducted a systematic grey literature review, and the results show that modular monolith combines the advantages of monoliths with microservices. We found three frameworks and four cases of building modular monolith architecture. In general, the modular monolith is an alternative way to microservices, and it also could be a previous step before systems migrate to microservices.
Notes & Annotations
Color-coded highlighting system used for annotations
📑 Annotations (imported on 2024-03-21#22:04:32)
However, several companies did not get the expected benefits from migrating to microservices, and fell into difficulty because of issues such as high cost and complexity of microservices [9].
[9] Ruoyu Su, Xiaozhou Li, and Davide Taibi. 2023. Back to the Future: From Microservice to Monolith. arXiv preprint arXiv:2308.15281 (2023).
Recently, the concept of "Modular Monolith" has attracted the attention of practitioners, as Google proposed the "Service Weaver" framework to enable developers to write applications as modular monolithic and deploy them as a set of microservices [3]. Google explains that it is a framework that has the best of both worlds: the development velocity of a monolith, with the scalability, security, and fault-tolerance of microservices [3].
[3] Kucukoglu Ahmet. 2023. What is Modular Monolith? https://serviceweaver.dev/.
The concept of modularization is not new knowledge, it has been proposed in the last century that modularization is a mechanism for improving the flexibility and comprehensibility of systems [8]. It differs from a monolithic system in that modularization divides the system into separate modules, and independent teams can work on each module so that it reduces product development time and has greater flexibility and comprehensibility [8].
[8] David Lorge Parnas. 1972. On the criteria to be used in decomposing systems into modules. Commun. ACM 15, 12 (1972), 1053–1058.
The results show that Modular Monolith is a software architecture pattern that combines the advantages of monolith with microservices architecture. In this architecture, systems are organized into loosely coupled modules, each delineating well-defined boundaries and explicit dependencies on other modules.
We found three frameworks for building the modular monolith: Service Weaver, Spring Modulith, and Light-hybrid-4j.
Modular Monolith is a software architecture pattern that strategically combines the simplicity of a monolithic structure with the advantages of microservices.
The focus on business domains rather than technical layers, along with the vertical stacking of modules, enhances code organization and maintainability.
More importantly, Service Weaver has flexible scalability, it can easily scale applications horizontally or vertically on demand, whether as a monolithic application or a distributed microservice [S52].
[S52] Spring Blog. Introducing Spring Modulith. 2022. https://spring.io/ blog/2022/10/21/introducing-spring-modulith
Shopify is one of the largest Ruby on Rails codebases in existence, worked on for over a decade by more than a thousand developers [S12]. It was initially built as a monolith all the distinct functionalities were built into the same codebase with no boundaries between them. To better development, Shopify chose to change its architecture. Shopify originally considered microservices but finally chose modular monolith to balance the benefits of a single codebase with clear component boundaries. Therefore, Shopify is a great example that has used this approach as an alternative to microservice decomposition [S12][S30].
[S12] Chris Richardson. How modular can your monolith go? Part 1 - the basics. 2023. https://microservices.io/post/architecture/2023/07/31/ how-modular-can-your-monolith-go-part-1.html
[S30] Thinktecture Team. Modular Monoliths With ASP.NET Core – Pragmatic Architecture. 2021. https://www.thinktecture.com/en/asp-netcore/modular-monolith/