TeamVenture Architecture Migration (Order + Guardrails)
Migration order (domain/context)
- Planning (core): Plans + review collaboration (memberships, itinerary revisions, itinerary suggestions)
- Authorization (supporting): Policy/permission checks (no ownership of business fact tables)
- Identity (supporting): Auth/login/session/user profile
- Infrastructure (supporting): Read/write routing, cache/MQ wiring, monitoring hardening
Refactor order inside a domain
- Split classes first (semantic/CQRS refactor), keep packages stable
- Example:
*Service→*QueryService+*CommandService
- Example:
- Move packages second (mechanical refactor)
- Move in small batches; keep public API/HTTP routes stable
CQRS + read/write split rule
- Query methods must be annotated with
@Transactional(readOnly = true)to route to slave - Command methods must use default or explicit
@Transactionalto route to master - Permission checks that must be immediately consistent should read from master (or cache with strict invalidation)
Execution checklist (per step)
- Make change in smallest viable slice
- Run Java tests (
mvn test) and fix regressions introduced by the slice - Avoid broad renames and unrelated refactors