Skip to content

Phase 5: Decommission Monolith

Status: Planned
Prerequisite: Phase 4 (Orders) stable for 30 days; all traffic at 100% on new services.
Risk: This phase is irreversible. The rollback path disappears when the monolith is shut down.


Goal

Shut down the legacy Java EE monolith and the shared Oracle database. At this point, all bounded contexts (Customers, Inventory, Orders) are independently deployed, SLA-compliant, and event-driven. The monolith is not needed as a fallback.


Prerequisites Checklist

Before this phase begins, all of the following must be true:

  • Customers Service: 30 days at 100% canary weight, no SLA breaches
  • Inventory Service: 30 days at 100% canary weight, no SLA breaches
  • Orders Service: 30 days at 100% canary weight, no SLA breaches
  • Zero traffic to the monolith for 7 consecutive days (Kong access logs confirm)
  • Oracle database: no writes for 7 days (DBA confirms via AWR report)
  • Fulfillment Gateway: confirmed operational with OrderConfirmed events from Orders Service
  • All SLA files in contracts/slas/ reviewed and updated to reflect the new architecture
  • Engineering VP sign-off

Decommission Sequence

  1. Final snapshot: Take a full Oracle database export. Archive to S3 (7-year retention for financial audit).
  2. Remove Kong routes: Delete monolith route configs from Kong. All paths must now resolve to a new service or return 404.
  3. Drain monolith: Let the monolith process any in-flight requests (max 30 seconds). Scale to 0 replicas.
  4. Shutdown verification: Confirm 0 active connections to Oracle for 10 minutes.
  5. Terminate monolith ECS service: Remove from ECS cluster and Terraform state.
  6. Oracle decommission: Stop Oracle RDS instance. Take final snapshot. Schedule deletion (7-day retention before actual deletion).
  7. DNS cleanup: Remove any internal DNS records pointing to the monolith.
  8. Infrastructure cleanup: Remove Debezium connectors, dual-write relay, and reconciliation jobs.

Post-Decommission Validation

  • All /v1/* paths return valid responses from new services
  • Kafka topics contain no new messages from monolith producers
  • OTEL pipeline shows no spans from the monolith application
  • Cost report: Oracle RDS and ECS monolith cluster no longer appear in AWS Cost Explorer

What Cannot Be Rolled Back

Once the Oracle database is deleted (7 days after shutdown), the monolith cannot be restored. Ensure the S3 archive exists and is readable before proceeding.