0

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?

3
  • 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, 2013 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?
    – user197797
    Nov 9, 2013 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, 2013 at 9:56

1 Answer 1

3

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.

You must log in to answer this question.