Ali Dubbo's crazy update, what's the matter with Spring Cloud?

Recently, a big event happened in the open source community. Dubbo, the most widely used open source service framework for Java developers in the country, restarted maintenance in a low-key manner, and released 4 maintenance versions in 3 months.

When I wrote this article last time to give up Dubbo and choose the most popular Spring Cloud microservice architecture practice and experience summary , many netizens left me a message saying that Dubbo has been updated again. Of course I am clear, and I have been following the trend of Dubbo. A few months ago, there was news in the technical circle that Dubbo started to be updated again, and everyone was talking about whether it was true or not. I also specifically went to GitHub to leave a message and asked, and finally found a confident answer in Dubbo's gitter chat room, saying that a team is being formed. Although I had some expectations, I didn't know how much sincerity Ali showed to do this. So I went to GitHub again yesterday and found that starting from September, Ali has released four consecutive three months. This version is still very sincere and deserves attention.

Introduction to Dubbo

Dubbo is an open source high-performance service framework of Alibaba. It is committed to providing high-performance and transparent RPC remote service invocation solutions, as well as SOA service governance solutions, enabling applications to implement service output, input functions and Spring through high-performance RPC. The framework integrates seamlessly. Dubbo includes three core parts: remote communication, cluster fault tolerance and automatic discovery.

It provides transparent remote method invocation, and implements calling remote methods just like calling local methods. It only needs simple configuration and does not have any API intrusion. At the same time, it has a soft load balancing and fault tolerance mechanism, which can replace hardware load balancers such as F5 in the intranet, reducing costs and reducing single points. It can realize the automatic registration and discovery of services, and no longer needs to write the address of the service provider. The registration center queries the IP address of the service provider based on the interface name, and can smoothly add or delete service providers.

At the end of 2011, Alibaba open-sourced Dubbo, a Java-based distributed service governance framework, on GitHub. Since then, it has become a leader in this type of open source project in China, and many developers have expressed their favor. At the same time, many companies have implemented distributed system architecture based on Dubbo in practice. Currently on GitHub, its fork and star numbers have exceeded 10,000.

Dubbo core functions :

  • Remote communication provides abstract encapsulation of various long-connection-based NIO frameworks, including various threading models, serialization, and information exchange in the "request-response" mode.
  • Cluster fault tolerance, providing transparent remote procedure calls based on interface methods, including multi-protocol support, and cluster support such as soft load balancing, failure tolerance, address routing, and dynamic configuration.
  • Automatic discovery, based on the registry directory service, enables service consumers to dynamically find service providers, making addresses transparent, and enabling service providers to smoothly increase or decrease machines.

History of Dubbo

Evolve to open source

At the end of 2008, Alibaba started planning and calling, and developed version 1.0 in early 2009; in April 2010, it refactored on top of version 1.0 and released version 2.0; in October 2011, Alibaba announced that Dubbo will be open source, the first open source The version is version dubbo-2.0.7 .

open source growth

After Dubbo was open sourced, the framework developed rapidly, and a version would be released almost every two or three months. The version dubbo-2.1.0 was released on March 14, 2012. Then it entered another period of rapid development. Versions were released frequently, almost several times a month. Until dubbo-2.4.10 was released on March 17, 2013, the version was stagnant; on October 30, 2014, the version dubbo-2.4.11 was released, a small bug was fixed, and the version was stagnant for a long time.

Development beyond Ali

On October 20, 2014, Dangdang fork a Dubbo version of Ali and started maintenance, and named it dubbox-2.8.0. It is worth noting that Dangdang extends the Dubbo service framework to support REST-style remote calls, and upgrades the corresponding versions with ZooKeepe and Spring. Since then, Dubbox has been maintained in a small version, and the last version dubbox-2.8.4 was released on March 31, 2015 .

What did the Dubbo team do in the past three months?

At present, the main development of Dubbo is mainly the middleware team of Alibaba. At the same time, some colleagues who are interested in Dubbo have also been recruited within Alibaba. Everyone needs to know, when is the last version of Dubbo released this year since maintenance began? It was October 30, 2014, nearly 3 years later. I don't know how many versions of Jdk, Spring, Zookeeper, Zkclient, etc. that Dubbo relies on have been updated. Therefore, the first step for Ali to restore and update is to adapt the versions of the components it depends on, so that the basic environment on which Dubbo depends is not too outdated, and also fixed some serious bugs.

dubbo-2.5.4/5 version

In September 2017, Ali released the dubbo-2.5.4/5 version, the updated content is as follows:

Dependency upgrade

rely current version target version Influence point
spring 3.2.16.RELEASE 4.3.10.RELEASE Schema configuration analysis; Http RPC protocol
zookeeper 3.3.3 3.4.9 Common Registry
zkclient 0.1 0.10 zookeeper Client Tools
curator 1.1.16 2.12.0 zookeeper client tool
commons-logging 1.1.1 1.2 log integration
hessian 4.0.6 4.0.38 hessian RPC protocol
jedis 2.1.0 2.9.0 redis registry; cache RPC
httpclient 4.1.2 4.5.3 Hessian, etc. use http connection pool
validator 1.0.0 1.1.0.Final java validation specification
cxf 2.6.1 3.0.14 webservice
jcache 0.4 1.0.0 jcache specification

While upgrading the relevant dependency versions, this version prioritizes issues based on the frequency of feedback and impact, and prioritizes the resolution of several bugs with the most feedback and greater impact, including graceful shutdown, asynchronous calls, dynamic configuration, and MonitorFilter monitoring statistics. And other issues.

dubbo-2.5.6 version

In October 2017, Ali released dubbo-2.5.6 version, and fixed a large number of serious bugs.

Post content

  • Generalized calls to PojoUtils tool class cannot handle enumeration types, private fields, etc. correctly
  • After the provider business thread pool is full, the exception that rejects the request cannot be notified to the consumer side
  • When the business return value payload exceeds the threshold, the payload is repeatedly sent back to the consumer
  • slf4jLogger correctly outputs the actual line number of the log call
  • Delay exposure has potential concurrency problems, causing different services to occupy multiple ports
  • When there is no provider, the mock logic on the consumer side cannot take effect
  • Some small optimizations: OverrideListener listening logic, provider side closing heartbeat request, Main startup class shutdown logic, etc.
  • Some minor bug fixes: dynamic configuration cannot be deleted, telnet supports generic json calls, monitor statistics errors, etc.

dubbo-2.5.7 version

In November 2017, 12 days ago, Ali released dubbo-2.5.7. This time not only fixed a batch of major bugs, but also made a small function improvement.

Post content

  • Improve the annotation configuration method and fix the old annotation bugs reported by the community
  • It supports reading and registering ip ports from environment variables at startup, binding ip ports, and supporting containerized deployment scenarios fed back by the community, etc.
  • Adjust and open some imperfect xml configuration items, such as dump.directory, etc.
  • Solve the problem that zk cannot connect during the startup phase, causing the application to block infinitely
  • Solve the problem that when zk cannot connect, the first access of MonitorService will cause rpc request to block #672
  • The internal json implementation marks deprecate, instead of relying on the open source fastjson implementation
  • RMI protocol supports passing attachments
  • Hessian supports EnumSet type serialization
  • Some minor bug fixes and optimizations reported by the community

This version has a lot of content released, so upgrade suggestions are also given.

Please note the upgrade

  • The upgrade has the following incompatibilities or points that need attention, but they have no impact on the core functions, and can be avoided by adding dependencies or complying with configuration rules. This is just a list of potential attention points, if you don't use these features, you don't need to pay extra attention.
  • Some functions such as AccesslogFilter, telnet, and mock depend on the implementation of the old version of JSON. If the above functions are enabled, please add fastjson as a third-party dependency after the upgrade.
  • This upgrade improves the annotation configuration method, while retaining the old annotation configuration code. If the project is transferred from the previous version of the annotation configuration to version 2.5.7, please make sure to delete the old annotation scanning configuration and use the new configuration form.
  • In the project startup phase, if the zk is unreachable, the current version's behavior is to use the registry cache to continue to start (specifically determined by the check parameter. MonitorService is called for the first time, if the zk is unreachable, the current version will ignore the monitor data upload to avoid Block the rpc main process.

focus

In the 2.5.7 version update, a preview of the next step is also given, and the dubbo-spring-boot-starter startup configuration module will be provided in the near future.

This prompt says two things:

  • Dubbo will continue to improve, and many new functions will be developed in the future, so I hope everyone will pay attention.
  • It shows that the influence of Spring Boot is also growing, and various open source software have given support, and now Dubbo will also be included.

What's next for Dubbo?

According to information from Alibaba Technology, the latest three versions will do the following:

  • Priority is given to solving problems in the use of the community and the defects of the framework, absorbing new features contributed by the community, and solving the problems of document access and incompleteness.
  • Provide service delay riot, graceful shutdown API interface supports RESTFULE style service calls, provides support for netty http, and integrates high-performance serialization protocols.
  • Routing function optimization, consumer-side asynchronous function optimization, provider-side asynchronous call support registry center push notification asynchronous, merge processing transformation, etc.

Future plans :

Reconstruct the dynamic configuration module, separate the dynamic configuration from the registry, integrate the popular open source distributed configuration management framework, separate the service metadata registration from the registry, enrich the metadata content, and adapt to the popular consul etcd and other registry solutions. Consider providing support for some service-based basic components such as opentrace, oauth2, metrics, health, gateway, etc. The service governance platform OPS is redone. In addition to code and UI refactoring, it is expected to provide stronger service testing, health checks, and dynamic service governance. and other characteristics. Dubbo is modular, and each module can be packaged and depended on separately, with cluster fuse and automatic fault detection capabilities.

