JAX 2023: "When Is Native Java With GraalVM Worthwhile for Me?"
Summary
- For most users, native Java was not worthwhile at the time.
- In the cloud, Java was more expensive than competitors like Go.
- Native Java made Java cheaper, but we spent developer time to save operational costs.
- Native Java sometimes didn’t work, and sometimes didn’t make business sense.
- In my sample application, going from Spring Boot 2.7 to Quarkus 3 reduced the startup time from 640 ms to 10.4 ms and the initial memory allocation from 98 MB to 7.3 MB.
- In the cloud, I only recommended native Java for microservices, not for monoliths or serverless.
- In Kubernetes, we could save money by running more pods per node — if the applications weren’t CPU limited.
- Cyberattacks like Log4Shell didn’t affect native Java.
- We should use a framework with GraalVM: Spring Boot 3, Quarkus, or Micronaut.
My slides showed why I came to this conclusion.
Logistics
Conference
JAX Hybrid 2023 was a hybrid conference in Mainz, Germany, and the second-largest Java conference in Germany. It ran from May 8 through May 12, 2023.
Talk
My talk took place on May 9, 2023, at 12:00.
Abstract
Java dominates enterprise applications. But in the cloud, Java is often more expensive than competitors like JavaScript, Python, or Go. Native Java with the GraalVM AOT (Ahead-of-Time) compilation makes Java cheaper: The resulting native Java applications start much faster and use less memory. But that doesn’t work for all Java applications, makes development & operation more complicated, and is also quite new.
When is native Java worthwhile for me? Usually talks on this topic either only highlight the advantages or only the disadvantages and give “It depends” as a recommendation.
My presentation, on the other hand, examines both the advantages and disadvantages of native Java. I explain how native Java works and when you can’t use it. And I told you specifically when native Java was worth it for you — and when not.
Who Made Me the Expert?
In the spring of 2022, I was the editor of a highly popular, six-part article series about native Java on InfoQ. I had data to back up my claims. And Java experts helped me.
Unlike some other talks, which were either pro or against GraalVM Native Image, I was neutral on it. I was the Switzerland of GraalVM talks! Which was quite fitting, as my project at the time was in Switzerland! 😃 I wasn’t selling books or training courses, and I wasn’t a developer advocate. I shared my experiences and my knowledge so you could get better projects faster!
Slides
The slides were available as a PDF. They had more content and more text than my talking slides. They were just 2.5 MB:
Historical note (as of May 2023): Back then, the slides were also available in their original Keynote format (36.4 MB) — with less text, but animated and with speaker notes; that file is no longer available today.
Get Started With Native Java
My guide to getting started with native Java explained how to install the tools for Spring Boot 3 and Quarkus, how to build native executables, and went into more detail on how Java and GraalVM worked.
Additional Talk Information
Demo Application
The demo application converted images to PDFs. It was available for Spring Boot 2 & 3 and Quarkus.
Check out the demo application
The chart is from Datadog’s 2022 “The State of Serverless” report.
Java in Serverless
Here’s Holly Cummins during her Devoxx UK 2023 keynote, citing the serverless market share statistics: