<?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: Jairo Junior</title>
    <description>The latest articles on DEV Community by Jairo Junior (@jairojr-software-engineer).</description>
    <link>https://dev.to/jairojr-software-engineer</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1522014%2Fd0a0ab97-4819-442c-a1d3-a5a4bd9ab052.jpeg</url>
      <title>DEV Community: Jairo Junior</title>
      <link>https://dev.to/jairojr-software-engineer</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jairojr-software-engineer"/>
    <language>en</language>
    <item>
      <title>Hello, do you ever think about an other way to organize your applications ? Let's think about it a little, just read my new article to see, how libraries can save your organization, and a few tokens when you work with AI</title>
      <dc:creator>Jairo Junior</dc:creator>
      <pubDate>Sun, 07 Jun 2026 23:00:31 +0000</pubDate>
      <link>https://dev.to/jairojr-software-engineer/hello-do-you-ever-think-about-an-other-way-to-organize-your-applications-lets-think-about-it-a-9jl</link>
      <guid>https://dev.to/jairojr-software-engineer/hello-do-you-ever-think-about-an-other-way-to-organize-your-applications-lets-think-about-it-a-9jl</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/jairojr-software-engineer/library-oriented-architecture-the-most-interesting-architecture-pattern-youve-probably-never-4e7i" class="crayons-story__hidden-navigation-link"&gt;Library Oriented Architecture: The Most Interesting Architecture Pattern You've Probably Never Heard About&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/jairojr-software-engineer" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1522014%2Fd0a0ab97-4819-442c-a1d3-a5a4bd9ab052.jpeg" alt="jairojr-software-engineer profile" class="crayons-avatar__image" width="800" height="800"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/jairojr-software-engineer" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Jairo Junior
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Jairo Junior
                
              
              &lt;div id="story-author-preview-content-3843602" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/jairojr-software-engineer" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1522014%2Fd0a0ab97-4819-442c-a1d3-a5a4bd9ab052.jpeg" class="crayons-avatar__image" alt="" width="800" height="800"&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Jairo Junior&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/jairojr-software-engineer/library-oriented-architecture-the-most-interesting-architecture-pattern-youve-probably-never-4e7i" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Jun 7&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/jairojr-software-engineer/library-oriented-architecture-the-most-interesting-architecture-pattern-youve-probably-never-4e7i" id="article-link-3843602"&gt;
          Library Oriented Architecture: The Most Interesting Architecture Pattern You've Probably Never Heard About
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/ai"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;ai&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/programming"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;programming&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/backenddevelopment"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;backenddevelopment&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/architecture"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;architecture&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
            &lt;a href="https://dev.to/jairojr-software-engineer/library-oriented-architecture-the-most-interesting-architecture-pattern-youve-probably-never-4e7i#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              &lt;span class="hidden s:inline"&gt;Add Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            6 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial crayons-icon c-btn__icon"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success crayons-icon c-btn__icon"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
    </item>
    <item>
      <title>Library Oriented Architecture: The Most Interesting Architecture Pattern You've Probably Never Heard About</title>
      <dc:creator>Jairo Junior</dc:creator>
      <pubDate>Sun, 07 Jun 2026 22:03:48 +0000</pubDate>
      <link>https://dev.to/jairojr-software-engineer/library-oriented-architecture-the-most-interesting-architecture-pattern-youve-probably-never-4e7i</link>
      <guid>https://dev.to/jairojr-software-engineer/library-oriented-architecture-the-most-interesting-architecture-pattern-youve-probably-never-4e7i</guid>
      <description>&lt;p&gt;Hello!&lt;/p&gt;

&lt;p&gt;I'm Jairo Jr, your favorite Dev.to writter, or something like this 😄. &lt;/p&gt;

&lt;p&gt;Over the last few years, I've spent a lot of time studying software architecture. Like most backend engineers, I've gone through the usual journey: Layered Architecture, Clean Architecture, Hexagonal Architecture, Event-Driven Architecture, and Microservices.&lt;/p&gt;

&lt;p&gt;While exploring different concepts, I found an architecture style that immediately caught my attention: &lt;strong&gt;Library Oriented Architecture (LOA)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I first discovered the term while reading an article by Krystian Kościelniak, and it completely changed how I think about domains and code organization.&lt;/p&gt;

&lt;p&gt;The funny thing is that the idea sounds almost too simple.&lt;/p&gt;

&lt;p&gt;And if you're a software engineer, you already know that's usually when things get dangerous 😄.&lt;/p&gt;

&lt;h2&gt;
  
  
  🤔 The Problem Every Growing Application Faces
&lt;/h2&gt;

&lt;p&gt;Have you ever opened a codebase and asked yourself:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Where does one domain end and another begin?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;At first, everything seems organized. Then the project grows, new features arrive, more business rules appear, and suddenly billing knows about users, users know about notifications, notifications know about payments, and nobody knows who owns what anymore.&lt;/p&gt;

&lt;p&gt;The code still works, but the boundaries become blurry. And blurry boundaries usually create expensive problems.&lt;/p&gt;

&lt;p&gt;The problem looks something like this:&lt;/p&gt;

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

&lt;p&gt;As applications grow, ownership becomes harder to understand. A feature that originally belonged to one domain slowly starts leaking into others, creating dependencies that nobody planned and everyone eventually has to maintain.&lt;/p&gt;

&lt;h2&gt;
  
  
  🧠 Before LOA, We Need to Talk About Ontologies
&lt;/h2&gt;

&lt;p&gt;To understand Library Oriented Architecture, we first need to understand a concept called &lt;strong&gt;Ontology&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The word ontology sounds much more complicated than it actually is.&lt;/p&gt;

&lt;p&gt;Honestly, the first time I read the word, I thought I was accidentally reading a philosophy book instead of a software architecture article 📖.&lt;/p&gt;

&lt;p&gt;In software terms, an ontology is simply a way to describe concepts, relationships, and business rules inside a specific domain.&lt;/p&gt;

&lt;p&gt;Think about an e-commerce platform. You have Customers, Orders, Products, and Payments. More importantly, you have rules that connect those concepts together.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Customers create Orders&lt;/li&gt;
&lt;li&gt;Orders contain Products&lt;/li&gt;
&lt;li&gt;Payments settle Orders&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;An ontology defines that language and those relationships. In other words:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;An ontology describes the language of a domain.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Visually, it looks something like this:&lt;/p&gt;

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

&lt;p&gt;Once you start thinking about systems as collections of concepts and relationships, LOA begins to make a lot more sense.&lt;/p&gt;

&lt;h2&gt;
  
  
  📚 The Core Idea Behind LOA
&lt;/h2&gt;

&lt;p&gt;The central idea of Library Oriented Architecture is surprisingly simple:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Each domain becomes a library.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's it.&lt;/p&gt;

&lt;p&gt;No secret framework.&lt;/p&gt;

&lt;p&gt;No new runtime.&lt;/p&gt;

&lt;p&gt;No AI-powered blockchain-driven microservice mesh 🚀✨😅.&lt;/p&gt;

&lt;p&gt;Not a package.&lt;/p&gt;

&lt;p&gt;Not a folder.&lt;/p&gt;

&lt;p&gt;Not a module hidden inside a monolith.&lt;/p&gt;

&lt;p&gt;A real library.&lt;/p&gt;

&lt;p&gt;Each library contains everything related to that specific business capability:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Domain concepts&lt;/li&gt;
&lt;li&gt;Domain rules&lt;/li&gt;
&lt;li&gt;Domain behavior&lt;/li&gt;
&lt;li&gt;Domain use cases&lt;/li&gt;
&lt;/ul&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;customer-library
payment-library
inventory-library
notification-library
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each one owns its knowledge.&lt;/p&gt;

&lt;p&gt;Each one owns its rules.&lt;/p&gt;

&lt;p&gt;Each one owns its evolution.&lt;/p&gt;

&lt;p&gt;Instead of having a giant application where domains are mixed together, you have independent units with explicit ownership.&lt;/p&gt;

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

&lt;p&gt;The domain stops being a section of the application and becomes a first-class citizen.&lt;/p&gt;

&lt;h2&gt;
  
  
  🏗️ The Structure
&lt;/h2&gt;

&lt;p&gt;A simplified LOA application usually looks like this:&lt;/p&gt;

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

