HOME

TheInfoList



OR:

Quarkus is a
Java Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's List ...
framework A framework is a generic term commonly referring to an essential supporting structure which other things are built on top of. Framework may refer to: Computing * Application framework, used to implement the structure of an application for an op ...
tailored for deployment on Kubernetes. Key technology components surrounding it are OpenJDK HotSpot and
GraalVM GraalVM is a Java VM and JDK based on HotSpot/OpenJDK, implemented in Java. It supports additional programming languages and execution modes, like ahead-of-time compilation of Java applications for fast startup and low memory footprint. The fi ...
. The goal of Quarkus is to make Java a leading platform in Kubernetes and serverless environments while offering developers a unified reactive and imperative programming model to optimally address a wider range of distributed application architectures.


Version history

Quarkus also offers near-instant scale-up and high-density utilization in container orchestration platforms such as Kubernetes. Many more application instances can be run given the same hardware resources. After its initial debut, Quarkus underwent several enhancements over the next few months, culminating in a 1.0 release within the open source community in October 2019. As a new framework, Quarkus does not need to attempt to retrofit new patterns and principles into an existing codebase. Instead, it can focus on innovation.


Design pillars


Container first

From the beginning, Quarkus was designed around the container-first and Kubernetes-native philosophy, optimizing for low memory usage and fast startup times. As much processing as possible is done at build time, including taking a closed world assumption approach to building and running applications. This optimization means that, in most cases, all code that does not have an execution path at runtime isn't loaded into the JVM. In Quarkus, classes used only at application startup are invoked at build time and not loaded into the runtime JVM. Quarkus also avoids reflection as much as possible, instead favoring static class binding. These design principles reduce the size, and ultimately the memory footprint, of the application running on the JVM while also enabling Quarkus to be ''natively-native''. Quarkus' design accounted for native compilation from the onset. It was optimized for using the native image capability of GraalVM to compile JVM bytecode to a native machine binary. GraalVM aggressively removes any unreachable code found within the application's source code as well as any of its dependencies. Combined with Linux containers and Kubernetes, a Quarkus application runs as a native Linux executable, eliminating the JVM. A Quarkus native executable starts much faster and uses far less memory than a traditional JVM. Here is an example how fast Quarkus can deliver significant runtime efficiencies based on Red Hat testing: $ ./my-native-java-rest-app Quarkus started in 0.008s * Fast Startup (tens of milliseconds) allows automatic scaling up and down of microservices on containers and Kubernetes as well as FaaS on-the-spot execution * Low memory utilization helps optimize container density in microservices architecture deployments requiring multiple containers * Smaller application and container image footprint


Live coding

One of the major productivity problems that face most Java developers is traditional Java development workflow. For most web developers this will generally be: ''Write Code'' → ''Compile'' → ''Deploy'' → ''Refresh Browser'' → ''Repeat'' This can be a major drain on productivity, as the compile + redeploy cycle can often take up to a minute or more. Quarkus aims to solve this problem with its ''Live Coding'' feature. When running in development mode the workflow is simply: ''Write Code'' → ''Refresh Browser'' → ''Repeat'' This will work out of the box, with no special setup required. This works for Java file, application config, and static resources.


Interactive developer user interface (DEV UI)

Quarkus provides an interactive developer UI to showcase all added dependencies when a developer accesses the http://localhost:8080/q/dev endpoint after the Quarkus dev mode gets started via mvn quarkus:dev command-line. The developers also can update configurations then the changes will sync the application.properties file up automatically.


Zero configuration with dev services

Installing a database in a developer's local environment is not a trivial task if the database should be the same as the production version. Of course, Linux users (developers) can run the database easily using a container command-line tool (e.g., Docker) and a container engine (e.g., Docker). They still tend not to run production-ready databases (e.g.,
PostgreSQL PostgreSQL (, ), also known as Postgres, is a free and open-source relational database management system (RDBMS) emphasizing extensibility and SQL compliance. It was originally named POSTGRES, referring to its origins as a successor to the In ...
and MariaDB) due to high consumption of the resources (e.g., CPU, memory, and disk space). Instead, they prefer to use in-memory datastores like the H2 database. Quarkus provides the Dev Services built on Testcontainers to solve this problem. For example, a developer can do test applications if they work in the production database, PostgreSQL rather than H2 in-memory datastore in the application.properties file: quarkus.datasource.devservices.image-name=postgres:latest DevServices is generally enabled by default, unless there is an existing configuration present. When DevServices is enabled Quarkus will attempt to automatically configure and start a database when running in development or test mode.


Continuous testing

