Back to roadmap
Module 4 · Edge: DNS, CDN, Load BalancersDay 03625 min

Health Checks, Circuit Breakers, Drains

Rotate broken backends out before users notice.

Day 036

Health Checks, Circuit Breakers, Drains

Healthy
service
Draining
service
Broken
service
Signal path
Health-check states and routing
Healthy
service
async
Draining
service
Draining
service
async
Broken
service
Memory hook

Health Checks, Circuit Breakers, Drains: rotate broken backends out before users notice

Mental model

move the first decision closer to the user

Design lens

Long drains slow deploys; short drains drop in-flight.

Recall anchors
ChecksPatterns

Why it matters

Health checks let LBs route only to working backends. Liveness asks 'are you alive?', readiness asks 'are you ready to take traffic?', and deep checks ask 'do you really work end-to-end?'.

Deep dive

Circuit breakers stop sending requests to a downstream failing too often, giving it time to recover.

Drains: stop sending new traffic to an instance, let in-flight finish, then remove. Critical for clean deploys.

Beware deep checks that depend on downstreams: a flaky DB can mark every instance unhealthy.

Demo / scenario

Rolling deploy with no user-visible errors.

  1. Mark instance NOT_READY → LB stops new traffic.
  2. Wait for in-flight (drain timeout 30s).
  3. Stop process, replace.
  4. New instance passes readiness, returns to rotation.

Tradeoffs

  • Long drains slow deploys; short drains drop in-flight.
  • Deep checks can cascade failures; prefer shallow.
  • Circuit breakers add complexity but cap failure spread.

Diagram

Healthy
Draining
Broken
Health-check states and routing.

Mind map

Check yourself

Loading quiz…

Sources & further reading