Deploying a Django App with No Downtime
I was responsible for a 10^6 views/day (due to most traffic being daytime, comes out to 10-20 req/sec) website running on Django.  I went through hell arriving at this solution because the system was in disarray when I took over and deployed on an expensive cloud solution (so resources were limited).  Finally I just put my foot down and demanded we buy servers instead, we would have more bare metal by a factor of 4 than we needed and we would pay only a fraction of what we did for the previous "solution".  I could provision all the VMs I wanted, provided I didn't break the host.<p>I arrived at this procedure: Spin up a dyno, worker, caches and warm everything up.  Run smoketests to validate everything from the app-server onwards is lit and firing on all cylinders.  Redirect nginx traffic to the new setup.  If everything turns to shit in a second, reverse traffic change and re-evaluate.  If everything works and nothing is broken after an hour, take the old dynos/workers/caches offline.<p>The trick was if there were migrations that broke the older version that you did it in 2 or more steps to isolate the changed model interactions.<p>And nobody should be using gunicorn, it's way less performant than uWSGI (citing:<a href="http://blog.kgriffs.com/2012/12/18/uwsgi-vs-gunicorn-vs-node-benchmarks.html" rel="nofollow">http://blog.kgriffs.com/2012/12/18/uwsgi-vs-gunicorn-vs-node...</a>).