<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Salaheddine Rouchdi on Medium]]></title>
        <description><![CDATA[Stories by Salaheddine Rouchdi on Medium]]></description>
        <link>https://medium.com/@adresselorem?source=rss-8a2a6dccfdd9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ryozQGGZqjpi_2K2AEG63A.jpeg</url>
            <title>Stories by Salaheddine Rouchdi on Medium</title>
            <link>https://medium.com/@adresselorem?source=rss-8a2a6dccfdd9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 08:47:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@adresselorem/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Inside the JVM : Understading the ClassLoader Architecture]]></title>
            <link>https://medium.com/@adresselorem/inside-the-jvm-understading-the-classloader-architecture-f1825d1ec71d?source=rss-8a2a6dccfdd9------2</link>
            <guid isPermaLink="false">https://medium.com/p/f1825d1ec71d</guid>
            <category><![CDATA[classloading]]></category>
            <category><![CDATA[jvm]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[jvm-class-loader]]></category>
            <category><![CDATA[jvm-architecture]]></category>
            <dc:creator><![CDATA[Salaheddine Rouchdi]]></dc:creator>
            <pubDate>Sun, 03 Aug 2025 16:39:22 GMT</pubDate>
            <atom:updated>2025-08-03T16:42:07.700Z</atom:updated>
            <content:encoded><![CDATA[<h3>Inside the JVM : Understanding the ClassLoader Architecture</h3><p>This post is part of a series exploring the internals of the Java Virtual Machine (JVM). In this article, we’ll deep dive into one of the JVM’s key components: the <strong>ClassLoader</strong> responsible for dynamically loading classes during program execution and enabling Java’s modular and secure architecture.</p><h3>Types of Class Loaders :</h3><p>The Class Loader is the one responsible of loading the classes needed by our Java program to run, It’s one of the components that assure security and network-mobility inside our JVM.</p><p>In general we distinguish two types of Class Loaders :</p><ul><li>the <em>“primordial”</em> Class Loader which is also known as the Bootstrap Class Loader.</li><li>the Class Loader objects , these are Java Objects / instances of subclasses of java.lang.ClassLoader. that are compiled to bytecode classes like and instantiated by the JVM like any other Java object.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*t78IpklzggSUw7iBjej-vA.png" /></figure><p>The primordial class loader is part of the JVM , say for example our JVM is a C program implemented on top of the OS, well the primordial Class Loader is part of this C program. The main job of the primordial class loader is to load <strong>TRUSTED </strong>including the ones of the Java API usually from the local disk usually from a predefined path from rt.jar or modules (like java.lang.*, java.util.*, etc.)..</p><p>The Class Loader Objects however, are installed during run-time and because of that you don’t need to know the classes needed by your Java program to run during compile-time .They enable you to dynamically extend the Java application at run-time. As it runs, the Java application determine what extra classes it needs and load them through one or more class loader objects.</p><h3>Modular nature of Class Loaders :</h3><p>Now that we covered the types of Class Loaders our JVM is using it’s important to talk about an important point regarding the <em>name-spaces </em>organization<em> </em>inside a single Java application. The JVM keeps track of each class it loads wether using the Primordial Class Loader or Class Loader Objects , When a loaded class first refers to another class, the virtual machine requests the <strong>referenced</strong> class from the same class loader that originally loaded the <strong>referencing</strong> class.</p><p>if we load a volcano class through a particular class loader and this class references to another class lava by invoking a method that includes that class, it will require the same Class Loader to loaded the volcano class to load the lava class as well. The <strong>Lava</strong> class returned by the class loader is dynamically linked with class <strong>Volcano</strong>. Because the Java Virtual Machine takes this approach to loading classes, classes can by default only see other classes that were loaded by the same class loader. This is how Java’s architecture enables you tocreate multiple <em>name-spaces</em> inside a single Java application. Each class loader in your running Java program maintains its own name-space, which is populated by the names of all the classes it has loaded.</p><p>A Java application can instantiate multiple class loader objects either from the same class or from multiple classes. It can, therefore, create as many (and as many different kinds of) class loader objects as it needs. Classes loaded by different class loaders are in different name-spaces and cannot gain access to each other unless the application explicitly allows it. When you write a Java application, you can segregate classes loaded from different sources into different name-spaces. In this way, you can use Java’s class loader architecture to control any interaction between code loaded from different sources. You can prevent hostile code from gaining access to and subverting friendly code.</p><h3>Class Loading Hierarchy:</h3><p>Now that we discussed how the JVM controls each Class Loader to assure the modular nature of a Java program , I want to discuss one last part regarding the hierarchical structure followed by Class Loaders. As I mentioned earlier there is two types of Class Loaders, the second type which is the Class Loader Objects includes 3 important notable types of Class Loaders that needs to be mentioned:</p><ul><li>Extension Class Loader — &gt; Loads classes from lib/ext.dirs .</li><li>Application Class Loader — &gt; Load classes from <strong>CLASSPATH,</strong> <strong>-classpath</strong>, <strong>-cp</strong>, <strong>Manifest</strong>.</li></ul><p>As a follow up to the classpath which we define in general to let the Application Class Loader know where our application is :</p><ul><li><strong>-classpath or </strong><strong>-cp flags (used at runtime)</strong></li></ul><pre>java -cp mylibs/*:target/classes com.example.Main<br># or<br>java -classpath mylibs/*:target/classes com.example.Main</pre><ul><li><strong>CLASSPATH environment variable</strong></li></ul><p>You can set this in your OS environment:</p><pre>export CLASSPATH=/path/to/classes:/path/to/libs/*</pre><ul><li><strong>Manifest file inside a JAR</strong></li></ul><p>If you&#39;re running a JAR file with:</p><pre>java -jar my-app.jar</pre><p>then the JAR’s META-INF/MANIFEST.MF file may contain a line like:</p><pre>Class-Path: lib/a.jar lib/b.jar</pre><p>This defines additional JARs needed by the app.</p><p>During the process of loading classes each C<strong>lass Loader</strong>, tries to delegate to its <strong>parent </strong>and<strong> </strong>only loads the class itself <strong>if parent didn’t find it</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QJGsuvBk55wbN9Vu.jpg" /></figure><p>This avoids:</p><ul><li>Shadowing trusted JDK classes.</li><li>Conflicts (like defining java.lang.String in your code).</li></ul><p><strong>in JDK 9 and above</strong>, the <strong>Extension Class Loader (</strong><strong>ExtClassLoader) is removed</strong> as part of the <strong>modularization effort (Project Jigsaw)</strong>. It was replaced by the Platform Class Loader that loads platform APIs that are not part of the base module (java.base), like java.sql, java.xml, etc.</p><p><strong>Theoretical example :</strong></p><p>Let’s create two “Hello” classes with the sayHi() method, we will have a main class who tries to call the sayHi() method from the Hello classes, we will demonstrate how the application class loader performs classloading in our class path and how precedence works :</p><ol><li>Create two different Hello classes in separate packages or jars, each with a distinct sayHi() implementation :</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ksEVG4mVZ8WgW1LlHgv_Uw.png" /><figcaption>Hello class in the original package</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pEWWv_TMPLeGyaH32jOtWQ.png" /><figcaption>Hello class in the override package</figcaption></figure><p>2. Create a Main.java that calls the sayHi() method</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k-0ttCnj14cHD0aONDNacg.png" /><figcaption>Main class calling the sayHi() method</figcaption></figure><p>3. Compile and package both Hello classes into separate jars</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gZTJY4F7EZA_BypOce3qFQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/1*UuKD_OYwbyQfHpIEeNXcog.png" /><figcaption>Original Hello class compiled and packaged in a JAR file</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RH2lQxV4TWeQ_nhJ--P9Rw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/428/1*Vgpl6s49Qup_Cmm9uaHWbg.png" /><figcaption>Override Hello class compiled and packaged in a JAR file</figcaption></figure><p>4. Compile Main.java referencing one or both Hello classes</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hQJjF86dJL_uPioZTIGjgQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0PTWhioY43kiQaRTUc-80g.png" /><figcaption>Main class compiled using reference to original Hello class (we can use either ones it doesn’t matter)</figcaption></figure><p>5. Run the program with different classpath specification to see which Hello class gets loaded</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ycz7z3WBab9qj8C8fNMy7g.png" /></figure><p>5. Run the program with different classpath orders to see which Hello class gets loaded using the verbose command :</p><ul><li>the -verbose:class flag allows us to view the different class loaded in a debug kind of view.</li><li>we run the command at first specifying the override.jar as our first classpath to search from java -verbose:class -cp ./:override/override.jar:orginal/original.jar Main</li><li>-cp flag allows us to specify where our Main class is defined at in our case it’s in the “./” directory we then place a “:” to specify the order in which our class loader will look for the Hello.class file in this first scenario we specify override first then original later on .</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lw7XEdkaXeMS7PZFM1lpCg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ErU1nKX5HrB-8k2RfkF6Tg.png" /></figure><ul><li>we run the command at second time specifying the original.jar as our first classpath to search from java -verbose:class -cp ./:original/original.jar:override/override.jar Main</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gsCH6Cb7BG4Bpdr8s_dC4A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WhjyucsBslvvfIUZI1HO5w.png" /></figure><ul><li>we will try to remove the original jar file and leave the same command :<br>java -verbose:class -cp ./:original/original.jar:override/override.jar Main specifying original as first jar file to look for and see what the output will be :</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*43OyBhn0M9c8NWedCLBdCA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7LB14UN939lXzmf658I8Wg.png" /></figure><p><strong>As you can see, even though the </strong><strong>original.jar file is removed</strong>, the application class loader seamlessly falls back to the next available location in the classpath (override.jar) and loads the Hello.class from there.</p><p>This demonstrates how the class loader respects the order of the classpath entries but will continue searching down the list if it cannot find a class in the earlier entries.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f1825d1ec71d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Java 8 : Lambda expressions]]></title>
            <link>https://medium.com/@adresselorem/java-8-lambda-expressions-9b8fac5c0e6d?source=rss-8a2a6dccfdd9------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b8fac5c0e6d</guid>
            <category><![CDATA[lambda-function]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[java-functional-interface]]></category>
            <category><![CDATA[lambda-expressions]]></category>
            <category><![CDATA[java-8-feature]]></category>
            <dc:creator><![CDATA[Salaheddine Rouchdi]]></dc:creator>
            <pubDate>Fri, 27 Dec 2024 15:44:30 GMT</pubDate>
            <atom:updated>2024-12-27T15:47:08.505Z</atom:updated>
            <content:encoded><![CDATA[<h3>Java 8 : Lambda expressions</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*kcerm_Q1PttkRjcIUxgtBg.jpeg" /></figure><p>Lambda expressions are a new important feature included in Java SE 8. They provide a clear and concise way to represent one method interface (Functional interfaces) using an expression. Lambda expressions also improve the Collection libraries making it easier to iterate through, filter, and extract data from a Collection. In addition, new concurrency features improve performance in multicore environments.</p><ol><li><strong>Functional interfaces :</strong></li></ol><p>Functional interfaces represents an interface that has only one method definition previously known as Single Abstract Method type (SAM).</p><p><strong>Example :</strong> Runnable interface</p><pre>package java.lang;<br><br>/**<br> * Represents an operation that does not return a result.<br> *<br> * &lt;p&gt; This is a {@linkplain java.util.function functional interface}<br> * whose functional method is {@link #run()}.<br> *<br> * @author  Arthur van Hoff<br> * @see     java.util.concurrent.Callable<br> * @since   1.0<br> */<br>@FunctionalInterface<br>public interface Runnable {<br>    /**<br>     * Runs this operation.<br>     */<br>    void run();<br>}</pre><p>2. <strong>Anonymous inner classes :</strong></p><p>They usually provide a way for implementing classes, we usually have 3 types of anonymous inner classes :</p><pre>    /**<br>         Thread implements the runnable interface -&gt; provides an implementation for run()<br>         using anonymous inner class that extends Thread we could override this function without the need to<br>         create a new class.<br>         **/<br>   Thread t1 = new Thread(){<br>       @Override<br>       public void run(){<br>           System.out.println(&quot;Anonymous inner class extending a class.&quot;);<br>       }<br>   };<br><br>   t1.run();<br><br>        /**<br>         * An anonymous inner class can also implement an interface directly .<br>         */<br>   Runnable r = new Runnable() {<br>       @Override<br>       public void run() {<br>           System.out.println(&quot;Anonymous inner class implementing an interface&quot;);<br>       }<br>   };<br><br>   Thread t2 = new Thread(r);<br>   t2.run();<br><br>        /**<br>         * Anonymous inner class that defines inside method/constructor argument<br>         * F.e: We&#39;ll be defining the inside constructor argument of Thread which is Runnable.<br>         */<br>   Thread t3 = new Thread(new Runnable() {<br>       @Override<br>       public void run() {<br>           System.out.println(&quot;Anonymous inner class defining method/constructor argument.&quot;);<br>       }<br>   });<br><br>   t3.run();</pre><p>3. <strong>Lambda expression syntax :</strong></p><p>Lambda expression address the bulkiness of anonymous inner classes, by converting 5 lines of code into a single statement. This horizontal solution solves the “<strong>vertical problem</strong>” presented by inner classes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*s5vba8IchSJRhJ-Tsa0sAQ.png" /><figcaption>Lambda expression composition</figcaption></figure><p>4. <strong>Runnable Lambda :</strong></p><p>We’ll proceed to implement a runnable using lambda this time, the difference in lines of code is huge :</p><pre><br>  //Lambda runnable<br> Runnable r2 = () -&gt; System.out.println(&quot;Lambda expression&quot;);<br> r2.run();</pre><p>5. <strong>Comparator Lambda:</strong></p><p>We’ll do the same thing now using the Comparator interface that provides int compare(o1,o2) .</p><p>First let’s check the syntax using an anonymous inner class :</p><pre>// using anonymous inner class to provide comparator<br>List&lt;Person&gt; personList = Person.createShortList();<br>personList.sort(new Comparator&lt;Person&gt;() {<br>     @Override<br>     public int compare(Person o1, Person o2) {<br>                return Math.min(o1.getAge(), o2.getAge());<br>     }<br>});</pre><p>Now we’ll do the same thing using a lambda expression and provide two different ways to sort our list (via names and age) :</p><pre>//Lambda age comparator<br>personList.sort((Person o1,Person o2) -&gt;  Math.min(o1.getAge(),o2.getAge()));<br>//Lambda forEach w/ consumer<br>personList.forEach(person -&gt; System.out.println(&quot;name: &quot;+person.getGivenName()+&quot; age :&quot;+person.getAge()));<br>//Lambda name comparator<br>personList.sort((Person o1, Person o2)-&gt; o1.getGivenName().compareTo(o2.getGivenName()));<br>personList.forEach(person -&gt; System.out.println(&quot;name: &quot;+person.getGivenName()+&quot; age :&quot;+person.getAge()));</pre><p>Before moving further with other Java.util.function interfaces &amp; how Lambda expressions improve our code, I’m gonna be providing you with an example of Predicate paired with both anonymous inner classes and Lambda .</p><p><strong>Predicate interface :</strong></p><pre>interface Condition{<br>        boolean test(Person t);<br>}</pre><p><strong>Print method : (Takes both our list of persons alongside the Predicate)</strong></p><pre>private static void printConditionally(List&lt;Person&gt; persons , Condition condition){<br>   for(Person p : persons){<br>      if(condition.test(p)){<br>                System.out.println(p);<br>       }<br>  }<br>}</pre><p><strong>Custom printing based on Condition using anonymous inner classes :</strong></p><pre>//Create a method that prints all elements in the list<br>printConditionally(personList, new Condition() {<br>   @Override<br>   public boolean test(Person t) {<br>     return true;<br>   }<br>});<br>//Create a method that prints all people that have last name beginning with C<br>printConditionally(personList, new Condition() {<br>   @Override<br>   public boolean test(Person t) {<br>      return t.getSurName().startsWith(&quot;C&quot;);<br>   }<br>});</pre><p><strong>Using Lambda expressions :</strong></p><pre>//Prints all elements in list <br>printConditionally(personList, (Person p) -&gt; true);<br>//Prints people that have last name beginning with C<br>printConditionally(personList, (Person p) -&gt; p.getSurName().startsWith(&quot;C&quot;));</pre><p>The condition interface we defined earlier was just for learning purposes, in real scenarios our code would be looking like this :</p><pre>private static void printConditionally(List&lt;Person&gt; persons , Predicate&lt;Person&gt; condition){<br>for(Person p : persons){<br>     if(condition.test(p)){<br>       System.out.println(p);<br>    }<br>  }<br>}<br>// Anonymous inner class :<br>printConditionally(personList, new Predicate&lt;Person&gt;() {<br>   @Override<br>   public boolean test(Person t) {<br>     return t.getGivenName().startsWith(&quot;C&quot;);<br>   }<br>});<br>//Lambda expression :<br>printConditionally(personList, (Person p) -&gt; p.getGivenName().startsWith(&quot;C&quot;));</pre><p><strong>In next topics, we’ll be covering other java.util.function package alongside practices to improve our code using Lambda expressions .</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b8fac5c0e6d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cloud deployment models]]></title>
            <link>https://medium.com/@adresselorem/cloud-deployment-models-814a55c9e7cc?source=rss-8a2a6dccfdd9------2</link>
            <guid isPermaLink="false">https://medium.com/p/814a55c9e7cc</guid>
            <category><![CDATA[public-cloud]]></category>
            <category><![CDATA[private-cloud]]></category>
            <category><![CDATA[cloud-models]]></category>
            <category><![CDATA[cloud-services]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Salaheddine Rouchdi]]></dc:creator>
            <pubDate>Fri, 20 Dec 2024 20:15:30 GMT</pubDate>
            <atom:updated>2024-12-20T20:20:50.824Z</atom:updated>
            <content:encoded><![CDATA[<p>In this topic, we’ll be discussing the different deployment models that the cloud providers offer to us. The difference between each of them and their use cases.</p><p><strong>In order to understand the different cloud models first, let’s consider this situation :</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/988/1*QwxBNUwNWuLgOCaw4zXbxQ.png" /><figcaption>-</figcaption></figure><h4><strong>Bus :</strong></h4><ul><li>Whenever you wanna go to a place using a bus you pay as much as you travel, the longer the destination is the more you pay. This is exactly what happens in the <strong>public cloud</strong>, you pay for the ressources you use and how long you use it . <strong>“Pay-as-you-go” (PAYG)</strong></li></ul><h4><strong>Own car :</strong></h4><ul><li>Using a personnal car involves paying a huge amount upfront then it is all owned by you, you do not pay for hourly or monthly usage etc… That is also exactly what happens in the <strong>private cloud</strong> you are the sole owner of the property. You gain complete command over service integration, IT operations, policies, and user behavior.</li></ul><h4>Taxi :</h4><ul><li>When you want the confort of the personnal car and still don’t want to pay everything upfront, otherwise only the time you use the service for we usually go for a taxi. This is exactly the case of <strong>hybrid cloud</strong>, you may host the app in a safe environment while taking advantage of the public cloud’s cost savings</li></ul><p><strong>Now that we’re done with the definitions and concepts of each one of them let’s start diving deep in each model .</strong></p><h3>Public cloud :</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/587/1*t2hx3px4B_oLJdCSYcHbGw.png" /><figcaption>Public cloud</figcaption></figure><p>The public cloud is one in which cloud infrastructure services are provided over the internet to the general people or major industry groups. The infrastructure in this cloud model is owned by the entity (AWS, Microsoft Azure) that delivers the cloud services, not by the consumer. It is a type of cloud hosting that allows customers and users to easily access systems and services.</p><h4>Advantages of the Public Cloud Model</h4><ul><li><strong>Minimal Investment: </strong>Because it is a pay-per-use service, there is no substantial upfront fee, making it excellent for <em>enterprises that require immediate access to resources.</em></li><li><strong>No setup cost:</strong> The entire infrastructure is fully subsidized by the cloud service providers, <em>thus there is no need to set up any hardware.</em></li><li><strong>Infrastructure Management is not required: </strong>Using the public cloud <em>does not necessitate infrastructure management.</em></li><li><strong>No maintenance: </strong>The maintenance work is done by the service provider (not users).</li><li><strong>Dynamic Scalability:</strong> To fulfill your company’s needs, <em>on-demand resources are accessible.</em></li></ul><h4>Disadvantages of the Public Cloud Model</h4><ul><li><strong>Less secure: </strong>Public cloud is less secure as resources are public so there is no guarantee of high-level security.</li><li><strong>Low customization: </strong>It is accessed by many public so it can’t be customized according to personal requirements.</li></ul><h3>Private cloud :</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*aiZ1DF4XRFc7ziKh83NC4Q.png" /><figcaption>Private cloud</figcaption></figure><p>The private cloud deployment model is the exact opposite of the public cloud deployment model. It’s a one-on-one environment for a single user (customer). There is no need to share your hardware with anyone else. The cloud infrastructure is exclusively operated by a single organization.</p><p>In a <strong>private cloud</strong>, the <strong>organization</strong> using the private cloud is responsible for either:</p><ul><li><strong>Owning and operating</strong> the infrastructure themselves (on-premises private cloud).</li><li><strong>Leasing dedicated infrastructure</strong> from a third-party provider (hosted private cloud).</li></ul><h4>Advantages of the Private Cloud Model</h4><ul><li><strong>Better Control: </strong>You are the sole owner of the property. You gain complete command over service integration, IT operations, policies, and user behavior.</li><li><strong>Data Security and Privacy:</strong> It’s suitable for storing corporate information to which only authorized staff have access. By segmenting resources within the same infrastructure, improved access and security can be achieved.</li><li><strong>Supports Legacy Systems:</strong> This approach is designed to work with legacy systems that are unable to access the public cloud.</li><li><strong>Customization: </strong>Unlike a public cloud deployment, a private cloud allows a company to tailor its solution to meet its specific needs.</li></ul><h4>Disadvantages of the Private Cloud Model</h4><ul><li><strong>Less scalable: </strong>Private clouds are scaled within a certain range as there is less number of clients.</li><li><strong>Costly:</strong> Private clouds are more costly as they provide personalized facilities.</li></ul><h3>Hybrid cloud :</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*_XdF0EahrL6eeXyLJVU65Q.png" /><figcaption>Hybrid cloud</figcaption></figure><p>By bridging the public and private worlds with a layer of proprietary software, hybrid cloud computing gives the best of both worlds. With a hybrid solution, you may host the app in a safe environment while taking advantage of the public cloud’s cost savings. Organizations can move data and applications between different clouds using a combination of two or more cloud deployment methods, depending on their needs.</p><h4>Advantages of the Hybrid Cloud Model</h4><ul><li><strong>Flexibility and control: </strong>Businesses with more flexibility can design personalized solutions that meet their particular needs.</li><li><strong>Cost:</strong> Because public clouds provide scalability, you’ll only be responsible for paying for the extra capacity if you require it.</li><li><strong>Security: </strong>Because data is properly separated, the chances of data theft by attackers are considerably reduced.</li></ul><h4>Disadvantages of the Hybrid Cloud Model</h4><ul><li><strong>Difficult to manage: </strong>Hybrid clouds are difficult to manage as it is a combination of both public and private cloud. So, it is complex.</li><li><strong>Slow data transmission: </strong>Data transmission in the hybrid cloud takes place through the public cloud so latency occurs.</li></ul><h3><strong>Community Cloud :</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/1*GhaGp_X9Y3rWFgsczDxy_w.png" /><figcaption>Community cloud</figcaption></figure><p>It allows systems and services to be accessible by a group of organizations. It is a distributed system that is created by integrating the services of different clouds to address the specific needs of a community, industry, or business. The infrastructure of the community could be shared between the organization which has shared concerns or tasks.</p><h4>Advantages of the Community Cloud Model</h4><ul><li><strong>Cost Effective: </strong>It is cost-effective<strong> </strong>because the cloud is shared by multiple organizations or communities.</li><li><strong>Security:</strong> Community cloud provides better security.</li><li><strong>Shared resources: </strong>It allows you to share resources, infrastructure, etc. with multiple organizations.</li><li><strong>Collaboration and data sharing: </strong>It is suitable for both collaboration and data sharing.</li></ul><h4>Disadvantages of the Community Cloud Model</h4><ul><li><strong>Limited Scalability: </strong>Community cloud is relatively less scalable as many organizations share the same resources according to their collaborative interests.</li><li><strong>Rigid in customization: </strong>As the data and resources are shared among different organizations according to their mutual interests if an organization wants some changes according to their needs they cannot do so because it will have an impact on other organizations.</li></ul><h3>What is the Right Choice for Cloud Deployment Model?</h3><p>As of now, no such approach fits picking a cloud deployment model. We will always consider the best cloud deployment model as per our requirements. Here are some <strong>factors</strong> which should be considered before choosing the best deployment model.</p><ul><li><strong>Cost</strong>: Cost is an important factor for the cloud deployment model as it tells how much amount you want to pay for these things.</li><li><strong>Scalability</strong>: Scalability tells about the current activity status and how much we can scale it.</li><li><strong>Easy to use:</strong> It tells how much your resources are trained and how easily can you manage these models.</li><li><strong>Compliance:</strong> Compliance tells about the laws and regulations which impact the implementation of the model.</li><li><strong>Privacy:</strong> Privacy tells about what data you gather for the model.</li></ul><p>Each model has some advantages and some disadvantages, and the selection of the best is only done on the basis of your requirement. If your requirement changes, you can switch to any other model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hbDc4HBQc029ADP6zpAMLQ.png" /></figure><p><strong>P.S :</strong> It is important to know that when we talk about On-premises we should put the model of deployment in context, if we’re talking about public cloud then on-premises only means u’re the one managing everything and cloud providers are the one providing everything for you. In the case of private cloud, on-premises means you’re not only managing everything but also providing everything including compute, storage, networking … Externally hosted private cloud tho differs, the providers are the one hosting your infrastructure and it’s only dedicated to your organization .</p><p><strong>Recap on service models types :</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/978/1*BmKnSSZ9Tjyv4ELUcdn1Rg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*72w0wjPXK7JVG_d2bAl95Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZToURCop8gkXr3Qr8hMJ2g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KVN_zTf0FVWx5XzpYYv8Iw.png" /></figure><ul><li><strong><em>Sources :</em></strong></li></ul><p><a href="https://youtu.be/1BMO7YkwR6Y">https://youtu.be/1BMO7YkwR6Y</a></p><p><a href="https://www.geeksforgeeks.org/cloud-deployment-models/">https://www.geeksforgeeks.org/cloud-deployment-models/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=814a55c9e7cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IaaS vs SaaS vs PaaS]]></title>
            <link>https://medium.com/@adresselorem/iaas-vs-saas-vs-paas-13df4205ced3?source=rss-8a2a6dccfdd9------2</link>
            <guid isPermaLink="false">https://medium.com/p/13df4205ced3</guid>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[iaas-vs-paas-vs-saas]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Salaheddine Rouchdi]]></dc:creator>
            <pubDate>Fri, 20 Dec 2024 18:16:19 GMT</pubDate>
            <atom:updated>2024-12-20T18:16:19.047Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>In this topic, we’ll be discussing the main cloud services models and the difference between each of them starting by IaaS, SaaS and PaaS</blockquote><p>Let’s start by demonstrating the different layers that we need during the developement and hosting of our application :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xP-RdaGfNt0UBjmeJK-8qg.png" /></figure><p>It is also important to differenciate between the parts managing each layer, if you’re the one managing them we’re then talking about :</p><h3><strong>On-premises</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7j18E6p1KFZgQio0R20eOQ.png" /></figure><p><strong>Key characteristics :</strong> Ownership is by the cloud providers but they aren’t managing any of it . You’re the one managing everything (Infrastructure, Platform, Software)</p><h3><strong>Infrastructure as a Service (IaaS)</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ihPd4lcFNzzfe2Emo_kOWg.png" /></figure><p><strong>Key characteristics :</strong> Ownership is by the cloud providers and the infrastructure is managed by the owner as well . You’re the one managing both platform &amp; software.</p><p><strong>Use cases :</strong></p><ul><li>Migration of workloads.</li><li>Test &amp; Development.</li><li>Storage, backups and recovery.</li></ul><p><strong>Examples :</strong></p><ul><li>Microsoft Azure : System virtualization.</li><li>IBM : Blue Cloud — Open source systems(Red Hat Entreprise Linux) + applications (Websphere, DB2…)</li><li>Amazon Web Service S3 : Illimited Storage — Elastic Compute Cloud (EC2) : Server images.</li></ul><h3>Platform as a Service</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6Yx9yfk2YYuYKIM5SRJVzA.png" /></figure><p><strong>Key characteristics :</strong> Ownership is by the cloud providers and both the infrastructure &amp; platform is managed by the owner as well . You’re the one managing software.</p><p><strong>Use cases :</strong></p><ul><li>Development framework.</li><li>Analytics &amp; business intelligence.</li></ul><p><strong>Examples :</strong></p><ul><li>Force.Com (SalesForce)</li><li>Titan (Microsoft Dynamics CRM). </li><li>Google App Engine (Dynamic website)</li></ul><h3>Software as a Service</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ECpOKtMVGqeH3MVCUl66nQ.png" /></figure><p><strong>Key characteristics :</strong> Ownership is by the cloud providers and everything is managed by it. You’re not managing anything of it.</p><p><strong>Use cases :</strong></p><ul><li>Buying of-the-shell applications.</li></ul><p><strong>Examples :</strong></p><ul><li>Salesforce CRM, Microsoft Dynamics CRM on line.</li><li>Google Apps : Google documents, Agenda, OpenClassRom, Talk.</li><li>BaseCamp .</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n6HvcHUB0e_StrvA7p6gzw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=13df4205ced3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[POJO vs DAO vs Entity vs DTO]]></title>
            <link>https://medium.com/@adresselorem/pojo-vs-dao-vs-entity-vs-dto-8301269c15ad?source=rss-8a2a6dccfdd9------2</link>
            <guid isPermaLink="false">https://medium.com/p/8301269c15ad</guid>
            <category><![CDATA[java-persistence-api]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Salaheddine Rouchdi]]></dc:creator>
            <pubDate>Sun, 15 Dec 2024 01:12:40 GMT</pubDate>
            <atom:updated>2024-12-15T01:12:40.344Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>In this article we’ll be discussing the difference between these terms, how they serve similar or different purposes.</blockquote><h3>POJO :</h3><p><strong>Definition :</strong> Plain Old Java Object is a simple object with no specific restrictions or dependencies on external libraries or frameworks.</p><p><strong>Purpose :</strong></p><ul><li>Used as a container for data without behavior other than getters and setters</li><li>Represents an entity or domain object in our application.</li></ul><p><strong>Characteristics :</strong></p><ul><li>No specific annotations or framework dependencies (pure Java).</li></ul><pre>public class User {<br>    private Long id;<br>    private String name;<br>    private String email;<br><br>    // Getters and setters<br>    public Long getId() {<br>        return id;<br>    }<br>    public void setId(Long id) {<br>        this.id = id;<br>    }<br>    public String getName() {<br>        return name;<br>    }<br>    public void setName(String name) {<br>        this.name = name;<br>    }<br>}</pre><h3>DAO :</h3><p><strong>Definition :</strong> Data access object is a pattern that provides an abstract interface to interact with the database (persistence layer).</p><p><strong>Purpose :</strong></p><ul><li>Encapsulates database access logic (CRUD operations).</li><li>Separates the persistence logic from the business logic.</li></ul><p><strong>Characteristics</strong>:</p><ul><li>Methods for interacting with a specific entity (e.g., save, findById, delete).</li><li>Often implemented with technologies like <strong>JDBC</strong>, <strong>Hibernate</strong>, or <strong>JPA, MongoDB …</strong></li></ul><pre>public interface UserDAO extends JpaRepository&lt;User, Long&gt; {<br>    Optional&lt;User&gt; findByUsername(String username);<br>}</pre><p>the DAO is then typically injected in our service which separates business logic from persistence logic by using it to communicate with our database.</p><h3>Entity :</h3><p><strong>Definition : </strong>A POJO mapped to a database table, typically used with JPA or Hibernate.</p><p><strong>Purpose</strong>:</p><ul><li>Represents a row in a database table.</li><li>Provides mapping between the database structure and Java objects.</li></ul><p><strong>Characteristics</strong>:</p><ul><li>Annotated with JPA annotations like @Entity, @Table, @Id.</li><li>May include relationships (@OneToMany, @ManyToOne, etc.).</li></ul><pre>@Entity<br>@Table(name = &quot;users&quot;)<br>public class UserEntity {<br>    @Id<br>    @GeneratedValue(strategy = GenerationType.IDENTITY)<br>    private Long id;<br><br>    @Column(nullable = false)<br>    private String name;<br><br>    @Column(unique = true, nullable = false)<br>    private String email;<br><br>    // Getters and setters<br>}</pre><h3><strong>DTO :</strong></h3><p><strong>Definition :</strong> DTOs allow you to decouple your database models (entities) from the data you expose to the outside world or other layers.</p><p><strong>Purpose :</strong></p><ul><li>Transfer data between layers (e.g., Service ↔ Controller or Backend ↔ Frontend) without exposing internal structures.</li><li>Separate persistence (entity) logic from business, API, or view logic.</li><li>Avoid exposing sensitive data (e.g., passwords, internal IDs).</li><li>Combine data from multiple entities or exclude unnecessary fields.</li><li>Enforce constraints (e.g., @NotNull, @Email) on data being sent to the service layer.</li></ul><p><strong>Characteristics :</strong></p><ul><li>Does not include JPA or persistence annotations.</li><li>Excludes sensitive fields like password.</li></ul><pre>public class UserDTO {<br>    private String name;<br>    private String email;<br><br>    public UserDTO(String name, String email) {<br>        this.name = name;<br>        this.email = email;<br>    }<br><br>    // Getters only (immutable DTO)<br>    public String getName() {<br>        return name;<br>    }<br><br>    public String getEmail() {<br>        return email;<br>    }<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8301269c15ad" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Design patterns in JAVA]]></title>
            <link>https://medium.com/@adresselorem/recap-design-pattern-18370d2c9ca7?source=rss-8a2a6dccfdd9------2</link>
            <guid isPermaLink="false">https://medium.com/p/18370d2c9ca7</guid>
            <category><![CDATA[design-pattern-in-java]]></category>
            <dc:creator><![CDATA[Salaheddine Rouchdi]]></dc:creator>
            <pubDate>Wed, 11 Dec 2024 21:48:45 GMT</pubDate>
            <atom:updated>2024-12-27T15:53:43.964Z</atom:updated>
            <content:encoded><![CDATA[<h3>Design patterns :</h3><p>Each of the listed design patterns are implemented in the following github repository : <a href="https://github.com/SalahRch/Design_patterns">https://github.com/SalahRch/Design_patterns</a></p><p>Introducing design patterns in your java code can significally improve your ability to write clean code .</p><p>Design patterns are in general divided to categories :</p><ul><li>Creational Design Patterns</li><li>Structural Design Patterns</li><li>Behavioural Design Patterns</li></ul><h3>Creational Design Patterns :</h3><blockquote>Often used preferably during class initiation process and mainly focused on the process of creating an object.</blockquote><h4><strong>Factory pattern :</strong></h4><blockquote>Defines an interface for creating an object but allows subclasses to alter the type of objects that will be created. This pattern promotes flexibility and scalability in your codebase.</blockquote><p>When to use the Factory Pattern in Java :</p><ul><li>Use the Factory Design Pattern in Java when the class does not know beforehand the exact types and dependencies of the objects it needs to create also wants to encapsulates the logic of creation .</li></ul><h4>Abstract factory pattern :</h4><blockquote>The abstract factory pattern provides a way to encapsulate a group of individual factories that have a common theme without specifying their concrete classes</blockquote><p>When to Use the Abstract Factory Pattern in Java :</p><ul><li>The system should be independent of how its products are created, composed, and represented.</li><li>You need to configure the system with one of multiple families of products.</li><li>A family of related product objects must be used together, enforcing consistency.</li></ul><h4><strong>Singleton pattern : (Lazy Initialization and Eager one)</strong></h4><blockquote>Ensures a Java class only has one instance, and provide a global point of access to this singleton instance.</blockquote><p>Use the Singleton pattern when :</p><ul><li>There must be exactly one instance of a class, and it must be accessible to clients from a well-known access point.</li></ul><h4>Builder pattern :</h4><blockquote>It separates the construction process of an object from its representation then delegates it to the builder that adds each component ensuring you get different representations and combinations of the object.</blockquote><p>Use the Builder pattern when :</p><ul><li>The Builder pattern is ideal for Java applications requiring complex object creation.</li><li>The algorithm for creating a complex object should be independent of the parts that make up the object and how they’re assembled.</li></ul><h3>Structural Design Patterns :</h3><blockquote>typically deal with the relationship between the classes and objects by identifying them to simplify complex structures.</blockquote><h4>Facade pattern :</h4><blockquote>provides a unified interface to a set of interfaces in a subsystem. This Java design pattern simplifies complex system interactions.</blockquote><p>Use the Facade pattern in Java when:</p><ul><li>You want to provide a simple interface to a complex subsystem.</li><li>Subsystems are getting more complex and depend on multiple classes, but most clients only need a part of the functionality.</li></ul><h4>Bridge pattern :</h4><blockquote>is about preferring composition to inheritance. Implementation details are pushed from a hierarchy to another object with a separate hierarchy. It decouples an abstraction layer from its implementations throught an interface.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/1*FNwmq8e66NL23d4SKVbYOA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/552/1*RhM3djum2Dxy7F56vE98Sg.png" /></figure><p>Use the Bridge pattern when:</p><ul><li>You need to avoid a permanent binding between an abstraction and its implementation, such as when the implementation must be chosen or switched at runtime.</li><li>Both the abstractions and their implementations should be extendable via subclassing, allowing independent extension of each component.</li></ul><h3>Behavioral Design Patterns :</h3><blockquote>usually concerned with the interaction between the objects. It makes sure that the objects can easily communicate with each other while being loosely coupled.</blockquote><h4><strong>Iterator pattern :</strong></h4><blockquote>provides a way to access elements of an aggregate object sequentially without exposing its underlying representation. This behavioral pattern is crucial for efficient collection traversal.</blockquote><p>Use cases :</p><ul><li>To access an aggregate object’s contents without exposing its internal representation.</li><li>To support multiple traversals of aggregate objects.</li><li>To provide a uniform interface for traversing different aggregate structures</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=18370d2c9ca7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Load balancer vs Gateway]]></title>
            <link>https://medium.com/@adresselorem/load-balancer-vs-gateway-60f993c96961?source=rss-8a2a6dccfdd9------2</link>
            <guid isPermaLink="false">https://medium.com/p/60f993c96961</guid>
            <category><![CDATA[spring-cloud]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[load-balancing]]></category>
            <category><![CDATA[api-gateway]]></category>
            <category><![CDATA[microservice-architecture]]></category>
            <dc:creator><![CDATA[Salaheddine Rouchdi]]></dc:creator>
            <pubDate>Sun, 10 Nov 2024 18:26:19 GMT</pubDate>
            <atom:updated>2024-11-10T18:26:19.558Z</atom:updated>
            <content:encoded><![CDATA[<p><em>In the world of microservices and infrastructures, assuring high scalability and availability in our application is a must ! In our current topic we’ll be discussing the main differences between Load Balancer and Spring Cloud Gateway as being the catalysts of traffic distribution .</em></p><p>Load balancing is the process of distributing traffic among different instances of the same application. This distribution prevents any single instance from being a bottleneck. It can either be <strong>client-sided</strong> or <strong>server-sided </strong>but one of the most concrete implementations of a load balancer is the Spring cloud client-sided load balancer, this latter is embedding the logic of load balancing directally at the application level. It is usually paired with a <strong>discovery server</strong> for dynamic fetching of the service instances.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/1*ax-82igKtwHuWYIeeUfIrw.png" /><figcaption>Client-side Load Balancing</figcaption></figure><p>Load balancing can also occure at the <strong>Server-side</strong> of our infrastructure. Traditional load balancers like HAProxy, Nginx, and Amazon Elastic Load Balancer (ELB) operate at the network level. They distribute traffic based on IP addresses and ports.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*r-G1DG2B7Lp45qiu_HtJ_g.png" /><figcaption>Server-side Load Balancing</figcaption></figure><p>This is also the case of the load balancer included in our <strong>Spring Cloud Gateway</strong>.</p><p>APIs are a common way of communications between applications , in our case there will be a lot of services and the client has to know the hostnames of all underlying applications to invoke them. To simplify this communication, we prefer a component between client and server to manage all API requests called API Gateway. Besides ensuring the distribution of requests to the convenient endpoints the API Gateway offers :</p><ul><li><strong>Security</strong> — Authentication, authorization</li><li><strong>Routing</strong> — routing, request/response manipulation, circuit breaker</li><li><strong>Observability</strong> — metric aggregation, logging, tracing</li></ul><p><strong>Conclusion :</strong></p><p>Load balancer can either be client-sided or server-sided it is mainly responsible for forwarding request to available instances of the same microservice, in the other hand a Gateway is a single point of entry responsible for distributing API calls to the convenient endpoints.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=60f993c96961" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bootstrap.yml vs Application.yml]]></title>
            <link>https://medium.com/@adresselorem/bootstrap-yml-vs-application-yml-dd0c881c6c3f?source=rss-8a2a6dccfdd9------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd0c881c6c3f</guid>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[spring]]></category>
            <category><![CDATA[microservices]]></category>
            <dc:creator><![CDATA[Salaheddine Rouchdi]]></dc:creator>
            <pubDate>Sat, 12 Oct 2024 15:53:19 GMT</pubDate>
            <atom:updated>2024-10-14T14:02:19.383Z</atom:updated>
            <content:encoded><![CDATA[<p><em>This following topic will be demonstrating the difference between application.propreties and bootstrap.propreties and the different use cases of each one in our microservices architecture !</em></p><blockquote>Bootstrap.yml</blockquote><p><strong>Bootstrap.yml </strong>is often used for early-stage configurations settings and is usually necessary for configurations that need to be read very early in the application’s life cycle, it is loaded during the <strong>bootstrap phase </strong>of the Spring application’s context initialization which occurs before the Application.yml is processed. Specifically, the bootstrap file is loaded by a parent Spring <strong>ApplicationContext</strong>, and that parent is loaded before the one that uses the application properties or YAML files.</p><p><strong>Use cases :</strong></p><ul><li>Spring Cloud configuration.</li><li>Discovery Service configuration. (e.g Eureka).</li></ul><blockquote>Application.yml</blockquote><p><strong>Application.yml </strong>is the main configuration file used by Spring Boot, it is loaded during the application’s context startup phase which means the settings in the application.yml are available when the application is initializing.</p><p><strong>Use cases :</strong></p><ul><li>Database configuration.</li><li>Logging.</li><li>Service-specific propreties.</li><li>Env-based configuration (using Spring profiles).</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd0c881c6c3f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Microservices : The DevOps story]]></title>
            <link>https://medium.com/@adresselorem/microservices-the-devops-story-98a13d2012ce?source=rss-8a2a6dccfdd9------2</link>
            <guid isPermaLink="false">https://medium.com/p/98a13d2012ce</guid>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Salaheddine Rouchdi]]></dc:creator>
            <pubDate>Sat, 06 Jul 2024 14:00:08 GMT</pubDate>
            <atom:updated>2024-07-06T14:00:08.987Z</atom:updated>
            <content:encoded><![CDATA[<h3>Microservices : The DevOps story</h3><blockquote>While DevOps is a rich and emerging IT field, for the DevOps engineer, the design of the microservice is all about managing the service after it goes into production. Writing the code is often the easy part.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1aOc4nM9AG02sz-KvVGsrA.png" /><figcaption>A microservice goes through multiple steps in its lifecycle.</figcaption></figure><p><strong>1- Service assembly: Packaging and deploying your microservices</strong></p><p>A service needs to be packaged and installed as a single artifact with all its dependencies defined within it. These dependencies must also include a run-time engine (Embedded Tomcat engine) that hosts the microservice. The process of consistently building, packaging, and deploying is the service assembly .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1016/1*IDEeEo39jr88b1PXP79wAA.png" /><figcaption>In the service assembly step, source code is compiled and packaged with its run-time engine.</figcaption></figure><p><strong>2- Service bootstrapping: Managing configuration of your microservices</strong></p><p>Service bootstrapping occurs when the microservice first starts and needs to load its application configuration information. As any of us developers know there will be times when you will be needing to make the <strong>run-time behavior</strong> of the application <strong>configurable</strong> .Usually this involves reading your <strong>application configuration</strong> data from a property file deployed with the application or reading the data out of a data store like a relational database. Microservices often run into the same type of configuration requirements. The difference is that in a microservice application running in the cloud, you might have hundreds or even thousands of microservice instances running so it’s not really applicable to be deploying your services each time to pick up new configuration data. A bold solution would be to use an external data store but that would be overkill . We’ll talk later about how to manage your microservice application configuration data using things like a simple key-value data store in a different topic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*sbbui4pazFOKE_e-_iSP4w.png" /><figcaption>As a service starts (bootstraps), it reads its configuration from a central repository.</figcaption></figure><p><strong>3- Service registration and discovery: How clients communicate with your microservices</strong></p><p>From a microservice consumer perspective, a microservice should be location-transparent because in a cloud-based environment, servers are ephemeral. <strong><em>Ephemeral</em></strong> means that the servers that a service is hosted on usually have shorter lives than a service running in a corporate data center. Cloud-based services can be started and torn down quickly with an entirely new IP address assigned to the server on which the services are running.</p><p>A microservice instance needs to register itself with a third-party agent. This registration process is called <strong>service discovery</strong>. When a microservice instance registers with a service discovery agent, it tells the discovery agent two things: the physical IP address (or domain address of the service instance) and a logical name that an application can use to look up the service. Certain service discovery agents also require a URL sent back to the registering service, which can be used by the service discovery agent to perform health checks. The service client then communicates with the discovery agent to look up the service’s location.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U_uHKzqlG_ojf4vGpgZtxg.png" /><figcaption>A service discovery agent abstracts away the physical location of a service.</figcaption></figure><p><strong>4- Communicating a microservice’s health</strong></p><p>A service discovery agent doesn’t act only as a traffic cop that guides the client to the location of the service. In a cloud-based microservice application, you’ll often have multiple instances of a running service. Sooner or later, one of those service instances will fail. The service discovery agent monitors the health of each service instance registered with it and removes any failing service instances from its routing tables to ensure that clients aren’t sent a service instance that has failed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*XCW7lj7_gSP_L4mabU7jPQ.png" /><figcaption>The service discovery agent uses the exposed health URL to check the microservice state.</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=98a13d2012ce" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>