I am trying to understand how reverse proxy and load balancing are different from each other. When its useful to use reverse proxy over load balancing.
-
1A reverse proxy is an http server put in front of application servers. It may or may not do load balancing. – Maurice Perry Jan 17 '20 at 06:14
-
okay , so you mean to say reverse proxy can do other stuff too . Seems like load balancing is subset of reverse proxy. @MauricePerry – Prakhar Gurawa Jan 17 '20 at 06:17
-
1I'd rather say that a reverse proxy can contribute to load balancing. – Maurice Perry Jan 17 '20 at 06:20
2 Answers
Both promise to improve efficiency and sits in between client and server. They nearly look the same when we try to understand them, but still their functionality differs.
Load balancing: Is hardware or a software unit that distributes the total load on a website by distributing it to multiple servers. The algorithms used by load balancing should be chosen as such it makes the best use of each servers’ capacity and can provide the result as fast as possible.
Load balancers are of three categories: DNS Round Robin, L3/L4 Load Balancer [ works on IP and TCP layer ], and L7 Load Balancer [ works on application layer].
The different kinds of algorithms used by load balancer for distributing load are IP Hash, Least connection, Round robin, Least traffic, etc.
Reverse Proxy: They act as a face of website or we can say they serve as a gateway that web traffic has to pass. The main role of a reverse proxy is:
- Security: They act as a wall to your backend server. Protecting the backend from direct interactions and thus improving the security of the overall system.
- Web acceleration: It also provides features like caching, SSL encryption, and Compression to reduce the time to provide responses to clients.
- Flexibility: The changes in backend architecture become more flexible as the client can only access the reverse proxy.
A reverse proxy can even be relevant even when there is only one server in your system. In such cases there is no requirement of load balancers but still the reverse proxy can be useful providing security, flexibility and web acceleration.

- 1,086
- 14
- 14

- 373
- 3
- 13
-
-
above explaination very similar to nginx docs.. i also interested from real case scenario when to use load balancer and when to use reverse proxy. or they have to come in combination or not. may this link can give you more enlightment.. https://serverfault.com/questions/127021/what-is-the-difference-between-load-balancer-and-reverse-proxy.. it looks like reverse proxy should comes with LB feature.. – cumibulat Dec 11 '20 at 12:19
According to this link,
A reverse proxy accepts a request from a client, forwards it to a server that can fulfill it, and returns the server’s response to the client. In other words, Reverse proxies act as such for HTTP traffic and application programming interfaces.
A load balancer distributes incoming client requests among a group of servers, in each case returning the response from the selected server to the appropriate client. Load balancers can deal with multiple protocols — HTTP as well as Domain Name System protocol, Simple Message Transfer Protocol and Internet Message Access Protocol. A load balancer receives and routes client requests for application, text, image or video data to any server in a pool that is capable of fulfilling them and then returns the server’s response to the client.

- 164
- 1
- 15