Alibaba open source its own version of OpenJDK, the Java community ushered in the power of China

On March 21, Alibaba will announce open source Alibaba Dragonwell. At that time, developers can download and use the Aliyun Developer Center and Github community. InfoQ spoke exclusively with Sanhong Li, senior technical expert of Alibaba Cloud Intelligent Basic Product Division, and Kingsum Chow, researcher of Alibaba Cloud Intelligent Basic Product Division, to hear their views on Alibaba Dragonwell’s return to Java.

The author | Zhao Yuying The interviewees | ali cloud intelligent based products to senior technical experts Lee three red Ali cloud based products intelligent researcher Kingsum Chow (Zhou Jingsen)

Alibaba is about to launch the long-term support version of open source OpenJDK Alibaba Dragonwell. It is well known that Oracle has undergone a series of changes in its attitude towards Java, and due to the large Java user base, this is expected to be a topic of discussion among developers for a long time to come. As one of the largest Java users in the world, what is the reason for Alibaba to choose Alibaba Dragonwell, the long-term support version of open source OpenJDK?

  • Oracle has dropped the ball and announced that Java 8 will be officially supported until December 2020 for Personal Users. For Commercial Users, the free update will not be available after January 2019.
  • Red Hat says it plans to continue providing OpenJDK 8 support until 2023.
  • AWS joined in and officially launched the OpenJDK long-term support version Amazon Corretto.

Today, Alibaba has also announced a major open source OpenJDK long-term support version Of Alibaba Dragonwell.

This makes people sigh: the Java ecosystem is becoming more and more fragmented. For developers, you don’t want to risk an immediate replacement, but you want to have the JDK with constant security updates and full functionality. At this time, Alibaba announced the open source OpenJDK long-term support version, out of what considerations? Will this appeal to the Java 8 community and address its immediate needs? How does Alibaba plan to deal with the relationship between this project and OpenJDK in the future? How does this billion lines of Java Code company see the future of Java?

Alibaba Dragonwell

Many developers in the Java ecosystem will have heard of the name of the Corretto project, a long-supported version of AWS ‘OpenJDK, derived from Caffe Corttto, an Italian drink that refers to an espresso containing a small amount of white wine. Similarly, Alibaba Dragonwell is also named after drinks. Chow Revealed in the interview:

“Dragonwell”, which translates as “Dragonwell” in Chinese, symbolizes China’s tea culture and happens to be a characteristic of hangzhou, where alibaba is headquartered. The word “well” is often described as water coming together for everyone to enjoy, and we wanted to bring together all developers to improve the project and ultimately contribute to all users.

Why open source now?

For the most part, Java has long been dominated by Oracle. Since the end of 2017, Oracle has been shifting its Java strategy, gradually opening up commercial features in the Oracle JDK to the community, and announcing that it will no longer provide free commercial version updates, security updates and bug fixes.

What does this mean for developers? If you are an Oracle JDK 8 user, the original License is still free to use, but you will have to pay for continuous security updates. Today, the Java landscape has changed under Oracle’s leadership. As one of the largest users of Java, with almost the largest Java application cluster in the world, Alibaba certainly needs to do something about it.

In an interview, Li sanhong said Oracle’s series of changes send an important message:

If you want to continue to use Java for free and get continuous updates, then you may need to switch to the community version.

Based on this, Alibaba has decided to open source the OpenJDK long-term support version of Alibaba Dragonwell. Firstly, because Alibaba has a large number of Java customers and business needs, Alibaba hopes that they can continue to enjoy all the functions of JDK for free. Second, considering that many developers may make new choices, Alibaba decided to open source the project to provide a new reference for developers.

Important features

Alibaba Dragonwell is a free OpenJDK release that provides long-term support, including performance enhancements and security fixes that correspond to what Oracle charges for. Li Sanhong revealed that Alibaba Dragonwell currently supports x86-64/Linux platform, mainly aimed at the scenario of large-scale Java application deployment in data centers, Java application stability, efficiency and performance optimization and improvement.

