[Java] Liven up the Java community: Alibaba open source Dragonwell Open JDK

13 minute read

Alibaba is backing the Java community by open sourcing Alibaba Dragonwell, the version of OpenJDK.

*This blog is a translation from the English version. You can check the original from here. Some machine translations are used. If you have any translation errors, we would appreciate it if you could point them out. *

From Yuying Zhao

InfoQ reporter monopolizes Alibaba trying to open source Alibaba Dragonwell, which is the long-term supported version of OpenJDK. Report. As you know, Oracle’s attitude towards Java is changing, and with a large number of Java users, this issue is expected to be a long-standing focus of discussion among developers.

Alibaba, one of the world’s largest Java users, has done a lot of work in deciding to make Alibaba Dragonwell open source. This overlaps with the announcement below.

  • Oracle has announced that official support for Java 8 for individual users will be until December 2020, and commercial users will not receive free updates after January 2019.
  • Red Hat planned to continue providing OpenJDK 8 support until 2023.
  • AWS officially announced the long-term support version of OpenJDK, “Amazon Corretto”.

Now, Alibaba has announced that it will open source the long-term support version of OpenJDK, Alibaba Dragonwell.

The trend of fragmentation within the Java ecosystem is becoming more pronounced. For developers, instead of taking the risk of immediate replacement, they want to use a JDK with continuous security updates and rich features.

So how does Alibaba respond to the needs of developers? Is it possible to open-source Dragonwell to impress users who stick to Java 8 and solve urgent needs? How will Alibaba handle the relationship between this project and OpenJDK in the future? How does the company with billions of lines of Java code see the future of Java?

In response to the above issues, InfoQ reporter had an exclusive interview with Li Sanhong, senior technical expert of Alibaba Cloud Intelligent Basic Products Division, and Kingsum Chow, a researcher of Alibaba Cloud Intelligent Basic Products Division. I’ve heard how you’re looking at the future of Dragonwell and Java.

What is #Alibaba Dragonwell

Many Java ecosystem developers have heard of the origin of the project, Corretto, a long-term supported version of AWS’s open source OpenJDK. Corretto is an extension of Caffe Corretto, an Italian word for espresso plus a small amount of alcohol. Coincidentally, the name of Alibaba’s Dragonwell is also associated with popular beverages.

According to Kingsum Chow, who answered the interview,

The Chinese translation for “Dragonwell” is Yongi, a symbol of Chinese tea culture and also a feature of Hangzhou (which has its Alibaba headquarters). The word “well” is usually described as a collection of water sources for everyone to enjoy, but “Tatsui” is not a collection of such water sources. We would like to bring together the power of the developers, make continuous improvements, and eventually contribute to all users.

Why open source now?

In a nutshell, Java has long been dominated by Oracle. Since the end of 2017, Oracle has announced that it will gradually change its Java strategy to gradually open source the commercial features within the Oracle JDK to the community and end of providing free commercial version updates, security updates and vulnerability remediation support. ..

What does this mean for developers? If you are an Oracle JDK 8 user, the original license will still be available for free, but you will need to pay for subsequent ongoing security updates. Today, the Java environment dominated by Oracle is changing. As the largest user of Java, Alibaba has one of the largest Java application clusters in the world, so you definitely have to do something.

In an interview, Lee Sang-Hul said the sequence of changes by Oracle delivered an important message.

If you want to continue using Java for free and want to receive ongoing updates, you may need to switch to the community version later.

With that in mind, Alibaba decided to open source Alibaba Dragonwell, the long-term support for OpenJDK, for two reasons. First, there are many Java customers and business needs. Alibaba wants to keep all the features of the JDK available for free. Second, given the potential for many developers to make new choices, Alibaba decided to open source the Dragonwell project to provide developers with new references.

Main features of #Dragonwell Alibaba Dragonwell is a free OpenJDK release version that offers long-term support such as performance improvements and security fixes, and actually supports the features that Oracle charges for. According to Li Hong, Alibaba Dragonwell currently supports x86-64/Linux platform, which is the stability, efficiency and performance of Java application mainly under the condition of large Java application deployment in data center. It aims to optimize and improve the.

