Proxy v/s Reverse Proxy

Proxy v/s Reverse Proxy

The terms proxy and reverse proxy are commonly used in software engineering but can be a bit confusing.

The article will focus on the terms and will help you as well as me in getting a clear understanding.

Normal SetUp-

Article content
The client connects to the server for a response

This is a normal setup, the client requests the server and the server returns the response and I will be building the Proxy and Reverse Proxy concepts upon this.


Proxy:


Article content
client-proxy-server setup

In such a setup, the client knows about the server as well as the proxy. That is, the client knows the address of the final server and the mediator as well. In this case, the mediator will act as a proxy.

Why do I need a proxy server?

There can be several reasons for it, some of them can be

  1. Security: The proxy can protect you from malicious sites knowing your data, as the server will not get the client's data.
  2. Logging: The ingress and outgress can be logged on the proxy level. This can be to have a performance analysis, market analysis, etc.
  3. There can be other numerous reasons why we can use proxy servers.

Reverse-Proxy:

In proxy, the client knows about the server as well as the proxy, but in reverse proxy, the client knows about the mediator server but does not know about the final server.

Article content
The server is acting as a reverse proxy here.


In the above setup, the client knows the server details only, and then the server sends the request to the final servers, hence the configuration of the final servers (Server 1 and Server 2) is stored on the Server.

The most commonly used example of Reverse Proxy setup can be a Load Balancer.


Article content
Load Balancer setup

In the above setup, the client knows only about the Load Balancer and never knows the final server data.

And, the load balancer stores the addresses of final servers(Server 1, Server 2, and Server 3)

Point to remember:

  • Never think of these concepts as an isolated idea.
  • They are the same thing, the only difference is the amount or level of information a particular layer has about the next layers.
  • Based on the level of information a layer has, the application is designed, and accordingly, the control flows.

Summary

If your client is aware of the final server as well as the mediator then the mediator is serving as a proxy.

else if, your client is aware of the mediator only then the mediator is serving as a proxy.


In architecture design, it's not like we use Proxy or Reverse Proxy, it's more like Proxy and Reverse Proxy, majority of architecture uses both to serve their requirements.

This is just the tip of the iceberg do read more about it to get a deeper understanding.






To view or add a comment, sign in

More articles by Nimit Didwania

Others also viewed

Explore content categories