Case study Datavio · Databases
Moving production Postgres across regions to double its capacity
Our database needed to grow, and its US region couldn't give it room. A cross-region read replica turned a risky migration into a short, planned cutover — and unlocked 2× server capacity.
- Server capacity after the move — a size the US region couldn't provision
- 2×
- Dump-and-restore steps — the data streamed over via replication
- 0
- Planned cutover window: freeze writes, promote, repoint
- 1
01 · The problemScale up… denied
As the platform's load grew, the database became the constraint. The obvious fix — scale the server up — was blocked: the US region it lived in wouldn't let us grow it to the size we needed.
Waiting on regional capacity isn't a plan. And the classic alternative — dump the production database and restore it somewhere else — means a long outage and a nervous night.
02 · The intuitionA replica is a migration tool
Read replicas are usually pitched as a read-scaling feature. They're also the gentlest way to move a database. A replica in another region stays continuously caught up with production, so the "migration" shrinks to the few minutes it takes to promote it.
The data moves while the business keeps running. Only the cutover needs a maintenance window.
03 · The runbookSix steps, in a fixed order
- Create the replica. Spin up a read replica of the primary in a region with the capacity we needed.
- Let it catch up. Watch replication lag until the replica is consistently in step with the primary.
- Freeze writes. Open a short maintenance window and stop writes, so nothing lands on the old primary mid-switch.
- Promote. Once lag hits zero, promote the replica to a standalone read-write server.
- Repoint. Switch the services' connection settings to the new server and bring writes back.
- Scale up. With the new region's headroom, scale the server to 2× its previous capacity.
04 · ImplementationWhy this beats dump & restore
Dump & restore
The outage lasts as long as dumping and restoring the entire database. Any failure means starting over.Replica promotion
Data syncs ahead of time while production runs. The outage is just the cutover.Cutover discipline
The replica does the heavy lifting; the cutover is about ordering. Writes stop before promotion, promotion waits for zero lag, and services only come back once they point at the new primary — so no write can land on the wrong server.
One variable at a time
Moving first and scaling second kept the migration boring: the move changed where the database lived, and only once it was settled did we change how big it was.
05 · ResultsRoom to grow
- 2× server capacity — a size the original US region wouldn't provision.
- The data moved through continuous replication; no dump-and-restore.
- Downtime was limited to a single planned cutover window.
06 · LessonsWhat I'd tell my past self
- Cloud capacity is regional and finite. Treat "can we scale up here?" as a question to answer before you need the answer.
- Replicas aren't just for reads — they're the lowest-drama way to move a database.
- Make cutovers boring: a fixed order of steps and a clear go/no-go on replication lag.