&lt;p&gt;The architecture can be divided into three major parts: the Application, the Middleware, and the Domain Libraries.&lt;/p&gt;

&lt;h3&gt;
  
  
  Application
&lt;/h3&gt;

&lt;p&gt;The application is the entry point of the system.&lt;/p&gt;

&lt;p&gt;It contains framework integrations, dependency injection, controllers, API endpoints, and infrastructure configuration.&lt;/p&gt;

&lt;p&gt;Its responsibility is orchestration.&lt;/p&gt;

&lt;p&gt;The application knows how to connect things together, but it does not own domain knowledge.&lt;/p&gt;

&lt;h3&gt;
  
  
  Middleware
&lt;/h3&gt;

&lt;p&gt;The middleware acts as a bridge between the application and the libraries.&lt;/p&gt;

&lt;p&gt;Its responsibility is providing common services such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HTTP communication&lt;/li&gt;
&lt;li&gt;Caching&lt;/li&gt;
&lt;li&gt;Persistence abstractions&lt;/li&gt;
&lt;li&gt;Messaging&lt;/li&gt;
&lt;li&gt;Shared utilities&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal is avoiding direct infrastructure coupling inside domain libraries.&lt;/p&gt;

&lt;h3&gt;
  
  
  Libraries
&lt;/h3&gt;

&lt;p&gt;This is where the business actually lives.&lt;/p&gt;

&lt;p&gt;Each library contains:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Business entities&lt;/li&gt;
&lt;li&gt;Business rules&lt;/li&gt;
&lt;li&gt;Use cases&lt;/li&gt;
&lt;li&gt;Domain logic&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ideally, it contains no framework dependencies, no infrastructure concerns, and no knowledge about the application itself.&lt;/p&gt;

&lt;p&gt;The library only knows its domain.&lt;/p&gt;

&lt;p&gt;And that's powerful.&lt;/p&gt;

&lt;p&gt;Another way to visualize it is:&lt;/p&gt;

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

&lt;h2&gt;
  
  
  💡 Why I Like This Idea
&lt;/h2&gt;

&lt;p&gt;The biggest thing that attracted me to LOA is clarity.&lt;/p&gt;

&lt;p&gt;When a domain becomes a library, ownership becomes explicit. You immediately know where business rules belong, where changes should happen, and who owns a particular piece of functionality.&lt;/p&gt;

&lt;p&gt;After working with large codebases for years, I've noticed that many architecture problems aren't technical problems at all.&lt;/p&gt;

&lt;p&gt;They're ownership problems.&lt;/p&gt;

&lt;p&gt;LOA addresses that challenge directly by making domain boundaries visible and enforceable.&lt;/p&gt;

&lt;p&gt;The architecture encourages engineers to think in terms of business capabilities instead of technical layers, which tends to produce cleaner and more maintainable systems over time.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔍 Isn't This Just a Modular Monolith?
&lt;/h2&gt;

&lt;p&gt;At first glance, it looks very similar.&lt;/p&gt;

&lt;p&gt;And honestly, there is some overlap.&lt;/p&gt;

&lt;p&gt;If you're thinking:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This sounds suspiciously like a modular monolith.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You're not alone.&lt;/p&gt;

&lt;p&gt;I had exactly the same reaction 😅.&lt;/p&gt;

&lt;p&gt;Both approaches aim to create strong boundaries and reduce coupling.&lt;/p&gt;

&lt;p&gt;The difference is that LOA pushes modularity one step further.&lt;/p&gt;

&lt;p&gt;Instead of thinking:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This folder belongs to the payment module.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You start thinking:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This library IS the payment domain.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That subtle difference changes how teams design software.&lt;/p&gt;

&lt;p&gt;The domain stops being a folder inside the application and becomes an independent unit with its own lifecycle and ownership.&lt;/p&gt;

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

&lt;h2&gt;
  
  
  🤖 The Unexpected Advantage of LOA in the AI Era
&lt;/h2&gt;

&lt;p&gt;One thing I realized while studying LOA is how naturally it fits the world of AI agents.&lt;/p&gt;

&lt;p&gt;Which was unexpected. I started reading about architecture and somehow ended up thinking about context windows and token consumption 🤖.&lt;/p&gt;

&lt;p&gt;One of the biggest challenges when building AI-powered systems is context management. The more information you provide to an agent, the more expensive, slower, and sometimes less accurate the responses become.&lt;/p&gt;

&lt;p&gt;With LOA, domain boundaries naturally become context boundaries.&lt;/p&gt;

&lt;p&gt;Instead of giving an agent access to the entire application, you can provide only the library related to the problem being solved.&lt;/p&gt;

&lt;p&gt;A Payment Agent only needs payment concepts. An Inventory Agent only needs inventory concepts.&lt;/p&gt;

&lt;p&gt;The result is lower token consumption, more focused reasoning, and agents that behave much closer to specialists than generalists.&lt;/p&gt;

&lt;p&gt;As AI becomes part of software architecture, this may become one of the most interesting benefits of LOA.&lt;/p&gt;

&lt;h2&gt;
  
  
  ✅ Advantages
&lt;/h2&gt;

&lt;p&gt;After studying the concept, these are the biggest benefits I see.&lt;/p&gt;

&lt;h3&gt;
  
  
  Clear Domain Boundaries
&lt;/h3&gt;

&lt;p&gt;Every domain has an explicit home. This makes ownership easier to understand and reduces the chances of business rules leaking into unrelated parts of the system.&lt;/p&gt;

&lt;h3&gt;
  
  
  High Reusability
&lt;/h3&gt;

&lt;p&gt;Because domains are packaged as libraries, they can be reused across multiple applications without bringing the entire codebase with them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Easier Testing
&lt;/h3&gt;

&lt;p&gt;Domain logic becomes easier to isolate, making unit and integration tests simpler to write and maintain.&lt;/p&gt;

&lt;h3&gt;
  
  
  Framework Independence
&lt;/h3&gt;

&lt;p&gt;Business rules remain independent from Spring, Express, ASP.NET, or any other framework, reducing long-term coupling.&lt;/p&gt;

&lt;h3&gt;
  
  
  Better Long-Term Maintainability
&lt;/h3&gt;

&lt;p&gt;Clear boundaries and reduced coupling make the system easier to evolve as business requirements grow.&lt;/p&gt;

&lt;h2&gt;
  
  
  ⚠️ Potential Drawbacks
&lt;/h2&gt;

&lt;p&gt;Of course, no architecture is perfect.&lt;/p&gt;

&lt;p&gt;LOA also introduces challenges.&lt;/p&gt;

&lt;h3&gt;
  
  
  More Initial Design Effort
&lt;/h3&gt;

&lt;p&gt;LOA requires careful thinking about domain boundaries. Poor boundaries can create as many problems as no boundaries at all.&lt;/p&gt;

&lt;h3&gt;
  
  
  Package Management Complexity
&lt;/h3&gt;

&lt;p&gt;As the number of domains grows, managing versions and dependencies between libraries becomes more challenging.&lt;/p&gt;

&lt;h3&gt;
  
  
  Not Ideal for Every Project
&lt;/h3&gt;

&lt;p&gt;Smaller applications may not benefit enough from the additional structure to justify the added complexity.&lt;/p&gt;

&lt;p&gt;Like most architectural decisions, LOA is a trade-off, not a silver bullet.&lt;/p&gt;

&lt;h2&gt;
  
  
  🚀 Final Thoughts
&lt;/h2&gt;

&lt;p&gt;What I like most about Library Oriented Architecture isn't the libraries themselves.&lt;/p&gt;

&lt;p&gt;It's the mindset.&lt;/p&gt;

&lt;p&gt;LOA forces us to think about domains as first-class citizens—not folders, not modules, and not technical layers.&lt;/p&gt;

&lt;p&gt;Domains.&lt;/p&gt;

&lt;p&gt;Will LOA replace Hexagonal Architecture, Clean Architecture, or Modular Monoliths?&lt;/p&gt;

&lt;p&gt;Probably not.&lt;/p&gt;

&lt;p&gt;But it offers an interesting perspective:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What if the domain wasn't a part of the application?&lt;/p&gt;

&lt;p&gt;What if the application was simply orchestrating a collection of domains?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And that's a question I've been thinking about ever since I discovered this architecture style.&lt;/p&gt;

