Ali Lei Volume: Established Reactive Foundation will develop what impact the way?

Author | Zhao Yu Ying

Recently, Linux Foundation announced the creation of Reactive Foundation. For Reactive, developers should be no stranger to you, especially Node.js developers, but to truly understand and realize the impact of this matter on the development of ways to bring is probably not much. This article, InfoQ honor the first time to promote the start-up of the Foundation Alibaba become a member of the Alibaba senior technical experts thunder roll exclusive interview, more comprehensive understanding of the background to the establishment and development of Reactive Foundation to develop ways of promoting.

file

What Reactive Foundation?

Recently, Linux Foundation announced the launch of  Reactive Foundation, aimed at accelerating the development of building the next generation web application architecture. The Foundation is governed by the original members of Alibaba, Facebook, Lightbend, Netifi and Pivotal other components. Reactive Streams specification and open source success RSocket involved, as well as the programming language.


Although Reactive foundation has just been established, but Reactive, that is, developers often said reactive programming, has been developed for many years. In 2011, Reactive went out into public view, then Microsoft .Net  built in the Reactive Framework 4.0 support, called Reactive Extensions. In 2013, the majority of Java developers familiar RxJava release. Next, Reactive enter the stage of rapid development, it has appeared in RxRuby, RxJS (interested developers can access  http://reactivex.io/   ) and so on.


In the development of technology, the major manufacturers also began to follow, such as Reactive Declaration, Lightbend of Akka, Spring of Reactor project, Spring Reactive Web and other emerging micro-services framework basically Reactive, such Vert.x, Micronaut and so on. Many developers is to develop an understanding of Reactive package, such as Android in the integration of RxJava, Spring of Reactive Web. However, the emergence of the Reactive RSocket extended to distributed scenarios, so that all applications can be linked together by Reactive and RSocket way.


As for why Reactive can quickly be accepted by the majority developers, typical of the two values as follows:

  • Non-blocking and high concurrency: Reactive asynchronous message-based communication, and Event Loop design is similar to Node.js, such applications are not synchronized obstruction, higher system throughput, which is equivalent to enhance system performance. Previously, developers thread pool to achieve concurrency, and now by news Actor model, eliminating the thread waiting to acquire, reducing the switching large number of threads, CPU utilization improved. In addition, non-blocking and high concurrency is particularly important for the cloud customer, CPU utilization, and QPS upgrade directly to the bill means that fewer;
  • Functional programming paradigms: functional programming has become increasingly accepted by developers, have the advantage of thread-safe, efficient execution, but these functions are connected in series to work, you need a certain paradigm and associated framework, which is what Reactive do, such as the standard Reactive Streams specification, related development framework RxJava, Reactor, etc., can make functional programming easier, and style code or uniform, read simple at the same time, Code Review is also very easy. It's like there are in Java Servlet specification, many Web framework to simplify Web application development, like. If you see in the code filter, map, flatMap, subscribe and so the function call, the basic is Reactive prototype.


The value of this technology will undoubtedly arise in the future to maximize Reactive Foundation. According to Lei volume revealed that the whole thing had started at the end of 2018. At the time, Ali Baba and the Netifi, Pivotal and FaceBook in joint development RSocket related open source products. Although, Reactive word often mentioned, but know the developer is still relatively small, several companies feel the need to allow more developers know this technology, so there is the idea of ​​the establishment of the Foundation. Thunder roll, said:

Throughout the preparatory process took less than six months, mainly thanks to the support Netifi and Pivotal, although many people do not particularly understand Reactive, but Linux Foundation is a lot of people grasp the direction of technology is still in place, so in less than six months the time to complete the creation Reactive Foundation.


Most developers in these startups member companies are not familiar with, such as micro-services more fire in the maintenance of Spring Framework is the Pivotal development. After that, the companies will jointly participate in the work of the Foundation, the volume represents a mine, Pivotal focused on the ecological RSocket fused with Spring; Netifi RSocket SDK is the core development team, and has its own RSocket Broker commercial products; Facebook RSocket also committed to the development of which, RSocket-cpp and RSocket-js are mainly Facebook engineers in maintenance, while also actively promoting internal Facebook RSocket floor; Lightbend many developers may feel strange, but it is behind the Scala language support company and a pioneer of reactive programming, support the development of Akka platform; Alibaba focused on the development of RSocket based Reactive and RSocket will push a highly distributed under development, while also actively developing internal RSocket products, which will provide services to customers on the cloud.


Reactive Foundation was established starting point is to promote the development of Reactive Streams and RSocket, which has a very large significance for subsequent Reactive product development to ensure that these Reactive products on the API and protocols are compatible to developers and the final speech is very important.


Specifically, Reactive Foundation will promote the first floor RSocket 1.0 specification, including the SDK to develop various languages, this is a heavy work load and tedious work, corresponding work in various languages, testing, performance, etc. need to be fit . For developers, Reactive Foundation will bring a lot of value, for example, continue to promote the evolution of specification, SDK development, documentation, support meetings, but also for each product developers Reactive introduction window.

Reactive to develop ways to bring change?


In fact, Reactive appeared to bring a lot of impact on the existing infrastructure, such as event-driven design, streaming, Service Mesh, not dependent on network, security and so on. Accordingly, the development mode will also change, more and more comprehensive support Reactive began framework, such as Spring WebFlux, Spring Data Reactive Repository and so on; database operations, by way R2DDBC has been completely Reactive technology; a variety of NoSQL products, such as Redis, MongoDB, have already supported Reactive; RPC and HTTP REST API developers may also change the understanding of distributed communications under the influence of RSocket. In these changes and shocks, the most typical is the code written and distributed communications.

  • Coding: Our previous procedural code, it will be replaced and Reactive functional programming paradigm, a large number of the code before the if else, null is determined, for loop, try / catch, will be greatly reduced, but each is Reactive kinds of standard operation, more simple, the code amount will be significantly reduced.
  • Distributed Communications: Prior to distributed development, we attach great importance to detail and communication of concurrent treatment, this is the core, Reactive and RSocket intervention will make development threshold will be reduced to a minimum, you almost do not care about the details of the underlying communications, the number of concurrent threads processing, circuit protection, all RSocket under Reactive give you solve it, you may only use the relationship between interface design and data serialization. Now more and more pursuit of extreme performance, CPU, GPU and FPGA are all on, if there is no matching efficient communications protocol, then the performance will be discounted a lot, and all this RSocket can help you do it, but more simple and elegant we will also introduce RSocket later.


It can be said, at this stage even if the developer does not care about Reactive, this has also been surging undercurrent. At the same time, the industry there are many Reactive Java and some of the technical integration of these technologies allow a more mature and stable Reactive:

  • Reactive 框架: RxJava, Reactor, Akka, Kotlin Coroutines & Flow
  • Web frameworks: Spring WebFlux, Vert.x, Micronaut, Helidon
  • Data layer: Spring Data Reactive, support database, Redis, Cassandra, MongoDB, etc.
  • Communication layer: RSocket, Reactor Netty, Reactor Aeron, Reactive Dubbo
  • Integration: Reactor Kafka, Reactor RabbitMQ, RocketMQ etc.


Today, more and more developers get used to cloud-based platform for developing applications. As noted above, Reactive development of cloud development in the field of primary students will also play a big role. In the interview, Ray volume revealed that the cloud allows native application independent of the underlying infrastructure, remain neutral, and thus can be run on a different cloud vendor's underlying architecture. However, this approach does not address the question of how communication between applications, although there are API-based collaboration, but did not make specific requirements for API, in particular, is based on asynchronous communication messages.


Currently among the most common application communications is RPC and HTTP REST API. Both for the communication request / response is no problem, HTTP REST API but there are some performance issues, but overall okay. However, these techniques are closer to Reactive, such as the Spring RestTemplate turn WebClient, and gRPC also has a corresponding Reactive gRPC and so on. For new architecture, such as Streaming, Event Driven, IoT and two-way communication, traditional RPC bit powerless, which is what RSocket are good at.


RSocket agreement after a very long argument, of course, draw on the idea of other protocols, and finally the formation of the current version 1.0.0 the developers to see. RSocket agreement can be said is a binary asynchronous message-based communication more perfect version, overcome some of the problems before protocol design, such as Client / Server convert to the role of peer manner; Pub / Sub adjusted to a more flexible Request / Stream; metadata and isolated manner, provide more flexible message routing and coding; pluggable transport layer, support TCP, WebSocket, UDP / Aeron, RDMA like; access support multiple languages, such as Java, Kotlin, Node, C ++, golang, Python, Rust and so on.


Currently, RSocket has been widely supported, Spring Framework version 5.2 will be built in RSocket, Spring Boot 2.2.0 version is also the first to support RSocket, other Spring Cloud Gateway, Spring Security, etc. will support RSocket. As Michael Dolan, vice president of strategic Linux Foundation said, Reactive based on message-driven approach can ensure the required elasticity native cloud applications, scalability and responsiveness, but none of this affected the underlying infrastructure. In other words, using Reactive properties, developers do not need or rely on cloud vendors can be achieved Infra layer Reactive declaration said resilient, scalability and responsiveness. It can be said, native cloud concern external applications, such as packaging deployment, operating environment, monitoring, and Reactive more concerned about internal applications, such as code that runs more efficiently, more natural and smooth communication between applications, a certain flexibility and self-recovery capability Wait.

Alibaba Reactive practice and open source projects


As one member of the start-Reactive Foundation, Ali Baba has been giving the impression that they are outside the interior uses a lot of Java programming language, has accumulated a large number of Java technology stack. However, according to Ray volume revealed that some of the products inside the Alibaba early start  Reactive technology , such as the developers are aware of Dubbo, just do Reactive and integration of RSocket. However, Reactive of course there are many problems to be solved, such as the SDK BUG, fit various internal architecture system. Ray Volume think the biggest problem is how to adjust the blocking non-blocking mode, such as database operations, non-asynchronous RPC call.


As a foundation, Alibaba will Reactive interior of the experience shared with developers need, the main contribution will tend to RSocket, mainly on the integration of distributed and cloud Reactive, because Ali Baba in security, performance testing, SDK development above all contributed very much, combined with the characteristics of the cloud and multi-tenant support, allowing users on the cloud easier to use. Internally, Alibaba also actively promote the product of Reactive, add RSocket support.


In technological innovation, while Alibaba also efforts to solve the cost problem, if a developer RSocket heard presentations on the QCon 2019 Beijing Conference might Netifi company through the development of micro RSocket help companies achieve service at the scene 40,000RPS, Istio need 3495 dollars per month, while Netifi as long as 388 dollars a month, while 10 times the performance had the impression that this undoubtedly very attractive for any business. Have six months from now to that speech, the new RSocket Broker already supports multi-tenant properties, rather than an exclusive way, costs can be reduced by 50% to 70% again, at 40000 RPS scene, as long as the monthly payments $ 20 less.


While Ali Baba Reactive process is still underway, but it brings the cost value has been reflected. Lei volume representation, mainly after synchronous asynchronous transfer, to enhance the overall performance of the application, change is the direct cost of spending is reduced, which should be the same for the other users.

Conclusion


For Node.js developers, and now almost all of Reactive, while Java developers, especially in the back end, is still in its early stages, is currently experiencing the biggest problem is, Reactive requires the user to adjust the code, which is the biggest trouble, developers need a long time to be familiar with, understand and use. And the associated integration is not perfect, though Spring 5.0 is already included Reactive, but not all are supported. Lei volume representation, Spring 5.2 will fully support the underlying Reactive, once the version of the official release, developers can experience the convenience and Reactive RSocket development.


In terms of revenue, Alibaba is developing RSocket Broker product, hope can be introduced quickly, so that more developers can make better use of Reactive, native cloud applications to help solve the problem of asynchronous communication, so that all organizations and developers can more simply and efficiently safety, while significantly lowering costs.


Author:
Ray volume, Alibaba senior technical experts, currently working in the Silicon Valley office of Ali Baba. Alibaba work in 10 years, with 20 years of experience in Java development, he participated in several internal projects ranging from logistics to Pu International Department middleware. At present the main research methods and RSocket is Reactive, Reactive and RSocket will bring application development, build a more simple and efficient architecture. Developers also RSocket thunder roll, mainly focused on the development of RSocket Broker.

Guess you like

Origin www.cnblogs.com/alisystemsoftware/p/11527096.html