11 / 25 · Service boundaries

Circuit breaker

A circuit breaker temporarily stops calls to a dependency that appears unhealthy, then cautiously tests recovery. It prevents repeated waiting and extra pressure; it does not repair the dependency.

What you will practise

  • Follow closed/open/half-open
  • bound recovery probes
  • separate breaker and retry

Before you start: Dependency, timeout and failure measurement.

About 4 minutes · offline-generated English female narration · captions included. Diagrams are conceptual; timings are illustrative.

Download MP4Captions

Listen without the videoDownload audio

The same pre-recorded voice as the video. Starting audio pauses the video, and starting the video pauses audio.

Chapters and full transcript

Let us understand circuit breaker. A home fuse interrupts an unsafe circuit instead of letting every appliance keep drawing current. A software breaker is not the same physical mechanism, but the useful idea is similar: stop repeated harmful attempts, observe conditions and restore access carefully. A circuit breaker temporarily stops calls to a dependency that appears unhealthy, then cautiously tests recovery. It prevents repeated waiting and extra pressure; it does not repair the dependency.

Follow the normal path. The breaker allows normal calls and records eligible outcomes. Timeouts still bound each attempt; a closed breaker is not a guarantee of health. The dependency times out repeatedly. A minimum sample and measurement window help distinguish a pattern from a single unlucky request. If SeatSpot recommendations repeatedly time out, continuing to call them can occupy every connection. A breaker can reject or use a safe optional fallback while core booking work continues.

Now change one condition. The breaker opens and rejects dependency calls quickly. This frees local resources and avoids repeating expensive failures while recovery is investigated. A common misunderstanding is this: An open breaker makes every fallback safe. A fallback must preserve business meaning; it cannot fabricate a successful payment. Think about this. The breaker opens. Has it repaired the failed payment provider? Pause the video and make your prediction. No. It stops repeated calls quickly. Recovery probes only test whether the dependency can be used again.

Let us reason with a concrete example. An illustrative breaker opens after enough samples show a 50% eligible-failure rate in its window. A minimum of 20 calls avoids opening after one failure out of one call in this example. The numbers are teaching choices, not recommended universal settings. Define which timeouts/errors count, limit half-open probes and watch false trips alongside recovery time. These figures are teaching examples, not production guarantees.

Turn the idea into a design decision. Optional recommendations can be omitted. Essential payment outcomes must remain pending or failed according to verified state, not invented to hide the outage. After a reset interval, allow a limited probe set. Sending every waiting caller at once can overload a dependency that is only partly recovered. When you try the practice task, look for this result. Few probes avoid a recovery stampede; thresholds are workload choices.

Check your understanding. Successful probes restore normal traffic; failed probes reopen the breaker. Observe both false trips and recovery behavior under controlled failure tests. Here is a challenge. What should a breaker do after the reset interval? Pause before the answer. Move to half-open with bounded probes. Evaluate actual outcomes before restoring full traffic; otherwise recovering capacity may be overwhelmed again. For an interview, define eligible failures, thresholds and bounded probes. Say what you would measure, not only which tool you would buy.

Start with an everyday picture

A home fuse interrupts an unsafe circuit instead of letting every appliance keep drawing current. A software breaker is not the same physical mechanism, but the useful idea is similar: stop repeated harmful attempts, observe conditions and restore access carefully.

Why SeatSpot needs this

If SeatSpot recommendations repeatedly time out, continuing to call them can occupy every connection. A breaker can reject or use a safe optional fallback while core booking work continues.

Trace one step at a time

Move through the diagram at your pace. Teal paths are active; unavailable components are labelled.

CallerBreakerDependencySafe fallbackOutcome metrics

Step 1 of 6 · State: CLOSED

Closed: calls flow

The breaker allows normal calls and records eligible outcomes. Timeouts still bound each attempt; a closed breaker is not a guarantee of health.

Read all six mechanism steps
  1. Closed: calls flow

    The breaker allows normal calls and records eligible outcomes. Timeouts still bound each attempt; a closed breaker is not a guarantee of health.

  2. Observe repeated failures

    The dependency times out repeatedly. A minimum sample and measurement window help distinguish a pattern from a single unlucky request.

  3. Open: stop pressure

    The breaker opens and rejects dependency calls quickly. This frees local resources and avoids repeating expensive failures while recovery is investigated.

  4. Choose an honest fallback

    Optional recommendations can be omitted. Essential payment outcomes must remain pending or failed according to verified state, not invented to hide the outage.

  5. Half-open: probe

    After a reset interval, allow a limited probe set. Sending every waiting caller at once can overload a dependency that is only partly recovered.

  6. Recover or reopen

    Successful probes restore normal traffic; failed probes reopen the breaker. Observe both false trips and recovery behavior under controlled failure tests.

Pause and make a prediction

The breaker opens. Has it repaired the failed payment provider?

Answer aloud or write your reasoning in the lesson notes before revealing the explanation.

Correct a common misunderstanding

Claim to question: An open breaker makes every fallback safe.

Better explanation: A fallback must preserve business meaning; it cannot fabricate a successful payment.

Walk the breaker states

A paper or whiteboard task. No cloud account or paid infrastructure is required.

  1. Record eligible failures while the breaker is closed.
  2. Open after an explicit minimum sample and threshold.
  3. Permit a small half-open probe set, then decide whether to close or reopen.

Check what you can explain

This is your self-check, not an automated grade. Try again without the diagram tomorrow.

0 of 3 goals checked. Choose one remaining idea to practise next.

These checkboxes reset when you leave. Use your saved lesson notes and completion marker to record lasting progress.

Teach it back

Without looking, explain what this component changes, what it does not solve and what happens if it fails. Use the animation to check your explanation, then switch to Engineering.

Try it before viewing the solution

What should a breaker do after the reset interval?

Check one key idea

Half-open should usually:

Your explanation and interview notes

Saved only in this browser when storage is available. Export a backup from the course page before clearing browser data or moving devices.

Loading your local notes…

Official references and next reading

The explanation, fictional examples and animations are original teaching material. Vendor behavior depends on the specific product/version; use its documentation before deploying.