&lt;p&gt;Maybe LOA won't become the next big architecture trend.&lt;/p&gt;

&lt;p&gt;But it definitely made me look at domains differently—and for me, that's already a win 🎯.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>backenddevelopment</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Hello guys, today I wanna share with you one of the best experiences that I've ever had using a linux distro, gaming is good, coding is incredible, and for the first time, the CODEX don't burned my pc running complex changes.
I'm really glad if you read it</title>
      <dc:creator>Jairo Junior</dc:creator>
      <pubDate>Wed, 03 Jun 2026 10:44:10 +0000</pubDate>
      <link>https://dev.to/jairojr-software-engineer/hello-guys-today-i-wanna-share-with-you-one-of-the-best-experiences-that-ive-ever-had-using-a-43c</link>
      <guid>https://dev.to/jairojr-software-engineer/hello-guys-today-i-wanna-share-with-you-one-of-the-best-experiences-that-ive-ever-had-using-a-43c</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/jairojr-software-engineer/why-i-drop-from-fedora-to-brgv-os-j1e" class="crayons-story__hidden-navigation-link"&gt;Why I drop from Fedora to BRGV-OS&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/jairojr-software-engineer" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1522014%2Fd0a0ab97-4819-442c-a1d3-a5a4bd9ab052.jpeg" alt="jairojr-software-engineer profile" class="crayons-avatar__image" width="800" height="800"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/jairojr-software-engineer" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Jairo Junior
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Jairo Junior
                
              
              &lt;div id="story-author-preview-content-3781994" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/jairojr-software-engineer" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1522014%2Fd0a0ab97-4819-442c-a1d3-a5a4bd9ab052.jpeg" class="crayons-avatar__image" alt="" width="800" height="800"&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Jairo Junior&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/jairojr-software-engineer/why-i-drop-from-fedora-to-brgv-os-j1e" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;May 30&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/jairojr-software-engineer/why-i-drop-from-fedora-to-brgv-os-j1e" id="article-link-3781994"&gt;
          Why I drop from Fedora to BRGV-OS
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/devjournal"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;devjournal&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/linux"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;linux&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/opensource"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;opensource&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/ui"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;ui&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
            &lt;a href="https://dev.to/jairojr-software-engineer/why-i-drop-from-fedora-to-brgv-os-j1e#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              &lt;span class="hidden s:inline"&gt;Add Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            3 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
    </item>
    <item>
      <title>talking a little about this wonderful linux distro</title>
      <dc:creator>Jairo Junior</dc:creator>
      <pubDate>Sat, 30 May 2026 05:51:59 +0000</pubDate>
      <link>https://dev.to/jairojr-software-engineer/talking-a-little-about-this-wonderful-linux-distro-5ahd</link>
      <guid>https://dev.to/jairojr-software-engineer/talking-a-little-about-this-wonderful-linux-distro-5ahd</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/jairojr-software-engineer/why-i-drop-from-fedora-to-brgv-os-j1e" class="crayons-story__hidden-navigation-link"&gt;Why I drop from Fedora to BRGV-OS&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/jairojr-software-engineer" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1522014%2Fd0a0ab97-4819-442c-a1d3-a5a4bd9ab052.jpeg" alt="jairojr-software-engineer profile" class="crayons-avatar__image" width="800" height="800"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/jairojr-software-engineer" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Jairo Junior
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Jairo Junior
                
              
              &lt;div id="story-author-preview-content-3781994" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/jairojr-software-engineer" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1522014%2Fd0a0ab97-4819-442c-a1d3-a5a4bd9ab052.jpeg" class="crayons-avatar__image" alt="" width="800" height="800"&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Jairo Junior&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/jairojr-software-engineer/why-i-drop-from-fedora-to-brgv-os-j1e" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;May 30&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/jairojr-software-engineer/why-i-drop-from-fedora-to-brgv-os-j1e" id="article-link-3781994"&gt;
          Why I drop from Fedora to BRGV-OS
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/devjournal"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;devjournal&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/linux"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;linux&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/opensource"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;opensource&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/ui"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;ui&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
            &lt;a href="https://dev.to/jairojr-software-engineer/why-i-drop-from-fedora-to-brgv-os-j1e#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              &lt;span class="hidden s:inline"&gt;Add Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            3 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
    </item>
    <item>
      <title>Why I drop from Fedora to BRGV-OS</title>
      <dc:creator>Jairo Junior</dc:creator>
      <pubDate>Sat, 30 May 2026 05:40:19 +0000</pubDate>
      <link>https://dev.to/jairojr-software-engineer/why-i-drop-from-fedora-to-brgv-os-j1e</link>
      <guid>https://dev.to/jairojr-software-engineer/why-i-drop-from-fedora-to-brgv-os-j1e</guid>
      <description>&lt;p&gt;Hello!&lt;/p&gt;

&lt;p&gt;I'm Jairo.&lt;/p&gt;

&lt;p&gt;This week I found myself doing something that probably every Linux user has done at least once: looking for a new distro even though my current one was working perfectly fine 😅.&lt;/p&gt;

&lt;p&gt;I was browsing YouTube, looking for something to distract myself and calm my anxiety a little, when I found a video talking about a Linux distribution that promised three things I care a lot about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Gaming&lt;/li&gt;
&lt;li&gt;Development&lt;/li&gt;
&lt;li&gt;A beautiful desktop experience&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'm not going to lie: that last one immediately caught my attention.&lt;/p&gt;

&lt;p&gt;The possibility of making my PC look like a MacBook without paying MacBook prices is always tempting.&lt;/p&gt;

&lt;p&gt;And that's how I discovered &lt;strong&gt;BRGV OS&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wait... Void Linux?
&lt;/h2&gt;

&lt;p&gt;The first thing that surprised me wasn't BRGV OS itself.&lt;/p&gt;

&lt;p&gt;It was its foundation.&lt;/p&gt;

&lt;p&gt;BRGV OS is built on top of &lt;strong&gt;Void Linux&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;And my immediate reaction was:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What is Void Linux?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I've spent most of my Linux journey around Ubuntu, Linux Mint, Fedora, Arch Linux, and CachyOS. Somehow Void Linux had completely escaped my radar.&lt;/p&gt;

&lt;p&gt;Coming from Fedora and Debian-based systems, everything felt a little unfamiliar at first. Different package manager, different ecosystem, different philosophy.&lt;/p&gt;

&lt;p&gt;And honestly? That's exactly what made it interesting.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I Decided to Try It
&lt;/h2&gt;

&lt;p&gt;I have a pretty simple checklist for my daily machine.&lt;/p&gt;

&lt;p&gt;I need something that allows me to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Code all day&lt;/li&gt;
&lt;li&gt;Play games at night&lt;/li&gt;
&lt;li&gt;Customize everything&lt;/li&gt;
&lt;li&gt;Stay fast and responsive&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Fedora already does most of that extremely well. In fact, Fedora with GNOME is still one of my favorite Linux experiences ever.&lt;/p&gt;

&lt;p&gt;So BRGV OS had a difficult mission: it needed to convince me to leave my comfort zone.&lt;/p&gt;

&lt;h2&gt;
  
  
  The First Impression
&lt;/h2&gt;

&lt;p&gt;What immediately stood out was how polished everything felt.&lt;/p&gt;

&lt;p&gt;Most Linux installations follow a predictable path:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install Linux&lt;/li&gt;
&lt;li&gt;Install your tools&lt;/li&gt;
&lt;li&gt;Spend three hours configuring your desktop&lt;/li&gt;
&lt;li&gt;Break something&lt;/li&gt;
&lt;li&gt;Fix it&lt;/li&gt;
&lt;li&gt;Finally enjoy the system&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;BRGV OS skips a lot of that process.&lt;/p&gt;

&lt;p&gt;Out of the box, you already get:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hyprland&lt;/li&gt;
&lt;li&gt;Beautiful theming&lt;/li&gt;
&lt;li&gt;Modern desktop layout&lt;/li&gt;
&lt;li&gt;Gaming-focused configuration&lt;/li&gt;
&lt;li&gt;Developer-friendly environment&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It feels much closer to one of those highly customized Linux setups you see on YouTube than a fresh installation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Performance
&lt;/h2&gt;

