NOTE: a generalized write-up of a problem class I have worked on. Client names, data and internal details are omitted on purpose.
Context
An enterprise platform ran on a commercial database. The goal was to cut licensing cost and gain deployment flexibility without risking the data.
Constraints
- Near-zero downtime for the cutover.
- Strict data integrity, with a tested way to roll back.
- Application behaviour had to stay the same for users.
Decision
Use continuous replication with SymmetricDS instead of a one-shot dump and restore. The PostgreSQL instance stayed in sync with the source while the schema, queries and application code were adapted and tested against it. The cutover then happened in stages, once the data matched.
Trade-offs
- Replication adds moving parts and needs monitoring during the migration window.
- Differences in data types and SQL dialect needed careful testing.
- In return, the switch was short and reversible.
What I built around the database
- A high-availability failover design.
- Automated backup strategies.
- Data replication for resilience.
- Query performance optimisation under real workloads.
Outcome
PostgreSQL runs in production as the core database of enterprise applications, with failover, backups and replication managed as part of the platform.
What I would stress
Rehearse the cutover and the rollback several times, and compare source and target data automatically instead of by eye.