Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How does everyone do postgresql upgrades with the least amount of downtime?


Fastest non-intrusive way I know in RDS or any other environment which allows you to spin up a new box:

* Set up a replica (physical replication)

* Open a logical replication slot for all tables on your old master (WAL will start accumulating)

* Make your replica a master

* Upgrade your new master using pg_upgrade, run analyze

* On your new master subscribe to the logical replication slot from your old master using the slot you created earlier, logical replication will now replicate all changes that occurred since you created the slot

* Take down your app, disable logical replication, switch to the new master

You can do the upgrade with zero downtime using Bucardo Multi-Master replication but the effort required is much much higher and I'm not sure if this is really feasible for a big instance.


For Pg and MySQL I usually have to resort to replicating to a newer instance then cutting over. Tools like pg_upgrade offer promise but I rarely have the time or access to test with a full production dataset. Hosting provider constraints sometimes limit my options too, such as no SSH to underlying instances.


Bucardo is great for replication.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: