DBRaven
Migration Playbook

Monolithic ApplicationModular Monolith

Medium complexityLow riskAlways Possible

Duration Estimate

2–6 weeks

Migration Stages

5

Blocking Prerequisites

2

Confidence

Strong

Readiness Checklist(2 blocking, 2 advisory)

blocking
Team

Team at mid maturity level

This migration requires mid engineering maturity. The team should have hands-on experience with the relevant technologies and proven ability to execute complex system changes safely.

Guidance: Build team skills through learning modules before attempting this migration.

blocking
Monitoring

Production observability baseline established

Comprehensive metrics, logs, and traces must be in place before the migration starts. You need a clear baseline to detect regressions during and after each migration stage.

Guidance: Instrument key metrics (latency p99, error rate, throughput, resource utilization) on all affected components.

Process

Rollback plan documented and tested

Rollback feasibility for this migration is 'always'. Rollback is possible but may be complex, document the exact rollback steps and test them in a non-production environment.

Guidance: Run a full dry-run in a staging environment that mirrors production load characteristics.

Process

Migration trigger condition confirmed

Confirm that the actual trigger for this migration is present. Common triggers: Deploy coupling slows feature velocity: all teams share one deploy pipeline; Team size exceeds ~15 engineers and ownership boundaries are unclear; Incident blast radius is the entire application regardless of change scope.

Guidance: Validate the trigger with production metrics or benchmarks before committing to the migration timeline.

Migration Stages

1Domain MappingLow1-2 weeks

Identify 3-6 natural domain clusters from existing code. Map existing files, models, and endpoints to domains. Document cross-domain dependencies explicitly.

Key tasks

  • ·Identify 3-6 natural domain clusters from existing code. Map existing files, models, and endpoints to domains. Document cross-domain dependencies explicitly.
  • ·Validate rollback capability at this stage boundary before proceeding.

Exit criteria

  • 'Domain Mapping' validated in production with no regression in key metrics

Rollback: possible at this stage

2Directory Structure ReorganizationLow1-2 weeks

Move files into domain directories without changing behavior. All imports point to new locations. No logic changes: this is a structural-only commit.

Key tasks

  • ·Move files into domain directories without changing behavior. All imports point to new locations. No logic changes: this is a structural-only commit.
  • ·Validate rollback capability at this stage boundary before proceeding.

Exit criteria

  • 'Directory Structure Reorganization' validated in production with no regression in key metrics

Rollback: possible at this stage

3Interface EnforcementMedium2-4 weeks

Add linting rules or import guards that reject cross-domain direct imports. All cross-domain access must go through public module interfaces. Fix violations.

Key tasks

  • ·Add linting rules or import guards that reject cross-domain direct imports. All cross-domain access must go through public module interfaces. Fix violations.
  • ·Validate rollback capability at this stage boundary before proceeding.

Exit criteria

  • 'Interface Enforcement' validated in production with no regression in key metrics

Rollback: possible at this stage

4Schema Domain AssignmentMedium2-6 weeks

Assign each database table to an owning module. Enforce that only the owning module queries its tables directly. Other modules must call the owner's API.

Key tasks

  • ·Assign each database table to an owning module. Enforce that only the owning module queries its tables directly. Other modules must call the owner's API.
  • ·Validate rollback capability at this stage boundary before proceeding.

Exit criteria

  • 'Schema Domain Assignment' validated in production with no regression in key metrics

Rollback: possible at this stage

5Independent Test SuitesLow1-2 weeks

Split CI into per-module test runs. Each module's tests run in isolation. Integration test suite covers cross-module contracts only.

Key tasks

  • ·Split CI into per-module test runs. Each module's tests run in isolation. Integration test suite covers cross-module contracts only.
  • ·Validate rollback capability at this stage boundary before proceeding.

Exit criteria

  • 'Independent Test Suites' validated in production with no regression in key metrics

Rollback: possible at this stage

Rollback Decision Points

After stage 5

Trigger: Final validation: confirm all success criteria are met within 24 hours of migration completion. If any success criterion fails, trigger rollback or remediation.

Procedure: If success criteria are not met within 24 hours, escalate to the architecture team. Decide between full rollback, partial rollback, or targeted remediation based on scope.

Recovery: 24–72 hours for full assessment and remediation

Success Criteria

  • Target state 'Modular Monolith' is stable in production for 72+ hours with no regressions.
  • p99 latency on all affected services is within acceptable range (≤110% of pre-migration baseline).
  • Error rate is at or below pre-migration baseline.

This migration playbook is derived from structured architecture knowledge. Duration estimates and risk levels are structural approximations based on documented migration complexity and operational risk, not measured execution data. Validate all stages against your specific system constraints before executing.