Quarkus – Supersonic Subatomic Java
Quarkus is an open source project released under an Apache License and co-developed by Red Hat. It is a Kubernetes-native Java framework, also known as “supersonic subatomic Java,” that allows developers to build Java applications that are meant to run in, and are optimized for, these type of environments.
Most Java applications that run inside a container functionally don’t change after they’ve been started. Therefore, a lot of the heavy lifting to resolve all the dynamics taking place at runtime could be moved to the build phase. This results in a clean and fully optimized JAR file, where mainly direct invocations are used. Combine this with an optimized JVM like OpenJ9, and you can already benefit from faster startup times and a lower memory footprint. This is the JVM option that Quarkus offers. The other option is the native one.
Quarkus follows a “container first” philosophy and therefore supports native compilation optimized specifically for containers, but this is entirely optional. GraalVM is used for this, which can run native Java executables. This starts much faster and also require significantly less memory than a conventional JVM. This makes Quarkus a great fit for serverless, cloud, and Kubernetes platforms.
Quarkus is designed to work with popular Java standards, frameworks, and libraries like Eclipse MicroProfile and Spring, as well as Apache Kafka, RESTEasy (JAX-RS), Hibernate ORM (JPA), Infinispan, Camel, and many more.
Quarkus’ dependency injection solution is based on CDI (contexts and dependency injection) and includes an extension framework to expand functionality and to configure, boot, and integrate a framework into your application. Adding an extension is as easy as adding a dependency, or you can use Quarkus tooling.
Here are the details given in the below image for an REST (jvm/native) based application with memory consumption and performance :
Built with an eye to enjoyability for developers, Quarkus also includes the following capabilities:
- Live coding so that developers can immediately check the effect of code changes and quickly troubleshoot them
- Unified imperative and reactive programming with an embedded managed event bus
- Unified configuration
- Easy native executable generation
Quarkus is designed to seamlessly combine the familiar imperative style code and the non-blocking, reactive style when developing applications.
This is helpful for both Java developers who are used to working with the imperative model and don’t want to switch things up, and those working with a cloud-native/reactive approach.
The Quarkus development model can adapt itself to whatever app you’re developing.
Quarkus is an effective solution for running Java in this new world of serverless architecture, microservices, containers, Kubernetes, function-as-a-service (FaaS), and cloud because it was created with all these things in mind.
Spring Boot Vs Quarkus comparison
We can easily convert a spring boot application to Quarkus application and quarkus also has the excellent support for creating native images.
Here is the performance chart for the SpringBoot and Quarkus, with jvm and native images .
We see that our jvm/native Quarkus app launches faster than Spring Boot jvm and native mode. With native images the application is almost 10x faster than a normal jvm application. But nothing in this world comes without sacrifice. So the only drawback of creating native java executables is that it consumes a lot of time to build an image and thats the only pain!!
I hope you liked this article , the main purpose of this article is to give the reader quick and precise glimpse of Quarkus framework and it’s benefits.