Skip to content
Tutorials Center
My learning

Topics

Lesson 1 of 36 ยท Getting Started

What Is Quarkus?

Meet Quarkus, the Kubernetes-native Java framework: what problem it solves, how it differs from Spring Boot, its main ideas and when to choose it.

Quarkus is an open-source Java framework for building web services, event-driven applications and command-line tools. Red Hat started it in 2019 with one clear goal: make Java a good fit for containers, Kubernetes and serverless platforms, where an application may start and stop many times a day and every megabyte of memory costs money.

Classic Java frameworks were designed for long-running servers. They scan your classes, read annotations, build proxies and wire everything together every time the application starts. That work takes seconds and needs a lot of memory. Quarkus moves most of it to the build, so the running application starts fast and stays small. In this lesson you will learn the main ideas, see how Quarkus compares with other frameworks and understand what you will build in the rest of this track.

The real Quarkus tooling is not available in the browser, so the lessons show real Quarkus code as read-only snippets. The runnable examples are small plain-Java stand-ins that demonstrate the idea underneath, and each one says what is real and what is imitation.

What Quarkus gives you

Four ideas behind Quarkus

Fast start Work moves from startup to build time.
Low memory Less runtime machinery, smaller heap.
Live coding Save the file, refresh the browser.
Native option Compile to a standalone executable.

Same Java, different engineering trade-offs.

1 / 2

Quarkus is not a brand-new programming model. It builds on Jakarta EE standards (CDI, JAX-RS style REST, JPA, Bean Validation) plus the open-source libraries most Java teams already use: Hibernate, Vert.x, Jackson, SmallRye, Netty. If you have used Spring Boot, you will recognise the shape: starters become extensions, application.properties stays, and a single mvn command runs everything.

The pieces that make Quarkus different are these:

  • Build-time processing. The Quarkus build analyses your code and your libraries, resolves dependency injection and configuration, and generates bytecode. At runtime very little scanning is left to do.
  • Dev mode. quarkus dev starts the app and recompiles on the next request when you change a file. There is no restart ritual.
  • Dev Services. In dev and test mode Quarkus starts a throwaway database, broker or other service in a container for you, with no configuration.
  • Unified imperative and reactive. The same application can mix blocking code and non-blocking code (Mutiny and Vert.x) on the same engine.
  • GraalVM native images. An optional build turns the app into a native executable that starts in milliseconds.

A first look at the code

This is a complete, real Quarkus REST resource. You will build it in the next lessons, so just read it now:

Java
package org.acme;

import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;

@Path("/hello")
public class GreetingResource {

    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public String hello() {
        return "Hello from Quarkus";
    }
}

There is no main method, no server setup and no XML. The annotations declare "this class answers GET /hello", and the framework does the rest. Notice the jakarta.* imports: Quarkus 3 uses the Jakarta namespace, so old javax.* imports from older tutorials will not compile.

Quarkus compared with other frameworks

Topic Quarkus Spring Boot Micronaut
Main style CDI and Jakarta REST Spring DI and MVC Own DI, compile-time
When DI is resolved Build time Mostly runtime Compile time
Dev experience Live reload, Dev UI, Dev Services DevTools, Docker Compose support Reload via plugins
Native image First-class Supported First-class
Typical use Cloud-native services Anything, huge ecosystem Cloud-native services

None of these is "the best". Spring Boot has the biggest ecosystem and the most job listings. Quarkus is attractive when container density, start time or the developer loop matter, and when your team already knows Jakarta EE. Your Java knowledge transfers in both directions: the concepts you learn here (injection, scopes, REST, repositories) exist in every framework.

Why start time matters

Think of a service that Kubernetes scales from 1 to 20 copies when traffic spikes. If each copy needs 12 seconds to start, requests wait or fail while the new pods boot. If it needs under a second, scaling is nearly invisible. The same applies to serverless functions that start on demand, and to tests: a test suite that boots the application many times is much faster when each boot is cheap.

The next stand-in shows where the startup time goes in a classic framework. It scans classes with reflection, reads annotations and builds a routing table. This is runtime work, repeated on every start:

Java Stand-in: runtime scanning (the classic approach)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with IO.readln() or a Scanner), it gets the next line from this box.

Here the scan is tiny. A real application has thousands of classes in dozens of libraries, and the classpath scan plus annotation parsing plus proxy generation are where seconds go. Now compare it with the build-time idea. A Quarkus extension performs the scan during the build and writes the result as plain code. At runtime the table already exists:

Java Stand-in: the same table, produced at build time

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with IO.readln() or a Scanner), it gets the next line from this box.

The output is identical, yet the second program does no reflection at all. That is the heart of Quarkus: same behaviour, less work at startup. It is also what makes native images possible, because GraalVM dislikes reflection it cannot see in advance. Build-Time Architecture goes deeper.

The stand-ins are teaching models, not Quarkus code. Real Quarkus uses Jandex (a class index), ArC (its CDI container) and bytecode recorders. You never write that code yourself.

What you will build in this track

You will start with a project and a first endpoint, learn dependency injection with CDI, build a JSON REST API with validation, store data with Hibernate ORM and Panache, then cover configuration, reactive code, messaging, native images, testing and deployment. The track ends with complete projects.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is the main idea that makes Quarkus start quickly?

    Quarkus analyses your code at build time and generates the wiring, so the running application has far less to do at startup. GraalVM native images are optional.
  2. 2. Which package prefix do Quarkus 3 applications use for REST and CDI annotations?

    Quarkus 3 follows Jakarta EE 10 and later, so annotations such as jakarta.ws.rs.Path and jakarta.inject.Inject replace the old javax ones.
  3. 3. What does Dev Services do?

    In dev and test mode Quarkus can start a container for a database or broker automatically, so you need no local setup.
  4. 4. Which statement is true?

    Quarkus mixes imperative and reactive styles and ships Hibernate ORM integration. It runs as a standalone application with its own embedded server.

Summary

  • Quarkus is a Java framework designed for containers, Kubernetes and serverless: fast start, low memory, great developer loop.
  • Its key technique is doing scanning, injection resolution and configuration at build time.
  • It builds on standards (CDI, Jakarta REST, JPA, Bean Validation) with jakarta.* packages.
  • Dev mode and Dev Services remove most setup friction; native images are an optional extra.
  • The runnable examples in this track are plain-Java stand-ins; real Quarkus code is shown read-only.

Next: Creating a Quarkus Project