Giter Site home page Giter Site logo

Failsafe vs Hystrix about failsafe HOT 7 CLOSED

failsafe-lib avatar failsafe-lib commented on August 19, 2024 1
Failsafe vs Hystrix

from failsafe.

Comments (7)

jhalterman avatar jhalterman commented on August 19, 2024 10

Let me quickly caveat this by saying I am not a user of Hystrix, so my comments are based only on its documentation:

Failsafe is intended to be lightweight and to blend as seamlessly into your code as possible while Hystrix appears a bit more imposing but offers many more features as a result, such as response caching, request collapsing and threadpool management. Generally, Hystrix is more oriented around the execution of remote requests and offers features around that, while Failsafe is more general purpose for handling any type of execution failure. To highlight a few differences:

  • Executable logic can be passed through Failsafe as simple lambda expressions or method references. In Hystrix, your executable logic needs to be placed in a HystrixCommand implementation.
  • Failsafe supports retries in addition to circuit breakers.
  • Asynchronous executions in failsafe are performed on a user supplied ThreadPool / Scheduler. In Hystrix, asynchronous commands are executed on internally managed thread pools for particular dependencies.
  • In Failsafe, asynchronous Failsafe executions can be observed via the listeners API and return FailsafeFuture. In Hystrix, asynchronous executions can be observed using RxJava Observables.
  • Failsafe circuit breakers support execution timeouts and configurable success thresholds (Hystrix only performs a single execution when in half-open state to determine whether to close a circuit).
  • Failsafe circuit breakers can be shared across different executions against the same component (such as a web service), so that if a failure occurs, all executions against that component will be halted by the circuit breaker.
  • Failsafe circuit breakers can be used and operated as standalone constructs.

Those are the main bits that stand out to me.

Reference: https://github.com/Netflix/Hystrix/wiki/How-it-Works

Edit: This content has been moved to a wiki page so it can be better maintained as needed:

https://github.com/jhalterman/failsafe/wiki/Comparisons#failsafe-vs-hystrix

from failsafe.

axelfontaine avatar axelfontaine commented on August 19, 2024 2

This should be copy-pasted in the main README.md (which BTW is a little confusing right now as the listeners API has changed from what is available on Maven Central...)

from failsafe.

jhalterman avatar jhalterman commented on August 19, 2024 1

@gabrielgiussi Yes, but depending on the CircuitBreaker implementation, applying the same breaker to a set of related executions can carry some constraints. In Hystrix (which I am not an expert on), you might place a group of operations in the same HystrixCommand. But doing so means that all of the executions in that command will be subject to the same configuration/fallback options.

from failsafe.

charphi avatar charphi commented on August 19, 2024

Thanks for you quick answer!

from failsafe.

jhalterman avatar jhalterman commented on August 19, 2024

@axelfontaine Will do. Also, rolled back changes to the README for the listeners API (#26) until the next release has gone out.

from failsafe.

jhalterman avatar jhalterman commented on August 19, 2024

This content has been moved to a wiki page so it can be better maintained as needed:

https://github.com/jhalterman/failsafe/wiki/Comparisons#failsafe-vs-hystrix

from failsafe.

gabrielgiussi avatar gabrielgiussi commented on August 19, 2024

@jhalterman I don't quite understand the following point:

Failsafe circuit breakers can be shared across different executions against the same component (such as a web service), so that if a failure occurs, all executions against that component will be halted by the circuit breaker.

This isn't like THE way that circuit breakers should work? If each execution will have his own circuit breaker it will never fail fast (aka open CB) and won't accomplish any purpose.
What is the scenario that you are specifying with this point?

Thanks.

from failsafe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.