Skip to main content

Resilience Patterns

1. Executive Summary​

Resilience patterns are structural defenses against partial failure in distributed systems. When one service slows or fails, uncontrolled retry storms and cascading overload can convert a localized fault into a system-wide outage. Patterns—timeouts, retries with backoff, circuit breakers, bulkheads, load shedding, and graceful degradation—bound blast radius and preserve liveness for critical paths.

Resilience is not "add a library." It requires explicit SLO budgets, failure budgets, idempotent endpoints, observability of saturation, and organizational policies (when to fail open vs closed). Principal architects design these as platform defaults with escape hatches, not as per-team afterthoughts.

This chapter covers mechanism, guarantees, tuning tradeoffs, anti-patterns (retry storms, retry without jitter), integration with service mesh, and interview-level failure reasoning.

2. Why This Topic Matters​

Microservice interviews probe whether candidates understand that failure is normal:

  • A dependency at 99.9% availability contributes ~43 minutes/month downtime—your service cannot pretend it is always up.
  • Cascading failure from thread pool exhaustion is a classic principal-level scenario.
  • Circuit breaker state transitions and half-open probing require precise explanation.
  • Idempotency and retries are inseparable—unsafe retries corrupt data.

Weak answers list pattern names without discussing when they hurt (circuit breakers causing false opens, hedging doubling load).

3. Problems Being Solved​

ProblemResilience pattern
Hung requests blocking threadsTimeouts on client and server
Transient network blipsRetry with exponential backoff + jitter
Failing dependency overloadCircuit breaker opens; fail fast
One tenant exhausts poolBulkhead isolation
Traffic spike exceeds capacityLoad shedding, rate limiting, queue caps
Non-critical feature blocks core pathGraceful degradation, fallbacks
Thundering herd on recoveryJittered backoff, gradual ramp

Patterns do not fix: incorrect consistency assumptions, missing idempotency, or under-provisioned capacity without autoscaling limits.

4. Assumptions and System Model​

AssumptionImplication
Partial failure is commonDesign every outbound call to fail
Latency has tailsPercentile SLOs; timeouts below client deadline
Retries amplify loadCap retry budget; coordinate with server rate limits
Not all failures are retryable4xx vs 5xx; business validation errors
Cascading failure is a liveness threatShed load before total collapse

Client model: Each outbound call has timeout T, retry policy R, breaker state B, and bulkhead quota Q. Server exposes health that reflects dependency health (deep health checks) vs liveness (shallow).

5. Essential Terminology​

TermDefinition
TimeoutMaximum wait before abandoning a call
RetryRepeat failed call subject to policy
Exponential backoffIncreasing delay between retries
JitterRandomized delay to desynchronize retries
Circuit breakerFail-fast after error threshold; periodic half-open probe
BulkheadResource pool isolation limiting cross-coupling
Load sheddingReject excess requests to protect survivors
Graceful degradationReduced functionality vs total failure
HedgingSend duplicate request if first slow—doubles load
Fail open / fail closedDegrade permissively vs deny when dependency down

6. Core Mechanism​

Circuit breaker state machine​

Figure 1: Closed allows traffic; Open fails fast; HalfOpen tests recovery with limited probes.

Bulkhead isolation​

Figure 2: Bulkheads prevent one slow dependency from exhausting all worker threads.

Retry with backoff and jitter​

Figure 3: Bounded retries with increasing delay; jitter prevents synchronized retry storms.

Timeout budget chaining​

For request path A → B → C, total deadline must fit:

HopBudgetCumulative
A processing50ms50ms
A → B call200ms250ms
B → C call150ms400ms
Client deadline500msmargin 100ms

Child timeouts must be shorter than parent remaining budget.

7. Step-by-Step Walkthrough​

Scenario: Order service calls Payment service during checkout spike.

