Ask HN: Patterns for deploying webapp updates with no downtime
I think I know how to do this while disabling writes: run two copies of the database (one replicated from the other), disable writes at the application label, separate the slave and continue to serve reads from the master, upgrade the slave's schema, "activate" the slave (essentially telling it it's now a master), point a new instance of the application running the updated application code at it and switch the HTTP traffic over - then set the original master up as a slave to the new master and enable writes again.
First question: is this sane / best practice?
Second question: if I want to do this without disabling writes for the period of the upgrade, what are my options?
Plenty of sites seem to manage to deploy new features without noticeable periods of downtime or read-only mode, so presumably there are a bunch of patterns for dealing with this. Where can I learn about them?
To clarify: I'm talking about updates that include some kind of modification to the database schema.