Since today, we have entered the core tutorial of the Distributed services project, which is to implement distributed services using Dubbo for enterprise services.

Before learning about dubbo distributed services, we need to learn about dubbo service related tutorials. I will write an article about Dubbo service to help you learn quickly.

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, there is no need to use a distributed service framework like Dubbo, and it is essentially a service invocation. In plain English, it is a distributed framework for remote Service invocation (moving away from WSDL in the Web Service schema and registering on Dubbo as a server and consumer).

Its core parts include: 1. Remote communication: provides abstract encapsulation of a variety of long-connection-based NIO frameworks, including multiple threading models, serialization, and “request-response” mode of information exchange. 2. Cluster fault tolerance: provides transparent remote procedure call based on interface method, including multi-protocol support, as well as soft load balancing, failure tolerance, address routing, dynamic configuration and other cluster support. 3. Automatic discovery: based on the registry directory service, so that service consumers can dynamically find the service provider, so that the address is transparent, so that the service provider can smoothly add or reduce machines.

2. What can Dubbo do?

1. Transparent remote method invocation, which calls remote methods just like local methods, with simple configuration and no API intrusion. 2. Soft load balancer and fault tolerance mechanism can replace hardware load balancer such as F5 on the Intranet to reduce costs and single points. 3. Automatic service registration and discovery, no longer need to write the service provider address, registry based on the interface name query service provider IP address, and can smoothly add or delete service providers. Dubbo uses a full Spring configuration mode to transparently access applications without any API intrusion. You only need to load Dubbo’s configuration with Spring. Dubbo is loaded based on Spring’s Schema extension.

3. Dubbo’s architecture

The architecture diagram of Dubbo is as follows:



Node roles:

Provider: exposes the service Provider of the service.

Consumer: Service Consumer that invokes the remote service.

Registry: A Registry where services are registered and discovered.

Monitor: monitors The Times and time of service invocation.

Container: service running Container.

Call relationship description:

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

1. At startup, service providers register their services with the registry.

2. At startup, service consumers subscribe to the registry for the services they need.

3. The registry returns the service provider address list to the consumer, and if there are changes, the registry will push the change data to the consumer based on the long connection.

4. The service consumer selects one provider from the provider address list to invoke based on the soft load balancing algorithm. If the invocation fails, the service consumer selects another one to invoke.

5. Service consumers and providers accumulate call times and call time in memory, and regularly send statistical data to the monitoring center once a minute.

The fault tolerance of Dubbo is obvious, but the performance has not been tested yet. A page in our system needs to drop the interface for 5 times. We wanted to suggest making a cache, but the business relationship cannot accept it, so we need to study the performance tuning of Dubbo

4. How to use Dubbo

Dubbo uses a full Spring configuration mode to transparently access applications without any API intrusion. You only need to load Dubbo’s configuration with Spring. Dubbo is loaded based on Spring’s Schema extension. If you don’t want to use the Spring configuration and want to use the API (not recommended), we’ll walk you through dubbo in later chapters!

Welcome to learn “Building a Dubbo Distributed Platform” with me, and I hope you will continue to pay attention to the following articles!

Willing to understand the framework technology or source code of friends directly beg exchange to share technology: 2042849237 distributed some solutions, there are willing to understand friends can find our team to discuss more detailed source code reference sources