Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Resiliency using Hystrix

Resiliency using Hystrix

Resiliency using Hystrix - A quick talk on Hystrix and how to utilize it to achieve resilient application architecture.

Senthilkumar Gopal

November 16, 2016
Tweet

More Decks by Senthilkumar Gopal

Other Decks in Programming

Transcript

  1. Hystrix
    why resiliency?

    View full-size slide

  2. Agenda
    ❏ What is Resiliency?
    ❏ Why we need Resiliency?
    ❏ What is Hystrix
    ❏ Not a silver bullet
    ❏ How to use
    ❏ What you get and don’t
    ❏ What’s next

    View full-size slide

  3. What is Resiliency?
    Resiliency is the ability to provide and maintain an acceptable level of service in the face of
    faults and challenges to normal operation.” Threats and challenges for services can range
    from simple misconfiguration over large scale natural disasters to targeted attacks.

    View full-size slide

  4. Why we need Resiliency?

    View full-size slide

  5. What is Hystrix?
    Hystrix is a latency and fault tolerance
    library designed to isolate points of access
    to remote systems, services and 3rd party
    libraries, stop cascading failure and enable
    resilience in complex distributed systems
    where failure is inevitable.

    View full-size slide

  6. Not a silver bullet
    More like a Gauge &
    Circuit breaker,
    Rather than a
    pipeline,
    Certainly NOT the
    Thor’s Hammer

    View full-size slide

  7. public class CommandHelloWorld extends HystrixCommand {
    private final String name;
    public CommandHelloWorld(String name) {
    super(HystrixCommandGroupKey.Factory.asKey("ExampleGroup"));
    this.name = name;
    }
    @Override
    protected String run() {
    // a real example would do work like a network call here
    return "Hello " + name + "!";
    }
    }
    CommandHelloWorld.execute();
    How to use

    View full-size slide

  8. How to use - Configurations
    Circuit Breaker
    ➔ circuitBreaker.enabled
    ➔ circuitBreaker.requestVolumeThreshold
    ➔ circuitBreaker.sleepWindowInMilliseconds
    ➔ circuitBreaker.errorThresholdPercentage
    ➔ circuitBreaker.forceOpen
    ➔ circuitBreaker.forceClosed
    Metrics
    ➔ metrics.rollingStats.timeInMilliseconds
    ➔ metrics.rollingStats.numBuckets
    ➔ metrics.rollingPercentile.enabled
    ➔ metrics.rollingPercentile.timeInMillisecond
    s
    ➔ metrics.rollingPercentile.numBuckets
    ➔ metrics.rollingPercentile.bucketSize
    execution.isolation.thread.timeoutInMilliseconds

    View full-size slide

  9. What you get and don’t
    ➔ Real-time Dashboard
    ➔ Circuit Breaker
    ➔ Auto Mark Up / Mark Down
    ➔ Highly Configurable
    ➔ Reduced Latencies
    ➔ Faster responses
    ➔ 100% availability
    ➔ Magic!!!

    View full-size slide

  10. What’s Next
    ➔ Aero Hystrix
    ➔ Use it for your dependencies
    ➔ Use the dashboard
    ➔ Checkout Turbine

    View full-size slide