This blog post will be the first part of the bigger proof of concept related to the data replication in distributed environment, which I’m working on. At the beginning, I will show how to separate GET requests from POST having multiple instances of a single application. The goal is to redirect all of the POST requests to the master instance, all GET requests should be distributed across all nodes. Today’s showcase will be focused on three subjects: single master - multiple slaves communication model, leader election between multiple application nodes, and using Service Discovery for automatic load balancer configuration. In this part we’re finding out how to simply use ZooKeeper for Service Discovery and Leader Election, NGINX as a load balancer with dynamically changing configuration by confd. NGINX is a web server, which can act as reverse proxy, load balancer or HTTP cache. In our case NGINX will be responsible for traffic load balancing to the appropriate nodes.