This preview version of Alibaba Dragonwell 8 is compatible with OpenJDK 8 and Java SE Standard. Of particular note are the following three features.

  • Port upstream Java 11 JFR (Java Flight Recorder) functionality. As you know, JFR function is a commercial function of Oracle JDK, and you have to pay for using it. Despite this feature being open source since OpenJDK 11, Java 8 has a very large number of users. Therefore, Alibaba decided to port this feature to Alibaba Dragonwell 8 and make it available to developers. By using JFR, Java developers can collect detailed profiling information while the JVM is running, and work with Java Mission Control (JMC) to improve the efficiency of Java application problem diagnosis and performance optimization. I can do it.
  • Integrates JWarmup technology. The warm-up problem has always been one of the most difficult problems in Java applications. Alibaba has had a solution for a long time, but it was difficult for outside users to get to this solution. JWarmup is currently established as the Java Enhancement Proposal (JEP) for OpenJDK and is expected to join the release version of Java Standard in the future. JWarmup allows users to dynamically pre-compile Java code in combination with data center application traffic scheduling timing, which allows users to use traditional justifications such as excessive CPU loads and response timeouts. -You can effectively reduce the problems caused by the in-time warm-up.
  • Achieve improvements in service functions such as GC diagnostics.

Perhaps some developers have noticed that Alibaba Dragonwell currently only supports the Linux platform, which is also the operating system used in most data centers. To prevent developer misunderstanding, it requires special attention here that it does not affect Java’s cross-platform functionality. Cross-platform functionality refers to the Java application itself, and the JDK (including the JVM) is just software. The version varies depending on the platform. All you have to do is install the JDK for your supported platform. Developers can develop Java applications on any system, deploy to a supported platform and run bytecode files. (Alibaba will provide detailed usage documentation in both Chinese and English once the project is open sourced)

the next deployment

In the future, Alibaba will iterate versions quarterly and expect the GA version to be released in the next phase, three months later. In addition, the Alibaba JDK technology team continues to maintain and update the project and works closely with the OpenJDK community to promote Java technology development.

In addition, given the needs of real users and the large number of Java 8 users, Alibaba will continue to port good features from future versions of OpenJDK to Alibaba Dragonwell, similar to the Java Flight Recorder feature mentioned above. However, he is also considering making it available to developers in advance in a production environment.

Alibaba and Java

Alibaba was invited to the JCP Executive Committee for a two-year term in 2018 and was the first Chinese company to participate in the JCP. JCP is an open international organization and Java executive committee. It consists of people who have been certified as Java developers. Its main function is the development and updating of the Java technical specification, and Alibaba has certain rights in developing the Java standard and can participate in the decision-making of major events in the Java ecosystem.

According to a survey, Alibaba is one of the largest Java users in the world, has a large number of Java developers and servers, and is ready for business development. Speaking of Alibaba, the easiest tag to come up with is “Singles Day”-the largest shopping carnival in the world. In 2018, Tmall’Singles’ Day’ total trading volume finally exceeded 100 billion in less than two hours, reaching 213.5 billion. The biggest hero that supports the efficient operation of support systems is Java.Given the growing volume and complexity of business requirements, Alibaba decided in 2004 to completely switch from PHP to Java, and urgently needed a more efficient way to solve problems in production. This forced Alibaba to build its own solutions based on open source technologies and educate Java developers to find and fix problems quickly.

Internet companies operate very quickly, often requiring many product versions to be iterated within a week, which can lead to many problems. If all these issues rely on waiting for the official update to be resolved, the entire front end will be affected and the business cannot afford to wait. This is also a major reason why many Internet companies choose to adopt open source products for their critical services. This is to quickly build a solution that matches the business development in an autonomous and controllable way.

As early as 2010, Alibaba began customizing JVM optimizations based on OpenJDK 6. It is the first optimized, customized and open source Java Virtual Machine for server in China. After that, several teams within Alibaba became involved in the JDK R&D one after another (yes, it was actually done by multiple teams at the beginning). After that, Alibaba believes that JDK covers almost all business scenarios such as logistics, finance, e-commerce, new retail, Kai Nao, etc. as an important infrastructure, and it is wrong to carry out R&D separately for a long time. I decided it was not possible and integrated all the JDK teams into one.

In 2015, the integrated Alibaba JVM team started optimization and customization based on OpenJDK 8 and launched the famous customized AJDK (Alibaba/AlipayJDK) to run almost all core applications of Taobao, Tmall, Ant and Cainiao. Hosted and endured the shopping madness of “Single Day” many times.

Is the current open source Alibaba Dragonwell the same AJDK that Alibaba uses internally?

Judging from Alibaba’s business operations, AJDK’s functions and performance are certainly good, but open source Alibaba Dragonwell is still different from AJDK. According to Li Hong, Alibaba Dragonwell is an open source version of AJDK and inherits the technology of AJDK. At present, the open source version does not include all the features of AJDK such as multi-tenancy, Wisp coroutine, ZenGC, etc. This is largely due to the time it takes to prepare for the technology to be open sourced.

With regard to the current preview version of “Alibaba Dragonwell 8”, Alibaba has conducted internal discussions and has undergone considerable preparation, testing, and communication. After confirmation, it will take another half a year to finally open source the preview version, after which Alibaba has considered gradually moving AJDK functionality to Alibaba Dragonwell. Obviously, this task takes time.

What to do with OpenJDK?

Unlike the Oracle JDK, OpenJDK is an open source project based on the GPL v2/a Classpath Exception. It has been the official reference implementation of Java SE since Java 7. According to the OpenJDK committer who responded to the interview, OpenJDK does what is taken for granted. The life cycle of the Oracle JDK, which has been free for many years, is nearing its end, so the community is taking over and handling subsequent updates. Prior to that, Oracle provided free JDK 8 support for five years before entering the community maintenance phase.

Today, many major overseas vendors such as Google, Twitter, Amazon, Alibaba, etc. use OpenJDK, and we are developing a version of JDK based on it. This has plagued ecosystem developers. When many users start to consider using OpenJDK, do these major vendors still want to participate in community-wide maintenance?

From the perspective of Alibaba, Li Sanhong repeatedly emphasized a perspective in the interview.

Alibaba Dragonwell must be downstream of OpenJDK. Each release of Alibaba Dragonwell synchronizes the latest upstream updates and performs extensive application cluster testing within Alibaba. At the same time, Alibaba actively contributes its technical accumulation on AJDK to OpenJDK and actively participates in updating and maintaining community projects.

The AWS perspective is quite similar. Arun Gupta, AWS’s chief open source technology expert, once announced on the AWS open source blog:

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

Under these circumstances, I think that the JDK software released by major vendors is bound to something slightly different from the easy-to-understand OpenJDK. In some cases, the problems that you actually encounter in your production environment may not be suitable for improving OpenJDK.If you face the same problem, there may be cases where the ideas of major vendors and OpenJDK’s solutions do not match, and various stakeholders are involved. I think that friendly negotiations will be needed, and a useful system will gradually be formed. Right now, this is just the first step to popularizing OpenJDK.

Java’s fate

With more choices, the ecosystem seems to be becoming more “fragmented.” Are developers sticking to Java 8 willing to move to OpenJDK in the future?

Users who stick to Java 8

Why don’t developers move to newer versions on a large scale, as Java 8 and Oracle JDK 8 have many problems? Why is Alibaba Dragonwell initially based on OpenJDK 8? The answer to this question is simple.

There are some very interesting things to see in the Java ecosystem. No matter how appealing the new version update is, most Java developers are not interested and stick to their choice. In fact, Java 8 has been released successfully, and many developers think that other versions do not need to be updated.

In this regard, Sanhong Li believes that over the years of Java development, most developers have become accustomed to relying on the official Oracle JDK and are not paying sufficient attention to OpenJDK. Therefore, switching from the Oracle JDK to OpenJDK requires a process. However, the efforts of these international technology giants will improve the OpenJDK ecosystem and make the features more complete. In the face of ongoing security updates and close participation of many large vendors, this project should be an important public resource in the Java ecosystem.

Ecosystem with progressive fragmentation

The Java ecosystem has been beginning to show a fragmentation trend for quite some time, and it seems to have grown since Oracle started charging for services. Previously, AdoptOpenJDK strongly recommended that all OpenJDK providers submit patches to OpenJDK to reduce potential fragmentation concerns.

In this regard, Kingsum Chow doesn’t believe that the increased developer choice is not necessarily a bad thing. Moreover, the different versions are actually very compatible with each other, and the migration cost is close to zero, so it won’t put an extra burden on users. Different versions have different performance optimizations and platform support. Developers can choose to suit their needs. But Alibaba is trying to push these technologies upstream, to the entire OpenJDK ecosystem. This issue should be mitigated in the future.

Alibaba has announced that it will open source the Alibaba Dragonwell from March 21, 2019. Starting from that, developers will be able to download and use it from GitHub community of Alibaba Cloud.

This article is a reprint/translation of the same topic article from InfoQChina.

Alibaba Cloud is the No. 1 cloud infrastructure operator in the Asia-Pacific region (2019 Gartner) with two data centers in Japan and more than 60 availability zones in the world. Click here for more information on Alibaba Cloud. Alibaba Cloud Japan Official Page