I'm interested in techniques that can be used for deploying new versions of web applications with no perceived downtime for end users, without having to disable writes.
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.
Changes:
a) Schema changes and row updates that are compatible with 'n'. No downtime, no worries.
b) Schema changes and row updates that are _in_compatible with 'n'. Ideally this requires downtime, but I've seen architectures that get away with live rolls by grouping app server updates by shard.
c) Database changes that will have a severe performance impact, e.g. index/update a massive table or hit some other perf corner of your db. Downtime or you invest in a key-value or FriendFeed-style architecture.
Most agile updates tend to be (a), luckily.