<?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: Danilo P. De Luca</title>
    <description>The latest articles on DEV Community by Danilo P. De Luca (@danilopdl).</description>
    <link>https://dev.to/danilopdl</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%2F1143295%2F5a8b0608-fc57-4d42-935f-4d351a532c95.jpg</url>
      <title>DEV Community: Danilo P. De Luca</title>
      <link>https://dev.to/danilopdl</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/danilopdl"/>
    <language>en</language>
    <item>
      <title>Master the Basics First: A Key Step Toward Senior Engineer</title>
      <dc:creator>Danilo P. De Luca</dc:creator>
      <pubDate>Mon, 22 Sep 2025 13:43:00 +0000</pubDate>
      <link>https://dev.to/danilopdl/master-the-basics-first-a-key-step-toward-senior-engineer-glo</link>
      <guid>https://dev.to/danilopdl/master-the-basics-first-a-key-step-toward-senior-engineer-glo</guid>
      <description>&lt;p&gt;"What should I test? What E2E test should I write?" - These were the questions that I heard from a teammate who was working on a task after a week. It reminded me of a bigger question: until when, or at what role, should you tell developers that they need to “brush their teeth”?&lt;/p&gt;

&lt;p&gt;Because there’s a difference between asking someone to do the basics and asking them to do the basics with quality.&lt;/p&gt;

&lt;h2&gt;
  
  
  Doing the Basics:
&lt;/h2&gt;

&lt;p&gt;These are the hygiene factors — the equivalent of brushing your teeth:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Write tests: unit, integration, maybe even some E2E depending on the context. At the very least, there’s a baseline every project should meet.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Monitor and observe your deploys: it’s 2025 — observability shouldn’t be optional. At a minimum, you need visibility into your system’s behavior after a change.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Deploy beyond your machine: “it works on my machine” isn’t enough. Your code should prove itself in a shared environment.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Follow the pipeline: commits build, tests run, deploy happens. No skipped steps.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Get a code review: not for perfection, but at least for another set of eyes.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are necessary, but not sufficient.&lt;/p&gt;

&lt;h2&gt;
  
  
  Doing the Basics with Quality:
&lt;/h2&gt;

&lt;p&gt;This is where the difference shows up. Instead of just asking “did you do it?”, the framing becomes “does this give us confidence?”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tests&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Not just “are there tests?” but “do these tests cover critical paths, edge cases, and failure scenarios?”&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;“If this service crashes under unexpected input, will our tests catch it?”&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Monitoring &amp;amp; Alerts&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Not just “did you add metrics?” but “are these metrics tied to user experience and business outcomes, not only system health?”&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;“Would this alert wake up the right person at 3am with enough context to act?”&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Deployments&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Not just “did you push to dev?” but “did you test this under conditions that resemble production scale and data shape?”&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;“Do we have a safe rollback plan if things go wrong?”&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Code Quality&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Not just “is it working?” but “is it readable, maintainable, and resilient against change?”&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;“Would another developer, six months from now, understand why this was written this way?”&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Documentation &amp;amp; Communication&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Not just “do we have docs?” but “would someone new to the project be able to follow the reasoning behind this decision?”&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;“Did we make tradeoffs explicit so future us won’t repeat old mistakes?”&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Reviews &amp;amp; Feedback Loops&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Not just “did someone approve?” but “did the review meaningfully improve clarity, correctness, or resilience?”&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;“Do we have feedback mechanisms in production that confirm we’re solving the right problem?”&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;From Compliance to Confidence, the real shift is this:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Basics&lt;/strong&gt; = compliance: check the box, do the thing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Quality&lt;/strong&gt; = confidence: the team trusts the change, today and tomorrow.&lt;/p&gt;

&lt;p&gt;So the next time you’re tempted to say “write better tests” or “clean up the code”, try reframing it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;“Do these tests give us enough confidence that this won’t break in production?”&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;“Would you trust this if you were the end user?”&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;“If another developer picks this up in 6 months, will they understand it?”&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That’s when the conversation shifts from brushing teeth… to actually keeping them healthy.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>seniorengineering</category>
      <category>career</category>
      <category>beginners</category>
    </item>
    <item>
      <title>SpringAI + DeepSeek: Faster Than Brewing a Coffee</title>
      <dc:creator>Danilo P. De Luca</dc:creator>
      <pubDate>Tue, 28 Jan 2025 03:30:45 +0000</pubDate>
      <link>https://dev.to/danilopdl/springai-deepseek-faster-than-brewing-a-coffee-35p1</link>
      <guid>https://dev.to/danilopdl/springai-deepseek-faster-than-brewing-a-coffee-35p1</guid>
      <description>&lt;p&gt;Over the past few days, there’s been plenty of buzz about &lt;a href="https://www.forbes.com/sites/maryroeloffs/2025/01/27/what-is-deepseek-new-chinese-ai-startup-rivals-openai-and-claims-its-far-cheaper/" rel="noopener noreferrer"&gt;DeepSeek&lt;/a&gt; and OpenAI. If you haven’t come across the news yet, no worries—this post isn’t about the headlines. But if you’re a #Java developer curious about how to use this 'new' AI, which has shown better results, lower costs, and already surpassed OpenAI in downloads and usage or if you’re looking to integrate with any AI for the first time here’s the best part: it’s faster than brewing a cup of coffee!&lt;/p&gt;

