The story behind Spring Cloud Alibaba open source | Open source China interview

The story behind Spring Cloud Alibaba open source | Open source China interview

Posted on 2018-11-28 | Author Miss Middleware | Category in  Spring Cloud Alibaba    |  

This article is an exclusive interview of Open Source China to the Spring Cloud Alibaba project team. It was first published in Open Source China and reprinted with authorization from Alibaba Middleware. The guest interviewed was Ji Wang, the head of the Spring Cloud Alibaba project team.
A major event happened in the Java world recently. Spring Cloud officially announced that Ali open sourced Spring Cloud Alibaba and launched the first preview version.

 

A major event happened in the Java world recently. Spring Cloud officially announced that Ali open sourced Spring Cloud Alibaba and launched the first preview version.

According to reports, Spring Cloud Alibaba is composed of two parts: Ali open source components and Aliyun product components. It is committed to providing a one-stop solution for microservices, facilitating developers to easily develop microservice applications through the Spring Cloud programming model.

The news of open source has caused a huge response. The arrival of Spring Cloud Alibaba has not only attracted the attention of Java developers, but also brought people's attention to the hottest microservice architecture field behind the project.

At present, the first choice for using Spring Cloud is Spring Cloud Netflix. Its leading position is unshakable. Will this project under the "native domestic" environment that Ali open sourced this time will bring about change? With more and more landing practices, the shortcomings of the microservice architecture have gradually emerged. At this time, what are the considerations behind Ali's major move in this field?

In addition, there are also issues such as the post-maintenance of the project that developers pay a lot of attention to, and whether Dubbo has been abandoned again... We interviewed Ji Wang, a senior technical expert on Alibaba middleware for the first time, and hope that everyone will be interested in the Spring Cloud Alibaba project. , Have more understanding of the development and trend of related fields.

The content of this article is longer, here are a few key points:

  • The Gospel of Chinese Java Developers
  • A new choice in the field of microservice architecture
  • Dubbo and Spring Cloud are not in competition
  • The next generation architecture is not a streaming architecture, but Serverless
  • Cloud computing will eventually rule the entire server architecture
  • Next February GA

Open source China:
Spring? Spring Boot? Spring Framework? Spring Cloud? Spring Cloud Alibaba? Spring Family Bucket must be mentioned in Java development. Although it is well-known and highly used, many people just use the framework and don’t even know what Spring Cloud is. They are silly about the above terms. Not sure. Please take this opportunity to give you a detailed introduction.

Ji Wang:
In the domestic Javaer world, the word Spring alone does not actually refer to anything. It is just a code. The specific meaning depends on the context. For example, when I say Spring is the big god, Spring refers to Spring Company at this time; for example, do you usually use Spring for development? At this time Spring generally refers to Spring IOC, and in most cases, we say Spring refers to All are Spring IOC.

I won’t explain much about Spring IOC here, I believe everyone is familiar with it, and this should be one of the hottest interview questions. Spring Framework revolves around Spring IOC and core Spring AOP functions, and also realizes integration with many J2EE development frameworks, which greatly reduces the difficulty of enterprise-level application development and improves efficiency.

The SSH framework, which was very popular a few years ago, is a typical example of Spring Framework integrating Hibernate and Struts2. At that time, learning SSH integration was a craft. The complicated configuration files and endless Jar packages could definitely make you dazzled. Therefore, the current Javaer is happy, because Spring Boot solves this problem.

Spring Boot allows you to introduce a POM dependency to realize the management of all Jar packages, and also allows you to solve all complex configuration problems with a configuration file and a few simple lines of configuration. The purpose of Spring Boot is to make it easier for users to develop applications built on the Spring Framework. It has to be said that Spring Boot perfectly fulfills its purpose.

As for Spring Cloud, it adds a bunch of microservice-related specifications on the basis of Spring Boot, and enhances the application context (Application Context).

Since Spring Cloud is a specification, it needs to be implemented. Spring Cloud Alibaba is a set of implementations of Spring Cloud microservice specifications.

In summary:

Spring usually refers to Spring IOC.

The Spring Framework includes Spring IOC and Spring AOP, and integrates with other J2EE frameworks.

Spring Boot is a supplement to the Spring Framework, making the integration of the framework easier, and is committed to rapid development of independent Spring applications.

