<?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 Gilberto Machado on Medium]]></title>
        <description><![CDATA[Stories by Gilberto Machado on Medium]]></description>
        <link>https://medium.com/@gilbertomrf01?source=rss-3a095b559136------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*rTuYUOG0DKysLJWbwmW86w.jpeg</url>
            <title>Stories by Gilberto Machado on Medium</title>
            <link>https://medium.com/@gilbertomrf01?source=rss-3a095b559136------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 05:05:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gilbertomrf01/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[Load Balance: Stateless vs Stateful]]></title>
            <link>https://medium.com/@gilbertomrf01/load-balance-stateless-vs-stateful-372d4db80444?source=rss-3a095b559136------2</link>
            <guid isPermaLink="false">https://medium.com/p/372d4db80444</guid>
            <category><![CDATA[system-design-concepts]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[load-balancing]]></category>
            <category><![CDATA[load-balancer]]></category>
            <dc:creator><![CDATA[Gilberto Machado]]></dc:creator>
            <pubDate>Mon, 17 Jul 2023 01:13:15 GMT</pubDate>
            <atom:updated>2023-07-17T01:13:15.208Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KKKDRZMLg-KZgfS6" /><figcaption>Photo by <a href="https://unsplash.com/@jareddrice?utm_source=medium&amp;utm_medium=referral">Jared Rice</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>This is the fourth article about Load Balance that I write, all the others you can see in the end of this story if you are interested in.</p><p>The Stateless and Stateful load balance are two distinct methods for distributing traffic among multiple servers or resources. They work as the names suggest, by keep the state or not, let’s check it out.</p><h3>Stateless Load Balancing</h3><p>This is a type of load balance where the load balance does not maintain any information about the client’s session or connection state. This means that the load balancer makes routing decisions based solely on the incoming request data, such as the client’s IP address, request URL, or other headers.</p><p>Stateless load balancing is a simpler and more efficient method of load balancing than stateful load balance due to the stateless load balancer doesn’t need to maintain any state information, does not need store session information. As a result, stateless load balancer can typically process requests more quickly than stateful load balancer. Also, can distribute the incoming requests more efficiently because doesn’t need consideration in the client’s history or past interactions with the server.</p><h4>The Benefits</h4><p>Some benefits we can mention in stateless load balancer are:</p><ul><li><em>Simpler and more efficient.</em></li><li><em>More reliable.</em></li><li><em>Less Overhead.</em></li><li><em>Faster processing of requests.</em></li><li><em>Easier to scale</em>.</li></ul><h4>The drawbacks</h4><ul><li>Not suitable for applications that require session state.</li><li>Can be more difficult to configure.</li><li>Not as secure as stateful load balance.</li></ul><h4>Usages</h4><p>Overall, stateless load balancing is a good choice for applications that do not require session state. It is a simpler and more efficient method of load balancing that can provide better performance and reliability. It can be used for:</p><ul><li>Static content delivery.</li><li>API calls.</li><li>DNS resolution.</li><li>Image and video streaming.</li><li>Email delivery.</li></ul><h3>Stateful Load Balancing</h3><p>The opposite for what we see before, the stateful load balancing is a type of load balancer that maintains the state of the client’s connection, its preservers the session information between the requests made by the client. This means that the load balancer can track the state of a session across different servers, even if the client’s IP address changes. The load balance assigns a client to a specific server and ensures that all subsequent requests from the same client are directed to that server.</p><p>Stateful load balancing can be implemented in two forms:</p><p><strong>Sticky session</strong>: The stateful load balancer can assign a client to a specific server based on the client’s Ip address. The load balance maintains a table of session IDs and the corresponding server that is handling the session, so every time the client makes a request, the load balancer looks up the session ID in the table and sends the request to the corresponding server.</p><p><strong>Session replication</strong>: The load balancer replicates the session state to all the servers in the pool. This means that all the servers in the pool have the same state information, so they can all handle the requests from the client for the same session.</p><h4>The benefits</h4><ul><li>Maintains the state of sessions across different servers.</li><li>Can provide a better user experience for applications that require session state.</li></ul><h4>The drawbacks</h4><ul><li>More complex and has more overhead than stateless load balancing.</li><li>Difficult to configure.</li></ul><h4>Usages</h4><p>Overall, stateful load balancing is a good choice for applications that require session state. It can offer a better user experience and improve the performance of the application. It can be used for:</p><ul><li>Shopping carts .</li><li>User logins.</li><li>Real-time chat.</li><li>Online gaming.</li></ul><p>Which should I choose?</p><p>The decision of whether to use stateless or stateful load balancing depends on the specific requirements of the application or service. If the application does not require session state, then stateless load balancing is a good choice. It is simpler, more efficient, and more secure.</p><p>However, if the application does require session state, then stateful load balancing is a better choice. It can provide a better user experience and improve the performance of the application.</p><p>I ask Google Bard to generate a table with the differences:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*aErzF4FBdS3Vzj4L24kGRA.png" /></figure><p>I hope you enjoy this article, and if you like, I have a few more articles about Load Balance, if you are interested in it.</p><ul><li><a href="https://medium.com/@gilbertomrf01/load-balance-4a68e7533b1a">Load Balance</a></li><li><a href="https://medium.com/@gilbertomrf01/load-balance-algorithms-3bc4c28d274d">Load Balance Algorithms</a></li><li><a href="https://medium.com/@gilbertomrf01/load-balance-types-faa1c53acdba">Load Balance Types</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=372d4db80444" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Load Balance Types]]></title>
            <link>https://medium.com/@gilbertomrf01/load-balance-types-faa1c53acdba?source=rss-3a095b559136------2</link>
            <guid isPermaLink="false">https://medium.com/p/faa1c53acdba</guid>
            <category><![CDATA[load-balancer]]></category>
            <category><![CDATA[load-balancing]]></category>
            <category><![CDATA[system-design-concepts]]></category>
            <category><![CDATA[application-load-balancer]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Gilberto Machado]]></dc:creator>
            <pubDate>Tue, 04 Jul 2023 20:37:16 GMT</pubDate>
            <atom:updated>2023-07-04T20:37:16.039Z</atom:updated>
            <content:encoded><![CDATA[<p>Load balancing is a crucial aspect of modern computing systems that helps distribute incoming network traffic efficiently among multiple servers or resources.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7qkToYTNdaiUZXfX" /></figure><p>This article continues of a series of articles about Load Balance and you can find the articles here:</p><p><a href="https://medium.com/@gilbertomrf01/load-balance-4a68e7533b1a">Load Balance</a></p><p>and here:</p><p><a href="https://medium.com/@gilbertomrf01/load-balance-algorithms-3bc4c28d274d">Load Balance Algorithms</a></p><p>A load balancing type refers to the method or approach used to ensure efficient utilization, improve overall system performance, and maintain high availability. Various load balancing techniques are employed to optimize performance, enhance reliability, and prevent overload situations.</p><p>Understanding the different load balancing types and their characteristics makes it possible to select the most appropriate solution for the specific needs and infrastructure. Some of the different load balance types can include hardware or software load balancing, cloud-based load balancing, DNS load balancing and so on…</p><p>Let’s check a few of them:</p><h3>Hardware Load Balancing</h3><p>Hardware load balancers are dedicated devices designed to distribute network traffic across multiple servers or resources. These devices employ specialized hardware components and software algorithms to efficiently manage the incoming requests. Some hardware components worth mentioning are ASICs (Application-Specific Integrated Circuits) or FPGAs (Field-Programmable Gate Arrays).</p><p>Hardware load balancers often provide advanced features such as SSL offloading, session persistence and health monitoring to optimize the performance. They can typically handle large volumes of traffic and scale horizontally by additional load balancer nodes.</p><p>They are commonly used in data centers and enterprise environments where high performance and scalability are crucial for maintaining a robust and responsive infrastructure.</p><h3>Software Load Balancing</h3><p>Software Load Balancing involves the use of specialized software or algorithms to distribute network traffic across multiple servers or resources. This type of load balancing is typically implemented within the operation system or as part of an application stack, without need for dedicated hardware devices.</p><p>They can offer flexibility and cost-effectiveness as they can be deployed on commodity hardware or virtual machines.</p><p>Software load balancing is commonly used in cloud computing environments, containerized applications, and virtualized infrastructures, enabling dynamic scaling and efficient resource allocation.</p><h3>Cloud-based Load Balancing</h3><p>Cloud-based load balancing is a type of load balancing that leverages cloud infrastructure to distribute incoming network traffic across multiple servers or resources. They are provided as a service by cloud providers, which handles the traffic distribution and management automatically.</p><p>This type of load balancing offers scalability, as it can dynamically scale up or down based on demand and automatically adjust the traffic allocation. Also, this provides high availability and fault tolerance by monitoring the health of servers and automatically rerouting traffic in case of failures or performance issues.</p><p>Cloud-based load balancing is well-suited for cloud-native applications and highly dynamic environments where elastic scaling and seamless traffic management are essential for optimal performance and resource utilization.</p><h3>DNS Load Balancing</h3><p>DNS (Domain Name System) load balancing is a technique that distributes incoming network traffic across multiple servers or resources using the DNS. It works configuring multiple IP addresses for a single domain name and associating each IP address with a different server or resource based on various policies.</p><p>DNS load balancing provides scalability and fault tolerance, as it can distribute traffic evenly across geographically distributed servers and automatically adjust the routing in case of server failures or performance issues.</p><p>DNS load balancing is commonly used for distributing web traffic, improving performance, and ensuring high availability of web applications services by direct the network traffic and users to the closest edge server based on their geographical location, making it faster content delivery and reduced latency.</p><h3>Global Server Load Balancing</h3><p>Global server load balancing (GSLB) is a load balancing technique that distributes network traffic across multiple servers or data centers located in different geographic locations. It leverages DNS resolution to direct client requests to the nearest or most optimal server based on factors such as network latency, server capacity, or geographic proximity.</p><p>GSLB enables organizations to achieve high availability, improved performance, and global scalability by directing users to the nearest or least congested server. It can improve performance and reduce latency for users by directing them to the closest or best performing data center.</p><p>GSLB is commonly used in globally distributed applications or services, allowing organizations to deliver a consistent and optimized user experience across different regions.</p><h3>Hybrid Load Balancing</h3><p>Hybrid load balancing combines different elements of load balancing techniques to optimize resource utilization and enhance system performance. It leverages a combination of predefined rules and real-time monitoring to distribute traffic across servers or resources, typically involving a mix of hardware, software, and cloud-based solutions to provide most effective and flexible load balancing strategy for a given scenario.</p><p>Hybrid load balancing algorithms may consider factors such as server capacity, response time, and traffic patterns to make intelligent traffic distribution decisions o it provides flexibility, adaptability, and efficient utilization of resources.</p><p>Hybrid load balancing is commonly employed in complex environments where a combination of predictable traffic patterns and dynamic workload fluctuations require a balanced, responsive distribution of network traffic and DNS load balancing for global traffic management. This type of load balancing suits a large-scale online streaming platform like Netflix for example.</p><h3>Layer 4 Load Balancing</h3><p>Layer 4 load balancing operates at the transport layer (Layer 4) of the OSI model and distributes network traffic based on information contained in the transport layer protocols, such as the information of TCP or UDP header, so it uses information such as source IP address, destination IP address, source port, and destination port numbers to make load balancing decisions.</p><p>Layer 4 load balancers do not inspect the contents of the network packets or the application layer protocols. It makes decisions based on limited information from the transport layer which make it fast and efficient.</p><p>Layer 4 load balancing is ideal for scenarios where simple traffic distribution based on network and transport layer information is sufficient, such as distributing web traffic or handling basic TCP/UDP applications.</p><h3>Layer 7 Load Balancing</h3><p>Layer 7 load balancing operates at the application layer (Layer 7) of the OSI model and provides advanced traffic distribution based on application-level information. It analyzes the contents of network packets, including the application layer protocols such as HTTP, HTTPS headers, cookies, SMTP, and URL paths, to make load balancing decisions about how to distribute the incoming traffic to the most appropriate server or resource.</p><p>This type of load balancing enables advanced features such as session persistence, content-based routing, SSL offloading, and application-aware traffic management. It provides more intelligent and fine-grained load balancing as it considers application-level information.</p><p>Layer 7 load balancing is well-suited for complex applications, e-commerce platforms, and environments where granular control over traffic routing and advanced application-level optimizations are required like a web application with multiple microservices so it can load balancing to route incoming API requests based on the URL path.</p><h3>Conclusion</h3><p>In conclusion, understanding the different load balance types is crucial for optimizing system performance, enhancing reliability, and maintaining high availability in modern computing environments. Whether it’s through hardware, software, cloud-based solutions, DNS, global server load balancing, or a hybrid approach, organizations have a range of options to efficiently distribute network traffic. Layer 4 and layer 7 load balancing techniques further provide granular control and intelligent traffic distribution based on transport and application-level information. By selecting the appropriate load balancing type, businesses can achieve optimal resource utilization, scalability, and a seamless user experience.</p><p><strong>Enjoyed the read</strong>? Let your <strong>clap </strong>on it and <strong>follow me</strong> for more! <strong>Thank you</strong> for your time!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=faa1c53acdba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Load Balance Algorithms]]></title>
            <link>https://medium.com/@gilbertomrf01/load-balance-algorithms-3bc4c28d274d?source=rss-3a095b559136------2</link>
            <guid isPermaLink="false">https://medium.com/p/3bc4c28d274d</guid>
            <category><![CDATA[load-balancing]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Gilberto Machado]]></dc:creator>
            <pubDate>Thu, 29 Jun 2023 11:39:06 GMT</pubDate>
            <atom:updated>2023-06-29T11:39:06.498Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, we will explore the algorithms used in Load Balance to achieve its purpose.</p><p>This is the second article about Load Balance, and you can find the first article <a href="https://medium.com/@gilbertomrf01/load-balance-4a68e7533b1a">here</a>. In the previous article we discussed the introduction to Load Balance and its importance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tuSocgiW24ySpmRI" /><figcaption>Distribute surfboards</figcaption></figure><h3>Introduction</h3><p>To ensure efficient utilization of available resources and improve overall system performance, Load Balance considers some factors such as server capacity, active connections, server health, response times among others. These algorithms make decisions on how to best distribute the incoming requests.</p><p><strong>Summary of Load Balance Algorithms:</strong></p><p><strong>Least Bandwidth</strong></p><p>This algorithm directs incoming requests to the server currently utilizing the least amount of bandwidth. It helps prevent servers from being overwhelmed by network traffic. Although effective in managing network resources, it requires more monitoring and tracking of server bandwidth, adding more complexity.</p><blockquote>For example, a file hosting service utilizes this algorithm to direct the users to the server with the lowest bandwidth usage. By doing so, it can alleviate overload traffic, allowing downloads to be faster and more reliable.</blockquote><p><strong>Round Robin</strong></p><p>Round Robin is the most famous Load Balance algorithm. It distributes incoming requests sequentially to available servers in a circular order. It is a simple algorithm that is easy to understand and apply. However, it does not consider server health or response time in the distribution process.</p><blockquote>Round Robin algorithm is commonly used in web applications with multiple backend servers. Round Robin ensures that the requests are distributed in a sequential and circular order. The first request goes to Server A, the second to Server B, the third to Server C and so on… This is very useful to prevent any single server from being overwhelmed and optimizes resource utilization.</blockquote><p><strong>IP Hash</strong></p><p>This algorithm routes requests to servers based on the source and/or destination IP address. It ensures that requests from a specific user are consistently directed to the same server. While it can evenly distribute the request load with a well-designed hash function, it may not be effective when dealing with a small number of clients generating many calls. It also does not consider the server health, response time, or varying server capacities.</p><blockquote>This approach is particularly useful in scenarios where maintaining session information is crucial, such as e-commerce platforms or applications with user-specific data.</blockquote><p><strong>Least Connections</strong></p><p>This algorithm directs incoming requests to the server with the lowest number of active connections. Its notable advantage is adaptability to different servers capacities and workloads. This makes it more effective when handling requests that take a variable amount of time to process.</p><blockquote>This algorithm is particularly useful in scenarios where response time and efficient resource utilization are crucial, allowing for optimal performance and improved user experience.</blockquote><p>There are other algorithms, such as Random, which randomly directs the incoming requests to servers from the available pool. It is also possible to create Load Balance algorithms that consider factors such as the server health, location, and capacity. Additionally, variations of the afore mentioned algorithms, like Weighted Round Robin, which assigns different weights to the servers based on specific criteria.</p><h3>Conclusion</h3><p>Load Balance algorithms play a crucial role in ensuring efficient resource utilization and improving system performance. Each algorithm discussed in this article has its strengths and limitations.</p><p>Choosing the right algorithm depends on factors such as the specific use case, servers capacities, and the trade-offs between simplicity and more advanced considerations such as server health and response time. It is also worth noting that there are other algorithms available, such as Random, Custom Load, Least Response Time, just to name a few.</p><p>By understanding the characteristics of each algorithm, system administrators and architects can make informed decisions when implementing Load Balance solutions to achieve high availability, reliability, and optional utilization of resources.</p><p>If you read untill here I hope you like this article and if so let your clap, thank you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3bc4c28d274d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Load Balance]]></title>
            <link>https://medium.com/@gilbertomrf01/load-balance-4a68e7533b1a?source=rss-3a095b559136------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a68e7533b1a</guid>
            <category><![CDATA[system-design-concepts]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[load-balancer]]></category>
            <category><![CDATA[load-balancing]]></category>
            <dc:creator><![CDATA[Gilberto Machado]]></dc:creator>
            <pubDate>Sat, 24 Jun 2023 13:57:51 GMT</pubDate>
            <atom:updated>2023-06-24T15:10:08.672Z</atom:updated>
            <content:encoded><![CDATA[<p>Series about Load Balance:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lRmAvnuGaELN-OPs" /><figcaption>Photo by <a href="https://unsplash.com/@nate_dumlao?utm_source=medium&amp;utm_medium=referral">Nathan Dumlao</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3><strong>Introduction to Load Balancing</strong></h3><p>This is the first article about load balance where I will dive into some of its concepts, give some examples of one of the most use concepts when comes up to improve the system performance and, also, a concept that is always asked in design system interviews.</p><h3>Key Terminology and concepts:</h3><p><strong>Load Balance</strong>: A device or software that distributes network traffic across multiple servers based on predefined rules or algorithms.</p><p><strong>Backend Servers</strong>: Servers that receive and process requests forwarded by the load balance. Could be called as server pool or server farm.</p><p><strong>Load Balance Algorithm</strong>: Algorithm method used by load balance do determine how to distribute incoming traffic among the backend servers.</p><p><strong>Health Checks</strong>: Test performed periodically by the load balancer to determine the availability and the performance of backend servers. Unhealth servers remove from server pool until recover from any issue.</p><p><strong>Session persistence</strong>: The concept to ensure that any subsequent request from the same client is direct to the same backend server so it can maintain session state and help to provide a consistent user experience.</p><h3><strong>Load Balance</strong></h3><p>Load balance is a crucial component when designing a system, it helps distribute incoming requests and traffic evenly across servers. Normally a load balance sits between client and server receiving income requests and application traffic and distributing it across multiple backend servers using several types of algorithms.</p><p>Load balance reduces the load time on individual servers and prevents any server from becoming a single point of failure helping overall application availability and responsiveness.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/1*tDzz4ShM4mxOgJB-EQC2iA.png" /></figure><p>To utilize it in whole way, using load balance in each layer of the application we can place the load balance putting it between user and web server and/or putting it between web servers and internal platform layer like application servers or cache servers or even putting it between internal platform layer and database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*fEWPiQ_lQYkpRsfhhLcP8A.png" /></figure><h3>Steps for Load Balance work:</h3><ol><li>The load balance receives the incoming requests, like end user browser or another API call.</li></ol><p>2. The load balance evaluates the request received and decides which server or resource should manage the request. A predefined load balancing algorithm considers factors like server capacity, server response time, number of active connections, and geographic location, for example.</p><p>3. After that, the load balance forwards the incoming traffic to the select server or resource which was decided from the previous step.</p><p>4. The server processes the request and sends it back to load balance.</p><p>5. Load balance receives the response from the server and sends it back to the caller.</p><h3><strong>The Usages of Load Balance:</strong></h3><ol><li><strong>Improving website performance</strong></li></ol><p>Since load balance can distribute the incoming request among multiple servers, evicting overload on individual servers that way making faster response time for the request caller.</p><p><strong>2. Ensuring high availability and reliability</strong></p><p>By nature, distributing the requests among multiple servers load balance help to prevent a single point of failure. The load balance has the intelligence to redirect the traffic to the available server if it checks one server is failing or experiencing a deficient performance.</p><p><strong>3. Scalability</strong></p><p>Load balance can help easily scale the infrastructure as the traffic increases. As additional servers could be added to the load balance poll to fit the increase demand, this could be achieved without some effortless in infrastructure.</p><p><strong>4. Redundance</strong></p><p>The strategy to use load balance to maintain the redundant copies of data and services so this could reduce the risk of data loss, inconsistence, or service outages due to some hardware failure or other issues.</p><p><strong>5. Network Optimization</strong></p><p>By route the network traffic across multiple servers in different paths load balance optimize and reduce congestion in the network, improving the overall network performance.</p><p><strong>6. Geographic Distribution</strong></p><p>Load balance can be used to reach the nearest or best-performing server to the end user. This is especially useful for global services that can be reached from anywhere in the globe, so the load balance can be used to distribute the traffic to better option.</p><p><strong>7. Application Performance</strong></p><p>By redirecting the requests to specific applications, the load balance can ensure that each request receives the necessary resources to perform optimally.</p><p><strong>8. Security</strong></p><p>Load balance can protect against DDoS attacks making it harder to overwhelm a single target.</p><p><strong>9. Cost saving</strong></p><p>This can be achieved through effective utilization and efficient workload distribution by load balancers, resulting in hardware and infrastructure optimization.</p><p><strong>10. Load testing</strong></p><p>Load balance can be configurated to simulate high incoming traffic to evaluate the application performance and identify the application bottle necks.</p><h3>Conclusion</h3><p>Load balancing plays a crucial role in optimizing system performance and ensuring high availability. By evenly distributing incoming requests across multiple servers, load balancing reduces load times and prevents any single server from becoming a bottleneck. It offers benefits such as improved website performance, scalability, network optimization, geographic distribution, and enhanced application performance. Load balancing also provides security against DDoS attacks and helps achieve cost savings through efficient workload distribution. By understanding the key concepts and usages of load balancing, system designers can effectively implement this critical component to enhance their applications’ responsiveness and reliability.</p><p>In the next article I will bring some of the algorithm used in load balance which has different purposes and the pros and cons.</p><p>I hope you enjoy this article, feel free to make your comment about it or give any suggestions.</p><p>Thanks for reading and if you like it give your clap, it can help me a lot.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a68e7533b1a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Playing with new features of Java 21]]></title>
            <link>https://medium.com/@gilbertomrf01/playing-with-new-features-of-java-21-3b6e2e8b5ca7?source=rss-3a095b559136------2</link>
            <guid isPermaLink="false">https://medium.com/p/3b6e2e8b5ca7</guid>
            <category><![CDATA[intellij-idea]]></category>
            <category><![CDATA[new-features]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[jdk]]></category>
            <category><![CDATA[java21]]></category>
            <dc:creator><![CDATA[Gilberto Machado]]></dc:creator>
            <pubDate>Thu, 22 Jun 2023 14:39:23 GMT</pubDate>
            <atom:updated>2023-06-22T14:39:23.022Z</atom:updated>
            <content:encoded><![CDATA[<p>Let’s get the hands dirty and run some features that Java 21 will bring to us in September 2023.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XWWfDD0w2YgR_vqh" /><figcaption>Photo by <a href="https://unsplash.com/@ericgilkes?utm_source=medium&amp;utm_medium=referral">Eric Gilkes</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Intro</h3><p>The basic “Hello World” program in Java is about to undergo significant changes in an upcoming Java version set to be released later this year. These changes will impact how Java programs are written, making it easier for both beginners and experienced programmers.</p><p>The new version, Java 21, will eliminate unnecessary clutter, such as class declarations and specific requirements for the main method. The main method will no longer need to be public or static, and the string array parameter can be omitted, yes, you read right.</p><p>Java 21 will identify the appropriate main method to start the program, starting from the traditional format and gradually moving to simpler versions until a suitable main method is found.</p><p>Although Java 21 is not yet available, I will provide instructions on how to install and have this early access build to try out the Java 21 new features. Uhuuu!</p><h3>TLDR;</h3><p>Just go to the Instructions</p><h3>Java 21</h3><p>Almost 100% of those who learned Java have learnt it written printing some Hello World in the console, creating a class, a main method and invoking the print method of System.out. At least for almost the last 30 years this has been the rule. Well, Java 21, which is coming soon (September 19), will change a few things here, making it a lot cleaner, especially for newcomers in the language. This will not only change how a simple Hello World is done but how can write small pieces of code.</p><p>So as most of you, you probably wrote and seen thousands and thousands of times public class with a main method that is public, static which is void and that take in the parameter a String array called args. And after all that we can add the print method. This could be done with the eyes closed for some who started learning java last week but imagine how it is so verbose for someone who is learning Java now, someone who has no previous experience. That`s too much to take care of here, it is overwhelming for sure.</p><p>Java 21 get rid of all this unnecessary clutter here and it will make easier for the beginner programmers or even for those who want to write small programs, with a single file for different purposes like learn and apply some java core concepts, you just need a small piece of code, you don`t need classes, frameworks, libraries, and dependencies.</p><p>Ok, so show me the new magic of Java 21</p><h3>Instructions</h3><p>Let’s go to the changes we are talking about here. First let`s check how we do it so far:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*sjfDpgwyUMO3ehcVn7R3tw.png" /></figure><p>Ok, Java needed that you write a code inside a file but it doesn’t require more you write the class declaration when it is not needed, which logically means you cannot refer to this class from any other classes, but the main reason to omit the class is to get rid of all the verbose and use it for a simple program.</p><p>So, now we have:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*TOiUKmuArX5qXDjp9dmoTA.png" /></figure><p>…and as you can see my IntelliJ IDE starts to complain a lot. We will fix it later, don’t worry, it’s just because I’m not using Java 21 yet in my IDE and will use it.</p><p>Next thing here is a big change. Now we can get rid of this public and the static words and we can get rid of the parameters. Yes, we just keep the return type, which is void in this case and the main name. Yeah, that’s it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/1*DtZlQlxkHIg3hUKNya2f_g.png" /></figure><p>Ok, now my IDE thinks that I am out of my mind. Now the whole program is this, a void main passing nothing.</p><p>What Java program will do when running this is to look for the right main method to start the program. It will start by checking for the complete traditional famous main method, the public static void man method that is passing a String array as a parameter, and if you have this method, the Java will use it. But if don’t have it like our changes here, the Java program will look for the public static void main method with no parameters….and so on until find the main method wrote just the way we did.</p><p>The main reason here is just to stay focused on what this small program will do instead of taking care of all verbosity Java structure class and syntaxes.</p><p><strong>How to make it work?</strong></p><p>Well, Java 21 will be released only in September 2023, and even so, those are just preview features. To have a try on this feature, which wasn’t released yet we can download an early access build. The link for it:</p><p>jdk.java.net/21</p><p>and you will see this page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*ulNyCW6yLOruFGvtbWwQYQ.png" /></figure><p>Find the JDK version for your OS.</p><p>I`m using windows so I download Windows/x64.</p><p>After downloading it I extract it to the directory where my others JDKs live, which is under C/Program Files/Java. After that I need to set my setting environment variable, so the windows know where to look when I run my Java programs.</p><p>So far so good, now we need to create a java file and write our code and try to run it.</p><p>First, I create a file in exactly like I showed before:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/1*DtZlQlxkHIg3hUKNya2f_g.png" /></figure><p>So, we need now compile it and run it, right? Well, there is a catch here when we are dealing with new features.</p><p>First, to compile we must pass some parameters to the javac command like you see in this image bellow:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*iuXdeuE_CVH7PF5u3vg2VA.png" /></figure><p>We must inform it is a release of Java 21 and to enable this preview with the commando as you can see.</p><p>To run we need do the same as you can see in the image bellow:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/1*M7xXZkueA0CelyIgpV87OQ.png" /></figure><h3>IDE IntelliJ</h3><p>To make use of this new feature in my IDE, I use IntelliJ, I had to make some changes.</p><p>First of all, I had to change the project structure (Ctrl+Shift+alt+S if you are using windows) to use the new JDK 21 and also enable the language level.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*O-_YOLUzmCfCKsA0NdPHoA.png" /></figure><p>After this you must go to the preferences to make some changes in the Java Compiler, so you go to Preferences &gt; Build, Execution, Deployment menu and them to Compiler &gt; Java Compiler.</p><p>So, in this menu you change you bytecode version and also, you need to write the additional command line parameter as you can see in the image below, passing the –enable-preview parameter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*8EYL-gOo4RT-rbGtBmCpNA.png" /></figure><p>After that you must go to the Run configuration and change some things. Go to the dropdown menu Modify options and select the Add VM Options.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*oT_1DiInXw_4DIqLQXCpag.png" /></figure><p>After this you just need to point to Java 21 pass the parameter — enable-preview and point the class to run, in my case it is the NewHelloWorld. Note the IntelliJ keep it in red, also my code, after this is complete red. The IntelliJ checker doesn’t realize it’s a new feature, but it was able to compile and run it as you can see in the image bellow:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HCPIvdT0k2yqhNhLbjkHdA.png" /></figure><h3>Amazing right?</h3><p>We just got rid of the class, the modifiers, the static and the String array parameters that we use in the main method, it is a big cut here. I believe it will be a good help for the newcomers and a good improvement to quickly write a very small code for any reason.</p><h3>Conclusion</h3><p>In this article we could see how to use the previous features of Java version before it was release. The new feature that Java 21 is bring would improve the ways we can write small programs for different purposes like some poc or it can be more effectively and enjoy full for someone who is learning as we could get rid of some many verbose code.</p><p>If you read until here thank you some much, please, let your 👏</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3b6e2e8b5ca7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>