gobreaker icon indicating copy to clipboard operation
gobreaker copied to clipboard

Feature Proposal: Distributed Circuit Breaker Support

Open call-stack opened this issue 1 year ago • 1 comments

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!

call-stack avatar Oct 15 '24 05:10 call-stack

https://github.com/sony/gobreaker/pull/70

call-stack avatar Oct 22 '24 07:10 call-stack

Up!

felipeagger avatar Oct 23 '24 16:10 felipeagger

+1, this is something that would greatly enhance the usability of this package.

hamzashariq avatar Oct 28 '24 12:10 hamzashariq

https://github.com/sony/gobreaker/pull/73 has been merged.

YoshiyukiMineo avatar Dec 28 '24 13:12 YoshiyukiMineo