For everyone — Traveling with a suitcase, not with a truck
Before a weekend abroad, there's no need to move the whole house: you pick what's truly necessary, and the suitcase is that much lighter. For a long time, Java applications lived the opposite way — standardized but enormous "suitcases", crammed with equipment installed as a precaution, which started slowly and consumed a lot of resources. Apache Quarkus proposes the well-packed suitcase approach: you only carry the extensions the application actually needs, and the whole thing becomes small, quick to start and economical — to the point of being turned into a standalone program able to run without the usual Java virtual machine.
Why does this matter beyond the computer scientists? Because the less an application consumes, the less it costs in energy and hosting, and the faster it reacts: very tangible benefits for all the everyday online services.
For Yokul, this is a particularly welcome brick. The non-profit explores virtual worlds where actors, behaviors and environments must respond to one another in real time; hosting these simulation bricks as small, lightweight services, ready for containers and Kubernetes, makes it possible to switch on exactly what's needed, when it's needed. True to its method of assembling open source bricks "like legos", Yokul finds its account there: Quarkus is a free platform, designed to reuse the whole existing Java ecosystem piece by piece.
The full text
Introduction
Apache Quarkus is a next-generation Java platform for microservice development. It makes it possible to create lightweight, high-performance Java applications optimized for the cloud, and is designed to work with containerization technologies and modern platforms such as Kubernetes.
Why Quarkus?
Most Java applications are built using Java EE application servers such as WildFly or Tomcat. However, these application servers are often too heavy and bulky to run in containerized or cloud environments. This can lead to performance and cost problems, since the Java virtual machine resources needed to run these application servers can be substantial.
Quarkus was designed to address these problems by offering a lightweight, fast Java platform for microservices. It uses an extension-based architecture, which lets developers pick only the features their application needs. This considerably reduces the size of the application and the resources required to run it.
Quarkus features
- High performance. Quarkus is designed to deliver high performance to microservices, through a lightweight architecture, fast startup and native compilation.
- Extensions. Quarkus offers hundreds of extensions to add features to your application: integration with a database, a messaging platform, and so on.
- Native compilation. Quarkus supports native compilation (via GraalVM), which makes it possible to build standalone executables without a Java virtual machine — hence near-instant startups and a reduced memory footprint.
- Project templates. Preconfigured project templates make getting started easier, with the extensions and features suited to the type of application targeted.
- Development mode. "Development" mode reloads code as you edit it (live reload), for a fast development cycle.
- Integration with containers and Kubernetes. Quarkus is designed to work transparently with Docker and Kubernetes, which simplifies deploying microservices on modern cloud platforms.
Using Quarkus
To get started with Quarkus, several paths exist: create a project from a
template (via the website or the quarkus command line tool), or simply add
the Quarkus dependencies to an existing Maven or Gradle project. The
application is developed in "development" mode with hot reloading, tested
with the usual tools of the Java ecosystem, then compiled into a regular JAR
or a native executable, ready to be packaged in a container and deployed on
Kubernetes.
In practice, a Quarkus microservice often boils down to a few annotated classes (REST resources exposed via JAX-RS, beans injected via CDI) and the list of extensions used — the rest of the wiring is provided by the platform at build time.
Why Quarkus for Yokul
Quarkus arrived in the project at a pivotal moment: it provides in a single framework the bricks that Yokul had until then been assembling piece by piece.
- Dependency injection, whose value the Google Guice article showed, is provided natively by Quarkus via CDI (Contexts and Dependency Injection): Google Guice was set aside in favor of this standard implementation, better integrated with native compilation.
- Integration flows, whose patterns Apache Camel showcased, are also covered: the Quarkus Camel extension makes it possible to define routes within a Quarkus application, without a separate server or Spring environment. Here too, the historical brick was replaced by its modern equivalent.
- Lightweight footprint and containers, finally, match exactly the need to host Yokul's simulation bricks (and the distributed in-memory computing platform Apache Ignite, whose place is described in the article Message queues) as small services started on demand, in containers, on Kubernetes.
In other words: Quarkus doesn't replace a brick of Yokul, it provides the framework that brings several of them together — and makes them smaller, faster and more economical in the end.
Takeaways
- Quarkus rethinks the Java platform for the cloud: extensions chosen one by one, fast startup, small memory footprint.
- Native compilation (GraalVM) makes it possible to obtain standalone executables without a Java virtual machine, ideal in containers.
- For Yokul, Quarkus offers the unified framework that replaced Guice (CDI) and Camel, and a lightweight, economical deployment for the simulation services.
See also
- Apache Camel Components
- Google Guice
- Apache Ignite — the distributed computing that Quarkus hosts
- Apache Maven — the build that remains, when the execution changes
- Message queues