Understanding Load Balancing!! (NGINX) ft. Jethalal.
Meet jethalal, he operates a shopping website where he sells all the electronic items at amazing prices.
Jethalal has deployed his website as we normally do, with no load balancing, no caching as he had just begun the business and the traffic was too less.
But, as he offered all the items at amazing price, the traffic on website started increasing exponentially. As his server was not configured to handle so much traffic it started crashing and took ages to load.
To tackle this situation, he started researching, googling and then he learns about NGINX.
NGINX offered everything jethalal wanted to ensure his website does not crash due to high traffic.
So what magic did NGINX do? NGINX simply created three instances of the website which runs at different ports.
Now, the whole traffic does not hit just one port of our server. Instead, it divides amongst the three instances running at three different ports. this does not overload one resource and all request are served within time.
This is called LOAD BALANCING. it is one of main features of of NGINX. Also, when jethalal announces a new offer, a lot of traffic is expected to hit the website in such cases, we can ask NGINX to cache that particular path.
Now our server does not always communicate with backend to display the offer page. As the path is cached, our users will get the response in quickest possible time.
Did you know ? Even Netflix uses NGINX !
Thanks for reading this blog.
Keep writing amazing code.
Please follow Dev for such amazing blogs.
Did you find this article valuable?
Support Dev Valecha by becoming a sponsor. Any amount is appreciated!