&lt;h2&gt;
  
  
  Spring AI
&lt;/h2&gt;

&lt;p&gt;First, let’s talk about SpringAI. As many of us know, the Spring Framework ecosystem is vast, and every time a new technology or concept gains traction in our field—especially one that interests the software developer and Java communities—efforts are made to integrate it with core frameworks like Spring Boot.&lt;/p&gt;

&lt;p&gt;With the rise of AI, it was no different. That’s why &lt;a href="https://github.com/spring-projects/spring-ai" rel="noopener noreferrer"&gt;SpringAI&lt;/a&gt; was created: to simplify the integration of Java applications with any AI domain or platform.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://spring.io/projects/spring-ai" rel="noopener noreferrer"&gt;Spring AI&lt;/a&gt; is an application framework for AI engineering. Its goal is to apply to the AI domain Spring ecosystem design principles such as portability and modular design and promote using POJOs as the building blocks of an application to the AI domain.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl28h1w4wg946gm6nmstz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl28h1w4wg946gm6nmstz.png" alt="Spring AI architectural illustration" width="456" height="301"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  DeepSeek
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/deepseek-ai" rel="noopener noreferrer"&gt;DeepSeek&lt;/a&gt; is a player in the game of AI Platforms, like the famous OpenAI it contains a lot of features and ways to integrate with, as well as a bunch of AI models, &lt;a href="https://www.deepseek.com/" rel="noopener noreferrer"&gt;here&lt;/a&gt; you can take a look at more features, including their &lt;a href="https://chat.deepseek.com/" rel="noopener noreferrer"&gt;chat&lt;/a&gt;, additionally its important to share that it's an open-source model.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;DeepSeek-V3 achieves a significant breakthrough in inference speed over previous models.&lt;br&gt;
It tops the leaderboard among open-source models and rivals the most advanced closed-source models globally.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Integrating SpringAI with DeepSeek
&lt;/h2&gt;

&lt;p&gt;First, you might have Java installed on your local machine. Once you have it, we will use the &lt;a href="https://start.spring.io/" rel="noopener noreferrer"&gt;Spring Start &lt;/a&gt;project to set up our brand-new project, which will integrate with DeepSeek.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to &lt;a href="https://start.spring.io/" rel="noopener noreferrer"&gt;Spring Start&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Choose your preferences, I suggest Maven + Java + Spring Boot 3.4.2 (latest) and for Project Metadata I filled as below, although you can place anything that you want, also I like jar packaging and I set up Java 21.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fof1il7chvrp3pq92bmif.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fof1il7chvrp3pq92bmif.png" alt="Project metadata filled with maven, java 21, spring boot 3.4.2, jar packaging" width="689" height="603"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Add Dependencies, for this we will need 2 dependencies:&lt;/li&gt;
&lt;li&gt;Spring Web&lt;/li&gt;
&lt;li&gt;OpenAI
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4pkd4g1l83stdldk6sls.png" alt="Adding dependencies Spring Web and OpenAI " width="729" height="278"&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After that, it's ready to generate your project. Click on 'Generate,' and a ZIP file containing the project will be downloaded. Unzip it into your favorite directory (&lt;em&gt;in my case, I just unzipped it in my chaotic Downloads directory—remember to clean up your Downloads folder regularly!&lt;/em&gt;)&lt;/p&gt;

&lt;p&gt;Open the project in your favorite IDE. I'm using IntelliJ in this example (&lt;em&gt;if you need help with that, check out the article &lt;a href="https://dev.to/danilopdl/using-java-21-on-intellij-36mm"&gt;"Using Java 21 with IntelliJ IDEA"&lt;/a&gt;&lt;/em&gt;).&lt;/p&gt;

&lt;p&gt;Once you open the project you will find the following structure and classes on it:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fczb3t9m4szptg5oik3qt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fczb3t9m4szptg5oik3qt.png" alt="Project structure after importing it into your IDE" width="800" height="415"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before we start, let's create the DeepSeek keys.&lt;/p&gt;

&lt;h2&gt;
  
  
  DeepSeek - Creating your API-Key
&lt;/h2&gt;