&lt;p&gt;This is where Void Linux starts to shine.&lt;/p&gt;

&lt;p&gt;The system feels incredibly lightweight. Applications launch quickly, memory usage stays low, and everything feels responsive.&lt;/p&gt;

&lt;p&gt;Coming from Fedora, I wasn't expecting such a noticeable difference, but there is definitely a feeling of reduced overhead.&lt;/p&gt;

&lt;p&gt;It feels a bit like driving a lightweight sports car instead of a luxury SUV.&lt;/p&gt;

&lt;p&gt;Both are fast.&lt;/p&gt;

&lt;p&gt;One just feels faster.&lt;/p&gt;

&lt;h2&gt;
  
  
  Gaming on BRGV OS
&lt;/h2&gt;

&lt;p&gt;Linux gaming has evolved dramatically over the last few years.&lt;/p&gt;

&lt;p&gt;Between Steam, Proton, Vulkan, and Wine, gaming on Linux is no longer an experiment. It's a real option.&lt;/p&gt;

&lt;p&gt;BRGV OS embraces that reality.&lt;/p&gt;

&lt;p&gt;Gaming isn't treated like an afterthought. The distribution clearly targets users who want to code during the day and play during the evening—which, honestly, describes a large percentage of software engineers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Development Experience
&lt;/h2&gt;

&lt;p&gt;As a backend engineer, my requirements are pretty simple:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Docker&lt;/li&gt;
&lt;li&gt;IntelliJ&lt;/li&gt;
&lt;li&gt;Git&lt;/li&gt;
&lt;li&gt;Multiple terminals&lt;/li&gt;
&lt;li&gt;Good performance&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;BRGV OS handled all of them surprisingly well.&lt;/p&gt;

&lt;p&gt;No drama.&lt;/p&gt;

&lt;p&gt;No weird workarounds.&lt;/p&gt;

&lt;p&gt;No endless troubleshooting sessions.&lt;/p&gt;

&lt;p&gt;Which is exactly what I want from my workstation.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Pros
&lt;/h2&gt;

&lt;p&gt;Things I really liked:&lt;/p&gt;

&lt;p&gt;✅ Lightweight and fast&lt;/p&gt;

&lt;p&gt;✅ Beautiful out of the box&lt;/p&gt;

&lt;p&gt;✅ Highly customizable&lt;/p&gt;

&lt;p&gt;✅ Great gaming experience&lt;/p&gt;

&lt;p&gt;✅ Excellent for developers&lt;/p&gt;

&lt;p&gt;✅ A great opportunity to learn something beyond Debian, Fedora, and Arch&lt;/p&gt;

&lt;h2&gt;
  
  
  The Cons
&lt;/h2&gt;

&lt;p&gt;No distribution is perfect.&lt;/p&gt;

&lt;p&gt;Some trade-offs I noticed:&lt;/p&gt;

&lt;p&gt;❌ Smaller community&lt;/p&gt;

&lt;p&gt;❌ Less documentation than Ubuntu or Fedora&lt;/p&gt;

&lt;p&gt;❌ Fewer tutorials specifically targeting Void Linux&lt;/p&gt;

&lt;p&gt;❌ Requires a bit more curiosity and willingness to learn&lt;/p&gt;

&lt;p&gt;But honestly, if you're the type of person who installs Linux for fun, that's probably not a problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  So... Is It Better Than Fedora?
&lt;/h2&gt;

&lt;p&gt;No.&lt;/p&gt;

&lt;p&gt;And yes.&lt;/p&gt;

&lt;p&gt;Fedora is still one of the best Linux distributions I've ever used.&lt;/p&gt;

&lt;p&gt;But BRGV OS offers something different.&lt;/p&gt;

&lt;p&gt;It feels fresh.&lt;/p&gt;

&lt;p&gt;It feels lightweight.&lt;/p&gt;

&lt;p&gt;It feels highly personal.&lt;/p&gt;

&lt;p&gt;Most importantly, it reminded me why I started using Linux in the first place.&lt;/p&gt;

&lt;p&gt;Not because it's the easiest option.&lt;/p&gt;

&lt;p&gt;Not because it's the most popular.&lt;/p&gt;

&lt;p&gt;But because there's always something new to learn.&lt;/p&gt;

&lt;p&gt;And sometimes that's exactly what we need.&lt;/p&gt;

&lt;p&gt;Even if we started looking for it just to calm our anxiety for a few hours 😄.&lt;/p&gt;

&lt;h2&gt;
  
  
  This is how my linux desktop looks like right now:
&lt;/h2&gt;

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

</description>
      <category>devjournal</category>
      <category>linux</category>
      <category>opensource</category>
      <category>ui</category>
    </item>
    <item>
      <title>You don't know concurrency, and I can prove it!!!</title>
      <dc:creator>Jairo Junior</dc:creator>
      <pubDate>Wed, 29 Apr 2026 00:52:51 +0000</pubDate>
      <link>https://dev.to/jairojr-software-engineer/you-dont-know-concurrency-and-i-can-prove-it-4g6l</link>
      <guid>https://dev.to/jairojr-software-engineer/you-dont-know-concurrency-and-i-can-prove-it-4g6l</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/jairojr-software-engineer/know-coroutines-doesnt-mean-you-know-concurrency-read-this-to-know-how-to-understand-it-420p" class="crayons-story__hidden-navigation-link"&gt;Know coroutines doesn't mean you know concurrency, read this to know how to understand it.&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/jairojr-software-engineer" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1522014%2Fd0a0ab97-4819-442c-a1d3-a5a4bd9ab052.jpeg" alt="jairojr-software-engineer profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/jairojr-software-engineer" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Jairo Junior
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Jairo Junior
                
              
              &lt;div id="story-author-preview-content-3554622" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/jairojr-software-engineer" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1522014%2Fd0a0ab97-4819-442c-a1d3-a5a4bd9ab052.jpeg" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Jairo Junior&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/jairojr-software-engineer/know-coroutines-doesnt-mean-you-know-concurrency-read-this-to-know-how-to-understand-it-420p" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Apr 26&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/jairojr-software-engineer/know-coroutines-doesnt-mean-you-know-concurrency-read-this-to-know-how-to-understand-it-420p" id="article-link-3554622"&gt;
          Know coroutines doesn't mean you know concurrency, read this to know how to understand it.
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/kotlin"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;kotlin&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/programming"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;programming&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/rust"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;rust&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/ai"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;ai&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
            &lt;a href="https://dev.to/jairojr-software-engineer/know-coroutines-doesnt-mean-you-know-concurrency-read-this-to-know-how-to-understand-it-420p#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              &lt;span class="hidden s:inline"&gt;Add Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            3 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
    </item>
    <item>
      <title>Know coroutines doesn't mean you know concurrency, read this to know how to understand it.</title>
      <dc:creator>Jairo Junior</dc:creator>
      <pubDate>Sun, 26 Apr 2026 21:46:03 +0000</pubDate>
      <link>https://dev.to/jairojr-software-engineer/know-coroutines-doesnt-mean-you-know-concurrency-read-this-to-know-how-to-understand-it-420p</link>
      <guid>https://dev.to/jairojr-software-engineer/know-coroutines-doesnt-mean-you-know-concurrency-read-this-to-know-how-to-understand-it-420p</guid>
      <description>&lt;h2&gt;
  
  
  Hello, I’m Jairo 👋
&lt;/h2&gt;

&lt;p&gt;The dev.to writer you love the most.&lt;br&gt;&lt;br&gt;
(Ok… maybe not yet 😅 but let me believe that for a second.)&lt;br&gt;
First of all, thank you for taking the time to read this.&lt;br&gt;&lt;br&gt;
I hope you learn something new — or at least enjoy the journey.&lt;/p&gt;


&lt;h2&gt;
  
  
  🚀 Why I built a Thread Pool
&lt;/h2&gt;

&lt;p&gt;This week I was looking for projects to improve my software engineering skills — not just frameworks or tools, but the &lt;strong&gt;fundamentals&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Lately, I’ve been learning Rust as my “low-level playground” language, building things closer to the system level. My goal is to understand &lt;em&gt;what happens under the hood&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;So I started exploring ideas like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;building a Redis-like database from scratch
&lt;/li&gt;
&lt;li&gt;understanding memory management
&lt;/li&gt;
&lt;li&gt;working with threads and concurrency
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And that’s when I decided:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Why not build my own thread pool?”&lt;/p&gt;
&lt;/blockquote&gt;


&lt;h2&gt;
  
  
  🧠 Why a Thread Pool?
&lt;/h2&gt;

&lt;p&gt;When learning a new language, we usually focus on things like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;strings
&lt;/li&gt;
&lt;li&gt;collections
&lt;/li&gt;
&lt;li&gt;classes / structs
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But one thing that’s often ignored:&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;how concurrency actually works&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A thread pool solves a very real problem:&lt;/p&gt;

&lt;p&gt;❌ One thread per task → high memory usage&lt;br&gt;&lt;br&gt;
✅ Fixed workers → controlled concurrency  &lt;/p&gt;

&lt;p&gt;Instead of creating a new thread for every job, we:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;create a limited number of workers
&lt;/li&gt;
&lt;li&gt;reuse them
&lt;/li&gt;
&lt;li&gt;keep them alive
&lt;/li&gt;
&lt;li&gt;let them consume tasks from a queue
&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  ⚙️ How I built it
&lt;/h2&gt;

&lt;p&gt;The idea is simple:&lt;/p&gt;

&lt;p&gt;main → pushes jobs → shared queue → workers → results queue  &lt;/p&gt;

&lt;p&gt;Workers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;stay alive forever
&lt;/li&gt;
&lt;li&gt;sleep when there’s no work
&lt;/li&gt;
&lt;li&gt;wake up when a new job arrives
&lt;/li&gt;
&lt;li&gt;execute the job
&lt;/li&gt;
&lt;li&gt;store the result
&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  🧩 Core Architecture
&lt;/h2&gt;

&lt;p&gt;Queue (Arc + Mutex + Condvar)&lt;br&gt;&lt;br&gt;
        ↓&lt;br&gt;&lt;br&gt;
   Workers (threads)&lt;br&gt;&lt;br&gt;
        ↓&lt;br&gt;&lt;br&gt;
  Result Queue  &lt;/p&gt;


&lt;h2&gt;
  
  
  🧪 Real code example
&lt;/h2&gt;

&lt;p&gt;Here’s the core of the worker loop:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;loop&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;process&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;shared_queue&lt;/span&gt;&lt;span class="nf"&gt;.get_process&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;process&lt;/span&gt;&lt;span class="nf"&gt;.run&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="n"&gt;result_queue&lt;/span&gt;&lt;span class="nf"&gt;.push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nn"&gt;Result&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;process&lt;/span&gt;&lt;span class="nf"&gt;.get_id&lt;/span&gt;&lt;span class="p"&gt;()));&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Workers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;continuously fetch jobs
&lt;/li&gt;
&lt;li&gt;execute them
&lt;/li&gt;
&lt;li&gt;store results
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Shared Queue (the heart of everything)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="n"&gt;Queue&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;processes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Arc&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Mutex&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;VecDeque&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Process&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Condvar&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why this?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Arc&lt;/code&gt; → shared across threads
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Mutex&lt;/code&gt; → safe mutation
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;VecDeque&lt;/code&gt; → efficient queue
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Condvar&lt;/code&gt; → sleep/wake mechanism
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Adding a job
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="k"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;process&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Process&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;processes&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;condvar&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;*&lt;/span&gt;&lt;span class="k"&gt;self&lt;/span&gt;&lt;span class="py"&gt;.processes&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="n"&gt;processes&lt;/span&gt;&lt;span class="nf"&gt;.lock&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="nf"&gt;.unwrap&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="nf"&gt;.push_back&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;process&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;condvar&lt;/span&gt;&lt;span class="nf"&gt;.notify_one&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Getting a job (blocking wait)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;get_process&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="k"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Process&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lock&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;condvar&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;*&lt;/span&gt;&lt;span class="k"&gt;self&lt;/span&gt;&lt;span class="py"&gt;.processes&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;processes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;lock&lt;/span&gt;&lt;span class="nf"&gt;.lock&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="nf"&gt;.unwrap&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;processes&lt;/span&gt;&lt;span class="nf"&gt;.is_empty&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;processes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;condvar&lt;/span&gt;&lt;span class="nf"&gt;.wait&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;processes&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nf"&gt;.unwrap&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="n"&gt;processes&lt;/span&gt;&lt;span class="nf"&gt;.pop_front&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="nf"&gt;.unwrap&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 This is where the magic happens:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;if no jobs → thread sleeps
&lt;/li&gt;
&lt;li&gt;when job arrives → thread wakes up
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧠 Arc + Mutex (the big lesson)
&lt;/h2&gt;

&lt;p&gt;This was the hardest part for me.&lt;/p&gt;

&lt;h3&gt;
  
  
  Arc
&lt;/h3&gt;

&lt;p&gt;Allows multiple threads to own the same data&lt;/p&gt;

&lt;h3&gt;
  
  
  Mutex
&lt;/h3&gt;

&lt;p&gt;Ensures only one thread mutates at a time&lt;/p&gt;

&lt;p&gt;Together:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="nb"&gt;Arc&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Mutex&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;VecDeque&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Process&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This gives you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;shared ownership
&lt;/li&gt;
&lt;li&gt;safe mutation
&lt;/li&gt;
&lt;li&gt;no race conditions
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Important detail
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;queue_clone&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;queue&lt;/span&gt;&lt;span class="nf"&gt;.clone&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This does NOT clone the data.&lt;/p&gt;

&lt;p&gt;It creates a &lt;strong&gt;new pointer to the same memory&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  Mutex lock
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;guard&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;mutex&lt;/span&gt;&lt;span class="nf"&gt;.lock&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="nf"&gt;.unwrap&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Means:&lt;/p&gt;

&lt;p&gt;“I want exclusive access to this data”&lt;/p&gt;

&lt;p&gt;If another thread is using it:&lt;/p&gt;

&lt;p&gt;👉 you wait.&lt;/p&gt;




&lt;h2&gt;
  
  
  😴 Condvar (sleeping workers)
&lt;/h2&gt;

&lt;p&gt;Without this, your workers would:&lt;/p&gt;

&lt;p&gt;loop forever → burning CPU  &lt;/p&gt;

&lt;p&gt;With &lt;code&gt;Condvar&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;no job → sleep&lt;br&gt;&lt;br&gt;
new job → wake up  &lt;/p&gt;

&lt;p&gt;This makes your system:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;efficient
&lt;/li&gt;
&lt;li&gt;responsive
&lt;/li&gt;
&lt;li&gt;production-like
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  💡 What I learned
&lt;/h2&gt;

&lt;p&gt;At some point I realized:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I wasn’t just learning Rust…&lt;br&gt;&lt;br&gt;
I was rebuilding what a dispatcher does internally.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Things became much clearer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;how thread pools work
&lt;/li&gt;
&lt;li&gt;how coroutines are implemented under the hood
&lt;/li&gt;
&lt;li&gt;how shared memory works
&lt;/li&gt;
&lt;li&gt;why synchronization matters
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🤖 Using AI as a teacher (not a code generator)
&lt;/h2&gt;

&lt;p&gt;One important thing about this project: I didn’t use ChatGPT to generate the solution for me.&lt;/p&gt;

&lt;p&gt;Instead, I used it as a &lt;strong&gt;teacher&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Whenever I got stuck, I asked things like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;“Why does this break?”
&lt;/li&gt;
&lt;li&gt;“What is the responsibility of this component?”
&lt;/li&gt;
&lt;li&gt;“Am I modeling this correctly?”
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And then I implemented everything myself.&lt;/p&gt;

&lt;p&gt;That made a huge difference.&lt;/p&gt;

&lt;p&gt;Because instead of just copying code, I was forced to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;understand the concepts
&lt;/li&gt;
&lt;li&gt;reason about concurrency
&lt;/li&gt;
&lt;li&gt;fix my own mistakes
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And honestly, that’s where the real learning happens.&lt;/p&gt;




&lt;h2&gt;
  
  
  📦 The project
&lt;/h2&gt;

&lt;p&gt;You can check the full implementation here:&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://github.com/jairo-dev-junior/thread-pool" rel="noopener noreferrer"&gt;https://github.com/jairo-dev-junior/thread-pool&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🎯 Final thoughts
&lt;/h2&gt;

&lt;p&gt;This project was one of those “click moments”.&lt;/p&gt;

&lt;p&gt;Rust forces you to think about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ownership
&lt;/li&gt;
&lt;li&gt;memory
&lt;/li&gt;
&lt;li&gt;concurrency
&lt;/li&gt;
&lt;li&gt;synchronization
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No magic. Just control.&lt;/p&gt;

&lt;p&gt;And yeah… I still need to implement a clean shutdown 😅&lt;/p&gt;




&lt;p&gt;Thanks for reading until here 🙏&lt;br&gt;&lt;br&gt;
See you in the next article 🚀&lt;/p&gt;

</description>
      <category>kotlin</category>
      <category>programming</category>
      <category>rust</category>
      <category>ai</category>
    </item>
    <item>
      <title>Hy guys, I've updated my portfolio, if you want to see it, its here:
https://jairo.dev.br/</title>
      <dc:creator>Jairo Junior</dc:creator>
      <pubDate>Fri, 27 Mar 2026 18:02:48 +0000</pubDate>
      <link>https://dev.to/jairojr-software-engineer/hy-guys-ive-updated-my-portfolio-if-you-want-to-see-it-its-herehttpsjairodevbr-51jd</link>
      <guid>https://dev.to/jairojr-software-engineer/hy-guys-ive-updated-my-portfolio-if-you-want-to-see-it-its-herehttpsjairodevbr-51jd</guid>
      <description>&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
      &lt;div class="c-embed__body flex items-center justify-between"&gt;
        &lt;a href="https://jairo.dev.br/" rel="noopener noreferrer" class="c-link fw-bold flex items-center"&gt;
          &lt;span class="mr-2"&gt;jairo.dev.br&lt;/span&gt;
          

        &lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


</description>
    </item>
    <item>
      <title>Did you know that your app just need an umbrella, let's talk about it and the impportance of the rate-limiting in your app.</title>
      <dc:creator>Jairo Junior</dc:creator>
      <pubDate>Fri, 13 Mar 2026 11:29:41 +0000</pubDate>
      <link>https://dev.to/jairojr-software-engineer/did-you-know-that-your-app-just-need-an-umbrella-lets-talk-about-it-and-the-impportance-of-the-4jmd</link>
      <guid>https://dev.to/jairojr-software-engineer/did-you-know-that-your-app-just-need-an-umbrella-lets-talk-about-it-and-the-impportance-of-the-4jmd</guid>
      <description>&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://dev.to/jairojr-software-engineer/rate-limiting-how-to-stop-your-api-from-drowning-in-requests-31mm" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvlj5264czof1e6to0b4i.jpg" height="436" class="m-0" width="800"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://dev.to/jairojr-software-engineer/rate-limiting-how-to-stop-your-api-from-drowning-in-requests-31mm" rel="noopener noreferrer" class="c-link"&gt;
            Rate Limiting: How to Stop Your API From Drowning in Requests - DEV Community
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            Hello! I'm Jairo.  Your favorite dev.to writer.  Just kidding — I know I'm not. Just breaking the ice...
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8j7kvp660rqzt99zui8e.png" width="300" height="299"&gt;
          dev.to
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>backend</category>
      <category>learning</category>
      <category>cloud</category>
      <category>sre</category>
    </item>
    <item>
      <title>Rate Limiting: How to Stop Your API From Drowning in Requests</title>
      <dc:creator>Jairo Junior</dc:creator>
      <pubDate>Tue, 10 Mar 2026 18:34:04 +0000</pubDate>
      <link>https://dev.to/jairojr-software-engineer/rate-limiting-how-to-stop-your-api-from-drowning-in-requests-31mm</link>
      <guid>https://dev.to/jairojr-software-engineer/rate-limiting-how-to-stop-your-api-from-drowning-in-requests-31mm</guid>
      <description>&lt;p&gt;Hello! I'm Jairo.&lt;/p&gt;

&lt;p&gt;Your favorite dev.to writer.&lt;/p&gt;

&lt;p&gt;Just kidding — I know I'm not. Just breaking the ice 😄&lt;/p&gt;

&lt;p&gt;Last week I was reading an excellent book called &lt;strong&gt;System Design Interview by Alex Xu&lt;/strong&gt;. If you work with backend systems and haven't read it yet, you probably should.&lt;/p&gt;

&lt;p&gt;One concept from the book reminded me of something interesting about software engineers: we all &lt;strong&gt;know rate limiting exists&lt;/strong&gt;, but very few engineers really understand &lt;strong&gt;when to use it, how it works internally, and which strategy to choose&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;So today let's talk about one of the &lt;strong&gt;most important protections your API can have&lt;/strong&gt;: rate limiting.&lt;/p&gt;




&lt;h1&gt;
  
  
  What Is Rate Limiting?
&lt;/h1&gt;

&lt;p&gt;Let’s imagine something simple.&lt;/p&gt;

&lt;p&gt;Your application is a person walking in the rain, and every &lt;strong&gt;raindrop represents an HTTP request&lt;/strong&gt; hitting your server.&lt;/p&gt;

&lt;p&gt;At first, everything is fine. Then the rain gets heavier. More drops. More requests. Eventually your application becomes completely soaked — CPU usage increases, your database starts struggling, and suddenly your server turns into soup.&lt;/p&gt;

&lt;p&gt;Not ideal.&lt;/p&gt;

&lt;p&gt;What do we do when it's raining?&lt;/p&gt;

&lt;p&gt;We grab an &lt;strong&gt;umbrella&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(No, not the evil corporation from Resident Evil — a real umbrella.)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;That umbrella represents a &lt;strong&gt;rate limiter&lt;/strong&gt;. It doesn't stop the rain entirely; it simply &lt;strong&gt;controls how much rain reaches you&lt;/strong&gt;. In the same way, a rate limiter allows some requests to pass while blocking the excess ones, protecting your system from overload.&lt;/p&gt;




&lt;h1&gt;
  
  
  What Happens Without Rate Limiting?
&lt;/h1&gt;

&lt;p&gt;Without rate limiting, a client could send:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;10 requests per second
100 requests per second
1000 requests per second
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your application will try to process every request it receives. Eventually this leads to CPU overload, database contention, cascading failures, and sometimes a full system crash.&lt;/p&gt;

&lt;p&gt;With rate limiting in place, the server can simply respond with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;HTTP 429 - Too Many Requests
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Which is basically your server saying:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Slow down, my friend."&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h1&gt;
  
  
  Common Rate Limiting Algorithms
&lt;/h1&gt;

&lt;p&gt;There are several strategies used to implement rate limiting. Each one has different trade-offs depending on the system requirements.&lt;/p&gt;

&lt;p&gt;Let's go through the most common ones.&lt;/p&gt;




&lt;h1&gt;
  
  
  Token Bucket
&lt;/h1&gt;

&lt;p&gt;The &lt;strong&gt;Token Bucket&lt;/strong&gt; algorithm is one of the most widely used rate limiting strategies.&lt;/p&gt;

&lt;p&gt;Imagine a bucket filled with tokens. Every incoming request must take &lt;strong&gt;one token&lt;/strong&gt; to be processed. If the bucket still has tokens, the request is allowed. If the bucket is empty, the request is rejected.&lt;/p&gt;

&lt;p&gt;Tokens are added back into the bucket at a fixed rate.&lt;/p&gt;

&lt;p&gt;Example configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Bucket capacity: 10 tokens
Refill rate: 1 token per second
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This allows the system to support short bursts of traffic, but once all tokens are consumed, incoming requests must wait until new tokens are added.&lt;/p&gt;

&lt;p&gt;This algorithm is popular because it supports bursts while still controlling overall traffic.&lt;/p&gt;




&lt;h1&gt;
  
  
  Leaky Bucket
&lt;/h1&gt;

&lt;p&gt;The &lt;strong&gt;Leaky Bucket&lt;/strong&gt; algorithm works a bit differently.&lt;/p&gt;

&lt;p&gt;Imagine a bucket with a small hole at the bottom. Requests enter the bucket like water, but water leaks out at a constant rate.&lt;/p&gt;

&lt;p&gt;If too many requests arrive too quickly, the bucket fills up and eventually overflows, causing new requests to be rejected.&lt;/p&gt;

&lt;p&gt;This approach forces requests to be processed at a &lt;strong&gt;constant and predictable rate&lt;/strong&gt;, which helps smooth traffic spikes.&lt;/p&gt;

&lt;p&gt;The downside is that it doesn't handle bursts as well as the token bucket strategy.&lt;/p&gt;




&lt;h1&gt;
  
  
  Sliding Window Log
&lt;/h1&gt;

&lt;p&gt;The &lt;strong&gt;Sliding Window Log&lt;/strong&gt; strategy tracks the timestamp of every request.&lt;/p&gt;

&lt;p&gt;For example, if your limit is &lt;strong&gt;5 requests per minute&lt;/strong&gt;, the system checks all requests that happened within the last 60 seconds.&lt;/p&gt;

&lt;p&gt;If five requests already exist in that window, the new request is rejected. If not, it is allowed.&lt;/p&gt;

&lt;p&gt;This method is very accurate because it always considers the real time window instead of fixed intervals.&lt;/p&gt;

&lt;p&gt;However, it requires storing many timestamps, which can become expensive at large scale.&lt;/p&gt;




&lt;h1&gt;
  
  
  Sliding Window Counter
&lt;/h1&gt;

&lt;p&gt;The &lt;strong&gt;Sliding Window Counter&lt;/strong&gt; is an optimization of the sliding window idea.&lt;/p&gt;

&lt;p&gt;Instead of storing every timestamp, it keeps track of only two counters: requests in the &lt;strong&gt;current time window&lt;/strong&gt; and requests in the &lt;strong&gt;previous window&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The algorithm then calculates a weighted average between those two counters to estimate the real request rate.&lt;/p&gt;

&lt;p&gt;This method dramatically reduces memory usage while still providing good accuracy, which is why it is commonly used in large distributed systems.&lt;/p&gt;




&lt;h1&gt;
  
  
  Implementing Rate Limiting in Java
&lt;/h1&gt;

&lt;p&gt;Now let's look at a few simple ways to implement rate limiting in Java.&lt;/p&gt;

&lt;p&gt;These examples are simplified but illustrate the idea.&lt;/p&gt;




&lt;h2&gt;
  
  
  Simple In-Memory Rate Limit
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.concurrent.ConcurrentHashMap&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SimpleRateLimiter&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="nc"&gt;ConcurrentHashMap&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Long&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;lastRequest&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ConcurrentHashMap&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;gt;();&lt;/span&gt;

    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;boolean&lt;/span&gt; &lt;span class="nf"&gt;allowRequest&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;clientId&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;currentTimeMillis&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="nc"&gt;Long&lt;/span&gt; &lt;span class="n"&gt;last&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;lastRequest&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;get&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;clientId&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;last&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;last&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;lastRequest&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;put&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;clientId&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;

        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This example allows &lt;strong&gt;one request per second per client&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Token Bucket Implementation
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.concurrent.atomic.AtomicInteger&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;TokenBucket&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;capacity&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="nc"&gt;AtomicInteger&lt;/span&gt; &lt;span class="n"&gt;tokens&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;AtomicInteger&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;capacity&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;boolean&lt;/span&gt; &lt;span class="nf"&gt;allowRequest&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tokens&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;get&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;tokens&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;decrementAndGet&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;

    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;refill&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tokens&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;get&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;capacity&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;tokens&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;incrementAndGet&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A scheduled task can periodically refill tokens.&lt;/p&gt;




&lt;h2&gt;
  
  
  Using Resilience4j (Production Approach)
&lt;/h2&gt;

&lt;p&gt;In production systems, engineers often use libraries instead of building rate limiters from scratch.&lt;/p&gt;

&lt;p&gt;One popular option is &lt;strong&gt;Resilience4j&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;RateLimiterConfig&lt;/span&gt; &lt;span class="n"&gt;config&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;RateLimiterConfig&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;custom&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;
        &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;limitForPeriod&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
        &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;limitRefreshPeriod&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Duration&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;ofSeconds&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt;
        &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;timeoutDuration&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Duration&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;ofMillis&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt;
        &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;

&lt;span class="nc"&gt;RateLimiter&lt;/span&gt; &lt;span class="n"&gt;rateLimiter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;RateLimiter&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;of&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"apiLimiter"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

&lt;span class="nc"&gt;Supplier&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;decoratedSupplier&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
        &lt;span class="nc"&gt;RateLimiter&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;decorateSupplier&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rateLimiter&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="s"&gt;"Hello API"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

&lt;span class="nc"&gt;Try&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;ofSupplier&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;decoratedSupplier&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
        &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;onFailure&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Rate limit exceeded"&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This approach integrates well with Spring Boot and production APIs.&lt;/p&gt;




&lt;h1&gt;
  
  
  Where Rate Limiting Is Usually Applied
&lt;/h1&gt;

&lt;p&gt;Rate limiting can be implemented in several layers of your architecture.&lt;/p&gt;

&lt;p&gt;At the &lt;strong&gt;API Gateway&lt;/strong&gt;, tools like NGINX, Kong, Cloudflare, or AWS API Gateway commonly enforce limits before traffic even reaches your application.&lt;/p&gt;

&lt;p&gt;Inside the &lt;strong&gt;application layer&lt;/strong&gt;, libraries like Resilience4j or Bucket4j allow developers to control request flow directly within the service.&lt;/p&gt;

&lt;p&gt;For &lt;strong&gt;distributed systems&lt;/strong&gt;, Redis is often used to share rate limit counters across multiple instances.&lt;/p&gt;




&lt;h1&gt;
  
  
  Final Thoughts
&lt;/h1&gt;

&lt;p&gt;Rate limiting looks simple on the surface. But once your system begins handling real traffic, it quickly becomes clear how important it is.&lt;/p&gt;

&lt;p&gt;A well-designed rate limiter protects your:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;API&lt;/li&gt;
&lt;li&gt;infrastructure&lt;/li&gt;
&lt;li&gt;databases&lt;/li&gt;
&lt;li&gt;users&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And sometimes, the difference between a stable system and an outage is surprisingly simple.&lt;/p&gt;

&lt;p&gt;Sometimes your API just needs…&lt;/p&gt;

&lt;p&gt;a good umbrella ☔&lt;/p&gt;

</description>
      <category>backend</category>
      <category>learning</category>
      <category>cloud</category>
      <category>sre</category>
    </item>
    <item>
      <title>Stop building a new microservice for every problem.
I almost built another backend just to handle personalization logic in my workout app.
Instead, I used AI as a controlled decision layer.
AI doesn’t replace architecture.
It becomes part of it.</title>
      <dc:creator>Jairo Junior</dc:creator>
      <pubDate>Tue, 03 Mar 2026 12:14:01 +0000</pubDate>
      <link>https://dev.to/jairojr-software-engineer/stop-building-a-new-microservice-for-every-problem-i-almost-built-another-backend-just-to-handle-1j2i</link>
      <guid>https://dev.to/jairojr-software-engineer/stop-building-a-new-microservice-for-every-problem-i-almost-built-another-backend-just-to-handle-1j2i</guid>
      <description>&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://dev.to/jairojr-software-engineer/replacing-a-rule-engine-with-ai-a-solo-developer-decision-37jf" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvjh45aogjmsb5salcli7.png" height="350" class="m-0" width="800"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://dev.to/jairojr-software-engineer/replacing-a-rule-engine-with-ai-a-solo-developer-decision-37jf" rel="noopener noreferrer" class="c-link"&gt;
            Replacing a Rule Engine with AI: A Solo Developer Decision - DEV Community
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            Hello! I’m Jairo Jr. 👋 I hope you’re doing great.  I’m a backend software engineer and I’m currently...
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8j7kvp660rqzt99zui8e.png" width="300" height="299"&gt;
          dev.to
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>ai</category>
      <category>backend</category>
      <category>architecture</category>
      <category>programming</category>
    </item>
    <item>
      <title>Replacing a Rule Engine with AI: A Solo Developer Decision</title>
      <dc:creator>Jairo Junior</dc:creator>
      <pubDate>Tue, 03 Mar 2026 12:05:40 +0000</pubDate>
      <link>https://dev.to/jairojr-software-engineer/replacing-a-rule-engine-with-ai-a-solo-developer-decision-37jf</link>
      <guid>https://dev.to/jairojr-software-engineer/replacing-a-rule-engine-with-ai-a-solo-developer-decision-37jf</guid>
      <description>&lt;p&gt;Hello! I’m Jairo Jr. 👋&lt;br&gt;
I hope you’re doing great.&lt;/p&gt;

&lt;p&gt;I’m a backend software engineer and I’m currently building an app to generate gym workouts for beginners.&lt;br&gt;
And at some point, I hit a &lt;strong&gt;very real problem&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I needed the app to create something &lt;strong&gt;personalized&lt;/strong&gt; for each user.&lt;/p&gt;

&lt;p&gt;And that’s where things got complicated.&lt;/p&gt;


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

&lt;p&gt;I started asking myself:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Should I create another backend just for personalization?&lt;/li&gt;
&lt;li&gt;Should I build a microservice to handle user profiles and workout rules?&lt;/li&gt;
&lt;li&gt;Should I design a full recommendation engine with categories, difficulty levels, and decision trees?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Technically, all of that is possible.&lt;/p&gt;

&lt;p&gt;But then reality kicked in.&lt;/p&gt;

&lt;p&gt;This is a solo project.&lt;br&gt;
I already have one backend running.&lt;br&gt;
Creating another service just to manage complex workout logic would mean:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;more infrastructure cost&lt;/li&gt;
&lt;li&gt;more maintenance&lt;/li&gt;
&lt;li&gt;more mental overhead&lt;/li&gt;
&lt;li&gt;slower development&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So I stopped and asked a different question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Do I really need to build all this logic manually?&lt;/p&gt;
&lt;/blockquote&gt;


&lt;h2&gt;
  
  
  The “backend-first” mindset (and why it didn’t make sense)
&lt;/h2&gt;

&lt;p&gt;My first idea was very classic backend thinking:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;collect user data (goal, level, duration)&lt;/li&gt;
&lt;li&gt;map everything into a workout category tree&lt;/li&gt;
&lt;li&gt;choose exercises based on rules&lt;/li&gt;
&lt;li&gt;define sets and repetitions programmatically&lt;/li&gt;
&lt;li&gt;store and version all of this logic&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Basically, build a recommendation engine from scratch.&lt;/p&gt;

&lt;p&gt;For a big team? Maybe.&lt;br&gt;
For a solo app? Overkill.&lt;/p&gt;

&lt;p&gt;So instead of asking &lt;em&gt;how to build it&lt;/em&gt;, I asked:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;How can AI help me make this decision — without losing control?&lt;/p&gt;
&lt;/blockquote&gt;


&lt;h2&gt;
  
  
  The savior: LangChain + OpenAI
&lt;/h2&gt;

&lt;p&gt;After evaluating complexity and cost, I chose a simpler approach:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a lightweight service that calls OpenAI’s API&lt;/li&gt;
&lt;li&gt;structured prompts&lt;/li&gt;
&lt;li&gt;strict schema validation&lt;/li&gt;
&lt;li&gt;controlled domain data&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of building a heavy rule engine, I built an &lt;strong&gt;AI-powered decision layer&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;And yes… I used &lt;strong&gt;TypeScript&lt;/strong&gt; 😅&lt;br&gt;
(I’m a Java fan, but LangChain is much more mature with TS right now.)&lt;/p&gt;


&lt;h2&gt;
  
  
  How the AI flow works
&lt;/h2&gt;

&lt;p&gt;The architecture is simple and intentional.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PromptTemplate → ChatOpenAI → StructuredOutputParser
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What this means in practice:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The prompt defines the role, business rules, and output format&lt;/li&gt;
&lt;li&gt;OpenAI generates the response&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;StructuredOutputParser&lt;/code&gt; forces the output to match a strict Zod schema&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No random text.&lt;br&gt;
No broken JSON.&lt;br&gt;
No guessing.&lt;/p&gt;




&lt;h2&gt;
  
  
  What the model actually sees
&lt;/h2&gt;

&lt;p&gt;The AI receives &lt;strong&gt;real context&lt;/strong&gt;, not just a generic prompt:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;user profile (goal, level, duration, etc.)&lt;/li&gt;
&lt;li&gt;an explicit catalog of allowed exercises&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;strict rules like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;valid exercise IDs&lt;/li&gt;
&lt;li&gt;required YouTube links&lt;/li&gt;
&lt;li&gt;ISO date format&lt;/li&gt;
&lt;li&gt;difficulty and category mapping&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;The model doesn’t invent workouts.&lt;br&gt;
It chooses from a &lt;strong&gt;controlled domain&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That was a key decision.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why this was cheaper than another backend
&lt;/h2&gt;

&lt;p&gt;Instead of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;building complex domain logic&lt;/li&gt;
&lt;li&gt;maintaining rule trees&lt;/li&gt;
&lt;li&gt;evolving workout selection algorithms&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I delegated the &lt;em&gt;decision-making&lt;/em&gt; to AI.&lt;/p&gt;

&lt;p&gt;And here’s the interesting part:&lt;/p&gt;

&lt;p&gt;As more workouts are generated, I reuse previous context to reduce unnecessary calls to OpenAI.&lt;/p&gt;

&lt;p&gt;So the system improves over time:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;more workouts → better context&lt;/li&gt;
&lt;li&gt;better context → fewer calls&lt;/li&gt;
&lt;li&gt;fewer calls → lower cost&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the end, this solution was &lt;strong&gt;much cheaper&lt;/strong&gt; than building and maintaining a full recommendation backend.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I learned about prompt structure (the hard way)
&lt;/h2&gt;

&lt;p&gt;This only worked because the prompt was treated like &lt;strong&gt;code&lt;/strong&gt;, not text.&lt;/p&gt;

&lt;h3&gt;
  
  
  What worked well
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Low ambiguity output&lt;/strong&gt;&lt;br&gt;
StructuredOutputParser + format instructions keep responses clean.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Domain control&lt;/strong&gt;&lt;br&gt;
Allowed exercise catalogs prevent hallucinated IDs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Functional safety&lt;/strong&gt;&lt;br&gt;
Constraints and realistic rules are explicit in natural language.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Higher determinism&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;temperature: 0&lt;/code&gt; makes responses more predictable.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This isn’t “ask AI and hope”.&lt;br&gt;
It’s “ask AI with constraints”.&lt;/p&gt;




&lt;h2&gt;
  
  
  Problems I found along the way
&lt;/h2&gt;

&lt;p&gt;Not everything was perfect.&lt;/p&gt;

&lt;p&gt;Some issues I identified:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;some fields were requested in the prompt but overwritten in the backend&lt;/li&gt;
&lt;li&gt;difficulty and category were guided, but not strictly validated as enums&lt;/li&gt;
&lt;li&gt;the prompt was too large and mixed responsibilities&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AI works best with structure — and so does code.&lt;/p&gt;




&lt;h2&gt;
  
  
  Improvements that made a big difference
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;split system and user messages using &lt;code&gt;ChatPromptTemplate&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;validate business rules in code, not only in prompts&lt;/li&gt;
&lt;li&gt;remove redundant fields from the prompt&lt;/li&gt;
&lt;li&gt;strengthen exercise ID validation&lt;/li&gt;
&lt;li&gt;version the prompt (&lt;code&gt;PROMPT_VERSION=v1&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AI doesn’t replace architecture.&lt;br&gt;
It becomes part of it.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;This article isn’t about saying &lt;em&gt;“AI is magic”&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;It’s about realizing something important:&lt;/p&gt;

&lt;p&gt;Sometimes you don’t need to build a massive system to solve a complex problem.&lt;/p&gt;

&lt;p&gt;Sometimes it’s better to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;delegate the decision layer&lt;/li&gt;
&lt;li&gt;control the input&lt;/li&gt;
&lt;li&gt;validate the output&lt;/li&gt;
&lt;li&gt;optimize for cost and simplicity&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AI is powerful, but only when &lt;strong&gt;you define the boundaries&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;You design the contract.&lt;br&gt;
You validate the result.&lt;br&gt;
AI generates the answer.&lt;/p&gt;

&lt;p&gt;And that’s the difference between building a product and just writing prompts.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>backend</category>
      <category>architecture</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
