Implementing HA for RESTful servers
A RESTful server is a web server that makes API endpoints available for consumption. There are various web servers, such as Apache and NGINX, and configuring each one is different.
To implement HA for a web server, you must implement a proxy server in front of the web servers that you will be setting up. In this scenario, the web servers will all make use of the same static files and assets, which will be deployed in a central location. If there is a need for a database connection, then the database server will be hosted separately. Rather than connecting to individual web servers, all traffic is directed to the load balancer, which then distributes traffic. That is how all major websites function.
One of the considerations for a load balancer is how to distribute traffic to the nodes within your cluster. Some common methods in use are as follows:
- Round-robin: In this approach, traffic is distributed evenly. For example, if you have...