| ||Ask HN: Patterns for deploying webapp updates with no downtime|
60 points by simonw on Apr 14, 2010 | hide | past | web | favorite | 19 comments |
|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.
| Apply to YC