Dev Valecha
Dev Valecha's Blog

Dev Valecha's Blog

Understanding Load Balancing!! (NGINX) ft. Jethalal.

Understanding Load Balancing!! (NGINX) ft. Jethalal.

Dev Valecha's photo
Dev Valecha
·May 27, 2022·

2 min read

Subscribe to my newsletter and never miss my upcoming articles

Play this article

Hello People

Meet jethalal, he operates a shopping website where he sells all the electronic items at amazing prices.

jethalal-removebg-preview.png 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.

jethashocked-removebg-preview.png

To tackle this situation, he started researching, googling and then he learns about NGINX.

1_9R59VNTAanVTzFefjOXqvg.png

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.

Screenshot_from_2022-05-27_13-00-36-removebg-preview.png

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.

Screenshot_from_2022-05-27_13-39-24-removebg-preview.png

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 !

download-removebg-preview.png

Thanks for reading this blog.

Keep writing amazing code.

Happy Hacking!

Happy Coding!

Please follow Dev for such amazing blogs.

GitHub followers

Did you find this article valuable?

Support Dev Valecha by becoming a sponsor. Any amount is appreciated!

Learn more about Hashnode Sponsors
 
Share this