<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Antonio Moreno</title>
    <description>The latest articles on DEV Community by Antonio Moreno (@antmordel).</description>
    <link>https://dev.to/antmordel</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F51507%2Fbfed0e7f-e90c-4040-af94-e27f4dc22ceb.png</url>
      <title>DEV Community: Antonio Moreno</title>
      <link>https://dev.to/antmordel</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/antmordel"/>
    <language>en</language>
    <item>
      <title>Spring Native: Spring Boot but faster</title>
      <dc:creator>Antonio Moreno</dc:creator>
      <pubDate>Fri, 09 Apr 2021 12:16:43 +0000</pubDate>
      <link>https://dev.to/antmordel/spring-native-spring-boot-but-faster-4o5h</link>
      <guid>https://dev.to/antmordel/spring-native-spring-boot-but-faster-4o5h</guid>
      <description>&lt;p&gt;While you are reading these lines, there are a few hundreds of Spring Boot applications struggling to load a JVM and start.&lt;/p&gt;

&lt;p&gt;Yet others are up and running but consuming a huge amount of memory since a JVM needs to be underlying - supporting the application on top.&lt;/p&gt;

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

&lt;p&gt;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).&lt;/p&gt;

&lt;p&gt;But in March 2021, something happened in the community of Spring Boot users, and that was the release of the beta program of &lt;a href="https://spring.io/blog/2021/03/11/announcing-spring-native-beta" rel="noopener noreferrer"&gt;Spring Native&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;What it was slow and resource consuming 🚚:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fantmordel%2Fbookend%2Fmain%2Fdocs%2Fassets%2Fdocker-jvm.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fantmordel%2Fbookend%2Fmain%2Fdocs%2Fassets%2Fdocker-jvm.gif" alt="bookend-jvm"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now is... just awesome 🚀:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fantmordel%2Fbookend%2Fmain%2Fdocs%2Fassets%2Fdocker-native.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fantmordel%2Fbookend%2Fmain%2Fdocs%2Fassets%2Fdocker-native.gif" alt="bookend-jvm"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Why? Spring Boot applications can be now be compiled using GraalVM. I.e., it can be compiled to &lt;strong&gt;native code&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Image size for an example project can go from ~170MB to ~60MB&lt;/li&gt;
&lt;li&gt;RAM memory consumption can go from ~172MB to ~30MB&lt;/li&gt;
&lt;li&gt;Start-up times can go from 2 seconds to 70 milliseconds&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Seems awesome.&lt;/p&gt;

&lt;p&gt;I've written a small example that you can take a look and comment on that 🙂&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/antmordel" rel="noopener noreferrer"&gt;
        antmordel
      &lt;/a&gt; / &lt;a href="https://github.com/antmordel/bookend" rel="noopener noreferrer"&gt;
        bookend
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Spring Native Starter App. Spring Boot, just faster.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;🚀 Bookend: Spring Native Starter app&lt;/h1&gt;

&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Example Spring Boot REST application using Spring Native&lt;/li&gt;
&lt;li&gt;Spring Boot, Java 11, Lombok&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Provided a comparison between JVM image build and GraalVM image build.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Using Spring Native&lt;/strong&gt; ⏳ &lt;code&gt;0.067 seconds&lt;/code&gt;
&lt;a rel="noopener noreferrer" href="https://github.com/antmordel/bookend-doc/blob/7a20cd9fcbc9556a8500f8606ee0fb9ba3e96cdf/assets/docker-jvm.gif?raw=true"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fantmordel%2Fbookend-doc%2Fraw%2F7a20cd9fcbc9556a8500f8606ee0fb9ba3e96cdf%2Fassets%2Fdocker-jvm.gif%3Fraw%3Dtrue" width="1200" alt="Execution for Spring Native"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Using the JVM&lt;/strong&gt; ⏳ &lt;code&gt;2.112 seconds&lt;/code&gt;
&lt;a rel="noopener noreferrer" href="https://github.com/antmordel/bookend-doc/blob/7a20cd9fcbc9556a8500f8606ee0fb9ba3e96cdf/assets/docker-native.gif?raw=true"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fantmordel%2Fbookend-doc%2Fraw%2F7a20cd9fcbc9556a8500f8606ee0fb9ba3e96cdf%2Fassets%2Fdocker-native.gif%3Fraw%3Dtrue" width="1200" alt="Execution for Spring on top of the JVM"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Get started&lt;/h2&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Create the image locally&lt;/h3&gt;

&lt;/div&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;./mvnw clean spring-boot:build-image&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Running the just created local image&lt;/h3&gt;

&lt;/div&gt;
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;docker run --rm -p 8080:8080 bookend-native:0.0.1-SNAPSHOT
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;or just&lt;/p&gt;
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;docker-compose up
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/antmordel/bookend" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;p&gt;And if you are Spanish, I've explained all this in a more multimedia format:&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/DK2OpCoU6NU"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Thanks for reading. I appreciate your comments ❤️.&lt;/p&gt;

</description>
      <category>springboot</category>
      <category>spring</category>
      <category>graalvm</category>
    </item>
  </channel>
</rss>