&lt;p&gt;When integrating with any AI Platform, we need an API-Key and with DeepSeek is the same, so the following are the steps to create it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to the &lt;a href="https://platform.deepseek.com/" rel="noopener noreferrer"&gt;DeepSeek Platform &lt;/a&gt; website, and register yourself using your preferred email.&lt;/li&gt;
&lt;li&gt;When logged, face the API Keys menu:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn78o9ofpbmrzm8mpgdr8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn78o9ofpbmrzm8mpgdr8.png" alt="DeepSeek menu options with API-Key" width="225" height="247"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create your new API Key - remember to &lt;strong&gt;keep it safe&lt;/strong&gt; as you do with your passwords and crypto-wallets, also you can delete it whenever you want.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbulrvkd7zxuuemvoeoxk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbulrvkd7zxuuemvoeoxk.png" alt="Creating your API-Key in DeepSeek" width="800" height="251"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you would like to know more about the pricing take a look at &lt;a href="https://api-docs.deepseek.com/quick_start/pricing" rel="noopener noreferrer"&gt;this documentation&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  SpringAI + DeepSeek
&lt;/h2&gt;

&lt;p&gt;Now that we have our project and the API Key, &lt;em&gt;Time to bring it to life!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;As you may know, once we add the Spring OpenAI dependency to our application (you can check your pom/gradle file for &lt;em&gt;spring-ai-openai-spring-boot-starter&lt;/em&gt;) all the setup for integrating with any AI platform is managed through environment variables. If you want to learn more, feel free to check out the&lt;a href="https://docs.spring.io/spring-ai/reference/api/chat/openai-chat.html" rel="noopener noreferrer"&gt;documentation&lt;/a&gt;. To integrate with #DeepSeek, we will need 4 environment variables:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;spring.application.name=deepseek
spring.ai.openai.api-key=${API_KEY_DEEPSEEK}
spring.ai.openai.base-url=https://api.deepseek.com
spring.ai.openai.chat.options.model=deepseek-chat
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note: the &lt;em&gt;spring.ai.openai.chat.options.model&lt;/em&gt; has two options depending on your need.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;The &lt;strong&gt;deepseek-chat&lt;/strong&gt; model has been upgraded to DeepSeek-V3. The API remains unchanged. You can invoke DeepSeek-V3 by specifying model='deepseek-chat'.&lt;br&gt;
The &lt;strong&gt;deepseek-reasoner&lt;/strong&gt; is the latest reasoning model, DeepSeek-R1, released by DeepSeek. You can invoke DeepSeek-R1 by specifying model='deepseek-reasoner'.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Once you add this variables it will be able to integrate with DeepSeek. Now lets create some piece of code to ask something for it. &lt;/p&gt;