Continue to explore the two major directions of Dubbo framework modernization and internationalization. The modernization aspect is mainly considering the current microservice architecture and the growing trend of containerization, how Dubbo is well integrated as an RPC framework and becomes an indispensable component in its ecosystem. It is emphasized that Dubbo's future positioning is not to become a comprehensive solution for microservices, but to focus on the RPC field and become an important component in the microservice ecosystem. As for the service governance needs derived from microservices that everyone is concerned about, Dubbo will actively adapt to open source solutions, and even launch independent open source projects to support it.

How is Dubbo different from Spring Cloud?

First do a simple function comparison:

  Dubbo Spring Cloud
Service Registry Zookeeper Spring Cloud Netflix Eureka
Service call method RPC REST API
service monitoring Dubbo-monitor Spring Boot Admin
breaker imperfect Spring Cloud Netflix Hystrix
service gateway without Spring Cloud Netflix Zuul
Distributed configuration without Spring Cloud Config
service tracking without Spring Cloud Sleuth
message bus without Spring Cloud Bus
data flow without Spring Cloud Stream
batch tasks without Spring Cloud Task
…… …… ……

As can be seen from the above figure, the function of Dubbo is only part of the Spring Cloud system.

This comparison is not fair. First of all, Dubbo is a product of the SOA era. Its focus is mainly on service invocation, traffic distribution, traffic monitoring and circuit breaker. Spring Cloud was born in the era of microservice architecture, considering all aspects of microservice governance. In addition, due to the advantages of Spirng and Spirng Boot, the two frameworks have different goals at the beginning. Dubbo positioning service governance and Spirng Cloud are one ecology.

If you only focus on this level of service governance, Dubbo is actually much better than Spring Cloud:

  • Dubbo supports more protocols, such as: rmi, hessian, http, webservice, thrift, memcached, redis, etc.
  • Dubbo uses the RPC protocol to be more efficient. Under extreme stress tests, the efficiency of Dubbo will be more than double that of Spring Cloud.
  • Dubbo has more powerful background management. The background management Dubbo Admin provided by Dubbo has powerful functions, providing routing rules, dynamic configuration, access control, weight adjustment, load balancing and many other powerful functions.
  • You can limit the access rights of a certain IP traffic, set different servers to distribute different traffic weights, and support a variety of algorithms. Using these functions, we can do grayscale publishing, failover, etc. online. Spring Cloud does not support grayscale yet. Publishing, traffic weighting and other functions.

So Dubbo focuses on service governance; Spring Cloud focuses on the microservice architecture ecology.

Does the Dubbo release have an impact on Spring Cloud?

Domestic technical people like to compare Dubbo and Spring Cloud because they are both excellent open source frameworks for service governance. But their starting points are different. Dubbo focuses on service governance and will continue to develop in this direction in the future. Spring Cloud focuses on the ecology of microservice governance. Because all aspects of microservice governance are what it focuses on, service governance is only part of the microservice ecosystem. Therefore, it can be boldly concluded that Dubbo will be better in service governance in the future, and Spring Cloud is unmatched in microservice governance.

At the same time, according to Dubbo's latest updated technology, Dubbo will also actively embrace open source and new technologies. The next version of Dubbo will soon support Spring Boot, so that while we can enjoy efficient development, it can also support efficient service invocation. Dubbo is widely used in various Internet companies in China. Now Ali has re-emphasized and released a new version and a series of plans. This is good news for companies that are using Dubbo, and it is even more exciting for the vast number of developers in China. a very joyful thing. We are very happy to see that China has a very good open source framework, which allows us to have more choices and better support.

In fact, the two are not necessarily competitive, and can even complement each other if used properly; the other two areas of concern are also inconsistent, so they have little impact on Spring Cloud.

how to choose?

Many people may be hesitating, which framework should they choose when serving governance? If the company has extremely high requirements on efficiency, it is recommended to use Dubbo, which is much more efficient than RPC; if the team does not want to make major changes to the technical architecture, it is recommended to use Dubbo. Dubbo can be integrated into the internal system with only a few modifications. in the structure. But if the technical team likes to challenge new technologies, it is recommended to choose Spring Cloud. The Spring Cloud architecture system has interesting and cool technologies. If the company chooses the microservice architecture to reconstruct the entire technical system, then Spring Cloud is the best choice. It can be said to be one of the best microservice frameworks at present.

Finally, technology selection is a comprehensive issue, which needs to consider the situation of the team, the development of the business and the product characteristics of the company. The coolest and coolest technology is not necessarily the best. Choosing a framework that suits your team and your company's business is the best solution. The development of technology never ends, so we must keep our glasses empty, hungry, and in awe of technology!

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324847692&siteId=291194637