Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is WebFlux?

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly explains "what is WebFlux". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what is WebFlux".

1. What is a responsive system?

The goal of the responsive system is high sensitivity, system robustness has always been responsive, loosely coupled and scalable. Responsive system is a kind of architecture, which can be used anywhere, whether it is a small blog page or a complex online shopping system.

Generally speaking, responsive systems have four distinct characteristics:

Immediate response (responsive)

Resilience (resilience)

Elasticity (elastic)

Message driven (message driven)

The following picture is a good description of the relationship between them:

Message-driven is the means, elasticity and resilience are forms, and the ultimate immediate response is its value.

Next, let's introduce these four features one by one.

two。 Four major characteristics

2.1 immediate response (responsive)

The characteristic of instant response is one word, quick!

Now the popularity of 4G, the use of 100 gigabytes of bandwidth, and the improvement of CPU computing power are all reducing users' patience with a system. If a web page has not been loaded in 5s, the user already feels that the experience is very poor. If 30s has not been loaded out, then you may lose this user.

Therefore, we need to build a robust, fast response real-time response system, especially in some high concurrency scenarios, the response delay can be kept within a reasonable range, which is the most important.

To achieve this goal, many specific techniques are used, such as asynchronous loading, preloading and so on. In addition, some principled issues such as elastic and resilience are also involved.

2.2 elasticity (elastic)

Elasticity actually means that the system can be expanded dynamically at any time.

For example, an e-commerce site, usually a limited number of active users, the number of servers needed to support daily services can be sufficient, there is no need to buy more, after all, it costs money. Once there is a great promotion, the traffic of the system breaks out in a short time, at this time, it needs to be able to expand the capacity of the system anytime, anywhere, which is the flexibility of the system.

Brother Song talked to you about Nginx load balancing in his previous article, which is actually a means of capacity expansion. Now many small and medium-sized companies may return to cloud services, if they use cloud services, it is generally very convenient to achieve dynamic expansion.

2.3resilience (resilience)

Resilience means that when the system encounters failure, it can still provide services. When Brother Song shared Spring Cloud with you before, one of the functions of Hystrix is fault tolerance, when one service crashes, it will not drag down other services. Through service degradation, isolation and other means, resilience can be guaranteed. Resilience also requires automatic retry in the event of a system error.

In fact, if you look back at the word resilience, I wonder if you have remembered that in the Spring Cloud system, the tool used to replace Hystrix is called resilience4j, so if you understand the function of Hystrix, you probably know what resilience is. If you don't know anything about Spring Cloud, take a look at this website: www.itboyhub.com.

2.4message driven (message driven)

Message-driven is a specific means of implementation.

In distributed systems, we need to decouple, isolate services, and improve scalability. In order to achieve this goal, message driver is the best choice. Because only the message driver can meet the requirements of immediate response, resilience, and resilience at the same time.

Some friends may see a term when learning micro-services, which is called message-driven micro-services.

In Songge's micro-personnel, there is a function of sending mail, which is driven by message. the sender only needs to throw the content of the message into the message middleware, and don't worry about the rest. The mail server will automatically read the mail information from the message middleware and send it out. Failed transactions, rollbacks and other operations will be handled by the mail server itself. The sender just throws the message out, which is a good way to decouple.

These are the four characteristics of what we often call responsive systems.

3. Responsive system around you

In fact, the responsive system is not far away from us. It does not mean that using WebFlux, using Gateway or using asynchronous Servlet is a responsive system. In fact, there is no inevitable connection. The above are all specific solutions and technologies for implementing a responsive system.

Give a simple example of a message-driven micro-service, as shown below:

After the introduction of message middleware RabbitMQ/Kafka, it can well realize the decoupling of A service and B service. At the same time, using the message consumption failure retry function of RabbitMQ/Kafka can also improve the fault tolerance and reliability of the system.

Thank you for your reading, the above is the content of "what is WebFlux", after the study of this article, I believe you have a deeper understanding of what is WebFlux, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report