Search code examples
web-servicesweb-applicationshateoas

How do rolling updates on website work


Lets say I have a website with 4 webapp server and 1 HAProxy before them to do load balancing. Now I want to update my webapp with new api/v2 and I start the rolling update. My webapp is doing HATEOAS so lets assume that 1 instance got updated and it sent a link like api/v2/dothis to a clinet. Now the client made a request on this link and HAProxy directed it to 3rd server in the cluster which is still running the old webapp and doesn't know about api/v2. How do people solve this problem in general, how do websites do rolling updates without disrupting the service.

Thanks in advance


Solution

  • You could use one of these options

    • Option a: Once you updated instance 1, shut down all the other instances so all the traffic goes to instance 1 (if this is even possible with the load you might expect. You could do this at a time when your one instance would be capable). Update instance 2 with the new webapp and bring it online, continue with all the other instances.
    • Option b: Keep all the available resources in a place to where all your servers can check whether the resources exists on another webapp instance if they do not have it themselves (yet).

    I feel that option a would be best, since you would not have to maintain another server/system for brokerage.