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

How to understand dubbo

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article will explain in detail how to understand dubbo. The content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

1. What is Dubbo?

Dubbo is a distributed services framework dedicated to providing high-performance and transparent RPC remote service invocation solutions, as well as SOA service governance solutions. To put it simply, dubbo is a service framework. If there is no distributed requirement, it does not need to be used. Only when it is distributed, there is a demand for a distributed service framework such as dubbo, and it is essentially a service invocation. To put it bluntly, it is a distributed framework for remote service invocation (bid farewell to WSDL in the Web Service pattern and register on the dubbo as a server and consumer).

Its core part includes:

1. Remote communication: provides abstract encapsulation of a variety of long-connection-based NIO frameworks, including multiple thread models, serialization, and information exchange in the "request-response" pattern.

two。 Cluster fault tolerance: provides transparent remote procedure calls based on interface methods, including multi-protocol support, as well as soft load balancing, failure fault tolerance, address routing, dynamic configuration and other cluster support.

3. Automatic discovery: based on the registry directory service, the service consumer can dynamically find the service provider, make the address transparent, and enable the service provider to smoothly increase or decrease the number of machines.

2. What can dubbo do?

1. Transparent remote method invocation, calling remote methods as if they were local methods, with simple configuration without any API intrusion.

two。 Soft load balancing and fault-tolerant mechanism can replace F5 and other hardware load balancers in the intranet to reduce costs and reduce a single point.

3. Automatic service registration and discovery eliminates the need to write down the address of the service provider. The registry queries the IP address of the service provider based on the interface name, and can smoothly add or delete service providers.

Dubbo adopts full Spring configuration mode and accesses the application transparently without any API intrusion to the application. You only need to load the configuration of Dubbo with Spring, and Dubbo is loaded based on Schema extension of Spring.

3. Architecture of dubbo

The dubbo architecture diagram is as follows:

Node role description:

Provider: the provider of the exposed service.

Consumer: the service consumer that invokes the remote service.

Registry: the registry for service registration and discovery.

Monitor: the monitoring center that calculates the call time and call time of the service.

Container: the service running container.

Description of invocation relationship:

The 0 service container is responsible for starting, loading, and running the service provider.

1. Upon startup, the service provider registers the services it provides with the registry.

two。 Service consumers subscribe to the services they need from the registry when they start up.

3. The registry returns a list of service provider addresses to the consumer, and if there is a change, the registry will push the change data to the consumer based on the persistent connection.

4. The service consumer, from the provider address list, chooses one provider to call based on the soft load balancing algorithm, and then chooses another one if the call fails.

5. Service consumers and providers accumulate the number of calls and call time in memory and regularly send statistics to the monitoring center every minute.

The fault tolerance of dubbo is obvious, and the performance has not yet been tested. We need to drop the interface for a page of our system for 5 times. We originally wanted to suggest a cache, but the business relationship could not be adopted. We also need to study the performance tuning of dubbo.

4. How to use dubbo

Dubbo adopts full Spring configuration mode and accesses the application transparently without any API intrusion to the application. You only need to load the configuration of Dubbo with Spring, and Dubbo is loaded based on Schema extension of Spring. If you don't want to use the Spring configuration, you want to call it through API (not recommended).

On how to understand dubbo to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

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

Internet Technology

Wechat

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

12
Report