explaingit

netflix/hystrix

24,461JavaAudience · developerComplexity · 3/5Setup · moderate

TLDR

A Java library from Netflix that keeps distributed backend systems running when individual services fail, using the circuit breaker pattern to stop cascading failures and return safe fallback responses instead.

Mindmap

mindmap
  root((Hystrix))
    What it does
      Circuit breaker
      Fallback responses
      Thread pool isolation
      Request caching
    Tech Stack
      Java
    Use Cases
      Prevent cascading failure
      Graceful API degradation
      Microservice resilience
    Audience
      Java backend developers
      Distributed systems teams
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Wrap calls to an external API so your app returns a cached fallback instead of crashing when that API goes down.

USE CASE 2

Prevent one slow database query from exhausting all threads and bringing down an entire Java microservice.

USE CASE 3

Isolate third-party service calls into separate thread pools so a failing vendor cannot affect your core logic.

USE CASE 4

Monitor which dependencies are failing most often in a distributed Java system.

Tech stack

Java

Getting it running

Difficulty · moderate Time to first run · 30min

No longer actively maintained, Netflix recommends resilience4j for new projects.

In plain English

Hystrix is a Java library from Netflix designed to make distributed systems more resilient when individual components fail. In a complex application made up of many services that call each other, one slow or failing service can cause a chain reaction that takes down everything, this is called cascading failure. Hystrix was built to prevent that. It does this through the circuit breaker pattern. A circuit breaker monitors calls to a dependency (like another service or database). If that dependency starts failing or responding too slowly too often, the circuit breaker trips open and stops sending it requests. Instead, a fallback response is returned immediately, for example, a cached result or a default value, so the rest of the system keeps functioning while the problem is isolated and the dependency has time to recover. Hystrix also supports running calls in isolated thread pools and request caching, so a misbehaving dependency cannot exhaust shared resources and bring everything else down with it. You would use Hystrix in Java backend systems that call multiple external services, databases, or third-party APIs, and where you need graceful degradation under failure conditions. Note: Hystrix is no longer actively developed and is in maintenance mode. Netflix recommends resilience4j for new projects. The tech stack is Java.

Copy-paste prompts

Prompt 1
Show me how to wrap a Java method in a Hystrix command with a fallback response for when a downstream service is unavailable.
Prompt 2
How do I configure Hystrix to open the circuit breaker after 5 failures and retry after 10 seconds?
Prompt 3
Help me set up Hystrix thread pool isolation for two separate external API calls in a Spring Boot service.
Prompt 4
What should I use instead of Hystrix for new Java projects, and how do I migrate from Hystrix to resilience4j?
Open on GitHub → Explain another repo

← netflix on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.