<?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: c0d3l0v3r</title>
    <description>The latest articles on DEV Community by c0d3l0v3r (@c0d3l0v3r).</description>
    <link>https://dev.to/c0d3l0v3r</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3963641%2F25250856-8728-4d85-9749-a72b2df53a8e.png</url>
      <title>DEV Community: c0d3l0v3r</title>
      <link>https://dev.to/c0d3l0v3r</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/c0d3l0v3r"/>
    <language>en</language>
    <item>
      <title>The System Has Awakened: Turn Your Coding Journey Into a Solo Leveling RPG ⚔️</title>
      <dc:creator>c0d3l0v3r</dc:creator>
      <pubDate>Sun, 12 Jul 2026 15:24:40 +0000</pubDate>
      <link>https://dev.to/c0d3l0v3r/the-system-has-awakened-turn-your-coding-journey-into-a-solo-leveling-rpg-32ob</link>
      <guid>https://dev.to/c0d3l0v3r/the-system-has-awakened-turn-your-coding-journey-into-a-solo-leveling-rpg-32ob</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for &lt;a href="https://dev.to/challenges/weekend-2026-07-09"&gt;Weekend Challenge: Passion Edition&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;This weekend, I built a gamified, AI-driven learning platform that treats mastering software engineering like clearing an S-Rank dungeon. &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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvh6mb1u6cs72f5jfexo3.gif" 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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvh6mb1u6cs72f5jfexo3.gif" alt=" " width="220" height="220"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When i watched the Anime Solo leveling i was inspired by the thing in the Anime called "System". basically, you act as a "Player" receiving instructions from the "System." You choose a career path (e.g., &lt;em&gt;Full Stack Web Developer&lt;/em&gt;, &lt;em&gt;Rust Systems Engineer&lt;/em&gt;), and the AI generates a dynamic curriculum. The System acts as your Quest Master, giving you hands-on coding tasks. You submit your code, the AI grades it, and if you pass, you level up your engineering stats. If you fail, you trigger a brutal Penalty Zone task to force your growth.&lt;br&gt;
Simple... Isn't it ? It took a good amount of time to configure the supabase and the Google AI and make it really usable + deploy it just over the weekend&lt;/p&gt;
&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;🎮 &lt;strong&gt;Live Demo:&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Here is the Demo, if you are evaluator or just want to see how the application works here is the video &lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/GmGnAT4omFo"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Because the app requires Google OAuth to register your "Player Profile," here is a look at what happens inside the System once you awaken:&lt;/em&gt;&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F98ffpopz35ibmmt2o117.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F98ffpopz35ibmmt2o117.png" alt=" " width="800" height="311"&gt;&lt;/a&gt;&lt;br&gt;
Status of the Player&lt;/p&gt;
&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/c0d3l0v3r-HeHe" rel="noopener noreferrer"&gt;
        c0d3l0v3r-HeHe
      &lt;/a&gt; / &lt;a href="https://github.com/c0d3l0v3r-HeHe/sl-app" rel="noopener noreferrer"&gt;
        sl-app
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;p&gt;This is a &lt;a href="https://nextjs.org" rel="nofollow noopener noreferrer"&gt;Next.js&lt;/a&gt; project bootstrapped with &lt;a href="https://nextjs.org/docs/app/api-reference/cli/create-next-app" rel="nofollow noopener noreferrer"&gt;&lt;code&gt;create-next-app&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Getting Started&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;First, run the development server:&lt;/p&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;npm run dev
&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; or&lt;/span&gt;
yarn dev
&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; or&lt;/span&gt;
pnpm dev
&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; or&lt;/span&gt;
bun dev&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Open &lt;a href="http://localhost:3000" rel="nofollow noopener noreferrer"&gt;http://localhost:3000&lt;/a&gt; with your browser to see the result.&lt;/p&gt;
&lt;p&gt;You can start editing the page by modifying &lt;code&gt;app/page.tsx&lt;/code&gt;. The page auto-updates as you edit the file.&lt;/p&gt;
&lt;p&gt;This project uses &lt;a href="https://nextjs.org/docs/app/building-your-application/optimizing/fonts" rel="nofollow noopener noreferrer"&gt;&lt;code&gt;next/font&lt;/code&gt;&lt;/a&gt; to automatically optimize and load &lt;a href="https://vercel.com/font" rel="nofollow noopener noreferrer"&gt;Geist&lt;/a&gt;, a new font family for Vercel.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Learn More&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;To learn more about Next.js, take a look at the following resources:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://nextjs.org/docs" rel="nofollow noopener noreferrer"&gt;Next.js Documentation&lt;/a&gt; - learn about Next.js features and API.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://nextjs.org/learn" rel="nofollow noopener noreferrer"&gt;Learn Next.js&lt;/a&gt; - an interactive Next.js tutorial.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can check out &lt;a href="https://github.com/vercel/next.js" rel="noopener noreferrer"&gt;the Next.js GitHub repository&lt;/a&gt; - your feedback and contributions are welcome!&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Deploy on Vercel&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;The easiest way to deploy your Next.js app is to use the &lt;a href="https://vercel.com/new?utm_medium=default-template&amp;amp;filter=next.js&amp;amp;utm_source=create-next-app&amp;amp;utm_campaign=create-next-app-readme" rel="nofollow noopener noreferrer"&gt;Vercel Platform&lt;/a&gt; from the creators of Next.js.&lt;/p&gt;
&lt;p&gt;Check out our &lt;a href="https://nextjs.org/docs/app/building-your-application/deploying" rel="nofollow noopener noreferrer"&gt;Next.js deployment documentation&lt;/a&gt; for more…&lt;/p&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/c0d3l0v3r-HeHe/sl-app" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;I tried to keep the architecture simple and as it is a prototype application, i use the NextJS with the Supabase for the authentication with Google OAuth Setup.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Frontend &amp;amp; Framework:&lt;/strong&gt; &lt;strong&gt;Next.js 16 (App Router)&lt;/strong&gt; paired with &lt;strong&gt;React 19&lt;/strong&gt;. The UI relies on &lt;strong&gt;TailwindCSS v4&lt;/strong&gt; to build a highly customized, immersive "System" skin featuring dark modes, monospace formatting, pulsing neon accents, and responsive layout structures.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Database &amp;amp; Auth:&lt;/strong&gt; &lt;strong&gt;Supabase PostgreSQL&lt;/strong&gt; houses the entire player state. It tracks persistent user profiles, historical quest completion records, active roadmaps, and independent skill trees (Frontend, Backend, Low-level, System Programming, DevOps).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI Integration:&lt;/strong&gt; I integrated the &lt;code&gt;@google/genai&lt;/code&gt; SDK using the &lt;code&gt;gemini-3.1-flash-lite&lt;/code&gt; model to act as the core game engine. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Interesting Technical Decisions:&lt;/strong&gt;&lt;br&gt;
Instead of hardcoding the learning paths, I used Gemini to dynamically generate the roadmaps based on user input, outputting strict JSON schemas so the frontend could map the data without parsing errors. &lt;/p&gt;

&lt;p&gt;When a player submits code, it is sent via a system prompt to the Gemini API alongside the strict rules of the quest. The model acts as an isolated sandbox evaluator, returning a Pass/Fail boolean, a score out of 100, and actionable feedback directly into the UI.&lt;/p&gt;
&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;p&gt;I am submitting this project for &lt;strong&gt;Best Use of Google AI&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;The entire "Quest Master" and "Automated Code Evaluator" features are powered entirely by the Google Gemini API (&lt;code&gt;gemini-3.1-flash-lite&lt;/code&gt;). The AI not only generates the curriculum but dynamically scores the player's code to determine if they earn EXP or trigger a Penalty task.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This was all about the Submission&lt;/strong&gt; , below this line, the rest of the post starts that contains the user journey and other things like technical details of the project.That makes a post instead of jsut a submission... &lt;/p&gt;
&lt;h1&gt;
  
  
  💡 Inspiration: The Passion Behind the Project
&lt;/h1&gt;

&lt;p&gt;Stop the Weakness..... &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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmthfwtrvty5tc0o6vnk2.gif" 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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmthfwtrvty5tc0o6vnk2.gif" alt=" " width="220" height="220"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This weekend, I wanted to capture the ultimate feeling of obsession, progression, and self-improvement by bringing the mechanics of the iconic anime &lt;strong&gt;Solo Leveling&lt;/strong&gt; into the real world.&lt;/p&gt;

&lt;p&gt;In the story, the protagonist receives access to a mysterious &lt;strong&gt;System&lt;/strong&gt; that grants:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Daily quests&lt;/li&gt;
&lt;li&gt;Immediate stat upgrades&lt;/li&gt;
&lt;li&gt;Brutal penalty zones&lt;/li&gt;
&lt;li&gt;Continuous progression&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;allowing him to evolve from the &lt;strong&gt;Weakest Hunter of All Mankind&lt;/strong&gt; into humanity's strongest.&lt;/p&gt;

&lt;p&gt;This application follows the same idea and uses AI to give the paths for the developers to select from and practical quests, although it is just an AI and don't put your carrer on the line. But, when i saw the system in the Anime i thought it would be great for the most of us lazy engineers.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkkr2c2ajg5052uxjqz6u.webp" 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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkkr2c2ajg5052uxjqz6u.webp" alt=" " width="200" height="170"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It bridges the gap between raw passion for building software and the structured discipline required to become a stronger software engineer.&lt;/p&gt;


&lt;h1&gt;
  
  
  🎮 The Player(User) Journey
&lt;/h1&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4fdhh2wzlhc48q43c2mp.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4fdhh2wzlhc48q43c2mp.png" alt=" " width="800" height="1200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Image Generated by ChatGPT given the user flow diagram using lucidchart&lt;/p&gt;


&lt;h1&gt;
  
  
  🛠️ Technical Deep Dive &amp;amp; Architecture
&lt;/h1&gt;

&lt;p&gt;The application is built on a modern web stack designed to feel responsive, immersive, and game-like.&lt;/p&gt;
&lt;h2&gt;
  
  
  Frontend
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Next.js 16 (App Router)&lt;/li&gt;
&lt;li&gt;React 19&lt;/li&gt;
&lt;li&gt;TailwindCSS v4&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The interface recreates the aesthetic of the Solo Leveling System with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Terminal-inspired UI&lt;/li&gt;
&lt;li&gt;Dark theme&lt;/li&gt;
&lt;li&gt;Neon blue accents&lt;/li&gt;
&lt;li&gt;Responsive layouts&lt;/li&gt;
&lt;li&gt;Animated status panels&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  Database &amp;amp; Authentication
&lt;/h2&gt;

