Well, proxies are one of the most important things when it comes to understanding system design.
Proxies mean "on behave". Imagine a situation when you do not go to college to attend a class, and ask your friend to give you attendance on behave of you. This situation is also called proxy.
In large-scale systems, we have something called a proxy which responds at the place of the server/client.
You will understand proxies better once we deep-dive the article further.
Types of proxies
Basically, there are two types of proxies:
Forward Proxy
Reverse Proxy
Forward Proxy
In forward proxy, the proxy sits with the client. Look at the diagram below:
You see we have multiple clients requesting some data to the server, but there is a proxy that is standing in between the server and the clients. Now whenever a client requests any request to the server, the request first goes to the proxy and then the proxy asks the request on behave of the client to the server. In this way, the server does not know the IPs of the clients, it knows the IP of the proxy. So the proxy acts as a middleman between the client and the server.
Disadvantages of using a forward proxy
Some of the key disadvantages are:
The chances of failure are high, and in case of any failure whole system will stop working as the proxy acts as a middleman between the client and the server. So there is a single point of failure in the system.
Setting up a forward proxy is quite complex.
Use cases of forward proxy
Privacy: Users can use a forward proxy to hide their IP address from the server, and maintain their privacy while surfing the web.
Content filtering and access control: Forward proxies are used to limit the access of certain content based on the location. For example, in some colleges using the college wifi, you won't be able to access the gaming sites, etc... That is also achieved with the help of a forward proxy.
Access to restricted content: In certain regions where some content is unavailable, users can use a forward proxy to bypass that security and access that particular content.
Reverse Proxy
In a reverse proxy, the proxy sits in front of the servers.
NOTE: In a forward proxy the server is unaware of the client's IP whereas, in a reverse proxy, the client is unaware of the server's IP
Advantages of using a Reverse Proxy
Load Balancing: A reverse proxy distributes the incoming traffic to multiple servers and acts as a load balancer.
Caching: Similar to forward proxies, reverse proxies can be used as cache storage for static data