Implement Monolith - Codebase Modularization, Microservices
summary
Shows how a product that started as a monolith becomes a modularized monolith by enforcing module API boundaries in code, not just packages. Uses Java 9 research but chooses ArchUnit to run architecture tests in CI, including rules like banning field injection and forbidding internal-class calls; initial scan surfaces ~3,000 violations. Implementation is pragmatic: add ArchUnit tests, enable one module at a time, move classes to the API, hide repositories behind APIs, and use mob programming to avoid massive pull-request reviews.
AI-written summary · about
chapters (39)
- 0:00Intro
- 2:30Start with monolith first
- 3:56A kind of agenda
- 5:53The perfect microservice
- 7:26There's this small feature... GDPR
- 8:43And one more: T&C
- 11:16Two modules and... the rest
- 12:28DB Relations
- 14:14The future: replace Identity module
- 14:42Future - replace CIAM
- 15:12We know where we're going
- 16:06Broken boundaries
- 16:33Is there a tool to help us
- 17:02Java 9
- 18:09ArchUnit
- 19:58Example: Field injection
- 22:29Example: Coding rules
- 23:13Example: layered architecture
- 24:23Example: Slices
- 25:12More examples
- 25:56Access module using its API
- 26:17Rule #1: Access Module via API
- 26:45Rule #1: Implementation
- 28:04Rule #1: Should be included in scan
- 28:54Rule #1: Rule check
- 30:19Rule #1: Actual dependency check
- 31:02Module has API
- 31:22Rule #2: Implementation
- 32:27Module API is unit tested
- 33:18Module internal architecture
- 34:32Start with a simple one
- 36:10Approach
- 36:49The next one
- 37:44Mob programming
- 38:57Other simple modules
- 39:33Create a new module
- 39:59Largest modules comes last
- 40:34Cohesion
- 41:44Next steps