StepEventResilience response
1Payment latency p99 rises 200ms → 2sClient timeout at 800ms triggers
2Errors exceed 50% in 10s windowCircuit breaker opens
3Open stateFail fast; queue checkout for async retry
430s cooldownHalf-open sends 5 probe requests
5Probes succeedBreaker closes; gradual traffic restore
6Retry policyMax 3 attempts, exponential backoff, idempotency key

Idempotency: Idempotency-Key: uuid header ensures duplicate retries do not double-charge.

Retry budget calculation (platform default example):

For a client making N concurrent requests with R max retries each, worst-case load multiplier on a failing dependency is approximately N × (R + 1). At 1000 RPS with 3 retries, a failing payment service could see 4000 RPS—enough to prevent recovery (metastable failure per OSDI research).

Platform defaults should include:

ParameterSuggested starting pointTune from
Max retries2–3Error budget impact
Base backoff100msDependency recovery time
Max backoff2sClient SLA
JitterFull jitter (AWS pattern)Retry storm metrics
Per-dependency retry budget10% of normal QPS capLoad test

Graceful degradation tiers (document in runbooks):

TierFeatureDegradation behavior
0Checkout, authFail closed; no silent bypass
1RecommendationsEmpty list; cached popular items
2Social proof ("X bought this")Hide widget
3Analytics beaconsDrop silently; queue locally

8. Invariants and Guarantees​

PropertyTypeStatement
Fail fast when openLivenessBreaker open rejects without waiting full timeout
No unbounded retriesSafetyRetry cap prevents infinite amplification
Idempotent retriesSafetyDuplicate attempts safe for mutating ops
Bulkhead isolationLivenessPool exhaustion localized to bulkhead
Perfect resilienceNot guaranteedTotal overload or shared infrastructure still fails

9. Failure Scenarios​

Scenario 1: Retry storm​

Setup: 1000 clients retry immediately on 503 without backoff.

Effect: Payment service never recovers—metastable failure.

Mitigation: Exponential backoff + jitter; server Retry-After; client retry budget.

Scenario 2: Circuit breaker flapping​

Setup: Threshold too sensitive; half-open allows full traffic immediately.

Effect: Oscillation between open/closed; erratic error rates.

Mitigation: Sliding window; minimum open duration; limited half-open concurrency.

Scenario 3: Timeout mismatch​

Setup: Client timeout 30s; load balancer idle 60s; threads tied up.

Effect: Thread pool exhaustion; cascading latency.

Mitigation: End-to-end deadline propagation (gRPC deadline, context cancellation).

Scenario 4: Unsafe retry on POST​

Setup: Payment charge retried after timeout; first request actually succeeded.

Effect: Double charge.

Mitigation: Idempotency keys; deduplication store; at-most-once business semantics.

Scenario 5: Hedging under load​

Setup: Hedged requests on all slow reads during incident.

Effect: 2× load on already struggling dependency.

Mitigation: Hedging only below p99 threshold; cap hedge rate.

Scenario 6: Shared breaker state missing​

Setup: 50 pod replicas each maintain independent circuit breaker; 10% see errors, 90% do not—breaker never opens cluster-wide.

Effect: Continued load on failing dependency from majority of pods.

Mitigation: Adaptive algorithms, shared state (Redis), or outlier detection at load balancer/mesh layer.

10. Performance Characteristics​

PatternLatency impactLoad impact
TimeoutCaps tail waitFrees resources faster
RetryIncreases tail on success pathMultiplies load on failure
Circuit breakerNear-zero when openReduces load on failing dep
BulkheadQueue wait if pool fullCaps concurrent dep load
HedgingReduces tail if luckyUp to 2× requests
Load sheddingFast rejectProtects capacity

Tune with load tests reproducing dependency failure—not happy path only.

11. Scalability Limits​

  • Circuit breaker state is per client instance—cluster-wide view needs shared state or adaptive algorithms.
  • Bulkhead pools require capacity planning—too small → false rejects; too large → no isolation.
  • Retry budgets must scale with client count—global rate limits on server side essential.
  • Service mesh adds hop latency (~1–3ms)—verify against SLO budget.

