Quarkus

Last updated
Quarkus
Developer(s) Red Hat
Initial release20 March 2019;5 years ago (2019-03-20) [1]
Stable release
3.12.1 [2] / July 3, 2024;0 days ago (2024-07-03)
Repository Quarkus Repository
Written in Java
Platform Java
Type Application framework
License Apache License 2.0
Website quarkus.io

Quarkus [3] [4] [5] is a Java framework tailored for deployment on Kubernetes. Key technology components surrounding it are OpenJDK HotSpot and GraalVM. 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.

Contents

Version history [6]

VersionDateNotes
0.12Mar 20, 2019Initial release
1.0Nov 2019
2.0Jun 2021
3.0.1Mar 2023
3.2.6Oct 2023LTS (3.2)
2.16.12.FinalOct 17, 2023
3.2.7.FinalOct 19, 2023
3.5.0Oct 25, 2023
3.2.9.FinalNov 17, 2023
3.6.0Nov 29, 2023
3.2.10.FinalJan, 2024
3.7.1Jan, 2024
3.8.1Feb, 2024LTS (3.8)
3.10.0Apr, 2024

Quarkus offers quick 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.0 release within the open-source community in November 2019. [7]

Distributions

GraalVM Community Edition (CE) & GraalVM Enterprise Edition (EE)

GraalVM is a Java Virtual Machine for compiling and running applications written in different languages to a native machine binary. GraalVM Community Edition has varying support and licensing requirements.

Mandrel

Mandrel is a downstream distribution of GraalVM CE, supporting the same capabilities to build native executables but based on the open source OpenJDK. Mandrel aims to make GraalVM easy to consume by Quarkus applications by only including GraalVM CE components that Quarkus needs. Red Hat began commercial support for using Mandrel to build native Quarkus applications since the Quarkus 1.7 release in October 2020. [8]

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.

Live coding [9]

One of the major productivity problems that most Java developers face is traditional Java development workflow. For most web developers this will generally be:

Write CodeCompileDeployRefresh BrowserRepeat

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 CodeRefresh BrowserRepeat

This will work out of the box, with no special setup required. This works for application source files, configurations, and static resources.

NoteWhen you run mvn compile quarkus:dev Quarkus will launch in development mode. When it receives a HTTP request it will hold the request, and check to see if any application source files have been changed. If they have it will transparently compile the changed files, redeploy the application with the changed files, and then the HTTP request will continue to the redeployed application. Quarkus redeploys are much faster than a traditional app server, so for all but the largest applications this should take well under a second.

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 DevServices [10]

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. Linux users (developers) can run the database easily using a container command-line tool and a container engine. They still tend not to run production-ready databases (e.g., PostgreSQL and MariaDB) due to the high consumption of the computer's resources. Instead, they prefer to use in-memory datastores like the H2 database.

Quarkus provides the DevServices built on test containers 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

Not testing is not an option to develop robust applications in software development from monolithic application 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 functionality while continuously developing business logic. [11] [12]

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, Java Persistence API (JPA), Java Transaction API (JTA), Apache Camel, and Hibernate, just to name a few.[ citation needed ]

