What is Circuit and why use it?
masterCircuit is an efficient Go implementation of the circuit breaker pattern, similar to Netflix's Hystrix. It protects your service from downstream failures by:
- Preventing hangs: Detects downstream failures quickly and returns errors immediately instead of waiting for timeouts.
- Providing monitoring boundaries: Creates common metric names for downstream failure types and supports SLO tracking.
- Handling fallbacks: Provides a centralized place for fallback logic when a circuit is open or a call fails.
- Preventing overload: Allows downstream services to recover by limiting traffic during degraded states.
- Protecting dependencies: Shields dependencies from abnormal traffic rushes.