GraalVM as pattern - work in progress

This is an attempt to describe GraalVM in pattern format. It’s motivated by this thread:


You are developing a JVM-based or (micro)service.


How do package my application for deployment?


  • Commonly used frameworks should be supported
  • Bugs should be detected as early as possible, e.g. unit tests on a developer’s laptop
  • Compilation should be quick
  • Test complexity should be minimized
  • Test execution time should be minimized
  • Resource utilization (e.g. on an edge device) should satisfy requirements
  • Cost of deployment (e.g. AWS bill) should be within budget
  • A fast startup time is important for some applications, especially serverless.


Package your application as a native image using GraalVM.

Resulting context

This approach has the following benefits:

This approach has the following drawbacks:

  • Slow compilation
  • GraalVM != JVM so application needs to be retested thoroughly
  • Support for reflection, which is heavily used by many popular Java frameworks and libraries, is problematic. the GraalVM compiler must often be manually configured with a list of programming language elements that will be accessed using reflection. There is a risk that a program that works when using the JVM compiler, will fail when compiled with GraalVM. Consequently, the native executable will need to be thoroughly tested, which increases test complexity and execution time.
  • Package the application as an executable JAR or WAR and use the JVM compiler

About is brought to you by Chris Richardson. Experienced software architect, author of POJOs in Action, the creator of the original, and the author of Microservices patterns.

Chris helps clients around the world adopt the microservice architecture through consulting engagements, and training classes and workshops.

New virtual bootcamp: Distributed data patterns in a microservice architecture

My virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!

It covers the key distributed data management patterns including Saga, API Composition, and CQRS.

It consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.

The regular price is $395/person but use coupon BNCDVUNB to sign up for $295 (valid until November 16th, 2021). There are deeper discounts for buying multiple seats.

Learn more

Signup for the newsletter

LEARN about microservices

Chris offers numerous resources for learning the microservice architecture.

Training classes

Chris teaches comprehensive workshops, training classes and bootcamps for executives, architects and developers to help your organization use microservices effectively.

Avoid the pitfalls of adopting microservices and learn essential topics, such as service decomposition and design and how to refactor a monolith to microservices.

Delivered in-person and remotely.

Get the book: Microservices Patterns

Read Chris Richardson's book:

Example microservices applications

Want to see an example? Check out Chris Richardson's example applications. See code

BUILD microservices

Ready to start using the microservice architecture?

Consulting services

Engage Chris to create a microservices adoption roadmap and help you define your microservice architecture,

The Eventuate platform

Use the platform to tackle distributed data management challenges in your microservices architecture.

Eventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.

ASSESS your architecture

Assess your application's microservice architecture and identify what needs to be improved.

Consulting services

Engage Chris to conduct an architectural assessment.

Self assessment

Alternatively, conduct a self-assessment using the Microservices Assessment Platform.

Join the microservices google group

Copyright © 2021 Chris Richardson • All rights reserved • Supported by Kong.