12. Operational Considerations​

  • Dashboards: breaker state transitions, retry counts, timeout rates, bulkhead rejections.
  • Alert on retry rate spike and breaker open duration—leading indicators.
  • Runbooks: when to manually trip breaker, drain queues, enable degradation mode.
  • Chaos tests: inject latency/failure on dependencies in staging.
  • Document degradation tiers (e.g., hide recommendations, keep checkout).

Resilience testing in CI/CD pipeline:

StageTest typePass criteria
UnitBreaker state transitions mockedStates correct
IntegrationTestcontainers + Toxiproxy latencyTimeout fires < SLA
StagingWeekly chaos: 500ms downstream delayCheckout error < 0.1%
Pre-prodLoad test with 10% dependency error rateNo metastable failure
Prod canary5% traffic during deployAuto-rollback on burn

Document resilience SLOs separately from availability SLOs—e.g., "99% of dependency failures fail fast within 100ms" measures breaker effectiveness.

13. Security Considerations​

  • Rate limiting prevents abuse and accidental DDoS from misconfigured clients.
  • Fail-open on auth may expose data—prefer fail-closed for security dependencies.
  • Retry amplification can be exploited—authenticate and throttle per tenant.
  • Circuit breaker metrics should not leak sensitive dependency topology publicly.

14. Cost Considerations​

  • Retries increase compute and egress during incidents—model in capacity planning.
  • Over-provisioned bulkheads waste resources; under-provisioned cause false failures.
  • Managed resilience (mesh, API gateway) adds licensing and operational complexity.
  • Incident cost of cascading failure often exceeds resilience infrastructure investment.

15. Production Implementations​

Netflix Hystrix (legacy) / Resilience4j​

JVM circuit breaker, bulkhead, timeout libraries—Hystrix in maintenance; Resilience4j successor.

Istio / Envoy​

Outlier detection, connection pool limits, retries at data plane—implementation with careful policy governance.

AWS ALB + API Gateway​

Timeouts, throttling, WAF—edge resilience before application patterns.

gRPC​

Built-in deadlines, retry policy (service config), keepalive.

Polly (.NET)​

Policy composition: retry, circuit breaker, bulkhead, timeout.

Cross-implementation comparison (selection guide):

EnvironmentRecommended starting pointRationale
JVM microservicesResilience4j + Micrometer metricsActive maintenance; Spring Boot integration
Kubernetes polyglotIstio outlier detection + app timeoutsUniform policy without per-language libs
AWS LambdaAPI Gateway timeout + idempotent handlersNo long-lived thread pools
.NET servicesPolly v8 pipelinesComposable policies with DI
Mobile BFFClient-side backoff + server idempotencyCannot rely on server-only breakers

Netflix historical context: Hystrix demonstrated circuit breaker patterns at scale but was designed for thread-per-request servlet models. Reactive and virtual-thread architectures may use lighter-weight alternatives—but the patterns remain valid regardless of library. Teams migrating off Hystrix should preserve metrics dashboards during Resilience4j migration to avoid blind spots.

Edge vs application resilience split: API Gateway handles coarse rate limits and WAF; application handles idempotency and business-aware degradation. Duplicating circuit breakers at both layers without coordination can cause confusing partial failures—document which layer owns which concern.

16. Alternatives and Tradeoffs​

ApproachStrengthWeakness
Client-side librariesFine-grained per callLanguage fragmentation
Service meshUniform policyOperational complexity
API gateway aggregationReduces fan-outSingle point of failure if not HA
Async + queueNatural decouplingHigher latency to consistency
Synchronous + patternsLow latency happy pathComplex tuning

Prefer async boundaries for non-critical paths; sync + resilience for latency-sensitive critical paths.

17. Common Misconceptions​

