Feature Proposal: Distributed Circuit Breaker Support
Hi maintainers,
I'd like to propose adding distributed circuit breaker support to Sony/gobreaker by allowing the circuit breaker state (open/closed/half-open) to be stored in an external datastore like Redis. This would allow multiple service instances to share the same state, ensuring consistent behavior across all instances.
Key Proposal:
- Optional External State: Allow users to opt-in to store circuit breaker state in a shared store (e.g., Redis) for distributed environments.
- Backward Compatibility: In-memory state management remains the default.
- Pluggable Interface: Introduce a pluggable interface for different datastores (Redis, etc.).
Benefits:
- Consistent circuit breaker state across multiple instances.
- Prevents downstream overloads in distributed systems.
I’d be happy to contribute a PR for this feature if it aligns with the project’s goals. Let me know your thoughts!
https://github.com/sony/gobreaker/pull/70
Up!
+1, this is something that would greatly enhance the usability of this package.
https://github.com/sony/gobreaker/pull/73 has been merged.