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.
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.
--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.
--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.
--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.
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.
This may seem a little overwhelming. However, users will not notice much difference in terms of user experience.
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.
Sentinal will soon be released as part of the Spring Boot framework. See their GitHub repo for more information.
Recommended Posts