Crafting a self-documenting Modular Monolith with DDD principles (theory not included)
summary
Demo repository shows a running modular monolith using Spring Modulith and JMolecules with ArchUnit tests that enforce a layered DDD structure and bounded contexts. Aggregate roots, value objects and repositories live only where tests expect them, and a change-price use case triggers domain events published on transaction commit implementing a built-in transactional outbox. Event listeners support sync and require-new retries, and Server-Sent Events stream order updates to the UI so eventual consistency and rollout to microservices remain straightforward.
AI-written summary · about
chapters (27)
- 0:00Modular monoliths and DDD
- 2:04Microservices strengths and weaknesses
- 3:51Monoliths pros and cons
- 5:17Why modular monolith
- 7:07DDD with Spring Modulith
- 9:42Project structure setup
- 11:25ArchUnit tests
- 13:14DDD in session module
- 16:09Architectural tests
- 17:57Layer boundaries enforcement
- 19:29Change price use case
- 22:19Transactional outbox pattern
- 24:33Event listeners and consistency
- 25:56Event propagation testing
- 27:51Eventual consistency handling
- 30:24Attendee and order aggregates
- 32:35Domain layer isolation
- 34:05Bounded contexts exposure
- 37:07Module dependencies verification
- 38:20Module structure inspection
- 40:12Price change event handling
- 41:48Immutable domain objects
- 43:15Order price updates
- 44:42Server-Sent Events
- 46:53Architecture documentation
- 49:23Key takeaways
- 51:12Architecture validation
related talks
01h 01mBuilding Modular Monoliths using Spring Modulith
43mModular Monoliths: The Architecture That Scales w Your Domain
02h 29mPractical advice for building glorious monoliths
51mBuilding better monoliths – Implementing modulithic applications with Spring
47mModular Monoliths
52mBuilding monolith applications that could scale to microservices..
02h 31mSlice & Dice your Monolith with Domain Driven Design
59mMajestic Modular Monoliths
