Glad to hear you will try Varnish!

For a 100% resiliency you will have to use 2 varnish servers, 2 backend (application) servers and 2 DB servers (replicated or master-master).

For the varnish servers you can setup Round-Robin DNS, so your domain will resolve in 2 IPs of your varnish servers (check our domain, www.aboutyou.de), this way the browser will try the other one if one is down. Please note the sick server has to be completely down, or respond with connection refused for the browsers to try the other one, and some clients like curl don’t have this functionality, they stick with one IP.

Another approach is to have a HA load balancer in front of your 2 varnish servers like AWS Elastic Load Balancer or Google Cloud Load Balancer that can scale with no failed requests and periodically health-check the upstream with probes too.

Regarding the second question, varnish will not redirect the user browser, but internally proxy the request to one of your application servers, without the user knowing what server responded. You can add some custom X header to debug the connections. For this to work, you just have to define 2 or more application servers in backend/cluster config as per our tutorial and make sure they respond with HTTP code 200 to the probe-url. You can check your backends with `sudo varnishadm backend.list`.

Hope this helps, good luck with your project!

ABOUT YOU TECH blog

Want to know more ABOUT TECH?

Do you want to know more ABOUT TECH? Have a look at corporate.aboutyou.de/de/jobs. We successfully launched the 1st eCommerce infrastructure for large scale & innovative retail: the ABOUT YOU Commerce Suite — check it out here: https://commercesuite.aboutyou.com

ABOUT YOU TECH

Written by

AY Dev news. Check our vacancies https://corporate.aboutyou.de/en/jobs or our large-scale eCommerce infrastructure https://commercesuite.aboutyou.com

ABOUT YOU TECH blog

Do you want to know more ABOUT TECH? Have a look at corporate.aboutyou.de/de/jobs. We successfully launched the 1st eCommerce infrastructure for large scale & innovative retail: the ABOUT YOU Commerce Suite — check it out here: https://commercesuite.aboutyou.com