&lt;p&gt;In your Application.java file add the following line of code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@Bean
    public CommandLineRunner runner(ChatClient.Builder builder) {
        return args -&amp;gt; {
            ChatClient chatClient = builder.build();
            String response = chatClient.prompt("Tell a brief history of Java programming language.").call().content();
            System.out.println(response);
        };
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This code will send the message &lt;em&gt;"Tell a brief history of Java programming language."&lt;/em&gt; will send it to DeepSeek and print the response, so to test it run (or use the maven/gradle plugin in IntelliJ to get it running):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;./mvnw spring-boot:run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl34vzhhnial1zjges7s2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl34vzhhnial1zjges7s2.png" alt="Spring Application log and DeepSeek integration response for the question " width="800" height="267"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There is it! Now you have one Java Application integrating with DeepSeek - _and opps you couldn't even finish brewing your coffee ☕ _&lt;/p&gt;

&lt;p&gt;What I like most about it is the fact that we can integrate with any AI platform by making only 3 to 5 lines of code changes. A big shoutout to Spring AI! And big thanks to &lt;a href="https://www.linkedin.com/in/danvega/" rel="noopener noreferrer"&gt;Dan Vega&lt;/a&gt; for sharing and contributing to Spring Ecosystem!&lt;/p&gt;

&lt;p&gt;Some references:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Wondering to know more about the differences between DeepSeek and OpenAI? &lt;a href="https://dev.to/maximsaplin/deepseek-r1-vs-openai-o1-1ijm"&gt;Deepseek R1 vs OpenAI o1&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.spring.io/spring-ai/reference/getting-started.html" rel="noopener noreferrer"&gt;Spring AI Initializer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;DeepSeek Open-Source &lt;a href="https://github.com/deepseek-ai" rel="noopener noreferrer"&gt;project&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>deepseek</category>
      <category>ai</category>
      <category>springboot</category>
      <category>java</category>
    </item>
    <item>
      <title>"The Strawberry in the Cake" - Challenges of Libraries and Dependency Management</title>
      <dc:creator>Danilo P. De Luca</dc:creator>
      <pubDate>Fri, 24 Jan 2025 17:31:23 +0000</pubDate>
      <link>https://dev.to/danilopdl/the-strawberry-in-the-cake-challenges-of-libraries-and-dependency-management-18ao</link>
      <guid>https://dev.to/danilopdl/the-strawberry-in-the-cake-challenges-of-libraries-and-dependency-management-18ao</guid>
      <description>&lt;p&gt;Imagine a beautiful cake topped with a fresh, juicy strawberry. The strawberry adds the perfect touch of sweetness, visual appeal, and flavor to the cake. It's the highlight, the centerpiece of the cake's presentation. However, there's a catch—strawberries have a much shorter shelf life than the cake itself. While the cake might stay fresh and edible for days, the strawberry begins to rot much sooner - have you ever eaten a piece of cake that the strawberry had gone rotten? Uhh, that's horrible!&lt;/p&gt;

&lt;p&gt;Now, let's connect this to software development, for this, do you remember any time that you had to update library or a dependency version and got into what we can call "Dependency Hell"? Its pretty similar to this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The Cake&lt;/strong&gt; represents your main &lt;strong&gt;application or system&lt;/strong&gt;. It's the core product, which should ideally have a long lifecycle and remain stable and maintainable.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The Strawberry&lt;/strong&gt; symbolizes a third-party &lt;strong&gt;library&lt;/strong&gt;, a &lt;strong&gt;dependency&lt;/strong&gt;, or a &lt;strong&gt;microservice&lt;/strong&gt; your application relies on. These can bring exceptional value, just like the strawberry enhances the cake - &lt;em&gt;I can remember the first time that the &lt;a href="https://projectlombok.org/" rel="noopener noreferrer"&gt;Project Lombok&lt;/a&gt; was introduced to me, back in 2016, while I was working on a #java huge application, that was fantastic! Nowadays, it might not be worth it, as much of it was introduced in the latest updates in #Java, turning the cake good enough to not need a strawberry.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;But, there is a &lt;strong&gt;problem&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Just like a &lt;strong&gt;strawberry&lt;/strong&gt; spoils faster than the cake, &lt;strong&gt;libraries&lt;/strong&gt;, and &lt;strong&gt;dependencies&lt;/strong&gt; often have shorter lifecycles than your application (&lt;em&gt;should it be easier to change a library or your entire application?&lt;/em&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If your &lt;strong&gt;application&lt;/strong&gt; (The Cake) is tightly coupled to a specific version of a &lt;strong&gt;library&lt;/strong&gt; (the strawberry), you might face significant issues when the library's lifecycle ends, for example when it has an &lt;a href="https://www.reddit.com/r/cpp/comments/lb6ki9/what_is_an_abi_and_why_is_breaking_it_bad/" rel="noopener noreferrer"&gt;ABI Breaking change&lt;/a&gt; - this is a common terminology when working with C++ in the past, today we mostly use an API Versioning, Breaking Changes, Contract Breakage, and for me, in particular, its one of the main issues when getting into the famous Dependency Hell 🔥&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Thinking about it there are different perspectives on avoiding this issue:&lt;/p&gt;

&lt;h2&gt;
  
  
  1. When Creating Your Libraries
&lt;/h2&gt;

&lt;p&gt;When you are building a library that others will rely on - your friend will use it, other teams in your company will use it, or you are creating it but don't know yet who will use it (&lt;em&gt;that happens sometimes hehe&lt;/em&gt;).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Backward Compatibility:&lt;/strong&gt; Ensure new versions of it maintain compatibility with previous versions wherever possible. This is not that easy, and sometimes we do need to release a breaking change, for this it should be carefully planned and communicated.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;-  Semantic Versioning:&lt;/strong&gt; Follow &lt;a href="https://semver.org/" rel="noopener noreferrer"&gt;semantic versioning principles&lt;/a&gt; (MAJOR.MINOR.PATCH) to help consumers understand the impact of updates. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Independent Upgradability:&lt;/strong&gt; Design your library so it can be updated independently of the system that depends on it. For example, avoid hard-coded assumptions about the consumer's environment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Share what has been done:&lt;/strong&gt; The famous CHANGELOG.md provides clear documentation and migration guides for new versions.&lt;br&gt;
&lt;strong&gt;- Focus on Security:&lt;/strong&gt; Regularly review and address security vulnerabilities in your libraries. You don't your library to be a "trojan" into other people's applications, do you?&lt;/p&gt;

&lt;h2&gt;
  
  
  2. When Using a Third-Party Library
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;- Evaluate the Community and Longevity&lt;/strong&gt;: before adopting a library, assess its community support, maintenance activity, and long-term viability.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Regular Updates&lt;/strong&gt;: Stay proactive in updating libraries to their latest stable versions. Many updates include critical bug fixes and security patches.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Monitor for Vulnerabilities:&lt;/strong&gt; Use tools like Dependabot or Seemplicity to automatically detect and report vulnerabilities in tour dependencies.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Avoid Over-Reliance:&lt;/strong&gt; Use libraries judiciously. Instead of importing an entire library for one small function, consider writing your own implementation or using lightweight alternatives (yeah! Why not coping and paste it into your project? 🤔)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Plan for Contingency:&lt;/strong&gt; Have a fallback strategy in case a library becomes deprecated or unsupported. This could involve forking the library or switching to a maintained alternative.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Abstract Dependencies:&lt;/strong&gt; I would say that this is the hardest one and at the same the most important, remembering concepts of Hexagonal Architecture, create an abstraction layer between your application and the library. This decouples your code from the library’s API, making it easier to replace or upgrade the dependency. (&lt;em&gt;A master chef knows that when placing a strawberry on a cake, it should be covered with sugar syrup. This helps delay the strawberry from rotting and also prevents it from damaging the cake&lt;/em&gt;).&lt;/p&gt;

&lt;p&gt;Note that, both of them work together, so when creating your library you might use a third-part library, then you need to be worried about it. &lt;/p&gt;

&lt;h2&gt;
  
  
  Some key takeaways from it:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Design systems that can handle library updates or replacements without significant disruption.&lt;/li&gt;
&lt;li&gt;Avoid tightly coupling your application to specific versions of dependencies.&lt;/li&gt;
&lt;li&gt;Emphasize backward compatibility when creating your own libraries to ensure they don't impose unnecessary constraints on their users.&lt;/li&gt;
&lt;li&gt;Keep in mind that even if the strawberry is appealing, it might not be worth jeopardizing the cake (&lt;em&gt;remember the to Avoid over-reliance?&lt;/em&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Don't let the "strawberry" define the lifecycle or quality of the "cake." Build systems that are resilient, adaptable, and not overly reliant on individual components. &lt;br&gt;
Do you know other situation that we could use the concept of "The Strawberry in the Cake"? Share it in the comments, I would love to hear about more examples!&lt;/p&gt;

</description>
      <category>java</category>
      <category>devchallenge</category>
      <category>dependencymanagement</category>
      <category>gradle</category>
    </item>
    <item>
      <title>Observability Challenge: Configuring Rules to Scale Your Application</title>
      <dc:creator>Danilo P. De Luca</dc:creator>
      <pubDate>Sat, 20 Jan 2024 20:36:21 +0000</pubDate>
      <link>https://dev.to/danilopdl/observability-challenge-configuring-rules-to-scale-your-application-2ei2</link>
      <guid>https://dev.to/danilopdl/observability-challenge-configuring-rules-to-scale-your-application-2ei2</guid>
      <description>&lt;p&gt;Working on a scalable architecture presents numerous challenges, especially when dealing with diverse components within the system. As the architecture expands, it becomes increasingly challenging to identify and address problems.&lt;br&gt;
Several practices can prove helpful in such situations, with Observability standing out as a key strategy.&lt;/p&gt;

&lt;p&gt;In this article, you will discover how adopting effective Observability practices can assist in configuring rules for scaling your application. By implementing these practices, you can also reduce infrastructure costs by the end of the month.&lt;/p&gt;

&lt;p&gt;Before delving deeper, let's briefly explore some Observability concepts.&lt;/p&gt;
&lt;h2&gt;
  
  
  What is Observability?
&lt;/h2&gt;

&lt;p&gt;As Cindy Sridharan once mentioned in her book &lt;a href="https://www.oreilly.com/library/view/distributed-systems-observability/9781492033431/"&gt;Distributed Systems Observability&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Observability is a spectrum of tooling and practices, with the end goal being the ability to understand the entire system’s state by looking at it from the outside.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Observability allows us to perform a range of tasks, including monitoring metrics, logging, and tracing. The primary goal is to comprehend the activities within our architecture and systems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Monitoring Metrics:&lt;/strong&gt; This involves quantitatively measuring various aspects of a system's performance. In simpler terms, it helps us understand the fundamental resources of our infrastructures, such as CPU usage, memory utilization, networking latency, and more. The focus here is on identifying trends, anomalies, and potential bottlenecks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Logging&lt;/strong&gt;: Have you ever debugged a feature and used logs to understand what's happening? That's logging! This approach entails capturing and storing data about the activities within a system, which is crucial for troubleshooting issues and bugs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tracing&lt;/strong&gt;: Tracing is about analyzing different components of your system and architecture. It provides the entire flow of a request or transaction, moving through various components and services. Tracing can offer a dependency map of the different parts of your system, aiding in the identification of performance issues or bottlenecks.&lt;/p&gt;
&lt;h2&gt;
  
  
  Configuring scalable rules for your application
&lt;/h2&gt;

&lt;p&gt;As evident, Observability emphasizes sharing metrics from our systems, enabling us to take informed actions. One of the pivotal advantages of scalable systems and architectures is leveraging metrics to establish rules for auto-scaling during periods of high usage or processing demands. Achieving this involves a systematic analysis of the data provided by observability tools.&lt;/p&gt;

&lt;p&gt;Now, let's delve into the steps for analyzing observability tools.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Finding Behavioral Patterns&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the following example, you'll observe metrics from a Java application that adhered to a single scaling rule: &lt;em&gt;maintaining an average of 60k requests within a 5-minute timeframe&lt;/em&gt;. This application operates within a Kubernetes (K8s) cluster, where each pod is allocated a maximum of 16GB memory and 4 CPU cores.&lt;/p&gt;

&lt;p&gt;In the image below, you'll find a snapshot displaying the number of pods/containers running in a Kubernetes application of our system. We are currently using &lt;a href="https://www.datadoghq.com/"&gt;Datadog&lt;/a&gt; for monitoring our architecture.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F71fnroyuuwtnk6ewf25v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F71fnroyuuwtnk6ewf25v.png" alt="Number of pods of a application" width="800" height="359"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To identify patterns and understand the application's behavior, observe the peaks in the graph. In the following image, you'll notice distinct cycles indicating common scaling patterns of the application.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3tgq2i82iv6099coalel.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3tgq2i82iv6099coalel.png" alt="Patterns when scale of the number of pods happens" width="800" height="359"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Some key observations on it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Days 12, 13, and 14 fall on the weekend (Friday, Saturday, Sunday), marked by heightened access peaks in our application (&lt;em&gt;the purple round&lt;/em&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Consistently, during lunch hours from 11 am to 1 pm every day of the week, we observe a similar pattern (&lt;em&gt;the pink round&lt;/em&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Similarly, during breakfast hours from 8 am to 10 am daily, we notice a consistent behavior (&lt;em&gt;the orange round&lt;/em&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Weekdays 09, 10, and 11 (Tuesday, Wednesday, Thursday) exhibit nearly identical usage peaks (&lt;em&gt;the green round&lt;/em&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Merge The Founded Patterns With Other Different Metrics&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The importance of this second step lies in avoiding reliance on a single metric as the sole source of truth for our analyses. Therefore, it is advisable to employ a minimum of two metrics to enhance the depth of your application analysis. In this instance, I will utilize one of the most common metrics in applications: Requests Per Minute.&lt;/p&gt;

&lt;p&gt;The image below provides a snapshot of the application's Requests Per Minute metrics for the same dates.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5nkax4q8as98brgcax6k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5nkax4q8as98brgcax6k.png" alt="Requests per Minute metrics for the same dates" width="800" height="373"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here, you'll observe a continuation of the same behavior as indicated by the colored rounds, providing further justification for the application's scaling of the pod count.&lt;/p&gt;

&lt;p&gt;The third metric to consider is the resource utilization of your application. Monitoring resource usage is essential for assessing its health and ensuring efficient resource utilization.&lt;/p&gt;

&lt;p&gt;The image below presents a snapshot of our application during the same timeframe, depicting the percentage usage of CPU and Memory resources.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm25bmehgl52drl40zldy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm25bmehgl52drl40zldy.png" alt="CPU and Memory Usage" width="800" height="157"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So... what about that? Upon closer examination, do you notice anything peculiar? Why is the application scaling pods when the resource usage is less than 20% for CPU and less than 5% for Memory?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbxp0b0x6qz8zis5co31i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbxp0b0x6qz8zis5co31i.png" alt="CPU and Memory Usage" width="317" height="89"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Finding Anomalies&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;As evident from the earlier observations, anomalies may exist in our application, given that we're scaling the number of pods despite the application's resource usage being below 20%.&lt;/p&gt;

&lt;p&gt;To address this, our first step is to comprehend the auto-scale algorithms. Kubernetes introduces the concept of HPA (Horizontal Pod Autoscale), utilizing both container metrics (CPU, memory) and external metrics (requests per second or custom metrics exposed by your application) to determine when scaling a new pod is necessary within a namespace.&lt;/p&gt;

&lt;p&gt;In the case of this application, only one metric was configured in HPA: the number of requests in the past 5 minutes. While this aligns with the application's need for high availability during peaks of throughput over HTTP requests, relying solely on this metric might not be sufficient for effective scaling.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgfgoi1ftxoolrlmk31lo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgfgoi1ftxoolrlmk31lo.png" alt="Configured metris for requests per minute" width="715" height="278"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Having identified an anomaly in our application, it's time to take corrective action! In this scenario, we are going to reconfigure the HPA for the application. The modifications we'll implement are grounded in the observed behavior and metrics gathered during the Observability process. It's crucial to recall that we identified a low usage of infrastructure resources (CPU and Memory).&lt;/p&gt;

&lt;p&gt;The adjustment involves shifting the HPA to utilize resource metrics for scaling our app. While retaining the metric for server requests in the past 5 minutes, we've decided to increase its threshold from 20,000m to 60,000m.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  metrics:
    - type: Pods
      pods:
        metric:
          name: http_server_requests_seconds_sum_rate5m
        target:
          type: AverageValue
          averageValue: "60000m"
    - type: Resource
      resource:
        name: cpu
        target:
          type: Utilization
          averageUtilization: 75
    - type: Resource
      resource:
        name: memory
        target:
          type: Utilization
          averageUtilization: 80
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After implementing any changes, it's crucial to emphasize the importance of restarting the Observability process. By doing so, you can assess whether the application's behavior has been altered and gather meaningful results from the updated configuration.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Restart The Observability Process After The Changes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the image below, you'll notice the precise moment when we deployed the changes—Wednesday at around 4 PM. On the same day, a distinct scaling pattern emerges during dinner time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2tfmyukxgdpdd5s9d2lh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2tfmyukxgdpdd5s9d2lh.png" alt="Number of Pods while deploying the HPA changes" width="800" height="363"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Notice the shift in patterns when examining the period from day 17 to day 20. In the image below, the colored rounds depict the same peaks and patterns as we observed previously.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgcioyynaeryu8e9z3fls.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgcioyynaeryu8e9z3fls.png" alt="Comparing the patterns before and after changing the HPA" width="800" height="363"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After a thorough analysis, as depicted in the previous image, we can draw the following conclusions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;During lunchtime - &lt;em&gt;indicated by the pink round&lt;/em&gt; - the number of pods decreased significantly, from an average of 49 pods between days 9 and 17 to 31 pods on day 18 and 34 pods on day 19, &lt;strong&gt;reflecting an almost 30% reduction in pods!&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;During dinnertime on weekdays - &lt;em&gt;marked by the green round&lt;/em&gt; - the number of pods decreased from an average of 75 pods on days 9 to 11 to 37 pods on days 17 and 18, &lt;strong&gt;representing almost a 40% reduction in pods!&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;During dinnertime on the weekend - &lt;em&gt;characterized by the purple round&lt;/em&gt; - the number of pods decreased from an average of 120 pods on days 12 to 14 to 82 pods on day 20, &lt;strong&gt;reflecting almost a 42% reduction in pods!&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Important Note:&lt;/strong&gt; On Day 20 (Friday) we ran an advertisement in a TV Show (Big Brother Brasil) that increased the number of access by +20% and as a strategy for it we decided to increase the minimum number of pods to 25 (it was 3 pods before).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In conclusion, Observability is indispensable for maintaining the efficiency of your scalable architecture, and it goes beyond that! Utilizing observability tools can also be instrumental in reducing infrastructure costs. In this straightforward example, we are poised to save almost 40% of the previous month's cost for this application by making a seemingly minimal adjustment: &lt;em&gt;adding only 10 lines of code&lt;/em&gt;'!&lt;/p&gt;

&lt;p&gt;Looking ahead to this same application, our next steps involve further reducing the infrastructure resources allocated to the application and fine-tuning the request per minute metric (&lt;em&gt;http_server_requests_seconds_sum_rate5m&lt;/em&gt;). This adjustment is vital as we've observed the scaling behavior without surpassing 30% of the allocated infrastructure resources.&lt;/p&gt;

&lt;p&gt;Do you have any other observability metrics or strategies for configuring an auto-scale tool? Feel free to share your insights!&lt;/p&gt;

</description>
      <category>observability</category>
      <category>aws</category>
      <category>devops</category>
      <category>cloud</category>
    </item>
    <item>
      <title>Using Java 21 with IntelliJ IDEA</title>
      <dc:creator>Danilo P. De Luca</dc:creator>
      <pubDate>Sat, 18 Nov 2023 16:55:06 +0000</pubDate>
      <link>https://dev.to/danilopdl/using-java-21-on-intellij-36mm</link>
      <guid>https://dev.to/danilopdl/using-java-21-on-intellij-36mm</guid>
      <description>&lt;p&gt;Java 21 was released last September/23 with a lot of new features, such as Virtual Threads, Structured Concurrency (preview), Record Patterns, Sequenced Collections, and many others (if you are interested you can read more on this article). However, how can you use it? Do you only need to update the JDK version of your project? What else you should do to be ready to start rocking some code?&lt;br&gt;
Following you will learn 3 steps to code with Java 21 using IntelliJ as your IDEA in Linux/Ubuntu.&lt;/p&gt;
&lt;h2&gt;
  
  
  0) Download IntelliJ.
&lt;/h2&gt;

&lt;p&gt;For that, you can follow this &lt;a href="https://www.jetbrains.com/help/idea/installation-guide.html" rel="noopener noreferrer"&gt;article&lt;/a&gt; or go to the download page.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo snap install intellij-idea-community --classic
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  1) Install locally the JDK 21
&lt;/h2&gt;

