Using the NGINX reverse proxy
In the previous section, you learned how to scale the workers responsible for parsing the subreddit URLs. In this section, you will explore how to scale the Recipes API we built in the previous chapters by serving it behind a reverse proxy.
One of the most used reverse proxies is Nginx. It faces the client and receives the incoming HTTP(S) requests. It then redirects them to one of the API instances in a round-robin fashion. To deploy multiple instances of the Recipes API, you will be using Docker Compose to orchestrate the containers. The following schema illustrates the difference between a single instance architecture and a load balanced multi-instance architecture with Nginx:
Another solution for scaling the Recipes API is vertical scaling, which consists of increasing the CPU/RAM of the system where the service is running. However, this approach...