DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

How does AI transform chaos engineering from an experiment into a critical capability? Learn how to effectively operationalize the chaos.

Data quality isn't just a technical issue: It impacts an organization's compliance, operational efficiency, and customer satisfaction.

Are you a front-end or full-stack developer frustrated by front-end distractions? Learn to move forward with tooling and clear boundaries.

Developer Experience: Demand to support engineering teams has risen, and there is a shift from traditional DevOps to workflow improvements.

Related

  • Distributed Tracing System (Spring Cloud Sleuth + OpenZipkin)
  • Component Tests for Spring Cloud Microservices
  • A Robust Distributed Payment Network With Enchanted Audit Functionality - Part 2: Spring Boot, Axon, and Implementation
  • 7 Microservices Best Practices for Developers

Trending

  • How You Can Use Few-Shot Learning In LLM Prompting To Improve Its Performance
  • RAG vs. CAG: A Deep Dive into Context-Aware AI Generation Techniques
  • KubeVirt: Can VM Management With Kubernetes Work?
  • Taming Billions of Rows: How Metadata and SQL Can Replace Your ETL Pipeline
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. Hystrix Vs. Sentinel: A Tale of Two Circuit Breakers (Part 1)

Hystrix Vs. Sentinel: A Tale of Two Circuit Breakers (Part 1)

Check out this post to learn more about Sentinel, an open-source Java flow control project.

By 
Andy Shi user avatar
Andy Shi
·
Apr. 08, 19 · Presentation
Likes (12)
Comment
Save
Tweet
Share
18.1K Views

Join the DZone community and get the full member experience.

Join For Free

Hystrix has been pretty popular over the last several years. Now that it is in maintenance mode, many people are seeking alternatives. In this article, I will introduce Sentinel: an open-source Java flow control project. I will do so by comparing it with Hystrix, since more people are familiar with it. In this part, we'll compare these two at a higher level. In the next article, we'll look at some code examples.

Image title

What Is Sentinel?

In short, it is a circuit breaker. A circuit breaker is triggered when certain resources keep failing. Instead of continuing to pound the already failing resource, the circuit breaker will intercept the request and return a failure signal. That sounds similar to every circuit breaker pattern. However, Sentinel offers more choices such as flow shaping, overload protection, and fault tolerance.

History of Sentinel

  • 2012: Sentinel started as a flow control component in Alibaba.
  • 2013-2017: with the wild growth of microservices comes the challenge of reliability. Sentinel quickly grows into a tool to prevent cascading disaster.
  • 2018: Sentinel is open-sourced by Alibaba.

What Is Sentinel For?

Image title

  • Sential provides many options to handle flow control. Users can choose to shape traffic based on QPS, thread pool numbers, system load, as well as using commands directly to stop traffic or to perform cold start. User can also mix and match different rules. Hystrix doesn't really offer comprehensive traffic shaping.flow control
  • Sentinal offers fault isolation and circuit breaking. This is similar to Hystrix. However, their approaches are different.
  • Sentinal offers real-time monitoring. It also provides a dashboard to aggregate information from the distributed system.

dashboard

How Is Sentinel Different From Hystrix?

The key difference between the two lies in how isolation is achieved. Hystrix normally uses bulkhead pattern to isolate dependencies. It puts each dependency in a seperate thread pool. The main benefit of doing this is it provides a clean cut. The drawbacks mainly include the computational overhead thread pool management incurs.

Sentinel, on the other hand, uses a counter for each dependency. By doing so, not only does it save the overhead of managing the thread pool, but it also gives more control to the user. The user now gets to decide the granularity of degradation of the flow.

This table lists more details of the difference Hystrix and Sentinel in design and implementation:

Feature in Hystrix Details of difference Feature in Sentinel
Thread Pool Isolation / Semaphore Isolation Sentinel does not support thread pool isolation; In Sentinel, flow control in thread count mode represents semaphore isolation. If you are using semaphore isolation, you can simply add flow rules for target resource. Thread Count Flow Control
Circuit Breaker Sentinel supports circuit breaking by average response time, exception ratio and exception count. If you want to use circuit breaking in Sentinel, you can simply configure degrade rules for target resource. Circuit breaking with various strategy
Command Definition You can define your resource entry (similar to command key) via SphU API in Sentinel. Resource definition and rule configuration are separate. Resource Entry Definition
Command Configuration Rules can be hardcoded through the xxxRuleManager API in Sentinel, and multiple dynamic rule data sources are also supported. Rule Configuration
HystrixCommand annotation Sentinel also provides annotation support (SentinelResource), which is easy to use. SentinelResource annotation
Spring Cloud Netflix Sentinel provides out-of-box integration modules for Servlet, Dubbo, Spring Cloud, and gRPC. If you were using Spring Cloud Netflix previously, it's east for you to migrate to Spring Cloud Alibaba.

Spring Cloud Alibaba


This may seem a little overwhelming. Users won't notice much difference from a user experience  perspective, though.

The Ecosystem

Sentinal is well suited for the cloud-native environment. It can be integrated with other popular cloud native solutions. One of them is Spring Cloud. Another popular java distributed framework in China is Dubbo. Sentinal can also work side by side with service mesh solutions such as Istio and Envoy.

Reference

Sentinal will soon be released as part of the Spring Boot framework. For more information, please visit their GitHub repo.

Spring Cloud Spring Framework

Opinions expressed by DZone contributors are their own.

Related

  • Distributed Tracing System (Spring Cloud Sleuth + OpenZipkin)
  • Component Tests for Spring Cloud Microservices
  • A Robust Distributed Payment Network With Enchanted Audit Functionality - Part 2: Spring Boot, Axon, and Implementation
  • 7 Microservices Best Practices for Developers

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • [email protected]

Let's be friends: