<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mateus</title>
    <description>The latest articles on DEV Community by Mateus (@rakoski___).</description>
    <link>https://dev.to/rakoski___</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1239503%2Fa3f6c22f-8105-47e9-9af1-da2f5b388cda.png</url>
      <title>DEV Community: Mateus</title>
      <link>https://dev.to/rakoski___</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rakoski___"/>
    <language>en</language>
    <item>
      <title>Tagging 8,700 exam questions with an LLM, and why the Portuguese and English versions disagreed</title>
      <dc:creator>Mateus</dc:creator>
      <pubDate>Tue, 06 Oct 2026 20:30:50 +0000</pubDate>
      <link>https://dev.to/rakoski___/tagging-8700-exam-questions-with-an-llm-and-why-the-portuguese-and-english-versions-disagreed-lk8</link>
      <guid>https://dev.to/rakoski___/tagging-8700-exam-questions-with-an-llm-and-why-the-portuguese-and-english-versions-disagreed-lk8</guid>
      <description>&lt;p&gt;I'm building NaHero (&lt;a href="https://nahero.site" rel="noopener noreferrer"&gt;https://nahero.site&lt;/a&gt;) on my own. It's a set of timed practice exams for AWS, Azure and Google Cloud certifications, in Brazilian Portuguese and English. There are 30 exams and about 8,700 questions, and every exam exists in both languages. Each exam has 65 questions, the real exam's time limit (90 minutes for CLF, 130 for SAA) and the passing score from the official exam guide.&lt;/p&gt;

&lt;p&gt;I started it because I was studying for an AWS certification and couldn't find anywhere to take practice exams for free.&lt;/p&gt;

&lt;p&gt;Three parts turned out to be harder than they looked: tagging every question with its exam domain using an LLM, keeping the two languages consistent, and generating study plans without letting the model do the math.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Front: Next.js, Tailwind, react-query&lt;/li&gt;
&lt;li&gt;Back: Spring Boot, Postgres, Flyway&lt;/li&gt;
&lt;li&gt;Payments: Stripe&lt;/li&gt;
&lt;li&gt;Study plan text: DeepSeek V4.1 Flash&lt;/li&gt;
&lt;li&gt;License: AGPL-3.0, &lt;a href="https://github.com/Rakoski/nahero-front" rel="noopener noreferrer"&gt;nahero-front&lt;/a&gt; and &lt;a href="https://github.com/Rakoski/nahero-back" rel="noopener noreferrer"&gt;nahero-back&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why domains matter
&lt;/h2&gt;

&lt;p&gt;Official exam guides split each certification into domains. A single score tells you whether you passed. A score per domain tells you where to study. NaHero shows results per official domain on the free tier, and the paid study plan is built on top of those numbers. All of that depends on every one of the 8,700 questions carrying the right domain.&lt;/p&gt;

&lt;h2&gt;
  
  
  The tagging loop
&lt;/h2&gt;

&lt;p&gt;I tagged the questions with &lt;code&gt;claude -p&lt;/code&gt; (Claude Code's non-interactive mode) in a loop:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;40 questions per call&lt;/li&gt;
&lt;li&gt;the domain list for that specific exam in the prompt&lt;/li&gt;
&lt;li&gt;output validated against a fixed list of domains for that exam&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The whole bank took about 220 calls.&lt;/p&gt;

&lt;p&gt;Putting the exam's own domain list in the prompt turns an open-ended question ("what is this about?") into a choice from a closed set. Validating against the same list means a domain name the model makes up, or paraphrases, never reaches the database.&lt;/p&gt;

&lt;h2&gt;
  
  
  The consistency problem
&lt;/h2&gt;

&lt;p&gt;Every question exists twice, once in Portuguese and once in English. That gave me a check I didn't need labeled data for: tag both versions independently and see whether they get the same domain.&lt;/p&gt;

&lt;p&gt;On Google Workspace Admin, the first pass agreed about 73% of the time.&lt;/p&gt;

&lt;p&gt;For the product, that's a bug. If roughly a quarter of questions land in a different domain depending on language, a Brazilian user and an English-speaking user with identical answers get different per-domain results, and per-domain results are what the whole product is built around.&lt;/p&gt;

&lt;p&gt;Two changes fixed it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Per-exam disambiguation lines in the prompt such as "billing and pricing".&lt;/li&gt;
&lt;li&gt;Tag English only, then copy the domain to Portuguese. With one source of truth, the two versions agree by construction.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The second change is the less clever one and the one I'd recommend first. The first change still matters, because agreement alone doesn't make the English tag correct.&lt;/p&gt;

&lt;p&gt;If you have equivalent inputs (two languages, two phrasings, two orderings), agreement between them is a cheap way to find errors when you have no ground truth.&lt;/p&gt;

&lt;h2&gt;
  
  
  Study plans: SQL does the math, the LLM writes the text
&lt;/h2&gt;

&lt;p&gt;Premium users get a study plan after each attempt: 3 priorities and an ordered list of topics. The pipeline:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;SQL computes hits per domain, missed questions and previous scores.&lt;/li&gt;
&lt;li&gt;DeepSeek V4.1 Flash receives those numbers and returns JSON with the text. It doesn't calculate anything.&lt;/li&gt;
&lt;li&gt;The output is validated: domain names in the response must match the ones in the input, and links aren't allowed.&lt;/li&gt;
&lt;li&gt;The plan is stored once per attempt, so reloading the result page doesn't regenerate it.&lt;/li&gt;
&lt;li&gt;Failures are stored too, so the system doesn't keep retrying the same attempt forever.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Matching domain names means the plan can't tell you to study a domain that isn't on your exam. Banning links means it can't send you to a URL nobody checked. Storing once means the plan you read today is the one you read tomorrow. Storing failures keeps a bad attempt from turning into a loop of paid API calls.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resuming an attempt
&lt;/h2&gt;

&lt;p&gt;A 130-minute exam doesn't always fit in one sitting. Answers are auto-saved as drafts, and reopening an attempt puts you back on the last question. Resume is on the free tier.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the data says so far
&lt;/h2&gt;

&lt;p&gt;Numbers as of October 6, 2026:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;About 95 registered users, about 75% from Brazil.&lt;/li&gt;
&lt;li&gt;About 30 signups a week, with no ads running.&lt;/li&gt;
&lt;li&gt;Most CLF attempts score between 23 and 47 out of 65. Passing is around 46, so most attempts fail.&lt;/li&gt;
&lt;li&gt;Only about 15% of users took a second exam in their first week.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those last two together changed the product. Someone takes an exam, fails, sees a number and doesn't know what to do next. So I rebuilt the result screen around "what to study next".&lt;/p&gt;

&lt;p&gt;On acquisition: I tested Google Ads with R$100. That got 71 clicks at R$0.31 to R$0.90 per click, an 11% click-to-signup rate and 1 annual subscriber. LinkedIn posts bring in 3 times what Google Ads did.&lt;/p&gt;

&lt;p&gt;The first paying user came from an ad, left, and came back after the 7-day re-engagement email. They scored 44 out of 65, subscribed 36 minutes after seeing the failing score, and passed with 55 out of 65 three days later.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pricing
&lt;/h2&gt;

&lt;p&gt;All 30 exams, unlimited attempts, scores, per-domain results and resume are free. Premium is R$10/month or R$90/year and adds explanations per question, the study plan and practice questions on your weakest domain.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd like feedback on
&lt;/h2&gt;

&lt;p&gt;If you've used LLMs for classification across languages, I'd like to know how you measured consistency and what you did about disagreements. The code is open, so you can also read exactly how it's done in the repos linked above.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>azure</category>
      <category>ai</category>
      <category>gcp</category>
    </item>
    <item>
      <title>Data Structures - Hash Tables</title>
      <dc:creator>Mateus</dc:creator>
      <pubDate>Wed, 22 May 2024 11:06:38 +0000</pubDate>
      <link>https://dev.to/rakoski___/data-structures-hash-tables-lj1</link>
      <guid>https://dev.to/rakoski___/data-structures-hash-tables-lj1</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Data structures are a fundamental part of initial programming studies. Understanding different data structures and knowing how to use them is essential. While studying the course: "Learn What Data Structures and Algorithms Are," the topic of hash tables was covered more superficially than other data structures. I decided to seek more information online. As a good apprentice developer, I googled it and soon found several videos discussing the topic. However, these definitions were also superficial, leading to inevitable frustration. I then tried ChatGPT, but believe it or not, it was down, and I couldn't get any answers. So, I sought help from Copilot (thanks to IFPR and their great help from education packages =D) and managed to understand a bit more than I had from the course. I decided to write this article to learn more and get feedback from those who understand the subject better. So, let's get into the little I understood.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Definition&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A hash table is a data structure that associates keys with values, allowing for fast and efficient searches, making it ideal for indexing and data access. Each key-value pair is called a "slot." Hash tables are widely used in user authentication systems to store passwords securely; we will discuss this in more detail later.&lt;/p&gt;

&lt;p&gt;An example of using hash tables is:&lt;/p&gt;

&lt;p&gt;Associative arrays: Mapping keys (e.g., names) to values (e.g., phone numbers).&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Index 0: "Paula" | "7198749874"     &amp;lt;- slot 1&lt;br&gt;
Index 1: "Antenor" | "71999999999"  &amp;lt;- slot 2&lt;br&gt;
Index 2:                                    &amp;lt;- slot 3&lt;br&gt;
Index 3:                                    &amp;lt;- slot 4&lt;br&gt;
Index 4: "Fernando" | "11999994444" &amp;lt;- slot 5&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;In this example, we have a hash table that maps a person's name to their phone number.&lt;/p&gt;

&lt;p&gt;Sets: Membership verification (e.g., checking if an element is in a set). The set elements are not necessarily ordered.&lt;/p&gt;

&lt;p&gt;For example, the set of prime numbers (2, 3, 5, 7, 11). To verify membership, we use the in operation.&lt;/p&gt;

&lt;p&gt;Caches: Temporary storage areas for frequently used data. For example, a cache of query results from a database prevents repeated queries to the database since the data will be used again. When a query is made, the cache is checked first. If the data is there, it avoids another query, reducing data flow and speeding up the application.&lt;/p&gt;

&lt;p&gt;In summary, hash tables are a way to index data. They are designed to allow quick access to values based on associated keys, even when retrieving information from large data sets. The hash code (index) is calculated and mapped to an index in the array, and the values are stored in the corresponding indices.&lt;br&gt;
Hash Function&lt;/p&gt;

&lt;p&gt;A hash function maps the key to an index in the hash table. Let's see an example. Suppose we have a hash table with 10 indices numbered from 0 to 9. We want to store keywords in this table. We will create a basic hash function to store the words: "cat," "dog," "lion," "goat," "jaguar," "bear," "elephant," "bull," "snake," "alligator." To populate the hash table, we will use the following function: the remainder of the division between the sum of the ASCII values of each character in the words by the number of table positions.&lt;/p&gt;

&lt;p&gt;1st word: "cat" =&amp;gt; (103 + 97 + 116 + 111) % 10&lt;br&gt;
 -&amp;gt; 427 % 10 = 7, this is the index (hash) where we will store the word "cat."&lt;/p&gt;

&lt;p&gt;2nd word: "dog" =&amp;gt; (99 + 97 + 99 + 104 + 111 + 114 + 114 + 111) % 10&lt;br&gt;
  -&amp;gt; 849 % 10 = 9, this is the hash for the word "dog."&lt;/p&gt;

&lt;p&gt;This process will be followed for all words. It is not uncommon, especially in this case where the number of table indices is limited, for a word to need to be stored at the same index as another word. This is called a "collision." Collisions are common in hash functions. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Collisions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Example of a Hash Function&lt;/p&gt;

&lt;p&gt;Consider a simple hash function that computes the hash value by summing the ASCII values of the characters in the key and then taking the modulus with the size of the hashmap.&lt;/p&gt;

&lt;p&gt;For example, suppose our hashmap has 10 buckets and our hash function is:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;def hash_function(key):&lt;br&gt;
    return sum(ord(char) for char in key) % 10&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Let's compute the hash values for two different keys:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Key: "cat"
    ASCII values: c (99), a (97), t (116)
    Sum: 99 + 97 + 116 = 312
    Hash value: 312 % 10 = 2

Key: "act"
    ASCII values: a (97), c (99), t (116)
    Sum: 97 + 99 + 116 = 312
    Hash value: 312 % 10 = 2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Both "cat" and "act" produce the same hash value of 2 because of their same ASCII values summed up, leading to a collision.&lt;/p&gt;

&lt;p&gt;But then the question arises: how to store the words if different words cannot be stored in the same index? There are some ways to resolve collisions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Resolving Collisions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The most common methods for resolving collisions are: Separate Chaining, Open Addressing, and Perfect Hashing (best-case scenario).&lt;/p&gt;

&lt;p&gt;Separate Chaining: In this case, each slot in the table contains a linked list of elements with the same index. When a collision occurs (i.e., two keys are mapped to the same slot), the elements are simply added to the corresponding list. Suppose the words "dog" and "elephant" map to the same slot; then the hash table would look like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Index 0:&lt;br&gt;
Index 1:&lt;br&gt;
Index 2:&lt;br&gt;
Index 3:&lt;br&gt;
Index 4:&lt;br&gt;
Index 5:&lt;br&gt;
Index 6:&lt;br&gt;
Index 7: 7 | "cat"&lt;br&gt;
Index 8:&lt;br&gt;
Index 9: 9 | "dog" -&amp;gt; "elephant"&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Open Addressing: Another way to resolve collisions is through Open Addressing or linear probing, which involves trying to find another free slot in the table. Linear probing is a common technique where slots are checked sequentially until an empty one is found. In the example of the collision between "dog" and "elephant," the word "elephant" would be stored in the slot with index 0, as it is the next empty slot. If slot 0 were occupied, then slot 1 would be tried, and so on. In this case, a free slot will always be found since there are 10 words for 10 slots.&lt;/p&gt;

&lt;p&gt;Perfect Hashing: Perfect hashing is the ideal situation but is not always possible. It means that each key has a unique index in the hash table without collisions. If we had a perfect hash function, each word would be perfectly indexed, and there would be no collisions.&lt;/p&gt;

&lt;p&gt;There are strategies aimed at finding a good hash function that ensures maximum spreading across the table. Perfect hashing is when, given a table of n positions and n elements to be inserted, there is no collision. One strategy for choosing the hash function is the Cichelli method, which aims to minimize collisions by making some adjustments to the hash to differentiate it from the already calculated hash. This adjustment can be called a "salt," which is, for example, a constant added to the hash, creating different possible values for collisions. This salt must be stored in some field of the table, so when attempting to access the value, it is added to the hash, and the values match. This may be a bit confusing.&lt;/p&gt;

&lt;p&gt;Remember the example where the words "dog" and "elephant" collided. The salt could be the hash divided by 2 or the number 1, for example. But the salt is added only to the second value that caused the collision, so it would only affect the hash of the word "elephant."&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;`Index 9: 9 | "dog"&lt;/p&gt;

&lt;p&gt;Hash calculated for "elephant" is 9; adding the salt 1, the hash becomes 10 % 10 = 0, so the word "elephant" would be stored in the slot with index 0.&lt;/p&gt;

&lt;p&gt;Index 0: 0 | "elephant"&lt;br&gt;
Index 7: 7 | "cat"`&lt;/p&gt;

&lt;p&gt;The hash table data structure has a complexity of Big O(1) notation because the search is immediate, making it ideal.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Application&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A very common application for hash tables is user authentication systems. The user creates a password, a hash is applied to this password, and the hash of the password is stored in the database, never storing the actual password typed by the user. This ensures the security of such sensitive information. Several hashes are used for this: MD4, MD5, SHA-1, SHA-256, SHA-512.&lt;/p&gt;

&lt;p&gt;But if the password is not stored, only the hash of the password, how do you know if the user entered the correct password? Simple, the password entered by the user is hashed again, and the newly generated hash is compared with the stored hash in the database. This is how authentication occurs.&lt;/p&gt;

&lt;p&gt;Another use of hashing is file verification. How do hash functions ensure the integrity of files? When the hash of a file is calculated, a compact representation of the data is obtained. If there is any alteration in a file, the resulting hash will be different. Therefore, such a comparison allows you to verify if the file remained unchanged. This comparison can be done before and after downloading a file, for example.&lt;/p&gt;

&lt;p&gt;Another application of hash tables is digital signatures. Digital signatures use hash functions to verify the authenticity of documents. The hash of the document is encrypted with the sender's private key, creating a digital signature. The recipient can verify the signature by decrypting the hash with the sender's public key.&lt;/p&gt;

&lt;p&gt;An example of using hash tables for a small user authentication system. Here I will add Python code. The user creates a password, and the password is stored in a hash table. At login, the password entered by the user is hashed again and then checked if the hash values are identical. For this example, I will use MD5 hashing. I will use the Python hashlib module to work with hash functions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import hashlib

# Hash table to store passwords (user -&amp;gt; password_hash)
password_hash_table = {}

def hash_password(password):
    # Create an MD5 object
    md5_hash = hashlib.md5()
    # Update the MD5 object with the password as a hexadecimal string
    md5_hash.update(password.encode('utf-8'))
    # Return the MD5 hash as a hexadecimal string
    return md5_hash.hexdigest()

def register_user(username, password):
    # Hash the password using the hash_password function
    password_hash = hash_password(password)
    # Store the username and password hash in the hash table
    password_hash_table[username] = password_hash
    print(f'User "{username}" registered successfully.')

def login_user(username, password):
    # Hash the entered password using the hash_password function
    entered_password_hash = hash_password(password)
    # Check if the username is in the hash table and if the hashes match
    if username in password_hash_table and password_hash_table[import hashlib

# Hash table to store passwords (user -&amp;gt; password_hash)
password_hash_table = {}

def hash_password(password):
    # Create an MD5 object
    md5_hash = hashlib.md5()
    # Update the MD5 object with the password as a hexadecimal string
    md5_hash.update(password.encode('utf-8'))
    # Return the MD5 hash as a hexadecimal string
    return md5_hash.hexdigest()

def register_user(username, password):
    # Hash the password using the hash_password function
    password_hash = hash_password(password)
    # Store the username and password hash in the hash table
    password_hash_table[username] = password_hash
    print(f'User "{username}" registered successfully.')

def login_user(username, password):
    # Hash the entered password using the hash_password function
    entered_password_hash = hash_password(password)
    # Check if the username is in the hash table and if the hashes match
    if username in password_hash_table and password_hash_table[username] == entered_password_hash:
        print(f'User "{username}" logged in successfully.')
    else:
        print(f'Login failed for user "{username}".')

# Registering users
register_user('Paula', '1234')
register_user('Antenor', 'abcd')

# Attempting logins
login_user('Paula', '1234')
login_user('Antenor', 'abcd')
login_user('Fernando', 'wrong_password')
        print(f'Login failed for user "{username}".')

# Registering users
register_user('Paula', '1234')
register_user('Antenor', 'abcd')

# Attempting logins
login_user('Paula', '1234')
login_user('Antenor', 'abcd')
login_user('Fernando', 'wrong_password')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the example, there is no method to handle collisions. What if there is a collision between the passwords registered by different users? Let's try to handle collisions. In this example, we will use the chaining technique, where each entry in the hash table is a linked list (i.e., a list of passwords with the same hash value). If there is a collision, we add a new password to the existing list. To add collision handling, we will modify the method for adding a user, as this is where values are inserted into the hash table. The method will look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def add_user(user, password):
    # Calculate the password hash
    password_hash = hash_password(password)

    # Check if the user already exists in the table
    if user in password_hash_table:
        # Add the password to the existing hash list
        password_hash_table[user].append(password_hash)
    else:
        # Create a new list with the new password
        password_hash_table[user] = [password_hash]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Important considerations: For security purposes, MD5 hashing is not recommended; it would be better to use SHA-256 or SHA-512. It is also a good idea to add a salt to the passwords before calculating the hash, which will increase security by making it more difficult for an attacker to use precomputed hash tables (Rainbow tables) to crack passwords.&lt;/p&gt;

&lt;p&gt;Thank you for reading this article.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>datastructures</category>
      <category>learning</category>
      <category>coding</category>
    </item>
    <item>
      <title>Load balancers and Club Bouncers.</title>
      <dc:creator>Mateus</dc:creator>
      <pubDate>Mon, 05 Feb 2024 00:53:51 +0000</pubDate>
      <link>https://dev.to/rakoski___/load-balancers-and-a-comparison-with-club-bouncers-1mkj</link>
      <guid>https://dev.to/rakoski___/load-balancers-and-a-comparison-with-club-bouncers-1mkj</guid>
      <description>&lt;p&gt;Imagine it's 11pm and, as the social butterfly you are, going to a club with all your friends seems a good idea. Now, let's say the club only has capacity for 300 people and over 1000 people are trying to enter, what could happen?&lt;/p&gt;

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

&lt;p&gt;Well, either the party is going to be way too crowded leaving no space to dance, or, firefighters will close up the party due to overcrowding. In such scenario, the owner of the club hires a bouncer to smooth up the entrance.&lt;/p&gt;

&lt;p&gt;Now, a bouncer in our club analogy is the load balancer on a server and people are like TCP data packets. That is because load balancers distribute incoming requests and data among multiple servers or resources in a way that ensures each server shares the load fairly.&lt;/p&gt;

&lt;p&gt;However, there are many more things a load balancer can do that a bouncer simply can't, namely: &lt;/p&gt;

&lt;h2&gt;
  
  
  1. Scalability
&lt;/h2&gt;

&lt;p&gt;What if the club becomes Project X? The number of partygoers keeps growing more than ever and it doesn't stop, what can the owner do? Either expand the club by opening additional entrances or risk turning away potential customers.&lt;/p&gt;

&lt;p&gt;In server language, this growth corresponds to an increase in users. As the demand for a website or application surges, a single server might struggle to handle the traffic. This is where scalability comes into play. Just like opening new entrances to accommodate more clubbers, load balancers enable the addition of more servers to distribute the growing workload.&lt;/p&gt;

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

&lt;h2&gt;
  
  
  2. High Availability
&lt;/h2&gt;

&lt;p&gt;Imagine the night is in full swing, the music is pumping, and everyone is having a great time but something minor happens – maybe a speaker malfunctions or a light goes out. In a good club, these issues are quickly addressed to ensure the party goes on without anyone even noticing;&lt;/p&gt;

&lt;p&gt;This also translates to servers, where load balancers contribute to high availability. If one server experiences a malfunction or becomes overloaded, the load balancer redirects incoming traffic to other healthy servers, ensuring optimal user experience. Just as the owner invests in backup systems to keep the party alive, load balancing strategies maintain a consistent and reliable back-end.&lt;/p&gt;

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

&lt;h2&gt;
  
  
  3. Types of Load Balancing
&lt;/h2&gt;

&lt;p&gt;Different music genres cater to diverse tastes on the dance floor, load balancers offer various algorithms to handle incoming requests. Remember the bouncer's role in managing the crowd? Here, they might employ different strategies to not let the users go away, such as directing people to the least crowded areas or alternating between multiple entrances.&lt;/p&gt;

&lt;p&gt;Similarly, load balancing algorithms dictate how incoming requests are distributed across servers. The 'Round Robin' algorithm, for instance, ensures an equal share of the workload, much like guiding people to various sections of the club. On the other hand, the 'Least Connections' algorithm mimics the bouncer's approach of sending attendees to less crowded spots, ensuring each server remains balanced in handling requests.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Digital Security
&lt;/h2&gt;

&lt;p&gt;By 4am, the bouncer still plays a crucial role in maintaining order, ensuring the club remains an enjoyable and secure environment as the night dies. &lt;/p&gt;

&lt;p&gt;Just like that, load balancers enhance digital security by preventing server overloads, minimizing the risk of system crashes, and mitigating potential threats like Distributed Denial of Service (DDoS) attacks.&lt;/p&gt;

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

&lt;p&gt;Much like a vigilant bouncer adeptly managing the crowd, load balancers act as the first line of defense against digital chaos. They monitor server health, optimize resource utilization, and swiftly respond to increased demand, guaranteeing a smooth digital dance floor experience.&lt;/p&gt;

&lt;p&gt;Just as a skilled bouncer bounces a memorable night at the club, load balancers direct servers, ensuring scalability, high availability, and a secure, uninterrupted performance for users. So, whether you're at the hottest club in town or navigating the online realm, the role of the bouncer – or load balancer – is central to a successful and enjoyable experience.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>devops</category>
      <category>cloud</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
