GraalVM as pattern - work in progress

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

Context

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

Problem

How do package my application for deployment?

Forces

  • 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.

Solution

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 Microservices.io

Microservices.io is brought to you by Chris Richardson. Experienced software architect, author of POJOs in Action, the creator of the original CloudFoundry.com, 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 WHWNKUXX to sign up for $275 (valid until January 11th). There are deeper discounts for buying multiple seats: 40% for 6 or more; and 50% for 15 or more - also valid until January 11th.

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 Eventuate.io 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 © 2020 Chris Richardson • All rights reserved • Supported by Kong.