4. Container First
Minimal footprint Java apps optimal for running in containers
Cloud Native
Embraces 12 Factor architecture in cloud environments like Kubernetes
Microservice First
Brings lightning fast startup time and code turn around Java
Why supersonic and subatomic java ?
8. DEVELOPER JOY
• Easy to start with
• Live reload with dev mode
• Java or Kotlin
• Maven or Gradle
• Runners for Junit 4 and 5
• Isolation from GraalVM CLI/API
12. TRADITIONAL APP SERVER
• JIT Compilation
• Runtime approach : hundreds of classes run only during the boot
• Later unused and occupy memory
• Ex: XML parsers, annotation lookups, management model, etc.
QUARKUS SERVER
• AoT Compilation
• Build time approach
• As much work as possible done at build time
• Build time augmentation using extensions
• Output: recorded wiring bytecode
VS
13. QUARKUS EXTENSIONS
Philosophy:
• Transform your entire app including the libraries it uses,
into an native image optimized for GraalVM
• Closed world assumption
3 Phases of Bootstrap:
• Augmentation: Produce recorded bytecode @Record(STATIC_INIT) or
@Record(RUNTIME_INIT)
• Static Init : Executed at build time in a static method on main class
• Runtime init : Executed at runtime
14. Two distinct things:
1. Graal compiler (AoT or JIT)
2. GraalVM – the polyglot VM
Supports Linux and macOS,
not windows yet
16. AoT compilation
• Static analysis
• Statically linked executable (app classes, jdk classes)
• Closed world assumption
• Dead code elimination
Enable:
• Fast process start
• Less memory
• Small size on disk
17. LIMITATIONS
« With great powers comes great cost »
• Dynamic class loading: unsupported
• JMX, JVMTI: unsupported
• Agents (jrebel, byteman, profilers): unsupported
• Java debugger: unsupported, but Native debugger (GDB) supported
• Reflection, dynamic proxies: limited
Toolkit: maven/gradle build tool, create/scaffold new project, dev mode, jar packaging, build native image
Framework: à la spring boot: web server, configuration, injections, testing, based on standards, extensions
- Augmentation: produit des @Recorded bytecode
Static init: If bytecode is recorded with @Record(STATIC_INIT) then it will be executed from a static init method on the main class.
Runtime Init: If bytecode is recorded with @Record(RUNTIME_INIT) then it is executed from the application’s main method. This code will be run on native executable boot. In general as little code as possible should be executed in this phase, and should be restricted to code that needs to open ports etc.
Custom extensions
- Universal VM 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++.
- Removes the isolation between programming languages and enables interoperability in a shared runtime.
- run either standalone or in the context of OpenJDK, Node.js or Oracle Database.
- The resulting native binary contains the whole program in machine code form for its immediate execution.
Improve the performance of JVM-based languages to match the performance of native languages.
Reduce the startup time of JVM-based applications by compiling them AOT
Enable GraalVM integration into the Oracle Database, OpenJDK, Node.js, Android/iOS, and to support similar custom embeddings.
Allow freeform mixing of code from any programming language in a single program, billed as "polyglot applications".[7][9]
Dynamic class loading: deploying jars, wars, etc. at runtime impossible
Reflection: requires registration via native-image CLI/API or @RegisterForReflection in Quarkus