Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Suppose I have a load balancer connected to 10 web servers.

Also assume that the app is used 24/7 so there is no "low peak" period, that is, reasonable speed of response must be maintained.

What is the best way to deploy updated web app code to all the servers while ensuring there is zero downtime? How do companies like Google, Amazon, Facebook etc. do it?

share|improve this question
1  
Provided you're confident of your update: drain one server out the load-balancer pool, update the code, put it back in service, watch the logs, if it's OK, repeat until all ten are done. –  MadHatter Nov 9 '13 at 8:15
    
wouldn't that introduce inconsistency, say for example in the frontend UI HTML that is generated by the old and new versions of the code under one load balancer? –  Lucas Tan Nov 9 '13 at 9:48
    
Yes - which as long as your app is designed reasonably well and can handle this inconsistency on its side, the only 'defect' would be a different look or functionality for users depending on which box they were hitting. This is not uncommon - Facebook users, for instance, often report seeing functionality or differences that their friends do not. I suspect in Facebook's world, it is doing something to lock users to web heads that have or have not received an update, in some way, as they don't generally report seeing functionality and then suddenly losing it and then gaining it again, etc, etc. –  Nex7 Nov 9 '13 at 9:56

1 Answer 1

up vote 3 down vote accepted

As you have a load balancer, you can configure it to stop sending requests to a node, when it's drained, update the node. Test and bring it back on line. Rinse and repeat for each backend node. And if you want faster rollouts: add more servers so you can do N-at-a-time, for whichever value of N works for you.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.