Medium System Design Microservices
What is the Circuit Breaker pattern and when should you use it?
Answer
Circuit Breaker prevents cascading failures by stopping calls to failing services. States: Closed (normal operation, tracking failures), Open (fails fast, doesn't call service), Half-Open (periodically tests if service recovered). Configuration: failure threshold, timeout, recovery time. Benefits: fail fast, prevent resource exhaustion, allow recovery time. Libraries: Hystrix, Resilience4j, Polly. Use for: external API calls, database connections, any unreliable dependency. Combine with: timeouts, retries with backoff, fallbacks.
IIT Certified
Master These Concepts with IIT Certification
175+ hours of industry projects. Get placed at Bosch, Tata Motors, L&T and 500+ companies.
Relevant for Roles
Software Engineer Backend Developer Systems Architect