Spring Cloud is a set of microservice specifications designed based on Spring Boot and enhances the application context.

Spring Cloud Alibaba uses Ali middleware as raw materials to implement Spring Cloud's microservice specifications.

Open source China:

At present, the Spring Cloud specification has been implemented by Spring Cloud Netflix, etc. What are the main differences and advantages of Alibaba?

Ji Wang:

Spring Cloud Alibaba's components are incubated from Alibaba's own internal middleware products. These middleware have experienced the test of Double 11 many times (Double 11 is currently the world's largest and most complex e-commerce transaction scenario). There is no doubt about ability. In addition, Spring Cloud Alibaba's complete native Chinese documentation and localized open source services will greatly reduce the learning cost of developers, increase the access rate, and reduce the difficulty of subsequent operation and maintenance.

Specific to each of the components:

Nacos

Nacos is based on the open source of Ali's internal configuration management and service discovery components. It has undergone many double 11 inspections and supports super-large clusters. It is trustworthy in terms of stability and performance. In the future, based on this mature business model, we will build more advanced features such as grayscale release, environmental isolation, and full-link stress testing, and output more of Ali's big killers in microservice practice.

Nacos Discovery

Nacos Discovery, Spring Cloud Netflix Eureka, ZooKeeper, and Consul all follow the standard implementation of Spring Cloud service discovery, and are well adapted to Ribbon. In contrast, Nacos Discovery has the following characteristics:

Support real-time push, reach the second-level service discovery.

Multi-layer disaster tolerance mechanism, try to ensure that the downtime of the service discovery center does not affect application calls.

Nacos Config

Nacos Config, like Spring Cloud Config, and ZooKeeper and Consul, follow the Spring Cloud configuration standard implementation, but with fewer dependent components, easier use and more powerful functions.

For example, it does not need Spring Cloud Bus or MQ, it can directly push the configuration in real time, and the push status can be checked. Support data rollback, support multiple data formats, perfect support for Chinese, and finally rely on multiple disaster tolerance mechanisms to ensure that the failure of the configuration server does not affect the application itself.

RocketMQ

The official Spring Cloud Stream framework of Spring Cloud shields the processing of the underlying message middleware and uses a unified programming model for programming. Currently, only Kafka and RabbitMQ's Binder are implemented officially. Alibaba's RocketMQ messaging middleware has become a top-level project of Apache. There are many people in the community asking when RocketMQ's Binder can be released, and we also think this is very necessary.

Sentinel

Currently, the circuit breaker officially recommended by Spring Cloud is Hystrix. Sentinel is an open source, lightweight and highly available flow control component for distributed service architecture by the Ali middleware team. It mainly uses flow as the entry point to help users protect services from multiple dimensions such as flow control, fuse degradation, and system load protection. The stability. Sentinel and Hystrix have some common features, but the underlying implementation is inconsistent.

In contrast, Sentinel has the following characteristics:

  • Lightweight, high performance
  • Diversified flow control strategies
  • System load protection

SchedulerX

SchedulerX is a highly reliable distributed task scheduling system that supports the scheduling of massive tasks in seconds, supports multiple task types such as Java, script, and http, and provides a distributed programming model that allows big data to run batches and is easy to use.

ARMS

ARMS is an APM monitoring product. Users can quickly build real-time application performance and business monitoring capabilities based on ARMS front-end monitoring, application monitoring or custom monitoring.

US

OSS is a cloud storage service provided by Alibaba Cloud. It has a platform-independent RESTful API interface that can provide 99.999999999% (11 9s) data reliability and 99.99% service availability.

Spring Cloud Alibaba has entered the Spring Cloud incubator. This news can be said to be relatively sudden. Can you introduce the entire process of entering the incubator from the very beginning to today, and the mentality behind it?

At the end of last year, we saw spring-cloud-aws and spring-cloud-gcp components in the Spring Cloud sub-project, which can improve the efficiency of AWS and GCP users when using Spring Boot programming.

At that time, we thought that if Alibaba Cloud's products were also integrated into the Spring Cloud ecosystem, it would definitely increase the happiness of Java users on Alibaba Cloud, so we started to do related work. The first project was called spring-cloud-alibabacloud.

But later, as Ali middleware fully embraces open source, heavyweight middleware such as service discovery and configuration management components Nacos and traffic protection Sentinel have been open sourced one after another. At the same time, we also found that the open source community encountered when using Spring Cloud already implemented Such and such problems. At this time, we feel that it will be a cooler thing to connect these production-level middlewares that have been tested on Double 11 to the Spring Cloud ecosystem. So we put Spring Cloud Alibaba as a separate item and submitted it to the Spring Cloud official.

Currently we have released the first version, which includes Nacos and Sentinel, as well as Alibaba Cloud's OSS, ACM and ANS. As Ali continues to increase its open source efforts, more components will be added in the future.

Open source China:
Spring Cloud Alibaba has become an officially certified implementation of a new set of Spring Cloud specifications. What does this mean in many ways?

Ji Wang:
Let me talk about it from the following aspects.

The first is to make up for the limitations of Spring Cloud's native implementation in large-scale cluster scenarios. There are many implementations of Spring Cloud specifications. For example, Netflix has its own set of systems, Consul supports service registration and configuration management, and ZK supports service registration. Each implementation more or less has its own advantages and disadvantages. Perhaps most Spring Cloud users find it difficult to realize the limitations of native implementations. Whether it is service discovery, distributed configuration, or service invocation and circuit breaking, they are not suitable for large-scale In cluster scenarios, for example, we also encounter Eureka performance problems internally. Therefore, Ali integrates its own super-large-scale cluster experience with the powerful Spring Cloud ecosystem to achieve a strong alliance, which is believed to have positive chemical changes in the industry.

Another impact is that we think this can benefit Javaer in China. We found that currently the first choice of Spring Cloud, Spring Cloud Netflix, is not particularly proficient in China, and their documents are all in English, and it is difficult to troubleshoot after problems.

Spring Cloud Alibaba is a set of domestic open source products. In the follow-up, we will provide Chinese reference and some principle analysis articles. This is a very good thing for domestic developers.

Alibaba's mission is to "let the world have no difficult business". In fact, many of Alibaba's Javaers have always had one mission, that is, "Benefit China's Javaers". Whether it is the previous Dubbo or the Java development manual some time ago, it has well reflected our purpose. Now, we take out Spring Cloud Alibaba and continue to implement our purpose.

Another aspect is for the field of microservice architecture. With the increasing popularity of microservices architecture, knowledge reserves in this area are becoming more and more important and urgent. The emergence of Spring Cloud Alibaba can be said to be the right time. For the field of microservices, the emergence of Spring Cloud Alibaba will also cause a lot of chemical reactions in this circle.

Open Source China:
Some people have to ask, what is Dubbo, who is also deeply involved in the field of microservices, if Ali does this? Just a while ago, cheered for its comeback, did you throw it away?

Ji Wang:
Actually, many people have a misunderstanding that Dubbo and Spring Cloud are alternatives or even opposites. Here we need to focus on clarification.

Contacting the content mentioned earlier, Spring Cloud is not equivalent to Spring Cloud Netflix's Ribbon, Feign, Eureka, and Hystrix components. Instead, it abstracts a set of general development models, and its purpose is to allow developers to develop business faster and better by abstracting out this general model.

However, the actual carrier of this development model runtime still depends on the specific implementation of components such as RPC, gateway, service discovery, configuration management, current limiting fuse, and distributed link tracking.

Dubbo and Spring Cloud are not in competition. As a mature RPC framework, Dubbo has been recognized by the industry for its ease of use, scalability and robustness. In the future, Dubbo will be used as the RPC component of Spring Cloud Alibaba, and will be seamlessly integrated with Spring Cloud's native Feign and RestTemplate to achieve "zero" cost migration.

In Alibaba's microservice solutions, Dubbo, Nacos, and Sentinel, as well as the microservice components that will be open source in the future, are all part of Dubbo EcoSystem. We will also integrate Dubbo EcoSystem into the Spring Cloud ecosystem.

So to summarize: Spring Cloud abstracts the general pattern of microservice programming, and Dubbo EcoSystem is the best practice of microservices.

Open source China:
Microservice architecture is particularly popular, but in fact it also has some problems. Recently, some people pointed out that the microservice architecture is going to be finished, and denied the view of "Service Mesh as the next generation of microservice architecture", and also stated that it is like Flink. The streaming architecture will become the new mainstream. Alibaba's addition of microservices through Spring Cloud Alibaba presumably does not agree with the view that the microservice architecture is about to end. By analogy with monolithic, SOA, serverless and other architectures, what stage do you think the microservice architecture has developed? Please share it in detail.

For details of the article, please see:
https://zhuanlan.zhihu.com/p/48036811

Ji Wang:
I think microservices are currently in a stage of vigorous development. Service Mesh and Serverless are actually under the category of microservice architecture. Service Mesh is a multi-language, dependency-free solution for providing microservices. Serverless is a solution for simplifying development, automated operation and maintenance, and time-sharing and multiplexing of resources to provide microservices.

Service Mesh and streaming programming architecture are both good directions, and there are other teams in the Alibaba Group doing this.

But from the perspective of our team, these are architectures that have not yet been verified by large-scale production clusters, and the components integrated in Spring Cloud Alibaba have been tested within Alibaba after many years of Double 11.

After all, technology still has to serve the business, so we integrate this set of technology into the Spring Cloud ecosystem to facilitate developers to develop business better and faster. Business is always the most important. This is our idea.

Specific to the point of view in that article, I look at it this way:

  • Microservices are an implementation of SOA

SOA is a service-oriented architecture, and microservices are also an implementation of service-oriented architecture. If you quote Martin Fowler, a pioneer in the field of microservices, then "we should regard SOA as a superset of microservices." Microservice is an agile implementation of SOA. Before ESB was IBM's imperfect implementation of SOA. Before the concept of microservice was created by Martin Fowler, Alibaba used Dubbo and HSF to implement its own microservice system. In fact, it is also an implementation of SOA.

  • The essential problem solved by microservices is the division of labor

Whether it is SOA or microservices, the fundamental problem to be solved is the division of labor. For details, see Conway's Law. This is the inevitable development of large-scale software and does not change because of people's preferences. When you understand Conway's Law, you will find that "the granularity of service splitting is difficult to accurately grasp" is not an essential problem at all.

If you have several 2 pizza teams, it is best to split them into several microservices. To give a realistic example: When there is only one developer, try to make a single application as much as possible. Don't break it into 10 microservices for stimulus, and eventually the developer will synthesize him into one. Microservices require a vertical 2 pizza team (countless small teams, including development, testing, operation and maintenance). Of course, we have also implemented some traditional large enterprises, but the team is still in a horizontal structure (development, operation and maintenance, testing). Each is a team), splitting microservices makes them very painful, especially the operation and maintenance team.

  • The challenge brought by microservices is the complexity of development, testing, and operation and maintenance under distributed conditions

There will never be a silver bullet, but we have to accept the trend of history and adapt to it. The emergence of microservices solves the problem of team division of labor, and at the same time introduces new problems, but it is not "large and complex infrastructure".

EDAS actually already provides most of the "infrastructure." Microservices are the same as driving. We don't need to build cars (infrastructure), but learning to drive (microservices concept) is the biggest challenge to the development, testing, and operation of single applications. For example: single application developers never think about method calls that will fail, retry, and be idempotent; single application testers will not think about how to integrate and test dozens of applications; single operation and maintenance personnel do not I will think about the impact of the down-stream application on me. It is more important to be aware of the complexity of development, testing, and operation and maintenance in a distributed environment, and to master the methods to solve these complex problems.

  • Microservices can live for at least 18 years

Of course, we cannot say that it will die just because there is a problem with microservices. Many people say that Java is about to die. They have heard of this argument since 2000. After 18 years, Java is still alive, and it has become popular recently.

Speaking of the death of microservices, then here is a link to Java. I think microservices will live at least 18 years, and it is also worth my lifetime. We will provide a complete infrastructure (car) and provide complete best practices ( Coach) to help developers enjoy the benefits of microservices (driving).

  • The next generation architecture is Serverless

Serverless = FaaS mentioned here, Serverless includes Serverless of the underlying middleware and Serverless of the service itself, and FaaS is just one of the simpler implementations. The Flink and FaaS mentioned in that article are actually not essentially different, but their commercialization is much worse than FaaS.

The specific analysis of each "streaming architecture advantage" argument in the article is as follows:

Original: Server-side developers no longer need to pay attention to system performance. Slink clusters can be dynamically expanded with containers, and Slink clusters can also dynamically adjust the number of nodes for a certain business.

Performance is an indicator that developers must pay attention to. Developers just don't need to pay attention to node expansion and contraction. FaaS can do better, and even nodes can not reside when there is no traffic.

Original: Server-side developers no longer need to pay attention to system reliability. Slink clusters manage each node, including scheduling, restarting, and state management.

Automatic failover of FaaS nodes.

Original: Server-side developers no longer need to consider system splitting, because the system has been split to the granularity of a single business, business development and changes will not lead to architectural changes, and only need to adjust the business processing flow diagram.

The ideal is full, and the reality is very skinny. After a team in Ali tried FaaS, it immediately returned. Complex business logic is not as simple as drag and drop. The code of a single application can theoretically be written into countless small methods, just drag and drop. At present, a small part of the banking system is implemented in this way, but why can't it be promoted on a large scale? This is caused by business complexity or variability, so FaaS is also difficult to succeed. The so-called method-level split of FaaS is essentially the same as the definition of the microservice interface API. The so-called orchestration is currently only suitable for the control of simple business logic.

Original: Slink can support multiple business operations, and resources can be shared to the greatest extent.

FaaS can prevent non-operational logic from loading and time-sharing multiplexing, which Flink (Slink) cannot.

Original: Almost most middleware, such as message queue, full link tracking, configuration center, downgrading system, etc. can be removed, and the Slink platform can have these functions built in.

AWS FaaS has provided various serverless services at the bottom, but Flink does not currently provide them.

Original: Operation and maintenance basically needs to maintain the Slink platform, and business does not require operation and maintenance.

AWS FaaS does not require maintenance, AWS will help you maintain it.

Original: Slink can support multiple languages ​​and no longer requires the server to develop a unified technology stack.

FaaS can be in any language and has been commercialized.

To sum up, in fact, the essential problems that Serverless solves are the following aspects:

  • Operation and maintenance complexity
  • Development complexity
  • Time reuse of resources

Although Serverless does not completely solve the complexity of development and testing, it is enough to become the next generation architecture. Serverless development is based on microservices, and Java developers will continue to use Spring Cloud. Serverless can be considered a useful supplement to microservices.

On the other hand, I think that no matter what architecture, cloud computing will eventually rule the entire server-side architecture.

We can see that cloud computing has solved the problem of the IaaS layer at this stage. Now when startups start, they are accustomed to buying machines directly on the cloud, instead of choosing the traditional form of finding a computer room and renting cabinets, saving one A lot of troubles have greatly improved efficiency and at the same time lower economic costs.

Looking at the upper level, at the database level, for example, people are used to buying RDS on the cloud. Developers do not need to care about sub-databases and tables, nor do they need a professional DBA for database operation and maintenance, because the RDS backend has automatically processed sub-databases and tables. And level expansion, and there are professional database personnel to help operation and maintenance and guarantee SLA, only need to pay according to the amount of use.

However, we have not done well in the PaaS and SaaS layers. We hope that in the near future, middleware capabilities can also be directly exported on the cloud. At that time, microservice developers no longer need to care about how to deploy the operation and maintenance service registry , Configuration center, message queue service, only need to use the standard programming model, out of the box, which can maximize development efficiency, and quickly realize business changes and advancement.

Open Source China:
What are your plans for the follow-up maintenance of open source projects that developers generally worry about?

Ji Wang:
Putting it in the Spring Cloud incubator from the very beginning has shown our attitude towards open source. Although the community ecology is dominated by Alibaba in the early stage, we welcome more people to join in and build this project better together. Whether it is a large feature, a small bug, or even a correction and improvement of the documentation, it can be of great help to this open source project.

Next, we will integrate the open source Dubbo, RocketMQ, ARMS, SchedulerX, SMS, VMS, SLS and other components on Alibaba Cloud. As Ali continues to strengthen its open source efforts, we will also access more open source components including distributed transactions.

Spring Cloud Alibaba will release the first GA version in February next year and graduate from the incubator with Spring Cloud H version.

The guest introduced
Ji Wang (Peng Wenjie), senior technical expert of Alibaba middleware, former CTO of Microclass Network, former chief architect of the examination system of the Ministry of Health, focusing on the field of microservices, once served as EDAS product development TL, currently responsible for Spring Cloud Alibaba open source .

Guess you like

Origin blog.csdn.net/yangguoqi/article/details/106690995