Decision guide
Circuit Breaker and Resilience Libraries by Stack
Which resilience library should you use in your stack (or should the mesh do it)?
Side by side
| Criterion | Resilience4j (Java/Kotlin) | Polly (.NET) | opossum / cockatiel (Node.js) | tenacity / pybreaker / stamina (Python) | Service mesh (Envoy/Istio/Linkerd) |
|---|---|---|---|---|---|
| Language | JVM | .NET | Node.js | Python | Any (sidecar/ambient) |
| Circuit breaker | Yes | Yes | Yes | Yes | Outlier detection / connection limits |
| Retries with jitter | Yes | Yes | cockatiel | tenacity/stamina | Yes (with budgets) |
| Bulkhead | Yes | Yes (concurrency limiter) | cockatiel | Manual (semaphores) | Connection/request limits |
| App-level fallbacks | Yes | Yes | Yes | Yes | No |
| Metrics integration | Micrometer | OpenTelemetry | Events/custom | Custom | Built-in |
When to choose each
Resilience4j (Java/Kotlin)
Modular breakers, retries, bulkheads, rate limiters, time limiters; Spring Boot integration.
Choose when
- Spring Boot services
Avoid when
- Non-JVM stacks
Polly (.NET)
Resilience pipelines: retry, breaker, timeout, hedging, rate limiter.
Choose when
- .NET services (Microsoft.Extensions.Resilience)
Avoid when
- Non-.NET stacks
opossum / cockatiel (Node.js)
Circuit breakers (opossum) and composable policies (cockatiel).
Choose when
- Node.js/TypeScript services
Avoid when
- CPU-bound workers
tenacity / pybreaker / stamina (Python)
Retries with backoff (tenacity, stamina) and breakers (pybreaker, aiobreaker).
Choose when
- Python services
Avoid when
- When you need bulkheads/rate limiters in one package
Service mesh (Envoy/Istio/Linkerd)
Timeouts, retries, outlier detection and breaking configured outside the app.
Choose when
- Polyglot microservices
- Uniform policies without code changes
Avoid when
- Fallback logic that needs app context
Verdict
Use your stack's library for app-aware behavior (fallbacks, per-operation policies) and a service mesh for uniform timeouts, retries budgets and outlier detection across many services — but avoid configuring retries in both layers for the same call.
Learn more
- Resilience Patterns
- Performance & Scalability
- Add retries and a circuit breaker with Resilience4j (Spring Boot)