Spring Native: Spring Boot but faster

While you are reading these lines, there are a few hundreds of Spring Boot applications struggling to load a JVM and start.

Yet others are running but consuming a huge amount of memory since a JVM needs to be running – supporting the application that …


This content originally appeared on DEV Community and was authored by Antonio Moreno

While you are reading these lines, there are a few hundreds of Spring Boot applications struggling to load a JVM and start.

Yet others are running but consuming a huge amount of memory since a JVM needs to be running - supporting the application that is running on top.

And adding this latency and resource consumption to a more Cloud Native world is just something that... It's NOT a match!

Some developers just abandoned the idea of using Spring Boot in a world conquered by containers. And they moved far to those battles with Golang. Others stayed with Java, but in another flavour, like Quarkus or Micronaut (i.e. GraalVM powered).

But in March 2021, something happened in the community of Spring Boot users, and that was the release of the beta program of Spring Native.

What it was slow and resource consuming ?:
bookend-jvm

Now is... just awesome ?:
bookend-jvm

Why? Spring Boot applications can be now be compiled using GraalVM. I.e., it can be compiled to native code.

  • Image size for an example project can go from ~170MB to ~60MB
  • RAM memory consumption can go from ~172MB to ~30MB
  • Start-up times can go from 2 seconds to 70 milliseconds

Seems awesome.

I've written a small example that you can take a look and comment on that ?

GitHub logo antmordel / bookend

Spring Native Starter App. Spring Boot, just faster.

? Bookend: Spring Native Starter app

  • Example Spring Boot REST application using Spring Native
  • Spring Boot, Java 11, Lombok

Provided a comparison between JVM image build and GraalVM image build.

Using Spring Native0.067 seconds Execution for Spring Native

Using the JVM2.112 seconds Execution for Spring on top of the JVM

Get started

Create the image locally

./mvnw clean spring-boot:build-image

Running the just created local image

docker run --rm -p 8080:8080 bookend-native:0.0.1-SNAPSHOT

or just

docker-compose up



And if you are Spanish, I've explained all this in a more multimedia format:

Thanks for reading. I appreciate your comments ❤️.


This content originally appeared on DEV Community and was authored by Antonio Moreno


Print Share Comment Cite Upload Translate Updates
APA

Antonio Moreno | Sciencx (2021-04-09T12:16:43+00:00) Spring Native: Spring Boot but faster. Retrieved from https://www.scien.cx/2021/04/09/spring-native-spring-boot-but-faster/

MLA
" » Spring Native: Spring Boot but faster." Antonio Moreno | Sciencx - Friday April 9, 2021, https://www.scien.cx/2021/04/09/spring-native-spring-boot-but-faster/
HARVARD
Antonio Moreno | Sciencx Friday April 9, 2021 » Spring Native: Spring Boot but faster., viewed ,<https://www.scien.cx/2021/04/09/spring-native-spring-boot-but-faster/>
VANCOUVER
Antonio Moreno | Sciencx - » Spring Native: Spring Boot but faster. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/04/09/spring-native-spring-boot-but-faster/
CHICAGO
" » Spring Native: Spring Boot but faster." Antonio Moreno | Sciencx - Accessed . https://www.scien.cx/2021/04/09/spring-native-spring-boot-but-faster/
IEEE
" » Spring Native: Spring Boot but faster." Antonio Moreno | Sciencx [Online]. Available: https://www.scien.cx/2021/04/09/spring-native-spring-boot-but-faster/. [Accessed: ]
rf:citation
» Spring Native: Spring Boot but faster | Antonio Moreno | Sciencx | https://www.scien.cx/2021/04/09/spring-native-spring-boot-but-faster/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.