Quarkus is an Ahead-of-Time compilation (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. [13]

Related Research Articles

<span class="mw-page-title-main">Java (programming language)</span> Object-oriented programming language

Java is a high-level, class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible. It is a general-purpose programming language intended to let programmers write once, run anywhere (WORA), meaning that compiled Java code can run on all platforms that support Java without the need to recompile. Java applications are typically compiled to bytecode that can run on any Java virtual machine (JVM) regardless of the underlying computer architecture. Although its syntax is similar to that of C and C++, the Java language has fewer low-level facilities than either of them. The Java runtime provides dynamic capabilities that are typically not available in traditional compiled languages.

In software design, the Java Native Interface (JNI) is a foreign function interface programming framework that enables Java code running in a Java virtual machine (JVM) to call and be called by native applications and libraries written in other languages such as C, C++ and assembly.

OpenJDK is a free and open-source implementation of the Java Platform, Standard Edition. It is the result of an effort Sun Microsystems began in 2006. The implementation is licensed under the GPL-2.0-only with a linking exception. Were it not for the GPL linking exception, components that linked to the Java Class Library would be subject to the terms of the GPL license. OpenJDK is the official reference implementation of Java SE since version 7.

In software development, the programming language Java was historically considered slower than the fastest third-generation typed languages such as C and C++. In contrast to those languages, Java compiles by default to a Java Virtual Machine (JVM) with operations distinct from those of the actual computer hardware. Early JVM implementations were interpreters; they simulated the virtual operations one-by-one rather than translating them into machine code for direct hardware execution.

In computer science, ahead-of-time 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 of work needed to be performed at run time.

Eclipse OpenJ9 is a high performance, scalable, Java virtual machine (JVM) implementation that is fully compliant with the Java Virtual Machine Specification.

VisualVM is a tool that provides a visual interface for viewing detailed information about Java applications while they are running on a Java Virtual Machine (JVM). VisualVM organizes JVM data that is retrieved by the Java Development Kit (JDK) tools and presents the information in a way that allows data on multiple Java applications to be quickly viewed—both local applications and applications that are running on remote hosts. Programmers can also capture data about the JVM software and save the data to the local system, and then view the data later or share it with others. VisualVM is built on the NetBeans Platform; its architecture is modular and easy to extend with plugins.

The Java Development Kit (JDK) is a distribution of Java technology by Oracle Corporation. It implements the Java Language Specification (JLS) and the Java Virtual Machine Specification (JVMS) and provides the Standard Edition (SE) of the Java Application Programming Interface (API). It is derivative of the community driven OpenJDK which Oracle stewards. It provides software for working with Java applications. Examples of included software are the Java virtual machine, a compiler, performance monitoring tools, a debugger, and other utilities that Oracle considers useful for Java programmers.

<span class="mw-page-title-main">Google Closure Tools</span> JavaScript developer toolkit

Google Closure Tools is a set of tools to help developers build rich web applications with JavaScript. It was developed by Google for use in their web applications such as Gmail, Google Docs and Google Maps. As of 2023, the project had over 230K LOCs not counting the embedded Mozilla Rhino compiler.

<span class="mw-page-title-main">Jenkins (software)</span> Open source automation server

Jenkins is an open source automation server. It helps automate the parts of software development related to building, testing, and deploying, facilitating continuous integration, and continuous delivery. It is a server-based system that runs in servlet containers such as Apache Tomcat. It supports version control tools, including AccuRev, CVS, Subversion, Git, Mercurial, Perforce, ClearCase, and RTC, and can execute Apache Ant, Apache Maven, and sbt based projects as well as arbitrary shell scripts and Windows batch commands.

Dart is a programming language designed by Lars Bak and Kasper Lund and developed by Google. It can be used to develop web and mobile apps as well as server and desktop applications.

<span class="mw-page-title-main">Gatling (software)</span>

Gatling is a load- and performance-testing framework based on Scala, Akka and Netty. The first stable release was published on January 13, 2012. In 2015, Gatling's founder, Stéphane Landelle, created a company, dedicated to the development of the open-source project. According to Gatling Corp's official website, Gatling was downloaded more than 20,000,000 times (2024). In June 2016, Gatling officially presented Gatling FrontLine, Gatling's Enterprise Version with additional features.

<span class="mw-page-title-main">GraalVM</span> Virtual machine software

GraalVM is a Java Development Kit (JDK) written in Java. The open-source distribution of GraalVM is based on OpenJDK, and the enterprise distribution is based on Oracle JDK. As well as just-in-time (JIT) compilation, GraalVM can compile a Java application ahead of time. This allows for faster initialization, greater runtime performance, and decreased resource consumption, but the resulting executable can only run on the platform it was compiled for.

libGDX is a free and open-source game-development application framework written in the Java programming language with some C and C++ components for performance dependent code. It allows for the development of desktop and mobile games by using the same code base. It is cross-platform, supporting Windows, Linux, macOS, Android, iOS, BlackBerry and web browsers with WebGL support.

Kubernetes is an open-source container orchestration system for automating software deployment, scaling, and management. Originally designed by Google, the project is now maintained by a worldwide community of contributors, and the trademark is held by the Cloud Native Computing Foundation.

In software engineering, a microservice architecture is an architectural pattern that arranges an application as a collection of loosely coupled, fine-grained services, communicating through lightweight protocols. One of its goals is to enable teams to develop and deploy their services independently. This is achieved by reducing several dependencies in the codebase, allowing developers to evolve their services with limited restrictions, and hiding additional complexity from users. Consequently, organizations can develop software with rapid growth and scalability, as well as use off-the-shelf services more easily. Communication requirements are reduced. These benefits come with the cost of maintaining decoupling, so a microservice architecture may be suitable only if the application is too complex to manage as a monolith. Interfaces need to be designed carefully and treated as public API. One technique used is having multiple interfaces on the same service or multiple versions of the same service to avoid disrupting existing users of the code.

<span class="mw-page-title-main">WebAssembly</span> Cross-platform assembly language and bytecode designed for execution in web browsers

WebAssembly (Wasm) defines a portable binary-code format and a corresponding text format for executable programs as well as software interfaces for facilitating interactions between such programs and their host environment.

References

  1. "Quarkus Github repository, First release commit". github.com.
  2. "Quarkus Github repository, Last release commit". github.com.
  3. "LogicMonitor, Quarkus vs. Spring". logicmonitor.com. 28 January 2023.
  4. "Guide to QuarkusIO". Baeldung.
  5. "Getting started with QuarkusIO". mastertheboss.com.
  6. "Quarkus". endoflife.date. 2023-10-02. Retrieved 2023-10-05.
  7. "Quarkus Github repository, First major release". github.com.
  8. "Quarkus Github repository, Release 1.7.0.Final". github.com.
  9. "Development mode". quarkus.io.
  10. "Dev Services Overview". quarkus.io.
  11. The Road to Quarkus 2.0: Continuous Testing/
  12. Test-driven development with Quarkus
  13. "What is Quarkus?". IONOS Digitalguide. 13 January 2022. Retrieved 2022-08-22.

Bibliography