<p>We're starting our move from D7 to D8, and are going to be using Docker and Kubernetes (with Jenkins) to manage and deploy our D8 environments.</p>

<p>Since with Docker and Kubernetes deploying as many identical nodes as you want / need is trivial, I'm looking for feedback re choosing the standard one-to-many design of Varnish and Drupal nodes (each Varnish node points at multiple Drupal backends), as opposed to a one-to-one design where each Varnish node points at a single Drupal backend.</p>

<p>We're leaning toward a one-to-one setup since with Kubernetes we could move the health check that Varnish would execute to test a backend as healthy to the Kubernetes layer, add another check in that layer to make sure Varnish itself is healthy, and if a pairing is marked as unhealthy Kubernetes will simply send the request to the next healthy pair.</p>

<p>I don't think this would result in any more pages being put in one Varnish node or another, since if it was one-to-many and a backend is sick Varnish will just try to get the page from the next healthy backend, but it still goes into the same Varnish cache.</p>

<p>In the case of a one-to-one setup, the testing of if something is "sick" simply moves from Varnish to Kubernetes, and since Varnish itself rarely goes down, this is an unlikely occurrence.</p>

<p>Roughed up proof of concept diagrams are attached.</p>

<p>I'd be very interested to see opinions / feedback on any potential disadvantages people can think of with the 1-to-1 design.</p>

<p>Thanks,
Pablo</p>

<p><a href="https://i.stack.imgur.com/SIEfA.png" rel="nofollow noreferrer">One-to-Many</a></p>

<p><a href="https://i.stack.imgur.com/AvR8K.png" rel="nofollow noreferrer">One-to-One</a></p>

<p>A couple of things I can think of:</p>
<ol>
<li><p>Having a 1-1 mapping will couple Varnish with your Drupal backend meaning if you won't be able to add or reduce capacity for Varnish or Drupal individually.</p>
<p>It may be fine if you don't care about this, but what if you feel that you need to add more capacity to the caching layer, say you have a really heavy hitter request. You will have to double your capacity for Drupal too and that will incur in more costs.</p>
</li>
<li><p>If you have some sort of sticky sessions you may run into a situation where a 1-1 mapping will serve a large percentage of the traffic leaving the other 1-1 mapping somehow idle or underutilized. In other words, it could lead you to have some unbalanced traffic.</p>
</li>
</ol>
