Developing Microservices with Aggregates
summary
Argues that DDD aggregates as single-unit boundaries solve microservice decomposition by using IDs instead of object references and limiting transactions to one aggregate; demonstrates an example system (order service, customer service, order-history service) with code on GitHub and an Eventuate-backed event store that persists events and publishes them as the single source of truth; shows a saga workflow for cross-service consistency (order created → customer reserves credit → order approved), covers compensating transactions, CQRS materialized views (MongoDB/Elastic) and practical issues like schema evolution and at-least-once delivery.
AI-written summary · about
chapters (16)
- 0:00Start
- 4:20Microservice architecture
- 5:48Domain model = tangled web of classes
- 6:56Reliance on ACID transactions to enforce invariants
- 10:31Domain Driven Design
- 14:40Aggregate rule #2
- 17:13Aggregate granularity
- 22:18Event-driven architecture
- 22:28Use event-driven, eventually consistent order processing
- 25:41Complexity of compensating transactions
- 35:01Request handling in an event sourced application Order Service
- 38:10Benefits of event sourcing
- 40:46Drawbacks of event sourcing...
- 45:59The Customer aggregate
- 48:12Customer Controller
- 50:24Summary