MisconceptionReality
"Retry everything"Retries unsafe without idempotency; amplifies outages
"Circuit breaker fixes slow deps"It protects callers; root cause still needs fixing
"Longer timeout = more reliable"Long timeouts exhaust pools; fail faster
"Mesh solves resilience"Policies still need correct values and idempotent apps
"Bulkhead = K8s resource limits"Different—thread/connection isolation per dependency

18. Principal Architect Perspective​

  1. Platform defaults for timeout, retry, breaker—teams opt out with ADR, not opt in blindly.
  2. Idempotency is prerequisite for any retry on mutations—enforce at API design review.
  3. Degrade features by tier before losing core transactions.
  4. Chaos engineering validates patterns under realistic failure—not unit tests alone.
  5. Metastable failures require load shedding, not just retries—study formal models (e.g., NSDI papers on metastability).

Platform resilience policy template (golden path):

Every outbound client generated from platform SDK should inherit:

timeout: parent_deadline - 50ms
retry: max 2, exponential backoff, full jitter
retry_on: [timeout, 503, 429]
no_retry_on: [400, 401, 402, 404, 409]
idempotency: required for POST/PUT mutations
circuit_breaker: 50% errors / 30s window, open 60s
bulkhead: dedicated pool per dependency

Teams override via ADR with SRE sign-off—not silent local copies.

19. Architecture Review Exercise​

Scenario: Mobile app → API gateway → 6 microservices, no timeouts, infinite retries on 500, shared Tomcat thread pool (200 threads).

Review prompts:

  1. What happens when Recommendations service hangs?
  2. Retry behavior during payment outage?
  3. Proposed remediation priority?

Expected findings: Add timeouts (gateway + client), retry cap with jitter, bulkheads per dependency, idempotency on payments, async recommendations with fallback empty list.

20. Whiteboard Explanation​

90-second version:

"Every outbound call gets a timeout shorter than the user's deadline, with cancellation propagated. Retries are limited, exponential backoff with jitter, only on idempotent operations or with idempotency keys. Circuit breakers fail fast when error rate spikes—open, then half-open probes before full restore. Bulkheads isolate thread pools so one bad dependency can't starve checkout. Under extreme load we shed non-critical work—hide recommendations, queue notifications. The goal is preventing cascading failure: a slow service shouldn't take down the whole mesh. We measure breaker opens, retry rates, and pool saturation, and chaos-test dependency latency in staging."

21. Interview Questions​

  1. Circuit breaker states?

    • Signals: Closed, open, half-open; thresholds and probes.
  2. Why jitter on backoff?

    • Signals: Desynchronize retries; prevent thundering herd.
  3. Retry without idempotency risk?

    • Signals: Duplicate side effects; double charge example.
  4. Bulkhead vs rate limit?

    • Signals: Pool isolation vs request rate cap.
  5. Timeout propagation?

    • Signals: Parent deadline minus processing; gRPC context.
  6. Fail open vs closed for recommendations?

    • Signals: Fail open (empty list); vs payment fail closed.
  7. Metastable failure?

    • Signals: System can't recover because retry/load prevents healing.
  8. Hedging tradeoff?

    • Signals: Tail latency vs doubled load.
  9. When circuit breaker hurts?

    • Signals: False opens; flapping; hides partial degradation needs.
  10. Design checkout resilience.

    • Signals: Payment idempotency, inventory reservation timeout, async confirmation.
  11. Client vs server retry?

    • Signals: Both dangerous if uncoordinated; prefer client with server idempotency.
  12. Deep vs shallow health check?

    • Signals: Shallow for LB liveness; deep for readiness including deps.
  13. How detect metastable failure?

    • Signals: System not recovering after fix; retry rate high; load exceeds sustainable.
  14. Bulkhead thread pool sizing?

    • Signals: Based on dependency SLA, pool % of total, load test saturation point.
  15. Platform vs app resilience ownership?

    • Signals: Platform defaults; app idempotency and degradation logic; ADR for overrides.

Scoring rubric:

