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 Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
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
Partner Zones AWS Cloud
by AWS Developer Relations
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
Partner Zones
AWS Cloud
by AWS Developer Relations
  1. DZone
  2. Coding
  3. Frameworks
  4. Hystrix vs. Sentinel: A Tale of Two Circuit Breakers (Part 1)

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

Now that Hystrix is in maintenance mode, we take a look a potential alternative to this popular open source microservices platform.

Leona Zhang user avatar by
Leona Zhang
·
May. 13, 19 · Analysis
Like (1)
Save
Tweet
Share
8.29K 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.

Sentinel

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 disasters
  • 2018: Sentinel is open-sourced by Alibaba.

What Is Sentinel For?

Sentinel Architecture

Sentinel Architecture
  • 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 starts. Users can also mix and match different rules. Hystrix doesn't really offer comprehensive traffic shaping.

Traffic Shaping

Traffic Shaping
  • 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.

Sentinel Dashboard

Example Sentinel Dashboard

How Is Sentinel Different From Hystrix?

The key difference between the two lies in how isolation is achieved. Hystrix normally uses a 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 that 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:

Hystrix vs. Sentinel

Hystrix vs. Sentinel

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.

Circuit Breaker Pattern Spring Framework

Published at DZone with permission of Leona Zhang. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • What Are the Different Types of API Testing?
  • Kubernetes-Native Development With Quarkus and Eclipse JKube
  • File Uploads for the Web (2): Upload Files With JavaScript
  • How To Select Multiple Checkboxes in Selenium WebDriver Using Java

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

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

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: