From Chaos to Cohesion: Building Modular Monoliths in the Real World
summary
A practical migration path shows moving code into top-level packages, adding Spring Modulith starters, then a single CI-enforced verification test that finds illegal cross-module access—one case study fixes 87 violations and 4 cycles, converts the first module in two days and ends with five modules and zero violations. Runtime features include persisted event publication (JDBC), automatic republish on restart, OpenTelemetry/Jaeger traces across modules, a scenario API with Awaitility for event-driven tests, and optional externalization to Kafka/RabbitMQ for gradual extraction.
AI-written summary · about
chapters (24)
- 0:00Modular monoliths intro
- 1:58Code structure erosion
- 7:40Microservices tax and structure
- 10:09Modularity history & principles
- 11:57Spring Modulith framework
- 13:18Monolith vs microservices
- 15:25Vertical domain slicing
- 19:567 steps to structure code
- 23:50Decoupling with events
- 25:34Demo: module structure
- 28:01Decoupling with events
- 30:50Breaking dependencies
- 31:53Maintaining modules discipline
- 32:56Docs & observability with Spring Modulith
- 34:40Adding observability
- 36:05Handling event failures
- 38:13Testing modules with scenario API
- 39:16Module testing
- 39:59Preparing extraction
- 40:40Externalizing events
- 41:44Avoiding microservices
- 42:47Starting modular monolith
- 43:49Key takeaways
- 45:34Final thoughts
related talks
01h 01mBuilding Modular Monoliths using Spring Modulith
50mImplement the monolith - the one well modularized
51mBuilding better monoliths – Implementing modulithic applications with Spring
57mModularizing the Monolith
46mModular Applications with Spring
47mModular Monoliths
53mCrafting a self-documenting Modular Monolith with DDD principles (theory not included)
50mSpring for the architecturally curious developer
