Microsoft Certified: DevOps Engineer ExpertImplement a Site Reliability Engineering (SRE) strategyEasy
A DevOps team is implementing a failure detection and recovery strategy for a critical API hosted on Azure Functions. They observe that upstream dependencies occasionally become unresponsive for short periods. To prevent the API from becoming unresponsive itself while waiting for these dependencies, they want to implement a mechanism that automatically retries failed calls after a delay, with increasing delays between subsequent retries. Which resiliency pattern should they implement?
- AThrottling Pattern
- BBulkhead Pattern
- CRetry with Exponential Backoff
- DCircuit Breaker
Show answer & explanationAnswer & explanation
Correct answer: C. Retry with Exponential Backoff
The Retry with Exponential Backoff pattern is specifically designed for handling transient failures. It retries operations that have failed, but with progressively longer delays between retries. This prevents overwhelming a temporarily unavailable service and allows it time to recover, which aligns perfectly with the scenario of 'upstream dependencies occasionally become unresponsive for short periods'.
Why the other options are wrong
- A. The Throttling pattern limits the number of requests a service can handle to prevent it from being overwhelmed, but doesn't specifically address retrying failed outbound calls to dependencies.
- B. The Bulkhead pattern isolates resources to prevent one component from consuming all resources, which is not the primary concern described here.
- D. The Circuit Breaker pattern prevents calls to a consistently failing service, but the scenario describes 'short periods' of unresponsiveness, where retries are more appropriate.
Retry with Exponential Backoff
A resiliency pattern where an application retries a failed operation with progressively longer delays between retries, giving a temporarily unavailable service time to recover.
- Effective for transient failures.
- Reduces load on struggling services.
- Delays typically increase exponentially (e.g., 1s, 2s, 4s, 8s).
Memory trick: Back off and retry, giving time for the system to recover.