Ask HN: How do you deploy updates to web apps seamlessly?
My questions are on how the unavailability during source updating, database migration and app server restarting are handled. It's not the end of the world if the app shows a 500 screen for a few seconds or so, but it's preferable that it doesn't (especially if a client happens to be submitting information during the upgrade - did it make it through?)
So far I've come up with two solutions:
1. Create a mirror system - clone the source tree and update it, duplicate the database and apply migrations, and then switch virtualhosts or symlinks once it's ready to go, however this takes longer and uses more space.
2. Deactivate the virtualhost to show a maintenance message, and then reactivate it again once the site is back - but I'd rather avoid this.
So what people are actually using in production systems at the moment?
My personal projects are Django apps (typical pg-django-gunicorn-nginx stack), however my work projects use PHP (so if a web request comes in mid-update, it can end up using a half-updated app; nasty).
Thanks
2 comments
[ 3.1 ms ] story [ 19.1 ms ] threadThe versioning system is great too, if a deploy is bad, you can simply cap rollback, which will revert the changes.