Testing is not an option to develop robust applications in software development from monolith to microservices. Developers probably think of external continuous integration (CI) tools that a QA team most likely has responsibility for verifying test cases. What if the developers do not need to integrate the CI tools but perform the test cases on a runtime environment where business applications are developing and running. Quarkus provides a continuous testing feature through the command-line interface as well as the DEV UI. This feature removes the developer's efforts to integrate an external CI tool and ensures the functionality while continuously developing business logic.


Built on standards

Quarkus rests on a vast ecosystem of technologies, standards, libraries, and APIs. Developers do not have to spend lots of time learning an entirely new set of APIs and technologies to take advantage of the benefits Quarkus brings to the JVM or native images. Among the specifications and technologies underlying Quarkus are Contexts & Dependency Injection ( CDI),
JAX-RS Jakarta RESTful Web Services, (JAX-RS; formerly Java API for RESTful Web Services) is a Jakarta EE API specification that provides support in creating web services according to the Representational State Transfer (REST) architectural pattern. ...
, Java Persistence API (JPA),
Java Transaction API The Jakarta Transactions (JTA; formerly Java Transaction API), one of the Jakarta EE APIs, enables distributed transactions to be done across multiple X/Open XA resources in a Java environment. JTA was a specification developed under the Java Commu ...
(JTA),
Apache Camel Apache Camel is an open source framework for message-oriented middleware with a rule-based routing and mediation engine that provides a Java object-based implementation of the Enterprise Integration Patterns using an application programming inte ...
, and
Hibernate Hibernation is a state of minimal activity and metabolic depression undergone by some animal species. Hibernation is a seasonal heterothermy characterized by low body-temperature, slow breathing and heart-rate, and low metabolic rate. It most ...
, just to name a few. Quarkus is also an
Ahead-of-Time compilation In computer science, ahead-of-time compilation (AOT compilation) is the act of compiling an (often) higher-level programming language into an (often) lower-level language before execution of a program, usually at build-time, to reduce the amount ...
(AOT) platform, optimizing code for the JVM as well as compiling to native code for improved performance. All of the underlying technologies are AOT-enabled, and Quarkus is continually incorporating new AOT-enabled technologies, standards, and libraries. All the technologies and capabilities needed for building microservices are available and optimized for Quarkus. These technologies take advantage of all the compile-time and runtime optimizations that have already been discussed. Technologies like Keycloak for authentication and authorization, or Infinispan for distributed caching, are optimized for use within Quarkus, regardless of whether they run in the HotSpot JVM or as a native image. Third-party framework and library developers can take advantage of this AOT platform to optimize them for Quarkus.


References

{{reflist, refs= github-first-release-commit {{cite web, url=https://github.com/quarkusio/quarkus/releases/tag/0.12.0, title=Quarkus Github repository, First release commit, website=github.com {{cite web, url=https://github.com/quarkusio/quarkus/releases/latest, title=Quarkus Github repository, Last release commit, website=github.com {{cite web, url=https://www.redhat.com/en/topics/cloud-native-apps/what-is-quarkus, title=Red Hat, What is Quarkus?, website=redhat.com {{cite web, url=https://developers.redhat.com/blog/2019/03/07/quarkus-next-generation-kubernetes-native-java-framework/, title=Introducing Quarkus: a next-generation Kubernetes native Java framework, website=developers.redhat.com {{cite web, url=https://www.logicmonitor.com/blog/quarkus-vs-spring, title=LogicMonitor, Quarkus vs. Spring, website=logicmonitor.com {{cite web, url=https://www.baeldung.com/quarkus-io, title=Guide to QuarkusIO, publisher=Baeldung {{cite web, url=http://www.mastertheboss.com/soa-cloud/quarkus/getting-started-with-quarkus, title=Getting started with QuarkusIO, website=mastertheboss.com


Bibliography

* Eric Deandrea, Daniel Oh, Charles Moulliard (August 2021). Quarkus for Spring Developers 1st Edition. Red Hat Developer *John Clingan, Ken Finnigan (December 2021). Kubernetes Native Microservices With Quarkus and MicroProfile 1st Edition. Manning. ISBN 9781617298653. * Tayo Koleoso (August 26, 2020)
Beginning Quarkus Framework: Build Cloud-Native Enterprise Java Applications and Microservices
1st Edition. Apress ISBN 1484260317. * Alex Soto Bueno, Jason Porter (Jul 14, 2020)
Quarkus Cookbook: : Kubernetes-Optimized Java Solutions
1st Edition. OReilly. ISBN 1492062650. * Francesco Marchioni (December 13, 2019),
Hands-On Cloud-Native Applications with Java and Quarkus: Build high performance, Kubernetes-native Java serverless applications
1st Edition. Packt. ISBN 1838821473 Java enterprise platform Web frameworks