Skip to content
Veltoryx Technologies
ProLesson 8.2Intermediate4 min readUpdated 31 October 2026

Resilience & Stability Patterns

Protect microservices from cascading failures using Circuit Breakers, Bulkhead thread isolation, exponential retries, and graceful fallbacks.

In distributed architectures, failures are not exceptional events; they are guaranteed daily occurrences. A hard drive fills up, a cloud hypervisor stutters, or a downstream dependency experiences a prolonged garbage collection pause.

If your microservices are not built with defensive resilience patterns, a failure in a minor dependency can trigger a domino effect that collapses your entire platform.

01The Circuit Breaker Pattern

Inspired by electrical circuit breakers in residential buildings, this software pattern monitors outbound remote calls. If failure rates cross a predetermined threshold, the breaker "trips" open, instantly failing subsequent calls without waiting for network timeouts.

Circuit Breaker and Bulkhead Isolation
Fig. 1 · Circuit Breaker and Bulkhead Isolation

The 3 States of a Circuit Breaker:

  1. CLOSED (Normal Operation):
    • Requests flow freely to the downstream service.
    • The circuit breaker maintains a sliding window of recent call results (e.g., last 100 calls).
    • If the failure rate remains below the threshold (e.g., < 50%), the circuit stays closed.
  2. OPEN (Failing Fast):
    • If failures or slow calls exceed the threshold, the breaker trips to OPEN.
    • All outgoing requests fail immediately with a CallNotPermittedException.
    • Why this saves systems: Prevents caller threads from hanging on connection/read timeouts, preserving upstream thread pools and giving the struggling downstream service room to recover.
  3. HALF-OPEN (Trial Probing):
    • After a configured waitDurationInOpenState (e.g., 10 seconds), the breaker transitions to HALF-OPEN.
    • It permits a limited number of test calls (e.g., 10 probe requests).
    • Once all the permitted probe calls have finished, the breaker works out their failure rate. If it is below the threshold, the breaker goes back to CLOSED. If not, it trips to OPEN again.

Loading the rest of the lesson…