DEV Community

loading...

Discussion on: Designing a Reverse Proxy: Why Golang performs better than Java(Spring Boot), An In-Depth Analysis

Collapse
rmgrimm profile image
Rob Grimm

I agree that using any application server such as Tomcat (even as embedded within Spring Boot) would be a naive choice for implementing a general reverse proxy. But I'm curious whether you benchmarked a properly-configured traditional reverse proxy (such as haproxy or certain configurations of nginx) with the same environment. It would be interesting to see how the Goroutines proxy compares against non-blocking I/O or asynchronous I/O implementations.

Also, a quick note about the reverse proxy/load balancer distinction that you make: All reverse proxies are not load balancers as you say; however, consider the inverse: all HTTP/HTTPS load balancers are reverse proxies. By overly-simple definition, a proxy will forward (or "proxy") a request from an internal network out to the greater internet. A reverse proxy is the opposite: it forwards a request from the greater internet into an internal network.

I believe the distinction you're wanting to make is this:

  • load balancers don't make routing decisions based upon the content of the request;
  • instead, load balancers only attempt to distribute (or "balance") the load across servers using some algorithm (random distribution, round robin, fewest active connections, etc).
  • you need a reverse proxy that makes routing decisions based upon the request (sometimes called a gateway)

Cheers! 🍺

Collapse
samsadsajid profile image
SajidSamsad Author

Hi Rob, thanks for the insightful comments.
Firstly, for the purpose of this article, I have not benchmarked for Nginx or Haproxy. But, I am planning to do one. And after that, I intend to publish another article with the result. And, yeah, of course, it will be a very interesting comparison between an event-driven, non-blocking i/o based solution vs. the Goroutine.

On the point of the load balancer, I did not want to go through all the details in this article as I thought it does not serve the purpose of this article. But yeah, you're absolutely right on the points you mentioned about the load balancer.

Hope to publish another one on the Nginx/Haproxy vs Go proxy soon. Hope to see you there. :D