What will you use for Application Resilience?

Application resilience in microservices is achieved by combining several complementary patterns that each protect the system from a different type of failure.

Key Points: • Circuit Breakers stop calls to a service once its failure rate crosses a threshold, preventing repeated failures from cascading through the system. • Retry Mechanisms automatically re-attempt operations that fail due to transient issues, ideally with exponential backoff and a maximum attempt limit. • Bulkheads isolate resources per dependency, so a problem in one area can't consume resources needed elsewhere and spread the failure. • Fallback Methods provide a backup response — like cached or default data — when the primary call ultimately can't succeed, so the user gets a degraded experience instead of an error. • Timeouts ensure a slow dependency doesn't hold resources indefinitely, which is essential for the other patterns to be effective.

Example: Resilience4j in a Spring Boot application can combine all of these on a single method — a bulkhead-limited thread pool, a circuit breaker tracking failures, a retry policy with backoff, and a fallback method, all layered together around a single external call.

Interview Tip: A concise interview answer is:

"For application resilience I'd combine Circuit Breakers to stop calling a failing dependency, Retry with backoff for transient issues, Bulkheads to isolate resources per dependency, and Fallback methods so the user gets a degraded response instead of a hard failure. Used together, typically via Resilience4j in a Spring Boot app, they cover the different ways a dependency can fail."