The Alibaba Dragonwell 8 preview release corresponds to OpenJDK 8 and is compatible with the Java SE standard. Here are three features to focus on:

  • Migrate upstream Java 11 Java Flight Recorder (JFR) functionality. As we all know, JFR is a commercial charging function of Oracle JDK, which requires payment. Although it is open source through OpenJDK 11, the user base of Java 8 is still very large. Therefore, Alibaba decided to port this feature to Alibaba Dragonwell 8 for developers to use. Java developers can use JFR to collect detailed profiling information during JVM runs to improve problem diagnosis and performance optimization for Java applications in conjunction with Java Mission Control (JMC).
  • Integrate JWarmup technology. Warmup has been one of the biggest challenges for Java applications, and while Alibaba had a solution for it early on, it was difficult for external users to access it. JWarmup has now been developed in OpenJDK as a Java Enhancement Proposal(JEP) and is expected to be included in Java standard distributions in the future. JWarmup allows users to dynamically pre-compile Java code in the data center based on application traffic scheduling timing, which effectively reduces CPULoad and Response Time timeout caused by traditional Just-in-time Warmup.
  • Performs improved RAS for GC problem diagnosis.

Interested developers have noticed that Currently Alibaba Dragonwell only supports Linux, which is the operating system used in most data centers. In case developers get the wrong idea, it’s important to note that this does not affect the cross-platform nature of Java. Because cross-platform refers to the Java application itself, the JDK (including the JVM) is just one piece of software, and there are different versions for different platforms, as long as the corresponding JDK is installed on the corresponding platform. Developers can develop Java applications on any system and then deploy them to the platform to run bytecode files. (After open source, Alibaba will provide detailed usage documentation in Both Chinese and English)

Subsequent planning

In the future, Alibaba hopes to iterate on releases every quarter, with the next phase expected to be a GA release in three months. In addition, ali JDK technical team will continue to maintain and update the project, and will work closely with the OpenJDK community to promote the development of Java technology.

In addition, considering the actual needs of users and the huge size of Java 8 community, Alibaba will continue to transplant the excellent functions in the later version of OpenJDK into Alibaba Dragonwell, similar to the Java Flight Recorder function mentioned above. For developers to use ahead of time in production environments.

Alibaba and Java

In 2018, Alibaba was invited to join the JCP’s supreme Executive Committee for a two-year term, becoming the first Chinese company to join the JCP. JCP is an open international organization and the highest Executive Committee of Java. It is composed of Java developers and licensees. Its main function is to develop and update Java technical specifications, which means Alibaba has a certain say in the formulation of Java standards and specifications. And can participate in major decisions about the Java ecology.

According to the survey, Alibaba is one of the largest Java users in the world, and it has a very large number of Java developers and servers internally, which is also the result of its business development. When it comes to Alibaba, the label that comes to mind most easily is “Double 11”. In 2018, the total transaction volume of Tmall Singles’ Day finally reached 213.5 billion yuan, breaking the 100 billion mark in less than 2 hours. Java is the biggest factor behind the efficient operation of the supporting system.

In 2004, alibaba decided to switch from PHP to Java due to the growing volume and complexity of its business needs, and needed a more efficient way to solve problems in the production environment. This forced Alibaba to build its own solutions based on open source technology, guiding Java developers to quickly locate and solve problems.

The pace of Internet enterprises is very fast, and they even need to iterate many versions within a week, which will lead to many problems. If they all rely on official updates to solve the problems, the whole battle line will be stretched suddenly, and the business cannot afford to wait. This is also a very important reason why many Internet enterprises choose to be based on the open source version: independent and controllable, and quickly build solutions to match business development.

As early as 2010, Ali started to optimize JVM customization based on OpenJDK 6, which is the first optimized, customized and open source server version of Java VIRTUAL machine in China. , ali internal research and development of multiple teams are involved in the JDK in succession (yes, the beginning is indeed a multiple teams are doing), then, alibaba, considering the JDK as an important infrastructure, almost covers the new retail and logistics, finance, electricity, rookie all business scenarios, such as separate r&d is certainly not for a long time, Merge all JDK teams into one.

In 2015, the unified Ali JVM team began to optimize and customize based on OpenJDK 8, and launched the now well-known customized version AJDK (Alibaba/AlipayJDK), which almost carries all the core applications of Taobao, Tmall, Ant and Cainiao. And has withstood the double eleven test for many times.

So is the open source Alibaba Dragonwell now the same thing as the AJDK used internally by Alibaba?

