Why Quarkus?
Java has always exceeded virtually all the challenges laid before by different aspects of programming over the ages, where many languages failed to do so. In the Era of cloud programming, Unlike any other challenge encountered Java is still striving to make its stand among its contenders like Node.js, python. Traditional java layered new functionalities on the existing stack, without changing the underlying stack enabling the cloud compatibility, consequently this resulted in larger memory consumption and slower startup. When it comes to cloud programming, faster runtime and less memory utilization are imperative. Quarkus tries to address this very problem. Quarkus has optimized the traditional dynamic nature for the Kubernetes immutable infrastructure.
Quarkus
Quarkus.io
A Kubernetes Native Java stack tailored for OpenJDK HotSpot and GraalVM, crafted from the best of breed Java libraries and standards.
Using Quarkus, java can be brought more effectively into cloud development. Quarkus application can produce nearly twice as many applications instances in a Java Virtual Machine as compared to other cloud-native stacks. This is by virtue of the optimized memory consumption on deployment.
Quarkus is adopted to the GraalVM. Quarkus uses the GraalVm providing an ecosystem that supports the AOT(Ahead Of Time) compilation. Ahead of time compilation is converting your code into binary machine code on the compilation itself rather than when executed making the executions faster. The normal code is converted to byte code on the compilation and this is converted to native code whenever it is executed. However, In other words, we could say that the Quarkus incites the possibilities of graalVm usable for Java. As Newton’s 3rd principle says “ For every action, there is an equal and opposite reaction ”, faster runtime causes more compile-time since we are using the AOT compilation. Quarkus uses and is based on the standards followed by RESTEasy and JAX-RS, Hibernate ORM and JPA, Netty, Eclipse Vert.x, Eclipse MicroProfile, Apache Camel making it more friendly to begin on the development. Quarkus application development provides the flexibility of choosing the underlying virtual machine with the help of GraalVM.
GraalVM
GraalVm.org
A universal virtual machine for running applications written in JavaScript, Python, Ruby, R, JVM-based languages like Java, Scala, Groovy, Kotlin, Clojure, and LLVM-based languages such as C and C++.
GraalVM removes the isolation between programming languages and enables interoperability in a shared runtime. It can run either standalone or in the context of OpenJDK, Node.js or Oracle Database.
Well, most of you will be thinking “Oh!, come on. Another new framework and new libraries”, think again. Quarkus is dynamic in nature that it offers virtual compatibility to most java libraries that exist. Quarkus is not intended to replace any stack to but offers more optimized memory consumption and rapid run times on the existing stacks as Extensions. Quarkus’ Spring API gives the freedom to code and executes like Quarkus. When combined with better extensions the Quarkus offers the best development experience for the microservices development. The most alluring feature is that Quarkus offers hot reload. You could just update the java and see the changes instantly without the hassle of compiling the whole application again and again. This hot reload is one of the products of AOT compilation as the code on compile time is updated to machine native code, Hence this could be easily reflected on the executables also.
As Title visualized, we now get a clear info on the question “why Quarkus?”. Recently launched Quarkus 1.1 is getting much popularity around the world. Here is summary of the features the quarkus could offer : –
- Function-as-a-Service (FaaS) Runtime : When compiled to a native binary, Quarkus applications can start in microseconds, making it possible to use the existing Spring and Java API knowledge with FaaS functions. ( Azure, AWS Lambda).
- Live Coding : Quarkus live coding “just works” out of the box, regardless of IDE.
- Support for reactive and imperative models : Quarkus has a reactive core that supports the traditional imperative model, reactive model, or both in the same application.
- Early detection of dependency injection errors : Quarkus catches dependency injection errors during compilation instead of at run time.
- Learning curve : As the quarkus inherits the standards as of the most java stack follows, its easy to get grip of quarkus application development.
For more detailed references:
- Follow the Getting Started Guide as a general Quarkus introduction.
- Follow the Spring DI, Spring Web, and Spring Data JPA guides.
- Create a new app using code.quarkus.io.