The English version of quarkus.io is the official project site. Translated sites are community supported on a best-effort basis.

Eclipse Adoptium Uses Quarkus for high volume Java SE distribution API

Adoptium logo

Java is used by millions of developers worldwide and according to Redmonk, recently moved back to the #2 most used programming language. There are many distributions of the Java runtime and development kit, but the Eclipse Temurin (formerly known as AdoptOpenJDK) distribution has proven to be the most popular. Recently, the AdoptOpenJDK project was moved into the Eclipse Foundation as Eclipse Adoptium. The goal of Adoptium is to promote and support high-quality, TCK certified runtimes and associated technology for use across the Java ecosystem. It does this by performing regular builds, tests, certifications, and of course serving binaries to those millions of developers that need to evaluate, prototype, and run production workloads with Java. Like other open source Eclipse projects, the team behind the distribution API are mostly volunteers, so they are constantly looking for optimizations of their time and resources and technology used to deliver on their mission.

The Challenge

While developers can download distributions directly from the Adoptium website with a single click, it becomes more of a challenge to automate this process, for example in a CI/CD pipeline. This is especially true due to the number of variants of Java versions, release types, operating systems, architectures, JVM implementations, etc. To that end, Adoptium needed to offer a way to programmatically discover and access pre-built binaries based on these variables, and produced an end-user API.

The sheer volume of AdoptOpenJDK downloads, about 500,000 per day, meant that performance would become a key consideration for the API. In addition, Adoptium does not have a traditional datacenter, so all of this runs in the cloud on Microsoft Azure, where costs can increase when you have continuously running workloads that take up unnecessary space.

Download trends
Figure 1. Recent download statistics for Adoptium distributions, from dash.adoptopenjdk.net

In 2017, the technical team’s first attempt at exposing an API was using Node.js + Express. As the request volume and number of distribution variants rose, the team found that the response times were getting slower, not only due to the volume, but also due to architectural choices made early on. In particular, the application’s monolithic architecture, where the frontend and backend were in the same app, would cause apparent slowness in the frontend, while the backend processed concurrent requests. In addition, lack of pagination in the API meant that requests could return huge results, even when only the first few elements of the result were needed.

The lead developer on the Technical Steering Committee responsible for the upkeep of the API explains:

The existing API had design flaws that wouldn’t have been easy to fix, so we were considering replacing it with a new implementation. Our small team had more experience in JVM languages than JavaScript, and since this was an API serving Java data, we thought eating our own dogfood would be a good thing!

-Lead Developer on the Adoptium Technical Steering Committee

Enter Quarkus

In July 2019 the team discovered Quarkus through its related work with other frameworks in the Java ecosystem. They were especially interested in Quarkus’ promise of stellar performance and smaller footprint, which is comparable to Node.js and even Golang. Even better, Quarkus’ first class support for Kotlin meant the team could re-use both their Java and Kotlin experience with Quarkus.

The team found Quarkus extremely easy to develop, especially the Live Coding capability. The familiar JAX-RS APIs in Quarkus made it easy to create the necessary endpoints. The lead engineer explains further:

We really liked the fact that Quarkus uses JAX-RS, which we were already familiar with. Having out-of-the-box integration with RESTEasy reactive was a nice performance bonus, and the OpenAPI extension available in Quarkus made it pretty simple to expose the API as a Swagger API browser with no additional work needed.

-Lead Developer on the Adoptium Technical Steering Committee

Live Coding with Quarkus also proved extremely useful when developing the application:

The live coding fast feedback loop was very useful when developing with Quarkus. Although fast startup was nice, it wasn’t critical since our apps are long-running, but during development, as we tweaked our APIs, being able to immediately re-test saved us a ton of development time.

-Lead Developer on the Adoptium Technical Steering Committee

The out-of-the-box performance of Quarkus on JVM exceeded their expectations quite easily:

We initially wanted sub-second response times for most of the API, and be able to handle around 10 thousand requests per second. With zero optimizations, our app was responding within 1ms for most APIs, and easily surpassed our throughput requirements. This is way more than we will need for the foreseeable future. The Quarkus app also uses less than half the CPU time [compared to Node.js], despite handling more traffic and providing more functionality.

-Lead Developer on the Adoptium Technical Steering Committee

Overall, the move to Quarkus has been a very positive experience, with real benefits in terms of developer productivity and operational efficiency. The team has been using Quarkus in production for the Adoptium API since November 2019 and has proved to be extremely stable.

An Active Community

Communities are a critical aspect to any open source project’s success, including Quarkus. It is no surprise that the health of a community is a major consideration when an adoption decision must be made. For Adoptium, this is made clear by example:

Earlier this year we discovered a memory leak in the RESTEasy Reactive component in Quarkus. Within a few days, working with the Quarkus community, we were able to identify and fix the issue. This gave us the confidence that longer term, we’ll be able to resolve issues quickly.

-Lead Developer on the Adoptium Technical Steering Committee

What’s Next for Adoptium

Adoptium has been very happy with their decision to adopt Quarkus, and are looking forward to trying out new capabilities in Quarkus like continuous testing and dev services support for MongoDB (their database of choice).

Overall, we have been very impressed with the capabilities of Quarkus, and our experience with the Quarkus community has been fantastic. We look forward to seeing how it evolves, and improving how we serve the Java community’s Java distribution needs for years to come!

-Lead Developer on the Adoptium Technical Steering Committee

More Information

About Eclipse Adoptium

The mission of the Eclipse Adoptium Top-Level Project is to produce high-quality runtimes and associated technology for use within the Java ecosystem. Eclipse Adoptium also provides artifacts including open-source infrastructure as code, a comprehensive continuous integration build and test farm, and extensive quality assurance tests. These artifacts may be used by Eclipse Adoptium projects and other runtime technology builders to ensure the provision of secure, Java SE TCK-tested and compliant, production-ready runtimes.