&lt;p&gt;The usage of SDKMan helps you to manage different Java versions on your machine in a simple way, even the last one.&lt;br&gt;
&lt;a href="https://sdkman.io/usage" rel="noopener noreferrer"&gt;https://sdkman.io/usage&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After installing the SDKMan, you should run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sdk list java
#choose what java 21 version you want to install, in this example I will use 21.0.1-oracle
sdk install java 21.0.1-oracle
#them you can set the previous version as the default.
sdk default java 21.0.1-oracle
#or only use that on your terminal
sdk use java 21.0.1-oracle
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you can check the Java version in your environment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;java -version
#java version "21.0.1" 2023-10-17 LTS
#Java(TM) SE Runtime Environment (build 21.0.1+12-LTS-29)
#Java HotSpot(TM) 64-Bit Server VM (build 21.0.1+12-LTS-29, #mixed mode, sharing)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2) Add the JDK to your IntelliJ Project
&lt;/h2&gt;

&lt;p&gt;This step is not that simple and requires some attention!&lt;/p&gt;

&lt;p&gt;First, you need to go from the top Menu &lt;em&gt;File-&amp;gt;Project Structure&lt;/em&gt; or use the shortcut [ctrl+alt+shit+s]&lt;/p&gt;

&lt;p&gt;Here you will find a window with your project settings, in this window you need to click on the SDK drop-down, and if everything went well with the SDKMan Installation in the previous step, your $JAVA_HOME will detect a new SDK as shown in the following image.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbw3wa4r7bfqziibqhyep.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbw3wa4r7bfqziibqhyep.png" alt="Detected SDKs based on the $JAVA_HOME config "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Choose the Java 21 version that you installed ("21.0.1-oracle"), when choosing a new SDK IntelliJ runs a "Home path validity", don't worry about that, it might take a few minutes to finish!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1plngep8q0h096oj7cpt.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1plngep8q0h096oj7cpt.png" alt="Home Path Validity after choosing Java 21 version"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To make sure that everything is correct, you can check on the same window the "&lt;em&gt;Platform Settings-&amp;gt; SDKs&lt;/em&gt;", the chosen version might be there!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdoavcg7xkmnthdam3gbj.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdoavcg7xkmnthdam3gbj.png" alt="Path to Platform Settings-&amp;gt; SDKs"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Depending on the version of your IntelliJ IDEA you will need to specify the Language Level since not all versions are compatible with the new features of Java 21.&lt;br&gt;
On the same window (Project Structure) choose "X - Experimental Features"&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F19jkp3d62kzoiktzsvq3.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F19jkp3d62kzoiktzsvq3.png" alt="Choosing Experimental Features in IntelliJ"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Trick Step) Using Experimental Features in IntelliJ
&lt;/h2&gt;

