Spring Native is a project which provides support for packaging Spring applications as native images using GraalVM, with fast startup times and optimized memory usage.

The Spring Native project provides support for packaging Spring applications as native images using GraalVM.

Compared to JVM executables, native images have faster startup times (<100 ms) and lower memory consumption. However, building a native image requires more time than a JVM-based one.

The project is still in beta but already supports most of the Spring portfolio modules, including Spring Framework, Spring Boot, Spring Security, and Spring Cloud.

Its features make it a good fit for building serverless applications with Spring Cloud Function and deploying them to a platform like Azure Functions, AWS Lambda, or Knative.

This article will guide you through the building of a Spring Boot application compiled to a native executable with Spring Native. You can find the  source code on GitHub.

Bootstrapping an Application With Spring Native

You can add Spring Native to your application when bootstrapping the project from  Spring Initializr.

Bootstrap a Spring Boot application with Spring Reactive Web and Spring Native

The generated project will contain a dependency on the Spring Native project and the Spring AOT plugin used to compile your application source code to native executable while improving compatibility and footprint.

#java #tutorial #docker #spring boot #serverless

Spring Native: Using GraalVM Native Images
1.50 GEEK