This article was originally published on bmf-tech.com.
Overview
This is a memo on what I researched about modular monoliths.
What is a Modular Monolith?
- A monolith divided into modules
- While domain-based division is commonly seen, various patterns such as functional or technical division can be considered
- Like a monolith, it has a single deployment pipeline
- Benefits
- Modules are divided, allowing independent development per module
- Easier transition to microservices
- Easier to progress with microservice conversion per module
- When transitioning from a monolith to microservices, it can be positioned as a strangler pattern (though it may not always be easy)
- Easier to review module boundaries, allowing more flexible adaptation to boundary changes compared to microservices
- Drawbacks
- Easier to cross module boundaries
- Microservices communicate over a network, preventing boundary crossing, but modular monoliths do not, so care must be taken with boundary violations
- Like a monolith, it has a single deployment pipeline, so if it becomes bloated or module dependencies become complex, operation becomes difficult
- If each module shares a single database, the cost of transitioning to microservices increases
Service Weaver
Google has released a tool called Service Weaver for developing as a modular monolith and deploying as microservices.
Impressions
I had a bit of a dream about modular monoliths, but my impression led me to write a poem.
I think it's logical that architecture needs to evolve with organizational expansion, but I wondered if there might be a silver bullet architecture that can flexibly respond to organizational scalability or doesn't incur excessive costs. (There isn't.)
Organizations may expand, contract, or remain unchanged, but since companies assume growth, I thought it might be good to invest proactively in organizational scalability.
I wanted to quote a passage related to this topic, so I'll include it here to conclude.
However, what we need to focus on here is the difference in lifecycle between the two. Organizational and team configurations can be changed the next day depending on the company's policy if desired. However, architecture and systems are difficult to change quickly like an organization.
References
- microservices.io - How modular can your monolith go? Part 1 - the basics
- microservices.io - How modular can your monolith go? Part 2 - a first look at how subdomains collaborate
- microservices.io - How modular can your monolith go? Part 3 - encapsulating a subdomain behind a facade
- microservices.io - How modular can your monolith go? Part 4 - physical design principles for faster builds
- techblog.hacomono.jp - Introducing Modular Monoliths to a Monolithic Rails
- tech-blog.rakus.co.jp - Monoliths Prepared for Service Division (Modular Monoliths, Aggregates, etc.)
- r-kaga.com - Summarizing Modular Monoliths
- speakerdeck.com - Expressing Complex Domain Regions and Boundaries with Modular Monoliths
- shopify.engineering - Deconstructing the Monolith: Designing Software that Maximizes Developer Productivity
- www.infoq.com - Microservices are not inevitable in monolith decomposition - A talk by Sam Newman at QCon London
- www.infoq.com - How Shopify Transitioned to a Modular Monolith
- www.publickey1.jp - Google Releases "Service Weaver" Framework, Combining the Best of Monoliths and Microservices, as Open Source
- Transaction Design in Modular Monoliths
- dev.classmethod.jp - [Report] For Those Hesitating Between Monoliths and Microservices #devio_day1 #main
- engineering.mercari.com - Mercari's Efforts in Modular Monolithization of the Transaction Domain
- eh-career.com - Reasons for Transitioning to a Modular Monolith ─ Asoview's Large-Scale Efforts to Balance Microservice Autonomy and Monolith Consistency
- logmi.jp - The Importance of "Flexible Architecture Design for the Future" - Adopting Modular Monoliths for Parallel Development by Three Teams
- medium.com - The Modular Monolith: Rails Architecture
Top comments (0)