Getting to know Dubbox

1. What is the SOA architecture
SOA is the acronym for Service-Oriented Architecture, which is an architectural style that supports service-oriented. From the perspective of service, service-based development and service results, service-oriented is a way of thinking. In fact, SOA architecture is more used in Internet project development.

Why do Internet projects adopt SOA architecture? With the development of the Internet, the scale of website applications continues to expand, and conventional vertical application architectures can no longer cope with it. Distributed service architecture and mobile computing architecture are imperative, and a governance system is urgently needed to ensure the orderly evolution of the architecture.

Let's look at the evolution of the development architecture. As shown below:

Single application architecture

When the website traffic is very small, only one application is needed and all functions are deployed together to reduce deployment nodes and costs. At this time, the data access framework (ORM) is the key to simplify the workload of adding, deleting, modifying and checking.

Vertical application architecture

When the number of visits gradually increases, the acceleration caused by the addition of a single application to the machine becomes smaller and smaller, and the application is divided into several unrelated applications to improve efficiency. At this point, the web framework (MVC) used to accelerate the development of front-end pages is the key.

Distributed service architecture

When there are more and more vertical applications, interaction between applications is inevitable. The core business is extracted as an independent service, and a stable service center is gradually formed, so that front-end applications can respond more quickly to changing market demands. At this time, the Distributed Service Framework (RPC) for improving business reuse and integration is the key.

Mobile computing architecture

When there are more and more services, problems such as capacity assessment and the waste of small service resources gradually appear. At this time, a dispatch center needs to be added to manage the cluster capacity in real time based on access pressure to improve cluster utilization. At this time, the resource scheduling and governance center (SOA) used to improve machine utilization is the key.

Dubbox is a mobile computing architecture.

2. Introduction to
Dubbox Dubbox is a distributed service framework. Its predecessor was Alibaba's open source project Dubbo, which was used in domestic e-commerce and Internet projects. Later, Alibaba stopped the maintenance of the project, and Dangdang was optimized on the basis of Dubbo. , And continue to maintain it. In order to distinguish it from the original Dubbo, it is named Dubbox.

Dubbox is committed to providing high-performance and transparent RPC remote service invocation solutions and SOA service governance solutions. Simply put, dubbox is a service framework. If there is no distributed requirement, it is actually unnecessary. Only when it is distributed, there is a requirement for a distributed service framework like dubbox, and it is essentially a service call. Dongdong, to put it bluntly, is a distributed framework for remote service calls.

Node role description:

        Provider: The service provider that exposes the service.

        Consumer: The service consumer who calls the remote service.

        Registry: The registry for service registration and discovery.

        Monitor: A monitoring center that counts the call times and call times of the service.

        Container: Service running container.

Calling relationship description:

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

        1. When the service provider starts, register the service it provides with the registration center.

        2. When the service consumer starts, he subscribes to the registration center for the service he needs.

        3. The registry returns a list of service provider addresses to consumers. If there are changes, the registry will push the changed data to consumers based on the long connection.

        4. Service consumers, from the provider address list, based on the soft load balancing algorithm, select one provider to call, and if the call fails, select another call.

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

3. New
Dubbox New Dubbox is an evolution from Dubbo and retains the original Dubbo configuration. Here we introduce the new features of Dubbox.

Support REST-style remote calls (HTTP + JSON/XML): Based on the very mature JBoss RestEasy framework, REST-style (HTTP + JSON/XML) remote calls are implemented in dubbox to significantly simplify cross-language interaction within the enterprise. Significantly simplify the development of external Open API, wireless API and even AJAX server. In fact, this REST call also allows Dubbox to provide basic support for today's particularly popular "microservice" architecture. In addition, REST calls have also achieved relatively high performance. Under the benchmark test, there is only about 1.5 times the gap between HTTP + JSON and Dubbo 2.x's default RPC protocol (ie TCP + Hessian2 binary serialization).

Supports efficient Java serialization implementation based on Kryo and FST: Based on today's more well-known Kryo and FST high-performance serialization libraries, a new serialization implementation has been added to Dubbo's default RPC protocol, and its serialization system has been optimized and adjusted, which is more significant Improved the performance of Dubbo RPC.

Supports Jackson-based JSON serialization: Based on the industry's most widely used Jackson serialization library, a new JSON serialization implementation is added to Dubbo's default RPC protocol.

Support HTTP remoting system based on embedded Tomcat: implement Dubbo's HTTP remoting system based on embedded tomcat (dubbo-remoting-http) to gradually replace the old version of embedded Jetty in Dubbo, which can significantly improve the remoteness of REST etc. Call performance and upgrade the Servlet API support from 2.5 to 3.1. (Note: Except for REST, the WebServices, Hessian, HTTP Invoker and other protocols in dubbo are all based on this HTTP remoting system).

Upgrade Spring: Upgrade Spring in dubbo from 2.x to the most commonly used 3.x version to reduce the trouble caused by version conflicts.

Upgrade ZooKeeper client: Upgrade the zookeeper client in dubbo to the latest version to correct the bugs contained in the old version.

Supports Dubbo configuration based entirely on Java code: Spring-based Java Config realizes a completely non-XML pure Java code way to configure dubbo

Adjust the demo application: temporarily adjust and rewrite the dubbo demo application to mainly demonstrate the REST function, the new serialization method of the Dubbo protocol, the Spring configuration based on Java code, and so on.

Note: Dubbox and Dubbo 2.X are compatible, and there is no change to any existing functions and configuration methods of Dubbo (except for upgrading Spring and other versions)


--------------------- 
Author: DJTUDaker 
Source: CSDN 
Original: https: //blog.csdn.net/wingzhezhe/article/details/78493335 
Disclaimer: This article Original article for the blogger, please attach a link to the blog post if you reprint it!

Guess you like

Origin blog.csdn.net/sulu0416/article/details/87907003