https://spring.io/blog/2021/03/11/announcing-spring-native-beta?utm_source=gaerae.com&utm_campaign=개발자스럽다&utm_medium=social

Today, after one year and half of work, I am pleased to announce that we’re launching the beta release of Spring Native and its availability on start.spring.io!

In practice, that means that in addition to the regular Java Virtual Machine supported by Spring since its inception, we are adding beta support for compiling Spring applications to native images with GraalVM in order to provide a new way to deploy Spring applications. Java and Kotlin are supported.

Those native Spring applications can be deployed as a standalone executable (no JVM installation required) and offer interesting characteristics including almost instant startup (typically < 100ms), instant peak performance and lower memory consumption at the cost of longer build times and fewer runtime optimizations than the JVM.

With simple mvn spring-boot:build-image or gradle bootBuildImage commands, you can generate an optimized container image that will contain a minimal OS layer and a small native executable that ships just the required bits from the JDK, Spring and the dependencies that you are using in your application. See for example below a minimal container image with a 50MB executable containing Spring Boot, Spring MVC, Jackson, Tomcat, the JDK and the application.

There is wide range of use cases where native makes could make sense for your Spring application:

Serverless with Spring Cloud Function
Cheaper and more sustainable hosting of your Spring microservices
Good fit with Kubernetes platforms like [VMware Tanzu](<https://tanzu.vmware.com/>)
Want to create optimal container images packaging your Spring applications and services

I am sure the amazing Spring community will find more, like this great tutorial from Piotr Mińkowski about how to build native microservices on Knative with Spring Boot and GraalVM.

Team work

Spring Native beta is the result of a wide collaboration across the Spring team and its portfolio of projects: Spring Framework, Spring Boot but also Spring Data, Spring Security, Spring Cloud and Spring Initializr. Check this video to watch the Spring team explaining how we built Spring Native beta and what it provides, including a demo of the brand new start.spring.io support.

The scope of our native effort is wider than Spring, since native concerns the wider JVM ecosystem, so we have been collaborating with the GraalVM team in order to improve native image compatibility and footprint. Here is a quote from Vojin Jovanovic from the GraalVM team:

“It is a great joy to collaborate with the Spring team on crafting the native JVM ecosystem: their deep technical knowledge, wrapped with sensitive touch for the community always leads to the best solutions. The latest Spring Native release, and its numerous usages in the JVM ecosystem, pave the way for the wide adoption of native compilation.”

Scope of the support

With Spring Native graduating from alpha to beta, I think it is important to clarify the scope of the support we provide.