From the perspective of Alibaba’s business operation, AJDK’s functions and performance are indeed good, but this open source Alibaba Dragonwell is still different from AJDK. According to Li sanhong, Alibaba Dragonwell is an open source version of AJDK, the successor to AJDK technology. The current open source version does not include all the features of AJDK, such as multi-tenancy, Wisp coroutines, ZenGC, etc., mainly because open sourcing a technology involves a long preparation period.

As for the preview version of Alibaba Dragonwell 8 that is currently open to the public, Alibaba has actually had many internal discussions, repeated preparation, testing and communication. After confirmation, it took six months to finally open source the preview version. After that, Alibaba will consider transitioning AJDK functions to Alibaba Dragonwell. Obviously, this work will take time.

How about OpenJDK?

Unlike the Oracle JDK, OpenJDK is an open source project based on GPL V2 / A Classpath Exception and has been the official reference implementation of Java SE since Java 7. OpenJDK committers have a convention that after years of free support, the Oracle JDK version life cycle comes to an end, after which the community takes over and takes the lead on subsequent updates. Oracle has been supporting JDK 8 for free for five years now, and it’s time to move into community maintenance.

At present, many mainstream international manufacturers are using OpenJDK, such as Google, Twitter, Amazon and Alibaba, and have developed JDK versions based on this, which makes many developers in the ecosystem worry: At a time when many users are considering OpenJDK, do these companies still want to participate in the maintenance of the entire community?

From the perspective of Alibaba, Li Sanhong repeatedly emphasized a point of view in the interview:

Alibaba Dragonwell must be the downstream of OpenJDK, every Alibaba Dragonwell distribution will be synchronized with the latest updates upstream and tested by a large application cluster within Alibaba. At the same time, Alibaba will also actively contribute AJDK technology accumulation to OpenJDK, and actively participate in community project update and maintenance.

AWS has a similar point of view. Arun Gupta, AWS’s chief open source technical expert, once published an announcement on AWS open Source blog:

We look forward to working closely with the OpenJDK community to develop future enhancements to OpenJDK 8 and 11.

In my opinion, it is easy to understand that the JDK will be slightly different from OpenJDK in this state. The actual problems encountered by customers in production environments may not be suitable for OpenJDK improvements. In the face of the same problem, the solution of OpenJDK may not be consistent with the idea of various major manufacturers, which requires friendly negotiation among various parties and gradually forms a benign mechanism. Now it is only the first step to promote OpenJDK.

The Java way home

With more choices, the ecosystem seems more fragmented. Will Java 8 developers want to migrate to OpenJDK in the future?

The Java 8 community that sticks to it

Given the problems with Java 8 and the Oracle JDK 8, why don’t developers migrate to newer versions on a large scale? Why is Alibaba Dragonwell still based on OpenJDK 8? The answer to this question is simple:

Java 8 is by far the most widely used version, and its community is very persistent!

One of the interesting things you’ll find in Java circles is that no matter how tempting the updates are, most Java developers don’t seem to be interested and stick to their choices. Indeed, Java 8 has been such a successful release that many developers don’t feel the need to update other versions, which may have something to do with long-standing habits and built-in trust.

In this regard, Li Sanhong believes that after so many years of Java development, most developers have been accustomed to trust the official Oracle JDK and pay less attention to the community OpenJDK version, so it takes a process to switch from Oracle JDK to OpenJDK. However, with the efforts of these international technology giants, the OpenJDK ecosystem will be more and more perfect and its functions will be more complete. In the face of continuous security updates and the deep participation of many giants, this project should become an important public resource in the Java ecosystem.

More and more “broken” ecology

Fragmentation has long been a trend in the Java ecosystem, and seems to have been exacerbated by Oracle’s fees. Previously, to reduce potential concerns about fragmentation, AdoptOpenJDK strongly encouraged all OpenJDK providers to submit patches to OpenJDK.

As far as developers are concerned, there are more choices, and that’s not necessarily a bad thing, chow said. Moreover, the compatibility between different versions is actually very high, and the migration cost is almost zero, which does not impose additional burden on users. There are some slight differences between the different versions in terms of performance optimizations, platform support, etc. Developers can choose according to their needs, but Alibaba is working hard to push these technologies upstream, i.e. the entire OpenJDK ecosystem, and this issue should be alleviated in the future.

Address of Alibaba Dragonwell project


Read the original

This article is the original content of the cloud habitat community, shall not be reproduced without permission.