Is HAProxy still necessary when Varnish can act as a load balancer

haproxyload balancingreverse-proxyvarnish

I would like to load-balance my application servers, as well as cache the responses from them.

I've read an article dating back to 2012 on HAProxy's website, that was supposed to clear the confusion between HAProxy and Varnish:

http://blog.haproxy.com/2012/07/04/haproxy-and-varnish-comparison/

This article basically says that HAProxy is a reverse-proxy load balancer only (no cache), while Varnish is a reverse-proxy cache (no load balancing), hence they are complementary.

But today, I can see in Varnish docs that it does load balancing as well:

https://www.varnish-cache.org/trac/wiki/LoadBalancing

So I can only guess that this feature has been introduced since 2012, and that it now directly competes with HAProxy in terms of load balancing.

Now considering that I need a reverse-proxy cache + load balancer, is it true that I can use a single server with Varnish only, that will do both? Any limitations maybe, compared to a typical HAProxy <-> Varnish setup?

Best Answer

Varnish does not support SSL

Running a site/service on SSL is a necessity for anything half serious, so thats one reason to use haproxy which will do SSL termination for you.