IntermediateAbout 14 min

    Circuit Breakers & Resilience Patterns

    Read the full article on Substack

    6 min read.

    Simulate the three-state circuit breaker pattern and learn how it prevents cascading failures when a downstream service becomes unhealthy.

    Think of it this way: A home fuse box trips and cuts power when there is a short circuit, protecting the house from damage. You have to manually reset it once the fault is fixed — a software circuit breaker does the same for service calls, tripping open when a downstream dependency fails so the rest of the system stays safe.

    Caller
    Service A
    Closed: requests flow
    failures
    Downstream
    Service B
    Healthy

    Send a request. Then make the downstream unhealthy and keep sending.

    Check your understanding

    Answer from memory before you scroll back up. Pulling an idea out of your head is what makes it stay there.

    Trip and recover

    Sequence

    Order the circuit breaker’s state changes as a service fails and recovers.

    Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.

    1. 1Drop a step here
    2. 2Drop a step here
    3. 3Drop a step here
    4. 4Drop a step here
    5. 5Drop a step here
    5 pieces left to place

    Quiz

    20 questions
    Question 1 of 20
    Score: 0

    In the circuit breaker pattern, what does the CLOSED state mean?

    Done with this lesson?

    Sign in free to keep your progress, streak and quiz scores.

    Keep going