When the user makes his first request to the web application load balancer (NGINX), it redirects the request to one of the servers within the cluster. Throughout the session user continues to work with that same instance of application server (so called Sticky Sessions). Obviously the other instance in the cluster is also working serving its half.
If one of the instances fails, the users, who were on that instance get automatically switched to the other instance in this cluster. Thanks to the replication, the other instance already has all the sessions of the failed instance, so end-users never notice any change. In the highly unlikely event of both instances in a cluster failing, users get redirected to another cluster (if there areseveral).Also, users can turn on/off replication within already created environment by changing its topology.