DimensionStrongWeak
Failure reasoningCascading, metastable, pools"Add retry" only
SafetyIdempotency, fail closedRetry all POSTs
OpsMetrics, chaos, runbooksLibrary name drop

22. Interview Follow-Ups​

  1. How set circuit breaker thresholds?

    • Signals: Error rate + slow call % over sliding window; tune from production baselines.
  2. Mesh retry on POST?

    • Signals: Dangerous; disable or require idempotent protocol design.
  3. Graceful degradation without code deploy?

    • Signals: Feature flags, config-driven fallbacks, cached responses.
  4. How coordinate retry budgets across microservices during incident?

    • Signals: Global rate limit on dependency; reduce client max retries centrally via config service.
  5. Resilience testing in production canary?

    • Signals: Small traffic %; abort on burn; fault injection on canary subset only.

22A. Production Low-Level Design (Interview + Game Day)​

Compose timeout, retry, bulkhead, breaker for checkout→payment. Production LLD and Game Day Standard.

Call policy LLD​

PatternSetting sketchWhy
Timeout< parent deadlineAvoid nested overrun
RetryMax 2, expo+jitter, idempotent onlyBound amplification
BulkheadIsolated pool for paymentProtect cart browse
BreakerOpen on error/slow %Fail fast + degrade

Step-by-step flow:

StepSafety
1Deadline propagation
2Same idempotency key on retry
4Queue for async pay / cached UX — no blind double charge

One SLO​

Checkout availability with payment success or explicit deferred state; alert on breaker open duration.


22B. Game Day Playbooks​

#DrillInjectDetectMitigateVerify
GD-1Payment 5xx stormFault inject paymentBreaker opensDegrade checkoutBrowse alive; no cascade
GD-2Retry amplificationShort timeout + retriesRetry RPS↑Cut budgetDependency load drops
GD-3Pool exhaustionSaturate payment poolBulkhead rejectOther pools healthyIsolation holds

GD-1 — Breaker protects checkout​

23. Strong Answer Example​

Question: "Payment dependency is flaky—how do you protect checkout?"

Answer this as a 45-minute greenfield design using the PRACTICE framework. Below is how a strong student sounds aloud—protect checkout liveness without double-charging, then defend timeout/retry/breaker composition.

PRACTICE interview answer map for protecting checkout from flaky payment

Figure A: PRACTICE map — Problem → Requirements → Assumptions → Capacity → Topology → Invariants → Constraints → Evolution.


Student interview script (PRACTICE)​

P — Problem framing​

"Checkout depends on a flaky payment provider—timeouts, 503s, latency spikes. Uncontrolled retries and shared thread pools turn that into a cascading outage of the whole cart/checkout path—and unsafe retries risk double charges.

Non-goals for v1: replacing the payment PSP, building a full ledger, or active-active multi-region checkout. I'll treat bounded sync path + safe async recovery as the core."

R — Requirements​

TypeRequirement
FRPlace order, charge card, confirm or park for async payment
NFRCheckout API p99 within latency budget (~1.2s); payment call timeout < parent; 99.9% checkout availability when payment is degraded (not necessarily charged)
SafetyNo double charge; declines (402) fail closed—no retry
OpsBreaker state, retry rate, pool saturation visible; chaos-test payment latency

"I'll ask: is payment a third-party PSP or internal? Sync charge required for confirmation, or is PENDING_PAYMENT OK? I'll assume third-party PSP, sync preferred, async hold allowed when flaky."

A — Assumptions (state aloud)​

AssumptionWhy it matters
Client supplies Idempotency-KeySafe retries / async re-charge
Server-side dedup store (TTL ≥ retry window)Prevents double charge on timeout ambiguity
Checkout has a hard latency budget (~1.2s)Child timeout must be shorter
Payment is flaky, not permanently downBreaker + half-open; async worker for backlog
Inventory/recommendations share the same appNeed bulkheads—payment can't starve them

"If they say 'must confirm payment before any order row,' I'd push for a reservation / pending state—otherwise flaky PSP = total checkout outage."

