Choosing Offline or Online Database Migration with a Decision Algorithm


Appendix:

Detailed formulas and decision rules

Here be dragons 🐉

This appendix collects the complete algorithm in one place. All time values are in minutes unless stated otherwise. The calculations estimate timing; capability and recovery checks establish whether the plan can actually perform the required work.

Define the shared inputs

VariableMeaningValid value
DataGBAmount of existing data to copy.Greater than zero, in GB
CutoverBudgetLongest acceptable cutover interruption.Greater than zero, in minutes
RollbackBudgetLongest acceptable rollback interruption.Zero or greater, in minutes
NetworkLatencyNetwork round-trip delay for the proposed path.Zero or greater, in milliseconds
PlanningFactorMultiplier applied to the estimated interruption.At least 1
PreferredApproachThe team’s preferred migration approach.Offline, online or no preference

A zero-minute rollback budget expresses an immediate recovery requirement. It does not mean rollback is unnecessary.

Network latency describes the conditions for testing throughput. It is not converted into a throughput estimate or an arbitrary time penalty. The preferred approach does not override the calculated results.

The complete Simple model

Two additional assumptions are required:

  • AssumedBulkSpeed: complete source reading, transfer and target loading speed, in GB/minute. It must be greater than zero.
  • OperationalTime: cutover work outside copying the data, in minutes. It must be zero or greater.

Calculate:

CopyTime = DataGB / AssumedBulkSpeed
EstimatedOfflineDowntime =
PlanningFactor × (CopyTime + OperationalTime)
AvailableCopyTime =
CutoverBudget / PlanningFactor - OperationalTime

When AvailableCopyTime > 0:

RequiredBulkSpeed = DataGB / AvailableCopyTime

The required speed formula comes directly from rearranging the downtime limit:

PlanningFactor × (DataGB / AssumedBulkSpeed + OperationalTime)
<= CutoverBudget
DataGB / AssumedBulkSpeed
<= CutoverBudget / PlanningFactor - OperationalTime
AssumedBulkSpeed
>= DataGB / (CutoverBudget / PlanningFactor - OperationalTime)

The final rearrangement applies only when the denominator is greater than zero.

Apply the rules in this order:

  1. Missing, nonnumeric or invalid required input: Unknown.
  2. AvailableCopyTime <= 0: Revise cutover plan.
  3. EstimatedOfflineDowntime <= CutoverBudget: Offline candidate.
  4. Otherwise: Evaluate online, improve bulk throughput or revise the budget.

Rollback remains Not assessed in the Simple model. An offline candidate is conditional on demonstrating the assumed speed and an acceptable recovery procedure.

The complete Advanced cutover model

VariableMeaningUnit
BulkThroughputMeasured complete speed for copying existing data.GB/minute, greater than zero
SourceChangeRateSource change data generated during representative activity.GB/minute, zero or greater
CDCCapacityComplete capacity to capture, transfer and apply source changes.GB/minute, greater than zero
ChangeBacklogGBComplete unapplied source changes at final write freeze.GB, zero or greater
OfflineOperationalTimeOther work during offline cutover.Minutes, zero or greater
OnlineOperationalTimeOther work during online cutover.Minutes, zero or greater

For offline migration:

FullCopyTime = DataGB / BulkThroughput
OfflineDowntime =
PlanningFactor × (FullCopyTime + OfflineOperationalTime)
OfflineCutoverPass =
OfflineDowntime <= CutoverBudget

For online migration:

CDCSpareCapacity = CDCCapacity - SourceChangeRate
CDCCapacityPass =
CDCSpareCapacity > 0
FinalChangeTime = ChangeBacklogGB / CDCCapacity
OnlineDowntime =
PlanningFactor × (FinalChangeTime + OnlineOperationalTime)
OnlineCutoverPass =
CDCCapacityPass
AND OnlineDowntime <= CutoverBudget

Here, AND means every listed condition must pass. OR means at least one listed condition is true.

To estimate backlog recovery while source writes continue, use the backlog at the point being evaluated:

CatchUpTime =
ExistingBacklogGB / CDCSpareCapacity

This calculation requires positive spare capacity and reasonably steady rates. ExistingBacklogGB is the backlog during preparation; it need not equal the backlog at final write freeze.

For the 4 GB example backlog, catch-up while writes continue takes:

4 / (2 - 0.5) = approximately 2.67 minutes

After source writes stop, finishing the same 4 GB takes:

4 / 2 = 2 minutes

Do not include the initial full copy in online cutover downtime if it finishes before the outage. Evaluate its project duration, storage and retained change logs separately.

The complete rollback model

Evaluate these inputs separately for offline and online migration:

VariableMeaningUnit
RollbackBacklogGBTarget changes that must be restored to the source.GB, zero or greater
RollbackThroughputSpeed at which the recovery process restores those changes.GB/minute, greater than zero when changes must be restored
RollbackOperationalTimeOther work during rollback.Minutes, zero or greater
AllowedDataLossMaximum permitted loss of recent activity.Minutes, zero or greater
ExpectedDataLossLoss expected from the proposed recovery procedure.Minutes, zero or greater
RequiredCoverageHow long rollback must remain available after cutover.Minutes, zero or greater
DemonstratedCoverageHow long the tested recovery plan supports rollback.Minutes, zero or greater
RecoveryConfirmedWhether a compatible, tested recovery method exists.Yes, No or Unknown

Use a conditional calculation to avoid dividing by a missing or zero restore speed:

IF RollbackBacklogGB = 0:
RestoreTime = 0
ELSE:
RestoreTime = RollbackBacklogGB / RollbackThroughput
RollbackDowntime =
PlanningFactor × (RestoreTime + RollbackOperationalTime)
RollbackTimePass =
RollbackDowntime <= RollbackBudget
DataLossPass =
ExpectedDataLoss <= AllowedDataLoss
CoveragePass =
DemonstratedCoverage >= RequiredCoverage
RollbackPass =
RecoveryConfirmed = Yes
AND RollbackTimePass
AND DataLossPass
AND CoveragePass

If the restore volume is unknown, the restore duration is unknown. Do not substitute zero.

Expected data loss must come from the recovery procedure and its evidence. It cannot be inferred from bulk speed, CDC capacity or rollback duration alone.

Combine timing and capability evidence

For each approach, confirm:

  • The required source and target capabilities are supported.
  • Relevant processing rates are supported by representative measurements.
  • Cutover passes.
  • That approach’s rollback plan passes.

Then assign the overall result:

IF any known required capability or requirement fails:
Result = Not feasible
ELSE IF any required evidence is missing,
any required check is unknown,
or performance is only assumed:
Result = Unknown
ELSE:
Result = Feasible

A known failure takes priority over missing evidence. For example, a measured offline outage above the allowed limit fails even when the rollback method is still unknown.

Choose between the two overall results:

Offline feasible AND online feasible:
Compare cost, complexity and interruption.
Offline feasible AND online not feasible:
Choose offline within the model.
Offline not feasible AND online feasible:
Choose online within the model.
Offline not feasible AND online not feasible:
Revise the plan or requirements.
Either result unknown:
Report known results and resolve the missing evidence.

Use full precision for comparisons and round only displayed results. An estimated 30.004-minute interruption exceeds a 30-minute budget even if the display rounds to 30.00.

Leave a Reply