
The term deserves precision first. "Zero downtime database migration" is the industry's name for a cutover small enough that users do not notice, not a literal promise of no interruption. Used that way it is a useful target; used as a commitment it sets up a conversation nobody wants at 3AM. This post covers what the term means, the techniques behind it, how to sequence a cutover, and what to do when it does not go to plan. The approaches are general to relational databases, including migrations from MySQL, SQL Server, or MongoDB, but the mechanisms and examples assume PostgreSQL as the target platform.
What zero downtime migration actually means
A zero downtime database migration keeps the application serving traffic throughout the move by replicating changes continuously from the source database to the target, then switching over once the two are in sync. In practice it means a cutover measured in seconds rather than literally no interruption to service.
Setting that expectation early matters, because everything after it depends on the distinction. Teams that treat the phrase literally tend to skip rollback planning, reasoning that a migration with no interruption has nothing to roll back from.
Choosing a migration approach
Continuous replication is not the default, and treating it as one adds operational complexity to migrations that never needed it. Start by asking whether the business can tolerate a planned outage, because if it can, a maintenance window is the shorter and more reliable path.
Maintenance window. The application stops, the data moves, validation runs against a static target, and the service comes back. Nothing replicates in the background, nothing can diverge, and rollback means pointing the application back at a source database that never changed. This is enough when the application tolerates a planned outage, the estate is small, and the business has a genuine quiet period.
Continuous replication. Changes flow from source to target while the source keeps serving traffic, and the cutover happens once the two are in sync. This earns its complexity when the service runs around the clock, when the downtime budget is contractual, or when the dataset is too large to move inside any window the business will approve.
Dual-write. The application writes to both the source and target databases during the transition, giving direct control over consistency and a clean fallback while both stay current. The constraint most engineering write-ups skip is that it requires modifying every application that writes to the database, which is feasible for a team that owns its service outright and frequently impossible when the database serves applications owned by other teams or outside vendors. There is a consistency risk too, since where the two writes are not transactional a failure between them leaves the databases disagreeing, and nothing detects that except validation.
The decision rule is short. Use a maintenance window where the business can absorb one. Use dual-write where you control every writer. Use change data capture where you do not.
| Approach | Best fit | Trade-offs |
| Maintenance window | Tolerant workloads, small estates, a real quiet period | A planned outage, but the lowest-risk path to validate and roll back |
| Continuous replication | You do not control every writing application | Operational complexity, and lag must converge before cutover is possible |
| Dual-write | You own every writer | Code changes in every writing application; consistency risk where the two writes are not transactional |
Comparing maintenance window, continuous replication, and dual-write migration approaches on best fit and trade-offs
How change data capture works
Change data capture (CDC) has two halves, and both have to complete before cutover is possible. The first is a backfill: a bulk copy of the data that already exists in the source database. The second is continuous capture, which reads the changes committed since that copy began and applies them to the target, so the target stays current while the source keeps serving traffic. In PostgreSQL this is built on logical replication, which is part of the database rather than a bolt-on, and our walkthrough of bi-directional replication using origin filtering goes deeper into the mechanics for anyone who needs them.
Replication lag is the number that governs the whole migration. It tells you how far behind the target is, which determines when a cutover is safe and what to watch during the run. Lag that rises under normal production load, or plateaus well above your threshold, is the clearest signal to postpone rather than push through, and lag that will not converge is not a problem to solve on the night.
Tooling varies by source platform, and our enterprise buyer's guide to database migration tools covers what to look for, while the SQL Server migration planning guide works the same sequencing for one specific source.
Schema changes that do not break the application
Live migrations usually involve schema changes, and the governing constraint is backward compatibility. At every point, the old application version and the new one may both be running against a database in transition, so no single change can break either.
The expand and contract pattern handles this. Add the new structure first, write to both old and new, move readers across once the new structure is populated and verified, then remove the old once nothing depends on it. The value for a migration owner is that every step is individually reversible, which a single cutover-night schema change is not.
Three practical traps are worth putting on the plan:
- Some ALTER TABLE operations take locks that block reads or writes for the duration. Which operations lock and for how long is worth confirming for the specific changes in scope.
- Indexes built during a live migration need to be created without blocking writes, which is a different operation from a routine index build.
- A schema change that completes in seconds on a test dataset may take hours on a production database. Timings mean nothing unless they come from data of a realistic size.
Rehearsing the cutover
The difference between a migration that works and one that improvises is rehearsal. And a rehearsal that excludes the rollback is only half a rehearsal, because a rollback plan that has never been executed is an assumption rather than a plan.
Rehearse in two environments, in sequence. A test environment establishes correctness, confirming that the data arrives intact, the application behaves, and the schema changes apply. A staging environment then establishes timings, which requires mirroring production shape and volume closely enough that the numbers transfer. A rehearsal against a tenth of the data tells you the procedure works, and nothing about how long it takes.
Data validation needs to be specific, agreed in advance, and written down:
- Checksums or row-level comparison on critical tables
- Business rule checks that confirm derived values and aggregates still reconcile
- Application-side error rates measured against a known baseline
- A defined acceptance threshold agreed before cutover, not negotiated during it
- A named owner for the go or no-go call
Record counts confirm nothing about correctness. Two tables can hold identical row counts and different data, and that is exactly the failure a count-based check is blind to.
The cutover sequence
Three numbers should be agreed and documented first, because they are what the abort decision gets measured against. How much downtime is acceptable, as a hard ceiling rather than a hope. How much data loss is acceptable mid-cutover, which for most transactional systems is none. And the rollback objective: how quickly the service must be back on the source database if the switch fails, and how long the team has to make that call before rolling back becomes the harder option.
With those fixed, the cutover runs as follows:
- Confirm replication lag is within the agreed threshold and stable, not merely low at the moment you look.
- Stop writes briefly or drain connections, so no new changes enter the source database.
- Allow the target database to catch up fully, and confirm it.
- Run the final validation checks defined during rehearsal.
- Switch the application to the target database.
- Monitor error rates, latency, and application logs closely through the first period after the switch.
Step five is worth engineering carefully. Feature flags or a blue-green deployment move traffic in a controlled and reversible way, unlike a configuration change nobody can undo quickly under pressure.
Define the abort conditions before the night. Lag above threshold, a failed validation check, an error rate above baseline after the switch: decide in advance what each means and who makes the call. A decision rule written at 2am under pressure is not a decision rule.
When it does not go to plan
Rollback is direct in the first minutes after cutover and gets harder every minute after. Once writes have landed on the target and not the source, going back means either losing those writes or reconciling them manually, so the practical rollback window is set by how long the new system has been serving traffic rather than by the plan.
The cheapest insurance is keeping the old source database available and current for a defined period after cutover. It costs infrastructure and some replication overhead, and it buys a real option instead of a theoretical one.
Three failure modes account for most of what goes wrong:
- Replication that will not converge. The target never catches up because write volume exceeds apply throughput. This is visible before cutover, which is why lag is monitored rather than checked once.
- Data corruption or divergence found after the switch. Validation after cutover matters as much as validation before it, because some divergence only appears under production write patterns.
- Performance that differs under real load. Staging suggested one thing and production does another, usually because of plan differences, cache behavior, or concurrency that staging did not reproduce.
What support looks like on cutover night
Fujitsu's Migration Assessment and Data Migration services cover the planning and execution this guide describes, and the completion report states what was in the source database, what moved, and what is in the target: the validation evidence the rehearsal section argues for, produced as a deliverable rather than assembled afterward. These services cover migrations to community PostgreSQL as well as to Fujitsu Enterprise Postgres, and sit within Fujitsu's wider database modernization services.
On the platform, three questions tend to be left open by the time a cutover date exists.
What is the replication actually running on?
PostgreSQL logical replication, provided unchanged. Fujitsu Enterprise Postgres is 100% compatible with community PostgreSQL, so the replication techniques above work exactly as documented, with no proprietary layer to learn or work around.
How does the target stay resilient once it is live?
High availability capabilities matter most immediately after cutover, when the new platform is carrying production load for the first time and the old one is still being held in reserve.
Who holds an incident to closure?
Response, resolution, and ownership of the resolution are three separate commitments worth evaluating individually, alongside 24/7 access to PostgreSQL engineering expertise.
Underneath all three sits the same foundation: operational stability, lifecycle management, deployment flexibility, and long-term platform ownership, which is also what shapes the enterprise database features regulated industries should prioritize. Talk to the Fujitsu team about a migration assessment, and get a view of what cutover window your estate realistically supports before you commit to one.
Frequently asked questions about zero downtime database migration
Is zero downtime migration actually possible?
Not literally, and the term is better read as a cutover brief enough that users do not notice. A well-rehearsed continuous-replication cutover typically interrupts service for seconds rather than hours.
What is change data capture in a database migration?
Change data capture performs an initial bulk copy of existing data, then continuously applies changes committed to the source afterward so the target stays current. Both halves must complete before cutover is possible.
What is the difference between dual-write and CDC?
Dual-write has the application write to both databases, which requires changing every writing application. CDC replicates changes at the database level, so no application code changes, which is why it fits estates with writers you do not control.
How do you validate data consistency during a live migration?
Use checksums or row-level comparison on critical tables, plus business rule checks that confirm aggregates and derived values reconcile. Record counts alone confirm nothing, since two tables can match on count and differ on content.
How long should you keep the source database after cutover?
Long enough to cover the period where divergence or performance problems would surface, commonly days to weeks depending on workload cycles. Keeping it current rather than merely available is what makes rollback a real option.
When is a maintenance window the better choice?
When the business can absorb a planned outage, the estate is small, and a genuine quiet period exists. A window removes replication complexity entirely and leaves both validation and rollback far more direct.
What is the biggest risk in a zero downtime database migration?
Data divergence between source and target that validation does not catch before the switch. It is more damaging than a failed cutover, because a failed cutover is obvious immediately while divergence can run undetected for days.
Who should own the go or no-go decision at cutover?
One named person, agreed before the night, with the authority to abort and clear acceptance thresholds to judge against. Decisions made by committee under time pressure are how teams talk themselves past a failing check.
Why do live migrations miss their cutover date?
Most often because replication lag will not converge under production write volume, or because rehearsal happened against data too small for the timings to hold. Both are visible in staging if staging mirrors production closely enough.