&lt;p&gt;Powered by &lt;strong&gt;Supabase&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The database stores:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Player Profiles&lt;/li&gt;
&lt;li&gt;Active Roadmaps&lt;/li&gt;
&lt;li&gt;Quest History&lt;/li&gt;
&lt;li&gt;EXP&lt;/li&gt;
&lt;li&gt;Levels&lt;/li&gt;
&lt;li&gt;Individual Skill Trees&lt;/li&gt;
&lt;li&gt;Achievement Progress&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Authentication is handled through &lt;strong&gt;Google OAuth&lt;/strong&gt;.&lt;/p&gt;


&lt;h2&gt;
  
  
  State Management
&lt;/h2&gt;

&lt;p&gt;Players can freely multiclass.&lt;/p&gt;

&lt;p&gt;Switching learning paths instantly loads independent:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stats&lt;/li&gt;
&lt;li&gt;EXP&lt;/li&gt;
&lt;li&gt;Roadmaps&lt;/li&gt;
&lt;li&gt;Progress&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;without affecting other classes.&lt;/p&gt;


&lt;h1&gt;
  
  
  🤖 Best Use of Google AI
&lt;/h1&gt;

&lt;p&gt;The heart of the application is the &lt;strong&gt;@google/genai&lt;/strong&gt; SDK using:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;gemini-3.1-flash-lite&lt;/strong&gt; is used for the generation of the tasks and the evaluation of the code,&lt;br&gt;
without the safe mode,&lt;br&gt;
without any high load,&lt;br&gt;
because i cann't afford. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;HeHe ( Internal Rapper Sleeps ) 🤘🎤🎶🔥&lt;/p&gt;
&lt;h2&gt;
  
  
  Here are the following detials about the AI and what does it do :
&lt;/h2&gt;
&lt;h3&gt;
  
  
  1. Dynamic Curriculum Engine
&lt;/h3&gt;

