Dubbo
First, basic knowledge
1. Distributed basic theory
1.1), what is distributed system?
Distributed System Principles and Paradigms:
“A distributed system is a collection of independent computers that act like a single related system to the user.”
A distributed system is a software system built on a network.
With the development of the Internet, the scale of website applications keeps expanding, and the conventional vertical application architecture can no longer cope with it. The distributed service architecture and mobile computing architecture are imperative, and a governance system is urgently needed to ensure the orderly evolution of the architecture.
When site traffic is low, only one application is needed to deploy all functions together to reduce deployment nodes and costs. At this point, data access frameworks (ORM) that simplify the work of adding, deleting, modifying and reviewing are key.
Suitable for small websites, small management systems, all functions are deployed into one function, easy to use.
Disadvantages: 1. Performance expansion is difficult
2. Collaborative development
3. It is not conducive to upgrade and maintenance
When the volume of traffic gradually increases, the acceleration caused by the increase of a single application machine is getting smaller and smaller. The application is divided into several unrelated applications to improve efficiency. At this point, a Web framework (MVC) for accelerating front-end page development is key.
By dividing services, each module can be independently deployed, reducing the difficulty of maintenance and deployment, making it easier for teams to perform their own duties and expanding performance more convenient and targeted.
Disadvantages: Common modules can not be reused, wasteful development
1.3), the RPC
Remote Procedure Call (RPC) refers to Remote Procedure Call, which is an inter-process communication method. It is a technical idea, rather than a specification. It allows a program to call a procedure or function in another address space, usually on another machine on a shared network, without the programmer explicitly coding the details of this remote call. That is, programmers write essentially the same calling code whether they call local or remote functions.
RPC has two core modules: communication and serialization.
2. Core concepts of Dubbo
2.1), Introduction
Apache Dubbo (incubating) | ˈ d ʌ b goes ʊ | is a high-performance, lightweight open source Java RPC framework, it provides three main core competencies: an interface of remote method invocation (rmi), intelligent fault tolerance and load balancing, and automatic registration and discovery of services.
Website:
dubbo.apache.org/
2.2) Basic concepts
Provider: A service Provider that exposes a service. At startup, the service Provider registers its services with the registry.
Service Consumer: the service Consumer who invokes the remote service. When the service Consumer starts up, it subscribes to the registry for the service it needs. The service Consumer selects one provider from the provider address list and invokes it based on the soft load balancing algorithm.
Registry: The Registry returns a list of service provider addresses to the consumer. If there are changes, the Registry pushes the change data to the consumer based on the long connection
Monitor: Service consumers and providers accumulate call times and call time in memory and regularly send statistics to the monitoring center once a minute
ø Description of call relationship
The service container is responsible for starting, loading, and running the service provider.
At startup, service providers register their services with the registry.
At startup, service consumers subscribe to the registry for the services they need.
L The registry returns a list of service provider addresses to the consumer, and if there are changes, the registry pushes the change data to the consumer based on the long connection.
L Service consumer, from the provider address list, based on the soft load balancing algorithm, chooses one provider to call, if the call fails, then chooses another call.
L Service consumers and providers accumulate the number of calls and call time in memory, and regularly send statistical data to the monitoring center once a minute.