C — Capacity (back-of-envelope + pool math)​

Checkout QPS (peak) → 2,000 (say)
Payment p99 target → < 300ms healthy; flaky → seconds
Parent deadline → 1.2s
Child payment timeout → 800ms (leaves margin for inventory/commit)
Max sync retries → 1–2 on timeout/503 only (budget permitting)
Bulkhead threads for payment → ~25–40 (sized from QPS × latency + headroom)
e.g. 2000 QPS × 0.05s avg ≈ 100 in-flight → pool + queue caps matter
Breaker → open if ~50% errors or slow calls in 30s window; open 60s
Async worker throughput → drain PENDING_PAYMENT without retry storm

"Capacity here is threads and in-flight calls, not just QPS—one slow PSP without a bulkhead exhausts the checkout pool."

T — Topology (draw this)​

Checkout resilience topology with payment bulkhead and circuit breaker

Figure B: Checkout owns timeout + retry + breaker + payment bulkhead; on open/budget exceeded → PENDING_PAYMENT + async worker; other deps isolated.

Pattern composition (order matters):

LayerPolicy
Timeout800ms child inside 1.2s parent
RetryMax 2; exponential backoff + full jitter; only timeout/503—not 402
Circuit breakerFail fast when error/slow rate spikes; half-open probes
BulkheadDedicated pool/queue for payment
DegradationBreaker open → PENDING_PAYMENT + async—not infinite sync retry

Checkout decision path when payment is flaky

Figure C: Idempotency → bulkhead → timed call → selective retry → breaker/async park; declines never retry.

I — Invariants (safety)​

"Non-negotiable for checkout + payment:

  1. Idempotency-Key on every charge—timeout after success must not double-charge.
  2. Never retry business declines (402 / insufficient funds)—fail closed to the user.
  3. Retry only when safe and budget remains—timeout/503 with key; cap attempts.
  4. Breaker open ≠ drop the order silently—park PENDING_PAYMENT and recover async.
  5. Bulkhead isolation—payment saturation must not block inventory or health endpoints."

C — Constraints (second C)​

ConstraintDesign response
User-facing latencyFail fast via breaker; don't wait 30s
Ambiguous timeoutIdempotent charge + reconcilation / status poll
Mesh retries on POSTDisable mesh retry on charge or require same idempotency key
Cost of async UXShow "confirming payment" / email when charged
Chaos / false opensTune from baselines; half-open probe count; don't open on tiny windows

E — Evolution (phased harden + prove)​

Phased delivery:

PhaseDeliverable
M1Idempotency-Key + dedup store; payment timeout < parent deadline
M2Retry with jitter (safe codes only); payment bulkhead
M3Circuit breaker + PENDING_PAYMENT async worker
M4Dashboards: breaker state, retry rate, pool reject, payment error budget
M5Monthly chaos: inject 5s payment latency; verify no cascade

Failure modes I'd mention:

FailureMitigation
PSP slow (not erroring)Timeout + slow-call breaker trip
Retry storm on recoveryJitter; breaker half-open limit; async rate limit
Double charge after timeoutIdempotency + PSP dedup
Shared thread pool exhaustionBulkhead; load-shed recommendations
Mesh + app double retryOne owner for retry policy

Observability: payment_timeout_rate, breaker_state, retry_attempts, bulkhead_rejected, pending_payment_age, checkout SLO vs payment error budget.


Closing line (interview)​

"So: idempotency first, then timeout inside the checkout budget, capped jittered retries only on transient codes, circuit breaker to fail fast, bulkhead so payment can't starve checkout, and when the breaker is open—park PENDING_PAYMENT and charge async—not sync retry forever. I'd chaos-test slow payment so we prove the cascade doesn't happen."

Scoring signals​

StrongWeak / red flag
Idempotency before retry"Retry three times"
Timeout < parent deadline30s timeouts
Retry only timeout/503—not 402Retry all errors
Breaker + async parkBreaker only, drop order
Bulkhead isolationShared pool for all deps
Chaos / metricsLibrary name drop only

