Resilience Patterns
Fault Tolerance Patterns
Prevents cascading failures by failing fast with automatic recovery detection through open, closed, and half-open states.
- State management (open/closed/half-open)
- Configurable failure threshold
- Timeout configuration
- Metrics and monitoring
- Microservice API calls
- Database connection failures
- External API integration
- Payment gateway calls
Handles transient failures with exponential backoff, jitter, and configurable maximum attempts for resilience.
- Configurable retry attempts
- Exponential backoff strategy
- Jitter to prevent thundering herd
- Idempotency checks
- Network request failures
- Database query timeouts
- Message delivery retry
- File upload operations
Isolates resources to limit blast radius and partition failures using thread pools and connection pools.
- Thread pool isolation
- Connection pool partitioning
- Circuit breaker per partition
- Resource limit enforcement
- Connection pool separation
- Thread pool isolation
- Multi-tenant resource isolation
- Service boundary enforcement
Rate & Load Control
Controls request rate using token bucket, sliding window, or fixed window algorithms to prevent system abuse.
- Per-user/IP rate limits
- Burst handling capability
- Distributed rate limiting
- Configurable time windows
- API throttling
- Login attempt limiting
- Resource protection
- DDoS prevention
Sets response time limits to prevent indefinite waits and enable fail-fast behavior across the system.
- Connection timeout
- Read timeout configuration
- Overall request timeout
- Cascading timeout prevention
- HTTP request timeouts
- Database query limits
- RPC call timeouts
- Cache lookup limits
Smooths traffic spikes using queue-based buffering to decouple producers from consumers with backpressure handling.
- Queue-based buffering
- Asynchronous processing
- Backpressure handling
- Traffic spike absorption
- Message queue systems
- Task queue processing
- Batch job processing
- Write operation buffering
Degradation & Recovery
Provides alternative responses on failure with degraded functionality, cached data, or default values.
- Static fallback responses
- Cached data serving
- Default value provision
- Simplified response mode
- Cache fallback on DB failure
- Static content serving
- Reduced feature mode
- Error page display
Monitors service availability with readiness vs liveness probes for graceful degradation and load balancer decisions.
- Periodic health checks
- Dependency health validation
- Deep vs shallow checks
- Liveness and readiness probes
- Kubernetes liveness probes
- Load balancer health checks
- Service discovery updates
- Auto-scaling triggers
Flow control mechanism preventing system overwhelming through request limiting, queue bounds, and consumer-driven feedback.
- Request rate limiting
- Queue size bounds
- Feedback loop mechanism
- Load shedding capability
- Reactive streams (RxJS)
- TCP flow control
- Message queue throttling
- Async processing pipelines
