Load Balancer Vs Reverse Proxy: An Easy Overview

Load Balancer Vs Reverse Proxy: An Easy Overview

Hey !!

You are also thinking what's the difference between reverse proxy and load balancers, then you are at right place to know about it

So let's start the learning process...

image.png

1. What is Load Balancer ??

Suppose, you have made one website which is hosted on some server and many users are accessing your site. It's good that your website is gaining popularity.

Now suppose, your server where your site is hosted can handle 1000 requests at a time and 2000 users are accessing your site, then only 1000 users can only access your site and other 1000 users have to wait for their turn. But, what if the number of users who are accessing your site are more than 2000 like 3000, 5000, 10000 etc. So many users have to wait for their turn and your website becomes gradually slow.

So, is there any solution for it...Yes, we can host our website on more than 1 servers so that we can handle large number of requests at a time.

Advantages of hosting site on more than 1 servers:

  • dependency on single server reduces, because If that single server goes down or something happens to it the whole application will be interrupted
  • can handle larger number of requests at a time

image.png

But, again the question is What is Load Balancer??

As we have discussed, we have to add more than 1 servers to handle large number of requests, but who will handle these requests ??, who will decide that the request has to go to which server ??, where we have to send our request first ??

and the answer of all these questions is Load Balancer

Load Balancer handles the requests, manages the load and decides which server has to receive the request

image.png

But Why to use Load Balancer ??:

  • minimizes server response time
  • do continuous health checks to monitor the server’s capability of handling the request
  • ensures high availability and reliability

image.png

2. What is Reverse Proxy ??

It is exactly opposite to the Proxy Server. In Proxy, you are hiding your identity but in case of Reverse Proxy, Identity of server is kept safe.

When you sends the request, you can use the proxy server to hide your identity and thus this proxy server will send your request on your behalf to server but here the role of reverse proxy server comes, instead proxy server will able to know about the server, reverse proxy server receives that request from proxy server and then sends it to the server so that proxy server will not able to know the about the sever. So to hide the identity of server, we uses reverse proxy.

image.png

Now, again the question is Why to hide server identity or Why not to expose the server directly or Why to use the Reverse Proxy Server??

  • It helps in balancing the load among the servers
  • It reduces the request size
  • It makes the server anonymous

3. But what is the difference between Load Balancer and Reverse Proxy ??

If we observe, both load balancer and reverse proxy are doing the same thing as they both makes the server anonymous in any way

so, they are same ??

They look similar but they both have different purpose to make the sever anonymous

  • Load Balancer sends the request to the server which has less number of requests but Reverse Proxy sends the request to particular server, making that server completely anonymous
  • Load Balancer has special purpose of managing the load only whereas Reverse Proxy has special purpose of hiding the server identity
  • Reverse Proxy server can still work with a single server in place whereas Load Balancers works with multiple servers only

I hope, you liked this article !!

image.png

Did you find this article valuable?

Support Anubhav Goyal's Blog by becoming a sponsor. Any amount is appreciated!