Phase 2: Extract Customers¶
Status: Done
Risk: Low — Customers has no upstream dependencies at the service boundary.
Rollback cost: Low — re-route /v1/customers/* to monolith in Kong; no data loss if dual-write is healthy.
Goal¶
Customers is the lowest-risk extraction: smallest domain, simplest data model, no dependencies on Orders or Inventory at the service boundary. Extracting it first gives the team a full practice run of the extraction workflow (CDC bootstrap, dual-write, traffic canary, SLA validation) before tackling CQRS and event sourcing.
What Changes¶
| Concern | Before | After |
|---|---|---|
| Customer data store | Oracle (shared) | PostgreSQL (per-service) |
/v1/customers/* handler |
Monolith Java EE | Customers Service (TypeScript/Fastify) |
| Customer events | None | CustomerRegistered, AddressUpdated on Kafka |
| SLA measurement | None | customers-sla.yaml → SLO → Prometheus alerts |
Extraction Sequence¶
- Bootstrap data: Debezium CDC from Oracle
customerstable →chakra.customers.bootstraptopic → Postgres. - Dual-write enabled: Customers Service writes to Postgres; relay also writes to Oracle.
- Canary start: Kong routes 1% of
/v1/customers/*to Customers Service. - Canary ramp: 1% → 10% → 50% → 100% (24-hour hold at each weight, SLA must hold).
- Dual-write disabled: Once at 100%, relay is stopped. Oracle
customerstable becomes stale. - Monolith handler decommissioned: After 30 days at 100% with SLA compliance, the monolith customer handler is removed.
Go / No-Go Criteria¶
- Customers Service p99 latency ≤ 300ms at all canary weights
- 0 data divergence between Postgres and Oracle during dual-write (reconciliation job confirms)
CustomerRegisteredevents appearing in Kafka for all new registrations
Rollback¶
- Kong: set
/v1/customers/*weight to 0 for Customers Service (monolith receives 100%). - If dual-write is active: no data loss. If dual-write is disabled: Oracle may be stale — restore from Postgres via reverse CDC if required.
- Trigger: SLA burn rate > 2× for 15 minutes, or data divergence > 0.1%.