&lt;p&gt;Instead of hardcoding learning paths, Gemini creates personalized progression trees based on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;User goals&lt;/li&gt;
&lt;li&gt;Current experience&lt;/li&gt;
&lt;li&gt;Desired specialization&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every roadmap is unique (Hopefully, you cann't Trust AI. can you). &lt;br&gt;
&lt;strong&gt;Lazy me&lt;/strong&gt; &lt;br&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhu9m49p3qu8qwbc2ulul.webp" 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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhu9m49p3qu8qwbc2ulul.webp" alt=" " width="200" height="170"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;h3&gt;
  
  
  2. Intelligent Code Evaluation
&lt;/h3&gt;

&lt;p&gt;Submitted code is evaluated using Gemini with strict system prompts.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"pass"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"score"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;88&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"feedback"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Clean implementation of the sorting algorithm. However, you can optimize the spatial complexity by avoiding the slice allocation on line 14."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"statAllocated"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Low-level Programming"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"expAwarded"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;25&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Players immediately receive:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pass / Fail&lt;/li&gt;
&lt;li&gt;Numerical score&lt;/li&gt;
&lt;li&gt;Personalized feedback&lt;/li&gt;
&lt;li&gt;EXP rewards&lt;/li&gt;
&lt;li&gt;Skill allocation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;without requiring a human reviewer.&lt;/p&gt;




&lt;h1&gt;
  
  
  🔮 Future Roadmap
&lt;/h1&gt;

&lt;p&gt;Currently, it is a good idea i would say but we can further increase it by adding communnities and Collaborative Events.&lt;/p&gt;

&lt;h2&gt;
  
  
  👥 The Shadow Army (Collaborative Raids)
&lt;/h2&gt;

&lt;p&gt;Multi-player boss battles where developers collaborate to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Build open-source projects&lt;/li&gt;
&lt;li&gt;Complete architectural challenges&lt;/li&gt;
&lt;li&gt;Defeat timed raid bosses&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Teamwork becomes progression.&lt;/p&gt;




&lt;h2&gt;
  
  
  ⚡ Instant Dungeon ( Similar to CodinGames)
&lt;/h2&gt;

&lt;p&gt;A dedicated arena for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Timed coding challenges&lt;/li&gt;
&lt;li&gt;Code golf&lt;/li&gt;
&lt;li&gt;Algorithm battles&lt;/li&gt;
&lt;li&gt;Rare rewards&lt;/li&gt;
&lt;li&gt;Exclusive profile titles&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Designed for quick daily practice sessions.&lt;/p&gt;




&lt;h1&gt;
  
  
  🎯 Vision
&lt;/h1&gt;

&lt;p&gt;Learning software engineering shouldn't feel like completing another checklist.&lt;/p&gt;

&lt;p&gt;It should feel like stepping into a dungeon, accepting increasingly difficult quests, overcoming failures, and watching your character and your real-world skills—grow stronger every single day.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The System has awakened.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Will you answer the call?&lt;/strong&gt;&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgrvqj8damtx2ji0lzqud.gif" 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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgrvqj8damtx2ji0lzqud.gif" alt=" " width="220" height="125"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>weekendchallenge</category>
      <category>showdev</category>
      <category>googleai</category>
    </item>
    <item>
      <title>Into-The-OS: Process and Scheduling</title>
      <dc:creator>c0d3l0v3r</dc:creator>
      <pubDate>Sun, 12 Jul 2026 00:17:55 +0000</pubDate>
      <link>https://dev.to/c0d3l0v3r/into-the-os-process-and-scheduling-44pj</link>
      <guid>https://dev.to/c0d3l0v3r/into-the-os-process-and-scheduling-44pj</guid>
      <description>&lt;p&gt;Hello and welcome to Part 3 of the &lt;em&gt;Into-the-OS&lt;/em&gt; series! This part aims to cover Chapter 6 of OSTEP. We will primarily dive into processes, Limited Direct Execution (LDE) alongside its problems and solutions (plus a few of my own opinions), and the dynamic between user space and kernel space 😉.&lt;/p&gt;




&lt;h2&gt;
  
  
  Direct Execution -&amp;gt; Limited Direct Execution
&lt;/h2&gt;

&lt;p&gt;Okay, let's think about it this way: what is the absolute fastest way to run a process on the CPU? Simple: &lt;em&gt;just run the process&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;No fluff, just raw, direct performance. Hence the name &lt;strong&gt;Direct Execution&lt;/strong&gt;. Simple enough, right? (Well, at least until I/O calls start staring at us from the background.)&lt;/p&gt;

&lt;h3&gt;
  
  
  So where is the problem?
&lt;/h3&gt;

&lt;p&gt;Imagine you own a factory with a machine and a single worker. When an order comes in, the worker is responsible for doing everything needed to get the job done. Their tasks might include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fetching things from the market&lt;/li&gt;
&lt;li&gt;Running the machine&lt;/li&gt;
&lt;li&gt;Writing the report to you and telling how much time might be needed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, can you guess the problem?&lt;/p&gt;

&lt;p&gt;When the worker is out at the market, the machine sits idle. Assuming we are incredibly greedy for efficiency, we don't want that machine to stop for anything other than a mandatory cooldown.&lt;/p&gt;

&lt;p&gt;So here is what will happen:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The time the worker takes to fetch materials from the market is wasted — the machine sits idle.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This, my friend, is exactly the problem with I/O calls. If a process waits for I/O, the CPU wastes precious cycles sitting idle.&lt;/p&gt;

&lt;p&gt;Now, to offload this work, you hire a manager to oversee the worker. But this introduces a second problem: what if the worker tries to access confidential information, or attempts to take factory resources home?&lt;/p&gt;

&lt;p&gt;We need two things to fix this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Control:&lt;/strong&gt; We don't want to give the resources to the worker (we are greedy, remember 🤑).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Performance:&lt;/strong&gt; We also want to make as much profit as we can.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's where the word &lt;strong&gt;LIMITED&lt;/strong&gt; comes into play. We give control to the Manager (the OS) to maintain security, while offloading the responsibility of performance management.&lt;/p&gt;

&lt;p&gt;Limited Direct Execution means the process still executes directly on the CPU, but we limit its ability to interact with the machine's hardware and resources.&lt;/p&gt;

&lt;h3&gt;
  
  
  A Practical Example
&lt;/h3&gt;

&lt;p&gt;If you are familiar and can distinguish the difference between a Synchronous program and an Asynchronous program, you understand me, don't you?&lt;/p&gt;

&lt;p&gt;There are various concepts we can pull out of this, like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Synchronous and Asynchronous Programming&lt;/li&gt;
&lt;li&gt;Decoupling in System Design (this includes various methods)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But all of these are based on one single concept: separating execution from fetching/uploading.&lt;/p&gt;

&lt;h3&gt;
  
  
  Addressing the Performance
&lt;/h3&gt;

&lt;p&gt;Okay, now if sitting idle is the problem — what if, when this worker gets to work, we send &lt;em&gt;another&lt;/em&gt; worker to the market to get materials? This would fix the issue, and the machine would not be idle.&lt;/p&gt;

&lt;p&gt;Here's a program that shows this in action:&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjitj960ygaj6ehf5bxm9.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjitj960ygaj6ehf5bxm9.png" alt=" " width="799" height="633"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is accessible in the Into-the-OS GitHub repository:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/c0d3l0v3r-HeHe" rel="noopener noreferrer"&gt;
        c0d3l0v3r-HeHe
      &lt;/a&gt; / &lt;a href="https://github.com/c0d3l0v3r-HeHe/Into-the-OS" rel="noopener noreferrer"&gt;
        Into-the-OS
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A hands-on exploration of Operating System fundamentals. This repo contains the C/C++ code, calculations, and practical experiments accompanying the "Into the OS" deep-dive series.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Into-the-OS&lt;/h1&gt;

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



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/c0d3l0v3r-HeHe/Into-the-OS" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;p&gt;These functions run as threads. Quick refresher if you're not familiar with threads: a thread isn't a process — it's a lightweight unit of execution &lt;em&gt;within&lt;/em&gt; a process, and all the threads belonging to a process share that process's address space. Think of them as the individual workers for one process. In our hypothetical Factory (the process), we have 2 threads (workers) doing the work.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;A quick caveat:&lt;/strong&gt; this demo uses threads purely to &lt;em&gt;illustrate&lt;/em&gt; the general idea — "don't let the CPU sit idle." It's programmer-level concurrency happening inside a single process. The actual mechanism OSTEP is describing in this chapter is different: the OS scheduler context-switching between separate, independent &lt;em&gt;processes&lt;/em&gt; when one of them blocks on I/O. Threads are a great visual for the underlying problem, just don't read this code as "this is literally how the OS scheduler works."&lt;/p&gt;
&lt;/blockquote&gt;

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

&lt;p&gt;As you can see in the code, as soon as the first worker goes to the market, the 2nd worker starts working on the machine. (Code is partially generated using AI.)&lt;/p&gt;

&lt;h2&gt;
  
  
  Addressing the Control
&lt;/h2&gt;

&lt;p&gt;Computers enforce this by splitting execution into two modes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Kernel Mode:&lt;/strong&gt; The privileged mode (the Manager). It can execute all instructions and access all resources.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;User Mode:&lt;/strong&gt; The unprivileged mode (the Worker). It executes a restricted subset of instructions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If any worker steps into the wrong room, it's the OS's responsibility to fire that worker — or the OS gets fired.&lt;/p&gt;

&lt;p&gt;Unfortunately, we can't demonstrate this mode-switching in code the way we did with the threads example above — kernel/user mode transitions happen below the level our program can observe, so we can only walk through it conceptually here.&lt;/p&gt;

&lt;p&gt;To execute the process, the CPU has to be handed over to it. So how does the manager get control back?&lt;/p&gt;

&lt;p&gt;Earlier versions of operating systems relied on the phrase "TRUST THE PROCESS." Not very controlling, are they?&lt;/p&gt;

&lt;p&gt;Earlier OSes typically used cooperative policies: it was the programmer's responsibility to hand control back to the OS after a certain amount of time. And when a developer asked, "what if I don't?" — the OS was practically silent. The answer was: you need to restart your machine….&lt;/p&gt;

&lt;p&gt;To fix this, we moved to a timer-based approach. There's a timer running in hardware from the moment the computer boots, and after a certain threshold, a timer interrupt fires, handing control back to the OS. The OS then decides whether to keep running the current process or swap in another one.&lt;/p&gt;

&lt;h3&gt;
  
  
  How do we execute an I/O call?
&lt;/h3&gt;

&lt;p&gt;Now, we want the CPU to know exactly what a worker (process) can and can't access, so it doesn't touch something it shouldn't. So how are these privileged instructions executed by the CPU? Can't we just tell the CPU directly — "Hey CPU, please read or open this file"?&lt;/p&gt;

&lt;p&gt;No — because the process doesn't have the right to open the file. It's the OS's job to check whether the worker has that right. So what actually happens when we call &lt;code&gt;open&lt;/code&gt;?&lt;/p&gt;

&lt;h3&gt;
  
  
  What Happens?
&lt;/h3&gt;

&lt;p&gt;When we call &lt;code&gt;open()&lt;/code&gt; in our program, we're not calling the syscall directly — we're calling a wrapper function (provided by libc) around it. What that wrapper does is save some information into a few registers:&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9e1p3io2irarso2ay1xj.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9e1p3io2irarso2ay1xj.png" alt=" " width="800" height="724"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So when we call &lt;code&gt;open(args)&lt;/code&gt;, each argument gets saved into a register, and then a special instruction called &lt;code&gt;syscall&lt;/code&gt; is executed.&lt;/p&gt;

&lt;p&gt;That instruction is what hands control to the OS to actually execute the I/O. But how does the OS know which syscall to run?&lt;/p&gt;

&lt;p&gt;See the number next to &lt;code&gt;open&lt;/code&gt; — that &lt;code&gt;2&lt;/code&gt;? That doesn't identify &lt;em&gt;which&lt;/em&gt; syscall to run; it actually refers to Section 2 of the Linux manual pages, the section dedicated entirely to System Calls.&lt;/p&gt;

&lt;p&gt;When a program wants to open a file, it places a specific &lt;strong&gt;syscall number&lt;/strong&gt; into a register (like &lt;code&gt;rax&lt;/code&gt; on 64-bit architecture) and executes a trap instruction (like &lt;code&gt;syscall&lt;/code&gt; or &lt;code&gt;int 0x80&lt;/code&gt;). This switches the CPU into kernel mode and triggers the kernel's main system call handler. The OS then reads that number and uses it as an index into the &lt;strong&gt;System Call Table&lt;/strong&gt; — a list, set up by the OS, containing the memory addresses of every kernel function (like &lt;code&gt;sys_open&lt;/code&gt;). When the &lt;code&gt;syscall&lt;/code&gt; instruction runs, the system saves the current register values onto the program's kernel stack and switches to kernel mode, where it decides whether to keep running the same process or perform a context switch (swapping out the registers and stack of the running process for those of the next scheduled process).&lt;/p&gt;

&lt;p&gt;Here are the images that show the earlier and later control mechanisms:&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbjicj2lr6af0u5ocksnk.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbjicj2lr6af0u5ocksnk.png" alt=" " width="786" height="382"&gt;&lt;/a&gt;&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frrov0drhea53ara1h1pd.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frrov0drhea53ara1h1pd.png" alt=" " width="800" height="1044"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Credits : The two images above are from OSTEP Book.&lt;/p&gt;

&lt;p&gt;We've now covered how the OS handles Control and tries to optimize for Performance, and we've seen how it juggles between processes. But how does it actually decide &lt;em&gt;which&lt;/em&gt; process runs next?&lt;/p&gt;

&lt;p&gt;I'd planned to go further, but I think this is already pushing past the 10-minute read that's the whole point of this format — so I'll pick this up next time. See ya!!!!!!!&lt;/p&gt;

&lt;p&gt;— c0d3l0v3r&lt;/p&gt;

</description>
      <category>programming</category>
      <category>architecture</category>
      <category>learning</category>
      <category>linux</category>
    </item>
    <item>
      <title>Into the OS - Part 1: The Magic of Virtualization</title>
      <dc:creator>c0d3l0v3r</dc:creator>
      <pubDate>Mon, 06 Jul 2026 06:27:28 +0000</pubDate>
      <link>https://dev.to/c0d3l0v3r/into-the-os-part-1-the-magic-of-virtualization-4hl3</link>
      <guid>https://dev.to/c0d3l0v3r/into-the-os-part-1-the-magic-of-virtualization-4hl3</guid>
      <description>&lt;p&gt;Hey, Welcome to the article one of the series “Into-the-OS”. First, i thought we should think about the process(instructions that runs on the computer).&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a Process ?
&lt;/h2&gt;

&lt;p&gt;The set of instructions that runs on a computer or machine is called a process in the terms of Operating systems. Let’s take a code&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F04j4ca64bq67eghw35k9.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F04j4ca64bq67eghw35k9.png" alt=" " width="799" height="161"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Code is available in the github repository for the Series of Article : &lt;a href="https://github.com/c0d3l0v3r-HeHe/Into-the-OS" rel="noopener noreferrer"&gt;https://github.com/c0d3l0v3r-HeHe/Into-the-OS&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, is this a Process ?&lt;/p&gt;

&lt;p&gt;It might shock you , No it is not. It is not a process until we really run the object file created. Let’s figure out the files created by the command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;gcc -o process process.c --save-temps
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;Files created by running the command above ( Compilation with — save-temps&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;process.i:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is a pre-compiled file that contains the added implementations from the stdio.h file as shown in the main process.c file&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;process.s:&lt;/strong&gt;&lt;br&gt;
This is the assembly file that contains the instructions in RISC-V or other architectures. Here is the demo of the above:&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flk40fg3wsymr8ch1fnp1.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flk40fg3wsymr8ch1fnp1.png" alt=" " width="800" height="845"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Scary. Isn’t it ?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;process.o:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It is the object file that we can run.&lt;/p&gt;

&lt;p&gt;So, nothing fancy ?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;objdump -d -s process &amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;objDump.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;by doing this you get another scary file objDump.txt&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnqnck2b4lfo0h8b1aegg.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnqnck2b4lfo0h8b1aegg.png" alt=" " width="800" height="451"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, let’s dig into the structure for some time.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fx7gilrnspuz8d9q6hhue.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fx7gilrnspuz8d9q6hhue.png" alt=" " width="800" height="748"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Image showing the objdump -d -s for the process.o&lt;/p&gt;

&lt;h3&gt;
  
  
  Sections
&lt;/h3&gt;

&lt;p&gt;See the things like Contents of section .dynsym, .gnu.hash, etc. These are the sections stored in a structure i will talk about later and you will be suprised.. Hehe.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsbtstg4e9ogogoexum69.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsbtstg4e9ogogoexum69.png" alt=" " width="800" height="670"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Image showing .text and .rosection&lt;/p&gt;

&lt;p&gt;We see .rodata section we see our “Hello World !!”&lt;/p&gt;

&lt;p&gt;Let’s move to the execution. Apparently when the Program Runs it starts with the &amp;lt;_start&amp;gt; not &amp;lt;main&amp;gt; 😲:&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkb26t7eyhs2gqj4hmkck.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkb26t7eyhs2gqj4hmkck.png" alt=" " width="800" height="331"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Start of the progam&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fko3ugjhrbpq5fmoff7mx.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fko3ugjhrbpq5fmoff7mx.png" alt=" " width="800" height="40"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Lines showing the loading of the main in the rip and then running the __lib_start_main using the location of the main function&lt;/p&gt;

&lt;p&gt;Rest of the instructions above and below are for security, holding argc and argv and other stuff which we might not need so we will skip it for now. But, if you are interested, you can GPT it 😉&lt;/p&gt;

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

&lt;p&gt;Here we push the rbp inside the stack and store the value of the earlier stack pointer to the rbp.&lt;/p&gt;

&lt;p&gt;Then we use &lt;code&gt;lea&lt;/code&gt; (Load Effective Address) to calculate the location of our string.&lt;/p&gt;

&lt;p&gt;The math: 0x1158 + 0x0EAC = 0x2004.&lt;/p&gt;

&lt;p&gt;This &lt;code&gt;2004&lt;/code&gt; is the exact address of our string &lt;code&gt;"Hello World !!"&lt;/code&gt; living in the &lt;code&gt;.rodata&lt;/code&gt; section. All these statements do is set up the plumbing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;code&gt;**1151**&lt;/code&gt;: Calculate the address of the string and load it into &lt;code&gt;%rax&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;**1158**&lt;/code&gt;: Move that address from &lt;code&gt;%rax&lt;/code&gt; into &lt;code&gt;%rdi&lt;/code&gt; (the first argument register for any function in Linux).&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;**115b**&lt;/code&gt;: Move &lt;code&gt;0&lt;/code&gt; to &lt;code&gt;%eax&lt;/code&gt; (telling &lt;code&gt;printf&lt;/code&gt; we aren't using floating-point vector registers).&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;**1160**&lt;/code&gt;: Call the &lt;code&gt;printf&lt;/code&gt; stub.&lt;/li&gt;
&lt;/ul&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F17d9o5y962ah8mtxbn7u.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F17d9o5y962ah8mtxbn7u.png" alt=" " width="800" height="93"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If we look closely at that &lt;code&gt;printf&lt;/code&gt; call, it does a &lt;code&gt;jmp&lt;/code&gt; to &lt;code&gt;*0x2f76(%rip)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;More math: 0x105a + 0x2f76 = 0x3FD0.&lt;/p&gt;

&lt;p&gt;This location (&lt;code&gt;3FD0&lt;/code&gt; in the Global Offset Table) will eventually point to the &lt;em&gt;real&lt;/em&gt; &lt;code&gt;printf&lt;/code&gt; implementation in your system's C library when the program actually runs. For now, because we are just looking at a static file, the real address isn't there yet!&lt;/p&gt;

&lt;h2&gt;
  
  
  What did we learn?
&lt;/h2&gt;

&lt;p&gt;After getting a little drifted in the assembly code, let’s zoom back out and look at the structure. What exactly did we just see in this file?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Sections:&lt;/strong&gt; distinct blocks of memory (&lt;code&gt;.rodata&lt;/code&gt;, &lt;code&gt;.plt&lt;/code&gt;, &lt;code&gt;.got&lt;/code&gt;) that store specific information and data needed for the program to function.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Executable Code:&lt;/strong&gt; The &lt;code&gt;.text&lt;/code&gt; section, holding the raw assembly instructions for &lt;code&gt;_start&lt;/code&gt;, &lt;code&gt;main&lt;/code&gt;, and the PLT stubs that will eventually run on the CPU.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;A whole lot of hex codes…&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But wait. Here is the most important question of this entire article: &lt;strong&gt;Did we ever actually run the program?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No, we didn’t. We just inspected a static &lt;code&gt;.o&lt;/code&gt; object file sitting dead on our hard drive.&lt;/p&gt;

&lt;p&gt;So… where did all those memory addresses (&lt;code&gt;1060&lt;/code&gt;, &lt;code&gt;2004&lt;/code&gt;, &lt;code&gt;3FD0&lt;/code&gt;) come from if the program isn't even loaded in RAM yet?&lt;/p&gt;

&lt;h2&gt;
  
  
  Revelation: The Illusion of Memory
&lt;/h2&gt;

&lt;p&gt;This is the core magic of the Operating System.&lt;/p&gt;

&lt;p&gt;The addresses you see inside the &lt;code&gt;objdump&lt;/code&gt; are &lt;strong&gt;not real physical RAM addresses&lt;/strong&gt;. They are &lt;strong&gt;virtual addresses&lt;/strong&gt;. The executable file we compiled is nothing more than a static blueprint (an ELF file).&lt;/p&gt;

&lt;p&gt;When you finally type &lt;code&gt;./process&lt;/code&gt; and hit enter, the Operating System steps in. It creates a completely isolated, private &lt;strong&gt;Address Space&lt;/strong&gt; for this specific execution. It reads our blueprint, copies the &lt;code&gt;.text&lt;/code&gt; and &lt;code&gt;.rodata&lt;/code&gt; sections into your actual physical RAM, and then &lt;em&gt;lies&lt;/em&gt; to the program—making it think it owns a perfect, continuous block of memory starting from those exact virtual addresses we saw in the dump.&lt;/p&gt;

&lt;p&gt;A program is just a dead file on a disk. A &lt;strong&gt;Process&lt;/strong&gt; is the active, breathing instance of that program, wrapped in a beautiful illusion of private memory orchestrated by the OS.&lt;/p&gt;

&lt;p&gt;One more important thing to note is if i run all these 3 programs together, they should technically crash because all of their main addresses at the same point. Right?&lt;/p&gt;

&lt;p&gt;But, they will not. Because they are just virtual addresses and the OS gives the illusion of the infinite memory. OS will give different physical memory locaiton to each one of the program that we would run.&lt;/p&gt;

&lt;p&gt;Let’s map what we just saw in our &lt;code&gt;objdump&lt;/code&gt; directly to this X-ray:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. The Code &amp;amp; Data (The Static Stuff)
&lt;/h3&gt;

&lt;p&gt;These sit at the very bottom, in the lowest memory addresses.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Remember our &lt;code&gt;main&lt;/code&gt; function sitting at address &lt;code&gt;1149&lt;/code&gt;? That is loaded right into the &lt;strong&gt;Code (.text)&lt;/strong&gt; block.&lt;/li&gt;
&lt;li&gt;  Remember our &lt;code&gt;"Hello World !!"&lt;/code&gt; string sitting at address &lt;code&gt;2004&lt;/code&gt;? That gets loaded into the &lt;strong&gt;Data&lt;/strong&gt; block right above it. Because the OS reads these directly from our ELF file on the disk, their sizes are fixed. They never change while the program is running.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. The Stack (The Missing Piece)
&lt;/h3&gt;

&lt;p&gt;If the code and data are static, how does a program actually &lt;em&gt;do&lt;/em&gt; things dynamically? Look back at the very first instruction inside our &lt;code&gt;main&lt;/code&gt; function: &lt;code&gt;114d: push %rbp&lt;/code&gt; &lt;code&gt;114e: mov %rsp,%rbp&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This is the code interacting with the &lt;strong&gt;Stack&lt;/strong&gt;! The Stack lives at the very top of the Address Space (the highest memory addresses). Every time you call a function, the OS pushes a new “frame” onto the stack to hold its local variables. When the function finishes (&lt;code&gt;ret&lt;/code&gt;), the frame is popped off. The Stack actively grows &lt;em&gt;downward&lt;/em&gt; as your program runs deeper into function calls.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. The Heap
&lt;/h3&gt;

&lt;p&gt;Right below the stack is the &lt;strong&gt;Heap&lt;/strong&gt;. If you’ve ever used &lt;code&gt;malloc()&lt;/code&gt; in C or &lt;code&gt;new&lt;/code&gt; in C++, this is where that memory comes from. While the Stack grows downward, the Heap grows &lt;em&gt;upward&lt;/em&gt;. (And yes, if you write a terrible infinite loop that allocates too much memory, the Heap and the Stack will eventually crash into each other, blowing up your program with a Stack Overflow or Out of Memory error. &lt;em&gt;Scary, isn't it?&lt;/em&gt;)&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion: The Brain of the Process (The PCB)
&lt;/h2&gt;

&lt;p&gt;We’ve seen the memory, the assembly instructions, and the grand illusion of the Address Space. But how does the Operating System actually keep track of all this?&lt;/p&gt;

&lt;p&gt;If the Address Space is the physical house the process lives in, the OS needs a master ledger to keep track of who owns which house, what they are doing, and what they own. In OS terms, this data structure is called the &lt;strong&gt;Process Control Block (PCB)&lt;/strong&gt; (or Process Descriptor).&lt;/p&gt;

&lt;p&gt;Every time you execute &lt;code&gt;./process&lt;/code&gt;, the OS doesn't just hand out virtual memory. It creates a massive C-structure deep inside the OS kernel to track everything about this specific running instance. What exactly does it store?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Process State:&lt;/strong&gt; Is the program actively running on the CPU? Is it blocked waiting for you to type something on the keyboard? Is it terminated?&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Process ID (PID):&lt;/strong&gt; The unique integer identifier (like &lt;code&gt;4092&lt;/code&gt;) you see when you run commands like &lt;code&gt;htop&lt;/code&gt; or &lt;code&gt;ps&lt;/code&gt; in your terminal.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;CPU Register State:&lt;/strong&gt; This is the most crucial part. When the OS temporarily kicks this process off the CPU to let another program run, it saves the exact, freeze-framed values of &lt;code&gt;%rax&lt;/code&gt;, &lt;code&gt;%rsp&lt;/code&gt;, &lt;code&gt;%rip&lt;/code&gt;, and all the other registers right here in the PCB. When the process gets the CPU back, the OS restores these values, and the program resumes as if it never stopped.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;I/O Status Information:&lt;/strong&gt; A list of all open files, network sockets, and connected devices the process is actively using.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A process is vastly more than just compiled code. It is an intricate, highly managed data structure maintained by the invisible engine of the Operating System kernel.&lt;/p&gt;

&lt;p&gt;Hopefully, this deep dive gives you a clear picture of what a process truly is under the hood. We stripped away the abstraction, dumped the raw binaries, and exposed the Virtual Memory illusion that makes modern software possible.&lt;/p&gt;

&lt;p&gt;Next up, we are going to see this PCB in action. If every process thinks it owns the CPU forever, how does the OS secretly pause them, swap their registers, and run 100 programs at once without any of them noticing?&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F61uzcq4akczdpgstutl8.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F61uzcq4akczdpgstutl8.png" alt=" " width="800" height="619"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Image showing the task struct on &lt;a href="https://elixir.bootlin.com/linux/v7.1.1/source/include/linux/sched.h#L820" rel="noopener noreferrer"&gt;https://elixir.bootlin.com/linux/v7.1.1/source/include/linux/sched.h#L820&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While that massive &lt;code&gt;task_struct&lt;/code&gt; is the &lt;em&gt;official&lt;/em&gt; way the Linux kernel tracks a process, it contains hundreds of fields we don't need to worry about right now. Moving forward in this series, we are going to stick to the classic, simplified textbook model we just built: &lt;strong&gt;Stack, Heap, Data, and Code&lt;/strong&gt;. As an engineer, this is the core mental framework you will actually need.&lt;/p&gt;

&lt;p&gt;See you in Part 2 for the math and magic of &lt;strong&gt;CPU Scheduling!&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>architecture</category>
      <category>operatingsystem</category>
    </item>
    <item>
      <title>The Introduction</title>
      <dc:creator>c0d3l0v3r</dc:creator>
      <pubDate>Sat, 27 Jun 2026 09:48:30 +0000</pubDate>
      <link>https://dev.to/c0d3l0v3r/the-introduction-4k17</link>
      <guid>https://dev.to/c0d3l0v3r/the-introduction-4k17</guid>
      <description>&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fm3odyij8db0d4i6bmgbr.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fm3odyij8db0d4i6bmgbr.png" alt="Cover Image" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Operating system, a thing that everybody uses but no one talks about.&lt;/p&gt;

&lt;p&gt;While reading Operating Systems: Three Easy Pieces (OSTEP), my background in C and C++ fueled a growing fascination with memory allocation, virtualization, scheduling, and the intricate mechanics of operating systems. This would be a series of article, the number i am not sure, it will be the amount of content that someone might comfortably read in a 10 min Article.&amp;nbsp;&lt;/p&gt;

&lt;p&gt;Keeping each piece to a solid 10-minute read is the perfect sweet spot for a developer to read over a cup of coffee. It gives you enough runway to explain a core concept, show the math, and link a practical C/C++ experiment without making their eyes glaze over.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why this Article&amp;nbsp;?&lt;/strong&gt;&amp;nbsp;We are often warned against “reinventing the wheel.” However, I firmly believe that building and optimizing modern software is impossible without a fundamental grasp of virtualization, memory allocation, and concurrency.&lt;/p&gt;

&lt;p&gt;Consider Docker: it functions almost entirely on OS-level virtualization features like Namespaces, cgroups, and isolated filesystems. Similarly, the highly optimized Memory Manager in PostgreSQL only works because it leverages the robust memory management systems already written into the OS kernel.&lt;/p&gt;

&lt;p&gt;This article aims to bring the core concepts of OSTEP to life through practical experimentation. By accompanying the theory with an open-source repository, my goal is to provide a clear, interactive learning experience that demystifies operating systems.&lt;/p&gt;

&lt;p&gt;I am not an operating system guru or a Principal Engineer with years of experience, but I hope to become one someday (assuming AI doesn’t replace me first… &lt;strong&gt;HeHe&lt;/strong&gt;). What I &lt;em&gt;can&lt;/em&gt; do is dive in, explore, and try to understand these concepts by actually building things. Because of that, my goal here is to present the findings and experiments I explore rather than giving strong opinions — I’ll leave the comment section for those! Any support, feedback, or contributions from the community will be incredibly valuable to me.&lt;/p&gt;

&lt;h3&gt;
  
  
  Who is this Article For&amp;nbsp;?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  Anyone curious about low-level system design and how things actually work under the hood.&lt;/li&gt;
&lt;li&gt;  Peers and developers looking for a practical, hands-on refresher on core operating system concepts.&lt;/li&gt;
&lt;li&gt;  People who hate dry theory and just want to build things practically (though fair warning: we &lt;em&gt;are&lt;/em&gt; going to dive into some essential calculations and theory notes to make the practical stuff actually work, bro…).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The Fundamentals
&lt;/h3&gt;

&lt;p&gt;The Operating system as written in OSTEP and i also agree, can be learned with the help of understanding 3 fundamental concepts that forms the backbone of any application today.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Virtualization&amp;nbsp;:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The ability of the operating system to give a process the illusion of infinite, private resources.&lt;/p&gt;

&lt;p&gt;Let’s break it down with an analogy. Consider yourself a wealthy investor, and I am your property manager. On paper, I sold you a massive 100-acre farm. In your mind, you own that entire 100 acres all to yourself.&lt;/p&gt;

&lt;p&gt;In reality, I only manage 50 physical acres, and I’m secretly juggling leases for several other investors on that exact same land. But here is the trick: you never inspect the entire 100 acres at the exact same time. Whenever you want to visit a specific acre, I scramble behind the scenes, clear out whatever else was there, and set up your stuff before you walk through the gate.&lt;/p&gt;

&lt;p&gt;To you, the illusion is perfect — you have a massive, private 100-acre estate. Meanwhile, I (the OS) am sweating under the hood, dynamically swapping things around to make a 50-acre reality work for everyone.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Persistence&amp;nbsp;:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The ability of the system to permanently retain data once it has been committed. Imagine how frustrating your life would be if you had to set up your mobile phone from scratch every single day because your contacts and settings wouldn’t save. Without persistence, everything a program does vanishes the moment the power cord is pulled. The OS handles the massive responsibility of mapping volatile, short-term memory to permanent, physical storage (like SSDs and hard drives) so your data survives.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Concurrency&amp;nbsp;:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The ability of the system to handle multiple tasks or run processes in parallel. While virtualization creates a tidy, isolated world for a single process, modern applications rely on multi-threading, which introduces total chaos. The OS has to manage this concurrency with strict rules to prevent disasters&amp;nbsp;:&lt;/p&gt;

&lt;p&gt;- &lt;strong&gt;Mutual Exclusion:&lt;/strong&gt; Ensuring that when one process or thread is modifying shared data (like a bank balance), no other thread can touch it at the same time.&lt;/p&gt;

&lt;p&gt;- &lt;strong&gt;Determinism &amp;amp; Isolation:&lt;/strong&gt; Ensuring that regardless of the chaotic order in which the OS schedules different threads, the final result of the program remains correct, predictable, and exact every single time.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Wrapping Up&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Hopefully, this introduction gives you a clear picture of what this series is all about. This first piece was all about laying the foundation and mapping out the technical road ahead. Because each of these core pillars contains a massive amount of depth, math, and practical nuance, I will be separating them into their own distinct, dedicated articles moving forward.&lt;/p&gt;

&lt;p&gt;Next up, we are diving straight into &lt;strong&gt;Part 1: The Art of Time Sharing&lt;/strong&gt;, where we will peel back the layers on CPU virtualization, understand how the OS pulls off seamless context switching, and dive into the math behind different scheduling policies.&lt;/p&gt;

&lt;p&gt;Thanks for reading, and I’ll see you in the next one… bro!&lt;/p&gt;

</description>
      <category>computerscience</category>
      <category>c</category>
      <category>cpp</category>
      <category>systemdesign</category>
    </item>
    <item>
      <title>I Doubled My Servers and Wrecked My Availability</title>
      <dc:creator>c0d3l0v3r</dc:creator>
      <pubDate>Sat, 27 Jun 2026 09:42:41 +0000</pubDate>
      <link>https://dev.to/c0d3l0v3r/i-doubled-my-servers-and-wrecked-my-availability-3dbc</link>
      <guid>https://dev.to/c0d3l0v3r/i-doubled-my-servers-and-wrecked-my-availability-3dbc</guid>
      <description>&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F57qhkil3odui2bk8xg0k.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F57qhkil3odui2bk8xg0k.png" alt="Cover Image" width="800" height="453"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Reliability is the most important feature of any system.” — Bill Gates&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Why does your bank never show the wrong balance, but your favorite app sometimes takes a few seconds to update? Why do some systems feel fast but crash under load, while others feel slower but never fail?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Performance answers: “How fast is the system right now?”&lt;br&gt;
Scalability answers: “What happens when demand increases?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;These questions point to a fundamental tension in system design: &lt;strong&gt;performance vs scalability&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A system can improve performance metrics like throughput and latency, yet fail to scale under load. This article demonstrates exactly that.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In this article, we’ll explore this trade-off through a simple analogy, and then connect it to real-world systems using measurable metrics like latency, throughput, and error rate.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Burger Shop Analogy
&lt;/h2&gt;

&lt;p&gt;Imagine a small burger shop run by a single worker, let’s call them &lt;strong&gt;A&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Let’s assume the following things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Burgers are prepared automatically by machines, so A only handles taking and serving orders.&lt;/li&gt;
&lt;li&gt;  Finished burgers are placed in a shared box, from which A picks them up and delivers them to customers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We intentionally ignore preparation time and assume burgers are instantly ready. This allows us to focus purely on how requests are handled, rather than how they are produced.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Single Worker System
&lt;/h3&gt;

&lt;p&gt;In this setup, a single worker handles all incoming requests.&lt;/p&gt;

&lt;p&gt;When you enter the shop, you join a single queue and wait your turn before placing an order. Every request is processed sequentially (one at a time).&lt;/p&gt;

&lt;p&gt;A few key observations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Single queue, sequential processing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With only one line, every customer must wait for those ahead of them. This results in higher waiting time, which translates to &lt;strong&gt;high latency&lt;/strong&gt; and &lt;strong&gt;low throughput&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;No contention&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Since only one request is handled at a time, there is no competition for shared resources. The system operates without conflicts or synchronization issues.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Efficient resource usage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Resources are used strictly on demand. Each burger is prepared only when needed, with no excess consumption or overhead.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What does this imply?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;High latency&lt;/strong&gt; → Each request experiences delay due to queuing&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Low throughput&lt;/strong&gt; → Only one request is processed at any given time&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;No contention&lt;/strong&gt; → No conflicts between concurrent operations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Despite its limitations, this system is &lt;strong&gt;remarkably stable&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;There are no race conditions, no lost work, and no unexpected failures. Every request is handled in a predictable and controlled manner.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Slow, but predictable.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Scaling the System
&lt;/h3&gt;

&lt;p&gt;So far, the limitation has been clear: a single worker handling all requests.&lt;/p&gt;

&lt;p&gt;To improve this, we introduce more machines. Instead of relying on a single machine, worker A can now distribute incoming orders across multiple machines.&lt;/p&gt;

&lt;p&gt;Let’s examine what changes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Parallel processing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With multiple machines available, several orders can be handled simultaneously. This increases the number of requests processed per unit time, leading to &lt;strong&gt;higher throughput&lt;/strong&gt; and &lt;strong&gt;reduced latency&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Decision overhead (routing)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Worker A must now decide which machine should handle each request. This introduces a small coordination overhead — similar to how a load balancer (e.g., Nginx) routes requests in real systems.&lt;/p&gt;

&lt;p&gt;For simplicity, we will ignore this overhead in our analysis.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  What happens to the metrics?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  Multiple orders can be processed simultaneously.&lt;/li&gt;
&lt;li&gt;  Waiting time decreases&lt;/li&gt;
&lt;li&gt;  Throughput increases&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This approach is known as &lt;strong&gt;horizontal scaling&lt;/strong&gt;, increasing system capacity by adding more resources rather than making a single component more powerful.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Hidden Problem
&lt;/h3&gt;

&lt;p&gt;So far, scaling seems like a clear improvement.&lt;/p&gt;

&lt;p&gt;But consider the shared burger box , the place where all machines deposit finished burgers.&lt;/p&gt;

&lt;p&gt;What happens if multiple machines try to place burgers into the box at the same time?&lt;/p&gt;

&lt;p&gt;This introduces two critical failure scenarios:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Lost Work&lt;/p&gt;

&lt;p&gt;One burger makes it into the box, but another falls to the ground.&lt;/p&gt;

&lt;p&gt;That burger is wasted, and the customer never receives their order.&lt;/p&gt;

&lt;p&gt;In system terms, this is a &lt;strong&gt;failed request&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;System Blockage&lt;/p&gt;

&lt;p&gt;Both burgers get stuck at the entrance of the box, blocking it completely.&lt;/p&gt;

&lt;p&gt;Now no further burgers can be placed.&lt;/p&gt;

&lt;p&gt;In system terms, this resembles &lt;strong&gt;contention or resource locking&lt;/strong&gt;, where the system slows down or stops entirely.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;What Changed ?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;By introducing multiple machines, we improved performance:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Higher throughput, lower latency&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Multiple burgers can now be prepared simultaneously. This increases throughput and reduces waiting time for customers, improving overall performance.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Increased coordination and state management&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With two machines handling requests, worker A must decide where each order goes. Both machines can process requests, so their state must be tracked and logs must be maintained. This introduces coordination overhead.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Inefficiency due to lost work&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Some burgers may fall to the ground before reaching the box. These orders are wasted, and the customer never receives their burger. In system terms, this represents failed or lost requests.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Unpredictable latency&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Consider a customer waiting for an order that never arrives. If they leave after 30 seconds, that request now has very high latency. Even if other customers are served quickly, overall latency becomes inconsistent and harder to predict.This is the core trade-off.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In system terms, we have introduced:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Contention for shared resources&lt;/li&gt;
&lt;li&gt;  Increased system complexity&lt;/li&gt;
&lt;li&gt;  Possibility of failure&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The Core Trade-off
&lt;/h3&gt;

&lt;p&gt;This is the fundamental trade-off in system design.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Some customers are served faster, but others may never get their order.&lt;/p&gt;
&lt;/blockquote&gt;

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

&lt;p&gt;Performance refers to how effectively a system executes tasks within a given time frame. It is typically evaluated in terms of speed, responsiveness, and how efficiently system resources are utilized under load.&lt;/p&gt;

&lt;p&gt;To understand and measure performance, we rely on a few key metrics:&lt;/p&gt;

&lt;h3&gt;
  
  
  Latency
&lt;/h3&gt;

&lt;p&gt;Latency is the time it takes for a system to respond to a request.&lt;/p&gt;

&lt;p&gt;In simpler terms, it measures how long a user has to wait after initiating an action.&lt;/p&gt;

&lt;h3&gt;
  
  
  Throughput
&lt;/h3&gt;

&lt;p&gt;Throughput represents the number of requests or transactions a system can handle per unit of time.&lt;/p&gt;

&lt;p&gt;It reflects the system’s capacity to process workload at scale.&lt;/p&gt;

&lt;h3&gt;
  
  
  Resource Utilization
&lt;/h3&gt;

&lt;p&gt;Resource utilization measures how much of the system’s resources, such as CPU, memory, and network bandwidth are consumed while handling requests.&lt;/p&gt;

&lt;p&gt;Efficient systems aim to maximize output while minimizing unnecessary resource consumption.&lt;/p&gt;

&lt;h3&gt;
  
  
  Efficiency
&lt;/h3&gt;

&lt;p&gt;Efficiency describes how well a system converts resources into useful work.&lt;/p&gt;

&lt;p&gt;A highly efficient system achieves high throughput and low latency while using minimal resources.&lt;/p&gt;

&lt;h2&gt;
  
  
  Scalability
&lt;/h2&gt;

&lt;p&gt;Scalability refers to a system’s ability to handle increasing load by proportionally utilizing additional resources, while maintaining acceptable performance.&lt;/p&gt;

&lt;p&gt;In other words, a scalable system does not degrade significantly as the number of users or requests grows, it adapts by efficiently distributing the workload.&lt;/p&gt;

&lt;p&gt;To evaluate scalability, we observe how key performance metrics behave under increasing load, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Latency under load&lt;/li&gt;
&lt;li&gt;  Throughput under load&lt;/li&gt;
&lt;li&gt;  Resource utilization&lt;/li&gt;
&lt;li&gt;  Error rates (failures, timeouts)&lt;/li&gt;
&lt;li&gt;  Number of concurrent users supported&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A system is considered scalable if these metrics remain stable or degrade gracefully as demand increases.&lt;/p&gt;

&lt;h3&gt;
  
  
  Availability
&lt;/h3&gt;

&lt;p&gt;Availability is the measure of a system’s ability to respond to requests within an acceptable time frame.&lt;/p&gt;

&lt;p&gt;A system is considered available if it is operational and capable of returning responses, even under load. High availability systems are designed to minimize downtime and ensure that users can reliably access the service.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“A system can be highly performant but not scalable. for example, a single powerful server may respond quickly, but fail when user load increases.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The Monolith vs. The Load-Balanced Fleet (A vs 2A’s)
&lt;/h2&gt;

&lt;p&gt;To move beyond theory, we need to observe how a system behaves when pushed to its absolute limits. To test the relationship between compute scaling, database bottlenecks, and overall availability, an A/B load test was constructed.&lt;/p&gt;

&lt;p&gt;The code for the experiments can be found in attached github repository: &lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/c0d3l0v3r-HeHe" rel="noopener noreferrer"&gt;
        c0d3l0v3r-HeHe
      &lt;/a&gt; / &lt;a href="https://github.com/c0d3l0v3r-HeHe/performance-vs-scalability-experiment" rel="noopener noreferrer"&gt;
        performance-vs-scalability-experiment
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;performance-vs-scalability-experiment&lt;/h1&gt;

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



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/c0d3l0v3r-HeHe/performance-vs-scalability-experiment" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;h2&gt;
  
  
  Assumptions
&lt;/h2&gt;

&lt;p&gt;Before running the load test, the architecture was built on three core hypotheses:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Linear Scalability:&lt;/strong&gt; Doubling the compute resources (adding a second application server) will linearly increase the system’s maximum throughput.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Testing Default Database Limits:&lt;/strong&gt; We hypothesized that the default connection pool of a single MongoDB instance would be sufficient to handle the concurrent load of doubled compute resources.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;The Load Balancer Penalty is Negligible:&lt;/strong&gt; The network hop introduced by routing traffic through a reverse proxy will be outweighed by the massive gains in request processing speed.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Setup Methodology
&lt;/h2&gt;

&lt;p&gt;The experiment was conducted locally using Docker to containerize and isolate the environments. The testing tool, k6, was configured to inject a stepped load simulating aggressive traffic spikes: starting at 100 concurrent virtual users and ramping up to 2,000 users over an 80-second window.&lt;/p&gt;

&lt;p&gt;The workload itself was a mixed Read/Write operation. Every request forced the application to write a new document to the database and immediately read a document back, simulating a standard transactional endpoint.&lt;/p&gt;

&lt;p&gt;We tested three distinct architectures:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Architecture A (The Baseline):&lt;/strong&gt; A single Node.js/Express application connected directly to a standalone MongoDB instance. This represents a traditional, unscaled monolith.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Architecture 2A (The Distributed Compute):&lt;/strong&gt; Two identical Node.js/Express applications sitting behind an Nginx load balancer. Nginx utilized a round-robin strategy to distribute incoming k6 traffic across both nodes. Crucially, both application nodes were wired to the exact same single MongoDB instance.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;express&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;express&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;mongoose&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;mongoose&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;os&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;os&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;express&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;


&lt;span class="nx"&gt;mongoose&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;mongodb://mongo:27017/testdb&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;maxPoolSize&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;TestSchema&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;mongoose&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Schema&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Test&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;mongoose&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;model&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Test&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;TestSchema&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;start&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;Test&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;Test&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findOne&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;latency&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;start&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="nx"&gt;latency&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;server&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;hostname&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; 
    &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DB error&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Server running on &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;hostname&lt;/span&gt;&lt;span class="p"&gt;()}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Results
&lt;/h3&gt;

&lt;p&gt;The k6 load test yielded drastically different saturation points for the two architectures.&lt;/p&gt;

&lt;p&gt;These reports are present as the .html files in the github respository.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Architecture A (Single Node Baseline):&lt;/strong&gt;&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqzbqwrm9p3hqaf9b36qx.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqzbqwrm9p3hqaf9b36qx.png" alt="The latency trade-off. With a single Node.js event loop acting as a natural throttle, the p95 latency sat at ~796ms. The system was relatively slow under heavy load, but perfectly stable." width="800" height="674"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The latency trade-off. With a single Node.js event loop acting as a natural throttle, the p95 latency sat at ~796ms. The system was relatively slow under heavy load, but perfectly stable.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1fnbrxae5ceg7kn63clm.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1fnbrxae5ceg7kn63clm.png" alt="Baseline throughput. The single-node architecture safely processed a total of 176,584 requests, hitting a hard bottleneck at roughly 2,193 requests per second." width="800" height="509"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Baseline throughput. The single-node architecture safely processed a total of 176,584 requests, hitting a hard bottleneck at roughly 2,193 requests per second.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fikgmtw2lcn7m6r3sw201.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fikgmtw2lcn7m6r3sw201.png" alt="_100% Availability. Because the compute layer could not overwhelm the database connection pool, every single read/write transaction was successfully completed without a single dropped request._" width="800" height="466"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;100% Availability. Because the compute layer could not overwhelm the database connection pool, every single read/write transaction was successfully completed without a single dropped request.&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Total Requests Processed:&lt;/strong&gt; 176,584&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Throughput:&lt;/strong&gt; 2,193 requests/second&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Latency (p95):&lt;/strong&gt; ~796 ms&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Failure Rate:&lt;/strong&gt; 0.00% (100% Success)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Architecture 2A (Distributed Compute):&lt;/strong&gt;&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fv5d10zshibur2p4qrp55.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fv5d10zshibur2p4qrp55.png" alt="The smoking gun. While the p95 latency for successful requests actually dropped to ~492ms, the maximum latency spiked to an unusable 36 seconds. The explicit HTTP 500 errors confirm the single MongoDB instance was pushed into connection exhaustion." width="800" height="768"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The smoking gun. While the p95 latency for successful requests actually dropped to ~492ms, the maximum latency spiked to an unusable 36 seconds. The explicit HTTP 500 errors confirm the single MongoDB instance was pushed into connection exhaustion.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw6z5l534a1utec96qqxk.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw6z5l534a1utec96qqxk.png" alt="The illusion of scale. Adding a load balancer and a second application node successfully pushed our throughput to over 3,600 requests per second, processing 350,261 total requests." width="800" height="512"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The illusion of scale. Adding a load balancer and a second application node successfully pushed our throughput to over 3,600 requests per second, processing 350,261 total requests.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnugivk7ca03etezrbl4p.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnugivk7ca03etezrbl4p.png" alt="The breaking point. Scaling the compute layer while leaving the data layer untouched resulted in a massive 26.5% failure rate, actively degrading the system’s availability." width="800" height="470"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The breaking point. Scaling the compute layer while leaving the data layer untouched resulted in a massive 26.5% failure rate, actively degrading the system’s availability.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Total Requests Processed:&lt;/strong&gt; 350,261&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Throughput:&lt;/strong&gt; 3,638 requests/second&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Latency (p95):&lt;/strong&gt; ~492 ms (for successful requests)&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Failure Rate:&lt;/strong&gt; &lt;strong&gt;26.57%&lt;/strong&gt; (93,069 failed requests, including explicit HTTP 500 database errors and massive timeouts spiking up to 36 seconds).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Discussion
&lt;/h2&gt;

&lt;p&gt;The experimental data explicitly demonstrates the systemic risks of isolated horizontal scaling. While adding compute resources improved specific performance metrics, it fundamentally compromised system reliability, proving that scaling a single tier does not equate to scaling the system as a whole.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. The Shifting Bottleneck and Resource Exhaustion&lt;/strong&gt; The baseline load test (Architecture A) established a clear system ceiling: a single Node.js instance capped throughput at 2,193 requests per second with a p95 latency of ~796ms. Crucially, the failure rate was 0.00%. In this configuration, the compute layer acted as a strict upstream bottleneck. Because a single server could not process requests fast enough to overwhelm the database’s connection pool (configured to a maximum of 50 connections), the database was naturally shielded from resource exhaustion. The system was relatively slow under peak load, but highly stable.&lt;/p&gt;

&lt;p&gt;By introducing a load balancer and a second application node (Architecture 2A), the compute-layer bottleneck was removed. The system accepted more concurrent traffic, driving throughput up by roughly 65% (to 3,638 req/sec). However, because both nodes funneled this doubled traffic into the single, unscaled MongoDB instance, the bottleneck immediately shifted to the data layer. The sudden influx of concurrent requests exhausted the database connection pool, leading to connection lockups and explicit HTTP 500 errors.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. The False Positive of “Improved” Performance&lt;/strong&gt; A superficial reading of Architecture 2A’s metrics might suggest a performance win: the p95 latency for successful requests actually dropped by ~38% (from 796ms down to 492ms), and total processed requests nearly doubled.&lt;/p&gt;

&lt;p&gt;However, a rigorous analysis reveals this “scale” is an illusion. The data shows a catastrophic failure rate of 26.57% (93,069 failed requests). The reduction in p95 latency for successful requests is effectively a survivorship bias metric; it only accounts for the requests that managed to secure a database connection. Meanwhile, the maximum latency for blocked requests spiked to an unusable 36 seconds. The experiment proves that forcing high throughput at the compute layer without matching capacity at the data layer destroys system availability.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. The Inadequacy of Isolated Scaling&lt;/strong&gt; The results strictly invalidate the hypothesis that doubling compute resources linearly increases maximum throughput &lt;em&gt;safely&lt;/em&gt;. Instead, it proves that architectural scaling must be holistic.&lt;/p&gt;

&lt;p&gt;When Architecture 2A pushed the database beyond its concurrency limits, the system did not degrade gracefully — it fractured, dropping more than a quarter of all user requests.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The data validates a core principle of distributed systems:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;throughput and availability are often inversely correlated when shared resources are unscaled.&lt;/strong&gt; Architecture A was unscalable but highly available (100% success). Architecture 2A was highly performant for a subset of users but critically unavailable for the rest (26.57% failure).&lt;/p&gt;

&lt;p&gt;To successfully scale this system beyond the 2,193 req/sec ceiling of Architecture A without incurring the 26% failure penalty of Architecture 2A, the architecture must evolve to protect the database. Based strictly on these failure modes, future iterations must either synchronously scale the data layer (e.g., database sharding/replicas to handle the higher connection volume) or implement an asynchronous buffer (e.g., a message queue) to decouple the request ingestion rate from the database write rate.&lt;/p&gt;

&lt;h2&gt;
  
  
  Acknowledgements &amp;amp; References
&lt;/h2&gt;

&lt;p&gt;The experiments and conclusions drawn in this article were directly informed by studying foundational distributed systems literature. Translating these concepts from theory into a live, containerized k6 experiment was made possible by the following resources:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Performance, Scalability &amp;amp; Throughput&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://www.youtube.com/watch?v=3HIV4MnLGCw" rel="noopener noreferrer"&gt;&lt;strong&gt;MIT 6.004: Performance Measures (YouTube)&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;:&lt;/strong&gt; Provided the classic “laundry analogy” illustrating why pipelining improves overall throughput but not individual request latency.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://blog.professorbeekums.com/performance-vs-scalability/" rel="noopener noreferrer"&gt;&lt;strong&gt;Performance vs. Scalability (Prof. Beekums)&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;:&lt;/strong&gt; Clarified the boundaries between making a single server faster versus designing an architecture to handle increased load.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://www.allthingsdistributed.com/2006/03/a_word_on_scalability.html" rel="noopener noreferrer"&gt;&lt;strong&gt;A Word on Scalability (Werner Vogels)&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;:&lt;/strong&gt; Foundational principles from Amazon’s CTO on building systems that scale gracefully.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://cs.fyi/guide/latency-vs-throughput" rel="noopener noreferrer"&gt;&lt;strong&gt;Latency vs Throughput (CS.fyi)&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;&amp;amp;&lt;/strong&gt; &lt;a href="https://community.cadence.com/cadence_blogs_8/b/fv/posts/understanding-latency-vs-throughput" rel="noopener noreferrer"&gt;&lt;strong&gt;Understanding Latency vs Throughput (Cadence)&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;:&lt;/strong&gt; Core definitions and metrics for measuring system speed and capacity.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The CAP Theorem &amp;amp; Consistency Patterns&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://robertgreiner.com/cap-theorem-revisited/" rel="noopener noreferrer"&gt;&lt;strong&gt;CAP Theorem Revisited (Robert Greiner)&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;&amp;amp;&lt;/strong&gt; &lt;a href="http://ksat.me/a-plain-english-introduction-to-cap-theorem" rel="noopener noreferrer"&gt;&lt;strong&gt;A Plain English Introduction to CAP (ksat.me)&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;:&lt;/strong&gt; Explained the core mathematical trade-off: why our partitioned, load-balanced system had to sacrifice availability when tied to a single database.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://cs.fyi/guide/consistency-patterns-week-strong-eventual" rel="noopener noreferrer"&gt;&lt;strong&gt;Consistency Patterns (CS.fyi)&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;:&lt;/strong&gt; Detailed breakdowns of Weak, Eventual, and Strong Consistency, which directly inspired the Redis asynchronous queue experiment.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;High Availability, Failover &amp;amp; Database Replication&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://www.youtube.com/watch?v=LdvduBxZRLs" rel="noopener noreferrer"&gt;&lt;strong&gt;Availability in Distributed Systems (GKCS — YouTube)&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;:&lt;/strong&gt; A practical war story detailing a real-world database migration, downtime management, and understanding the “9s of availability.”&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://www.slideshare.net/slideshow/scalability-availability-stability-patterns/4062682" rel="noopener noreferrer"&gt;&lt;strong&gt;Scalability, Availability &amp;amp; Stability Patterns (SlideShare)&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;:&lt;/strong&gt; A comprehensive visual overview of architectural patterns.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://www.designgurus.io/blog/high-availability-system-design-basics" rel="noopener noreferrer"&gt;&lt;strong&gt;High Availability System Design Basics (DesignGurus)&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;&amp;amp;&lt;/strong&gt; &lt;a href="https://dev.to/decoders_lord/system-design-availability-patterns-104i"&gt;&lt;strong&gt;System Design Availability Patterns (Dev.to)&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;:&lt;/strong&gt; Practical guides on identifying and removing single points of failure.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://www.serverion.com/uncategorized/active-passive-vs-active-active-failover/" rel="noopener noreferrer"&gt;&lt;strong&gt;Active-Passive vs Active-Active Failover (Serverion)&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;:&lt;/strong&gt; The blueprint used for configuring our Nginx load balancer to distribute compute traffic.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://www.enjoyalgorithms.com/blog/introduction-to-database-replication-system-design" rel="noopener noreferrer"&gt;&lt;strong&gt;Introduction to Database Replication (EnjoyAlgorithms)&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;:&lt;/strong&gt; A deep dive into separating read/write workloads and scaling the data tier.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>systemdesign</category>
      <category>distributedsystems</category>
      <category>node</category>
      <category>software</category>
    </item>
    <item>
      <title>What Would You Change First About My Developer Portfolio?</title>
      <dc:creator>c0d3l0v3r</dc:creator>
      <pubDate>Tue, 02 Jun 2026 03:39:16 +0000</pubDate>
      <link>https://dev.to/c0d3l0v3r/what-would-you-change-first-about-my-developer-portfolio-50ca</link>
      <guid>https://dev.to/c0d3l0v3r/what-would-you-change-first-about-my-developer-portfolio-50ca</guid>
      <description>&lt;p&gt;I've been working on improving my developer portfolio and would appreciate feedback from other engineers and developers.&lt;/p&gt;

&lt;p&gt;Portfolio: &lt;a href="https://portfolio-one-rust-77.vercel.app/" rel="noopener noreferrer"&gt;https://portfolio-one-rust-77.vercel.app/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; The portfolio is best viewed on a laptop or desktop, as some sections include interactive elements that are easier to explore on a larger screen.&lt;/p&gt;

&lt;p&gt;Some specific questions I have:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What was your first impression after opening the site?&lt;/li&gt;
&lt;li&gt;Is the navigation intuitive?&lt;/li&gt;
&lt;li&gt;Are the projects presented clearly?&lt;/li&gt;
&lt;li&gt;Does anything feel confusing, unnecessary, or distracting?&lt;/li&gt;
&lt;li&gt;If you had 5 minutes to improve this portfolio, what would you change first?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A bit about me:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Computer Science student&lt;/li&gt;
&lt;li&gt;Interested in backend engineering and distributed systems&lt;/li&gt;
&lt;li&gt;Building projects involving PostgreSQL, Redis, Kafka, Docker, and observability tooling&lt;/li&gt;
&lt;li&gt;Currently looking for internships and software engineering opportunities&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'm looking for honest feedback, including criticism. If something doesn't work, I'd rather hear it now than during an interview process.&lt;/p&gt;

&lt;p&gt;Even if you only have one suggestion, I'd love to hear it.&lt;/p&gt;

&lt;p&gt;Thanks in advance to anyone who takes the time to review it.&lt;/p&gt;

</description>
      <category>backend</category>
      <category>career</category>
      <category>webdev</category>
      <category>discuss</category>
    </item>
    <item>
      <title>From a Simple Auth Service to a Distributed Authentication Platform with Kafka, Debezium, and Observability</title>
      <dc:creator>c0d3l0v3r</dc:creator>
      <pubDate>Tue, 02 Jun 2026 03:15:27 +0000</pubDate>
      <link>https://dev.to/c0d3l0v3r/from-a-simple-auth-service-to-a-distributed-authentication-platform-with-kafka-debezium-and-3o2</link>
      <guid>https://dev.to/c0d3l0v3r/from-a-simple-auth-service-to-a-distributed-authentication-platform-with-kafka-debezium-and-3o2</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/github-2026-05-21"&gt;GitHub Finish-Up-A-Thon Challenge&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;I built a Distributed Authentication System as a long-term learning project to explore real-world backend and distributed systems concepts through a familiar use case: user authentication.&lt;/p&gt;

&lt;p&gt;The project started as a simple authentication service with signup and login functionality. Over time, it evolved into a distributed architecture that incorporates event-driven communication, change data capture (CDC), observability, horizontal scaling, and performance testing.&lt;/p&gt;

&lt;p&gt;The current system consists of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;PostgreSQL as the primary source of truth for user credentials&lt;/li&gt;
&lt;li&gt;Redis for refresh token storage and session management&lt;/li&gt;
&lt;li&gt;Kafka as the event streaming platform&lt;/li&gt;
&lt;li&gt;Debezium for Change Data Capture (CDC) from PostgreSQL&lt;/li&gt;
&lt;li&gt;MongoDB for materialized user profile documents&lt;/li&gt;
&lt;li&gt;Nginx for load balancing across multiple service instances&lt;/li&gt;
&lt;li&gt;Prometheus and Grafana for monitoring and observability&lt;/li&gt;
&lt;li&gt;k6 for load testing and performance analysis&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When a user signs up, the authentication service writes user data to PostgreSQL. Debezium captures the database change and publishes it to Kafka. A separate profile service consumes the event and creates a corresponding profile document in MongoDB. This allows services to communicate asynchronously while keeping the architecture loosely coupled.&lt;/p&gt;

&lt;p&gt;Beyond implementing features, the main goal of this project was to understand the trade-offs involved in building distributed systems. Throughout development I conducted load-testing experiments, measured replication lag, analyzed bottlenecks, and documented the architectural decisions that shaped the system.&lt;/p&gt;

&lt;p&gt;This project has become my personal distributed systems playground where I can experiment with new ideas, evaluate design decisions, and learn how real systems behave under load.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;h4&gt;
  
  
  GitHub Repository
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Repository:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://github.com/c0d3l0v3r-HeHe/distributed-auth-system" rel="noopener noreferrer"&gt;https://github.com/c0d3l0v3r-HeHe/distributed-auth-system&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Signup Flow
&lt;/h4&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%2F30edq7k4gtyzq4aa94en.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%2F30edq7k4gtyzq4aa94en.png" alt="Image showing the signup flow in the distributed system" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Login Flow
&lt;/h4&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%2Fnt91s2dpdcn63mw3sbyk.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%2Fnt91s2dpdcn63mw3sbyk.png" alt="Login architectural diagram" width="800" height="848"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The repository contains additional architecture diagrams, performance experiments, load-testing results, observability metrics, and detailed documentation covering the design decisions and trade-offs explored throughout the project.&lt;/p&gt;

&lt;p&gt;Rather than reproducing all of those results here, I've kept this submission focused on the project's journey and evolution. If you're interested in the deeper technical details, bottleneck analysis, replication lag measurements, scaling experiments, or observability setup, you'll find them documented in the repository.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Comeback Story
&lt;/h2&gt;

&lt;p&gt;This project was not originally intended to be a standalone distributed authentication platform.&lt;/p&gt;

&lt;p&gt;In May, I started building it as the authentication backend for a larger job portal project. The initial goal was fairly straightforward: implement signup, login, token management, and the supporting infrastructure needed for user authentication.&lt;/p&gt;

&lt;p&gt;After building the core authentication service and setting up the initial infrastructure, I shifted my focus to other work and the project was left unfinished. While the foundation existed, many of the ideas I wanted to explore—distributed systems patterns, observability, scalability, and performance analysis—were still missing.&lt;/p&gt;

&lt;p&gt;A few weeks later, I came across the GitHub Finish-Up-A-Thon Challenge and decided to revisit the project instead of letting it remain another abandoned repository.&lt;/p&gt;

&lt;p&gt;Rather than simply cleaning up old code, I used the opportunity to significantly expand the project and turn it into a distributed systems playground.&lt;/p&gt;

&lt;p&gt;During the revival, I:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Added Redis-based refresh token management&lt;/li&gt;
&lt;li&gt;Implemented a CDC pipeline using PostgreSQL, Debezium, and Kafka&lt;/li&gt;
&lt;li&gt;Added a dedicated profile service backed by MongoDB&lt;/li&gt;
&lt;li&gt;Introduced Prometheus metrics and Grafana dashboards&lt;/li&gt;
&lt;li&gt;Added k6 load-testing infrastructure&lt;/li&gt;
&lt;li&gt;Scaled the authentication service horizontally behind Nginx&lt;/li&gt;
&lt;li&gt;Conducted multiple performance experiments and documented the results&lt;/li&gt;
&lt;li&gt;Created architecture diagrams and expanded the project documentation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One of the most valuable outcomes of revisiting the project was discovering bottlenecks that only became visible under load. While scaling the authentication service improved CPU utilization, load testing revealed that MongoDB and the CDC pipeline became the primary bottlenecks. Investigating these trade-offs taught me far more than simply building the original authentication service.&lt;/p&gt;

&lt;p&gt;By the end of the challenge, the project had evolved from an unfinished backend component into a fully documented distributed authentication system that I can continue using to explore distributed systems concepts, scalability patterns, and performance engineering.&lt;/p&gt;

&lt;h2&gt;
  
  
  My Experience with GitHub Copilot
&lt;/h2&gt;

&lt;p&gt;GitHub Copilot acted as an implementation and exploration partner throughout the revival of this project.&lt;/p&gt;

&lt;p&gt;For many components, I first designed the architecture and wrote the interfaces, function signatures, and high-level implementation plan. I then used Copilot to generate boilerplate code, suggest implementations, and accelerate repetitive development tasks.&lt;/p&gt;

&lt;p&gt;Copilot was particularly useful for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Generating service scaffolding and repetitive CRUD logic&lt;/li&gt;
&lt;li&gt;Assisting with Docker Compose configuration&lt;/li&gt;
&lt;li&gt;Helping configure Prometheus metrics collection&lt;/li&gt;
&lt;li&gt;Suggesting Kafka consumer and producer implementations&lt;/li&gt;
&lt;li&gt;Writing integration and infrastructure tests&lt;/li&gt;
&lt;li&gt;Explaining configuration options for Debezium and Kafka Connect&lt;/li&gt;
&lt;li&gt;Speeding up refactoring and cleanup work&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One workflow I found especially effective was defining the architecture and API contracts myself, leaving implementation placeholders, and then using Copilot to generate an initial implementation. This allowed me to focus more on system design decisions and less on repetitive coding.&lt;/p&gt;

&lt;p&gt;I also used Copilot while setting up and validating the distributed architecture. It helped me troubleshoot configuration issues, understand service interactions, and quickly iterate on infrastructure changes during development.&lt;/p&gt;

&lt;p&gt;The biggest benefit wasn't code generation itself—it was the ability to move from an idea to an experiment much faster. Since this project is intended as a distributed systems learning playground, that rapid feedback loop allowed me to spend more time investigating architectural trade-offs, performance bottlenecks, and scalability challenges.&lt;/p&gt;

&lt;h2&gt;
  
  
  Feedback Welcome
&lt;/h2&gt;

&lt;p&gt;This project started as a learning exercise and has evolved into my personal distributed systems playground.&lt;/p&gt;

&lt;p&gt;If you're an experienced backend or distributed systems engineer and happen to read this submission, I'd genuinely appreciate any feedback on the architecture, design decisions, bottlenecks, or trade-offs discussed throughout the project.&lt;/p&gt;

&lt;p&gt;Some areas I'm currently thinking about include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Improving the CDC pipeline under higher load&lt;/li&gt;
&lt;li&gt;Reducing replication lag and read amplification&lt;/li&gt;
&lt;li&gt;Better approaches to profile materialization&lt;/li&gt;
&lt;li&gt;Scaling strategies beyond the current setup&lt;/li&gt;
&lt;li&gt;Observability improvements and production-readiness considerations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Constructive criticism, alternative approaches, and architecture suggestions are all welcome. One of the main goals of this project is to learn from engineers who have solved these problems in real systems.&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%2F4ftryfxkkmystybk64m8.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%2F4ftryfxkkmystybk64m8.png" alt="Cover Image" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>githubchallenge</category>
      <category>distributedsystems</category>
      <category>backend</category>
    </item>
  </channel>
</rss>