&lt;p&gt;Since we still need to use the mode of "Experimental Features, IntelliJ has a trick to make it work well: the &lt;em&gt;"--enable-preview"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;To do so, go to &lt;em&gt;Settings [ctrl+alt+s] -&amp;gt; Build, Execution, Deployment -&amp;gt; Compiler -&amp;gt; Java Compiler&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi0iut5y5k3k26fikmzqg.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi0iut5y5k3k26fikmzqg.png" alt="Java Compiler Menu to configure it"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the section "Override compiler parameters per module" include a new configuration!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8rv25ub5t9gtd63xd3ea.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8rv25ub5t9gtd63xd3ea.png" alt="Overriding compiler parameters"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The configuration might appear like this in the end:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb6hdk7vdh6ktjwjv3jkn.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb6hdk7vdh6ktjwjv3jkn.png" alt="new variable for the module"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's code!
&lt;/h2&gt;

&lt;p&gt;With everything configured, it's time to brave the new features of Java 21 release! So here are some amazing contents that might be helpful for that:&lt;/p&gt;

&lt;p&gt;For this, I would recommend the following articles:&lt;br&gt;
&lt;a href="https://dzone.com/articles/the-evolution-of-java-challenging-stereotypes-and" rel="noopener noreferrer"&gt;The Evolution of Java: Challenging Stereotypes and Embracing Modernity&lt;/a&gt; by &lt;a href="https://www.linkedin.com/in/bazlur/" rel="noopener noreferrer"&gt;Bazlur&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dzone.com/articles/exploring-java-21s-intriguing-additions-part-1" rel="noopener noreferrer"&gt;Exploring Java 21's Intriguing Additions (Part 1) &lt;/a&gt; by &lt;a href="https://www.linkedin.com/in/bazlur/" rel="noopener noreferrer"&gt;Bazlur&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=3uAms_OJ2Rs" rel="noopener noreferrer"&gt;Unlocking Performance: Exploring Java 21 Virtual Threads&lt;/a&gt; by &lt;a href="https://twitter.com/otaviojava" rel="noopener noreferrer"&gt;Otavio Santana&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=vrFEhtGj1GY" rel="noopener noreferrer"&gt;Suas maiores dúvidas sobre Java no Backend | Esquenta TDC Business&lt;/a&gt; with &lt;a href="https://twitter.com/GabrielS_Java" rel="noopener noreferrer"&gt;Gabriel Silva&lt;/a&gt; and &lt;a href="https://twitter.com/elderjava" rel="noopener noreferrer"&gt;Elder Moraes&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://blogs.oracle.com/javamagazine/post/java-21-now-available" rel="noopener noreferrer"&gt;Java 21 is here: Virtual threads, string templates, and more&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