Compact outline (if time-boxed to 2 minutes)​

"Idempotency-Key + dedup. Checkout budget 1.2s; payment timeout 800ms. Retry ≤2 with full jitter on timeout/503 only—never 402. Circuit breaker 50%/30s → open 60s, half-open probes. Payment bulkhead ~25 threads. If open: PENDING_PAYMENT + async worker. Metrics + monthly 5s latency chaos."

24. Weak Answer Example​

Question: "Payment dependency is flaky—how do you protect checkout?"

"Add a circuit breaker and retry three times."

Why weak / red flags: No idempotency, no backoff/jitter, no bulkhead, no timeout budget, no async fallback—retries without keys risk double charges and cascades.

25. Hands-On Exercise​

Try it: Sagas §25 Hands-On — Lab 010 demonstrates timeout/retry, compensation, and idempotent saga steps on :8093.

  1. Implement Resilience4j (or equivalent) on sample service with breaker + retry + bulkhead.
  2. Inject 100% failure on dependency; observe open state and recovery.
  3. Remove jitter; measure retry spike with load generator.
  4. Add idempotency middleware; verify duplicate POST safety.
  5. Document degradation tiers for a product page BFF.
  6. Run chaos test: 2s latency injection; capture thread pool metrics.
  7. Measure metastable failure: inject 503 on dependency with unlimited client retry; observe recovery time after fix.
  8. Implement idempotency store (Redis or DB) and verify duplicate charge prevention under parallel retries.
  9. Document platform SDK default resilience policy; present override ADR template to mock staff panel.

26. Knowledge Check​

  1. Half-open purpose? (Probe recovery with limited traffic.)
  2. Jitter prevents? (Synchronized retry storms.)
  3. Bulkhead protects? (Resource pool isolation per dependency.)
  4. Idempotency needed for? (Safe retries on mutations.)
  5. Metastable failure? (Overload prevents recovery despite fix.)

27. Flashcards​

#FrontBack
1Circuit breakerFail-fast after errors; half-open probes recovery.
2BulkheadIsolated resource pool per dependency.
3Exponential backoffIncreasing delay between retries.
4JitterRandom delay to desynchronize clients.
5Idempotency keySafe duplicate request handling.
6Load sheddingReject excess load to survive.
7Graceful degradationReduced features vs total outage.
8HedgingDuplicate slow request—doubles load.
9Fail fastShort timeout vs hanging threads.
10Metastable failureSystem stuck in bad state despite fix.

28. Cheat Sheet​

EVERY OUTBOUND CALL
Timeout < parent deadline
Retry: capped, backoff, jitter, idempotent only
Breaker: error + slow thresholds
Bulkhead: dedicated pool

BREAKER
Closed → Open (threshold) → HalfOpen (probe) → Closed

ANTI-PATTERNS
Infinite retry
Retry on non-idempotent POST
Shared pool all deps
Timeout > client SLA

DEGRADATION TIERS
Tier 0: Core transactions
Tier 1: Personalization
Tier 2: Analytics beacons

METRICS
Breaker state, retry count, pool reject, timeout rate

30. References​

Primary sources​

  • Nygard, M. (2018). Release It!, 2nd ed. Pragmatic Bookshelf — circuit breaker, bulkhead, stability patterns.
  • Bronson, G., et al. "Metastable Failures in Distributed Systems." OSDI 2021 — formal treatment of retry-induced outages.

Engineering blogs​

  • Netflix Technology Blog — Hystrix and resilience evolution.
  • Microsoft Azure Architecture Center — Circuit Breaker pattern.
  • Resilience4j documentation — configuration semantics.

Distinction​

Claim typeSource
Pattern definitionsNygard; Azure patterns catalog
Metastable failureOSDI 2021 paper
Library behaviorResilience4j/Istio docs — implementation choices