Comparison of Alibaba's open source Sentinel Java flow control project with Hystrix

In this series of articles, we will introduce the ** Alibaba ** open source ** Sentinel Java ** flow control project in comparison with ** Hystrix **.

High Stricks has been quite popular in the last few years. Now that it's in maintenance mode, many are looking for alternatives. This article introduces Sentinel, an open source Java flow control project. I will introduce it while comparing it with Hystrix, which is familiar to more people. In this part, we will compare the two at a higher level. Next time, let's look at some code examples.

image.png

What is Sentinel?

Simply put, it's a circuit breaker. The circuit breaker is activated when a particular resource continues to fail. Instead of continuing to hit resources that are already faulty, the circuit breaker intercepts the request and returns a fault signal. This sounds similar to all circuit breaker patterns. However, Sentinel offers more options such as flow shaping, overload protection, and fault tolerance.

History of Sentinel

--2012: Sentinel started as Alibaba's flow control component --2013-2017: With the dramatic growth of microservices, the challenge of reliability comes. Sentinel quickly grows into a tool to prevent cascading disasters. --2018: Sentinel will be open sourced by Alibaba.

What is Sentinel for?

image.png

--Sential offers many options for handling flow control. Users can shape traffic based on QPS, number of thread pools, system load, and can also use commands directly to stop traffic or perform a cold start. Users can also use a combination of different rules. Hystrix does not provide comprehensive traffic shaping.

image.png

--Sentinal offers fault isolation and circuit braking. This is similar to Hystrix. But those approaches are different. --Sentinal provides real-time monitoring. It also provides a dashboard that aggregates information from distributed systems.

image.png

What is the difference between Sentinel and Hystrix?

The main difference between the two is how to achieve the separation. Hystrix typically uses bulkhead patterns to isolate dependencies. Hystrix puts each dependency in a separate thread pool. The main advantage of this method is that it provides a clean cut. The downside is primarily the overhead incurred in thread pool management.

Sentinel, on the other hand, uses counters for each dependency. Doing so not only saves thread pool management overhead, but also gives the user more control. Users can now determine the granularity of flow degradation.

This table details the differences between Hystrix and Sentinel in design and implementation.

image.png

This may seem a little overwhelming. However, users will not notice much difference in terms of user experience.

ecosystem

Sentinal is suitable for cloud-native environments. It can be integrated with other popular cloud-native solutions. One of them is Spring Cloud. Dubbo is also a popular Java distribution framework in China. Sentinal can also work side by side with service mesh solutions such as Istio and Envoy.

References

Sentinal will soon be released as part of the Spring Boot framework. See their GitHub repo for more information.

Recommended Posts

Comparison of Alibaba's open source Sentinel Java flow control project with Hystrix
Generate source code from JAR file with JD-GUI of Java Decompiler project
Java and Swift comparison (1) Source control / Scope / Variables
Control the processing flow of Spring Batch with JavaConfig.
Version control Java with SDKMAN
[Java] Summary of control syntax
Comparison of WEB application development with Rails and Java Servlet + JSP