<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mallikarjun 17 on Medium]]></title>
        <description><![CDATA[Stories by Mallikarjun 17 on Medium]]></description>
        <link>https://medium.com/@mallikarjunkonemane?source=rss-ccde10d76290------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*EbvGMSxIshj568MvW0sVkA.png</url>
            <title>Stories by Mallikarjun 17 on Medium</title>
            <link>https://medium.com/@mallikarjunkonemane?source=rss-ccde10d76290------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 15:37:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mallikarjunkonemane/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How Git Works Internally]]></title>
            <link>https://mallikarjunkonemane.medium.com/how-git-works-internally-f151e64e8707?source=rss-ccde10d76290------2</link>
            <guid isPermaLink="false">https://medium.com/p/f151e64e8707</guid>
            <dc:creator><![CDATA[Mallikarjun 17]]></dc:creator>
            <pubDate>Fri, 16 Jan 2026 06:40:23 GMT</pubDate>
            <atom:updated>2026-01-16T06:40:23.604Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>A Deep DiveMany developers use Git mechanically — running a handful of familiar commands like git add, git commit, and git push, while relying on trial, error, or copy-pasted fixes when something goes wrong.</blockquote><blockquote>But what truly happens behind the scenes when these commands run? Where are your files stored, and how does Git record years of changes without ballooning in size?</blockquote><blockquote>Learning how Git works internally removes the mystery. It allows you to understand your repository’s state, troubleshoot problems with confidence, and take full advantage of Git’s design rather than working around it.</blockquote><p>In this article, we’ll break down:</p><ul><li>What Git actually is at a fundamental level</li><li>Git’s core object model: blobs, trees, and commits</li><li>How SHA-1 hashes are used to identify and store content</li><li>The role of the working directory, staging area, and repository</li><li>What really happens during commits, branching, merging, and rebasing</li><li>How Git efficiently stores data while keeping repositories lightweight</li></ul><h3>1. Distributed Version Control</h3><p>Git is a <strong>distributed version control system</strong> created by Linus Torvalds in 2005 for Linux kernel development.</p><p>Older tools like <strong>CVS</strong> and <strong>SVN</strong> use a <strong>centralized</strong> model: one server holds the source of truth, and developers pull from and push to that central machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_YR6WMeYoFXT_WHlEKv-Qg.png" /></figure><p>Git flips this model. In Git, <strong>every developer has a full copy of the repository</strong>, including the entire history.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A6pZuTCdtCo6N8F6iqYjHQ.png" /></figure><p>This distributed setup gives Git a few key advantages:</p><ul><li>Work offline with full history</li><li>No single point of failure</li><li>Faster operations because most work happens locally</li><li>Flexible workflows for teams and individuals</li></ul><p>But how does Git store the full history without the repo becoming huge? To answer that, you need to understand the <strong>Git’s data model</strong>.</p><h3>2. Git’s Data Model</h3><p>At its core, Git is a <strong>content-addressable filesystem</strong>. It stores data as <strong>objects</strong>, and each object is identified by a <strong>SHA-1 hash</strong> of its contents.</p><p>When you add a file to Git, it computes a 40-character hexadecimal SHA-1 hash of the file’s contents. This hash becomes the file’s unique address in Git’s database.</p><pre>File contents: &quot;Hello, World!&quot;<br>SHA-1 hash:    5dd01c177f5d7d1be5346a5bc18a569a7410c2ef</pre><p>Same content always produces the same hash. So two files with identical contents (even if they have different names) share the same hash.</p><p>Git stores the content <strong>once</strong> and references it <strong>multiple times</strong>, which helps repositories stay compact even across thousands of commits.</p><p>Git organizes everything into <strong>objects</strong> stored in its database. There are four types of objects, but three are essential for understanding how Git works: <strong>blobs, trees, and commits</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ATrdOvnGuxnYzEvHRW1G-g.png" /></figure><h3>Blobs: Storing File Contents</h3><p>A <strong>blob</strong> (binary large object) stores the raw contents of a file. Just the contents. No filename, no permissions, no timestamps, no metadata of any kind.</p><p>When you add README.md to Git, it creates a blob containing the file’s text. That blob has no idea it came from a file called README.md. It is simply a chunk of bytes with a SHA-1 hash computed from those bytes.</p><p><strong>Why separate content from filename?</strong></p><p>If the same config file is copied to three locations, a naive system stores three copies. Git stores <strong>one blob</strong> and references it <strong>three times</strong>, and these storage savings compound across the project’s history.</p><p>Of course, if blobs do not store filenames, Git still needs a way to represent folder structure. That is the job of <strong>trees</strong>.</p><h3>Trees: Mapping Directory Structure</h3><p>A <strong>tree</strong> represents a <strong>directory</strong>. It contains pointers to blobs (files) and other trees (subdirectories), along with filenames and permissions.</p><pre>Tree: 4c5f8a2b9d3e7f1a6b0c8d5e2f9a4b7c3d6e0f1a<br>├── README.md      -&gt; blob 5dd01c17...  (100644)<br>├── src/           -&gt; tree 8a3b2c1d...<br>└── package.json   -&gt; blob 7f2e3d4c...  (100644)</pre><p>The tree acts as a directory listing. It says “there is a file called README.md, and its contents are stored in blob 5dd01c17.” The blob stores the data; the tree gives it a name and location.</p><p>If you rename a file without changing its contents, Git creates a new tree (with the new filename) pointing to the same blob. The actual file data is not duplicated.</p><p>Now we have blobs for content and trees for structure. But version control needs more: who made changes, when, and why. That is what <strong>commits</strong> provide.</p><h3>Commits: Recording History</h3><p>A <strong>commit</strong> captures a complete snapshot of your project at a specific moment in time. Every commit contains:</p><ul><li>A pointer to a tree (the root directory at that moment)</li><li>Pointers to parent commits (the history leading to this point)</li><li>Author information (who wrote the changes)</li><li>Committer information (who applied the changes)</li><li>Timestamps</li><li>A commit message explaining the changes</li></ul><pre>Commit: abc123def456...<br>  tree:      def456...<br>  parent:    789012...<br>  author:    John &lt;john@example.com&gt; 1699900000 +0000<br>  committer: John &lt;john@example.com&gt; 1699900000 +0000</pre><pre>  Add login feature</pre><p>When you run <strong>git commit</strong>, Git creates a new commit object. This commit points to a tree representing your project’s current state. The parent pointer links back to the previous commit, forming a chain. This chain is your project’s history.</p><blockquote><em>The </em><strong><em>parent pointer</em></strong><em> is what makes Git a version control system rather than just a filesystem. By following parent pointers backward, Git can reconstruct any previous state of your project.</em></blockquote><p>The following diagram shows how a complete snapshot looks in Git’s object model:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BHQtvG6gCEBRSTQtjgwAbQ.png" /></figure><h3>3. How Git Stores Objects</h3><p>When you run <strong>git init</strong>, Git creates the .git directory with this structure:</p><pre>.git/<br>├── HEAD              (contains: ref: refs/heads/main)<br>├── config            (repository configuration)<br>├── description       (used by GitWeb, rarely relevant)<br>├── hooks/            (scripts triggered by Git events)<br>├── info/             (exclude patterns, other info)<br>├── objects/          (the object database, initially empty)<br>│   ├── info/<br>│   └── pack/<br>└── refs/             (references to commits)<br>    ├── heads/        (branch pointers, initially empty)<br>    └── tags/         (tag pointers)</pre><p>All Git objects live inside your repository’s .git/objects directory.</p><p>Git uses a simple organization scheme: the first two characters of an object’s hash become a subdirectory name, and the remaining 38 characters become the filename.</p><pre>.git/objects/<br>├── 5d/<br>│   └── d01c177f5d7d1be5346a5bc18a569a7410c2ef  (blob)<br>├── 4c/<br>│   └── 5f8a2b9d3e7f1a6b0c8d5e2f9a4b7c3d6e0f1a  (tree)<br>├── a1/<br>│   └── b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0  (commit)<br>└── ...</pre><p>This two-character prefix prevents any single directory from containing too many files, which could slow down filesystem operations.</p><p>Before writing an object to disk, Git also <strong>compresses it with zlib</strong>. A 1MB source file might shrink to ~100KB or less. Combine that with content-addressable deduplication (identical content stored once), and Git repositories stay surprisingly small even with long histories.</p><h3>Inspecting Objects Directly</h3><p>Git provides low-level commands to examine objects. These “plumbing” commands reveal what is happening under the hood:</p><pre># Determine an object&#39;s type (blob, tree, commit, or tag)<br>git cat-file -t 5dd01c17</pre><pre># Display an object&#39;s contents<br>git cat-file -p 5dd01c17</pre><pre># Examine what a commit contains<br>git cat-file -p HEAD</pre><p>Try running git cat-file -p HEAD in a repository. You will see the tree pointer, parent pointer, author information, and commit message. Then run git cat-file -p on that tree hash to see the directory listing.</p><p>Objects explain how Git stores data, but they do not yet explain the day-to-day workflow. When you edit a file, stage it, and commit, you move data through three distinct areas.</p><p>Let’s look at those next.</p><h3>4. The Three Areas</h3><p>Git organizes your work into three separate areas. Understanding these areas is the key to understanding why Git commands behave the way they do.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oKW_MGxIFCWCoQK77FlkGQ.png" /></figure><h3>Working Directory: Your Workspace</h3><p>The <strong>working directory</strong> is what you see in your file explorer. These are actual files on your filesystem that you open in your editor, modify, and save.</p><p>The working directory is not Git. It is simply a checkout of one particular version of your project. Git can delete it and recreate it from any commit in seconds.</p><p>This is why you can switch branches instantly, even in large projects. Git is not moving files around; it is regenerating the working directory from its object database.</p><h3>Staging Area: Your Draft</h3><p>The <strong>staging area</strong> (also called the <strong>index</strong>) lives in a single file at .git/index. It represents the exact snapshot of what your <strong>next commit</strong> will contain.</p><p>When you run git add README.md, Git does two things:</p><ol><li>Creates a blob object from the file’s current contents (or reuses an existing blob if the contents match).</li><li>Updates the index to associate the filename with that blob’s hash.</li></ol><p>Think of the staging area as a draft of your next commit. You can add files to it incrementally, remove files from it, and review exactly what is staged before committing.</p><p>This gives you precise control over what goes into each commit.</p><pre># See what is staged versus what is modified<br>git status</pre><pre># See the actual diff of staged changes<br>git diff --staged</pre><pre># Remove a file from staging (keep the working directory change)<br>git restore --staged README.md</pre><h4>Why have a staging area at all?</h4><p>Imagine you changed five files. Three are part of a bug fix, and two are unrelated cleanup.</p><p>Without staging, you either commit everything together or do awkward manual juggling. With staging, you commit the bug fix first, then commit the cleanup separately. Your history stays clean and easy to follow.</p><h3>Repository: The Source of Truth</h3><p>The <strong>repository</strong> is the .git directory. It contains everything: the object database (all blobs, trees, commits), references (branches, tags), configuration, hooks, and more.</p><p>When you run <strong>git commit</strong>, Git:</p><ol><li>Creates a tree object from the current index</li><li>Creates a commit object pointing to that tree, with the current HEAD as parent</li><li>Updates the current branch to point to this new commit</li></ol><p>The repository is the source of truth for your project. The working directory and staging area are just convenient views into it. If you delete your working directory but keep .git, you can restore everything. If you delete .git, your history is gone.</p><p>Now that we understand where data lives, let’s understand what actually happens when you commit files.</p><h3>How Branches Work</h3><p>Here is the fact that changes how you think about Git: <strong>a branch is just a pointer to a commit</strong>.</p><p>That is the entire implementation. A branch is a small file containing a 40-character commit hash. The file for your main branch lives at .git/refs/heads/main.</p><pre>.git/refs/heads/main:    a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0<br>.git/refs/heads/feature: x9y8z7w6v5u4t3s2r1q0p9o8n7m6l5k4j3i2h1g0</pre><p>Creating a branch is nearly instantaneous because Git only creates a tiny file. There is no copying of files, no duplicating history. Just a 41-byte file (40 characters plus a newline) pointing to an existing commit.</p><h3>HEAD: Tracking Your Current Position</h3><p><strong>HEAD</strong> is a special reference that tells Git where you are. In most cases, HEAD points to a branch name rather than directly to a commit:</p><pre>.git/HEAD: ref: refs/heads/main</pre><p>This means: “you are on main.” Git resolves your current commit by following pointers: HEAD → main → commit → tree → files</p><p>When you create a new branch using <strong>git branch feature</strong>, Git creates .git/refs/heads/feature containing the current commit hash. No new commits, no copying.</p><p>When you switch branches with <strong>git checkout feature</strong>, Git updates HEAD to point to refs/heads/feature, then regenerates your working directory and index to match that branch’s commit.</p><p>Sometimes HEAD points directly to a commit hash instead of a branch name. This is called <strong>detached HEAD</strong> state. It happens when you checkout a specific commit by its hash or checkout a tag.</p><p>In this state, any new commits you create are not attached to a branch and can become “lost” if you switch away without creating a branch to preserve them.</p><h3>How Commits Advance Branches</h3><p>When you create a new commit while on a branch, Git advances that branch pointer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8mA_4VnKN4nIpw-tCwsLwA.png" /></figure><p>The new commit (C4) has C3 as its parent. Then Git updates .git/refs/heads/main to contain C4’s hash. HEAD still points to main, but main now points to the new commit.</p><p>This pointer-based design explains why Git branching is so fast and cheap. There is no copying involved. Creating ten branches from the same commit means creating ten 41-byte files, all pointing to the same commit hash.</p><p>But branches diverge. Different developers make different changes on different branches. Eventually, those branches need to come back together. Let’s see how merging works.</p><h3>How Merging Works</h3><p>Merging combines the work from two branches into one. Git handles merging differently depending on how the branches have diverged.</p><h3>Fast-Forward Merge: The Simple Case</h3><p>The simplest merge happens when the target branch has not moved since the source branch was created. In this case, Git performs a <strong>fast-forward merge</strong>: it simply moves the target branch pointer forward to match the source branch</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/0*KVd6XAPc86qXB8hJ.png" /></figure><p>No new commit is created. Git just updates the main branch pointer from C2 to C3. Fast-forward merges are instant and create a linear history.</p><h3>Three-Way Merge: When Branches Diverge</h3><p>When both branches have new commits since they diverged, Git performs a <strong>three-way merge</strong>. It needs three pieces of information:</p><ol><li>The <strong>merge base</strong>: the common ancestor where the branches diverged</li><li>The <strong>current branch tip</strong>: where your branch is now (ours)</li><li>The <strong>other branch tip</strong>: what you are merging in (theirs)</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/505/0*10qpBxnmMEbnxdYC.png" /></figure><p>Git compares both branch tips against the merge base to determine what changed on each side. Changes that only appear on one side are applied automatically. Changes that conflict (both sides modified the same lines) require manual resolution.</p><p>The resulting merge commit (C4) has two parents: C2 from main and C3 from feature. This preserves the complete history of both branches. You can trace back through either parent to see exactly what work happened on each branch.</p><h3>Handling Conflicts</h3><p>When Git cannot automatically merge (the same lines were changed differently on both sides), it marks the conflicts in your files:</p><pre>&lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD<br>const timeout = 5000;<br>=======<br>const timeout = 10000;<br>&gt;&gt;&gt;&gt;&gt;&gt;&gt; feature</pre><p>Everything between &lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD and ======= is from your current branch. Everything between ======= and &gt;&gt;&gt;&gt;&gt;&gt;&gt; feature is from the branch being merged.</p><p>You resolve the conflict by editing the file to contain what you actually want, removing the conflict markers, then staging and committing.</p><p>Merging preserves the complete history of both branches, but it creates merge commits that can clutter the history. There is another way to integrate changes that results in a cleaner, linear history.</p><h3>How Git Optimizes Storage</h3><p>So far, we have discussed “loose objects”: individual files in .git/objects/ named by their hash. This is simple and fast for writing new objects, but it does not scale perfectly.</p><p>Two issues show up as a repo grows:</p><ul><li><strong>Filesystem overhead:</strong> thousands (or millions) of tiny files can slow down filesystems.</li><li><strong>Wasted space across versions:</strong> even though Git stores snapshots, many snapshots differ only slightly.</li></ul><p>Git solves both problems with <strong>pack files</strong>.</p><h3>Pack Files</h3><p>Instead of keeping every object as a separate file, Git periodically (during <strong>git gc</strong>, <strong>push</strong>, <strong>fetch</strong>, or <strong>clone</strong>) bundles many objects together into a pack:</p><pre>.git/objects/pack/<br>├── pack-abc123def456.idx   (index for fast lookup)<br>└── pack-abc123def456.pack  (compressed objects with deltas)</pre><ul><li>The .pack file holds the actual compressed, delta-encoded data.</li><li>The .idx file is an index that lets Git locate any object inside the pack quickly.</li></ul><p>This reduces file count dramatically and makes large repositories more efficient to store and transfer.</p><h3>How packing saves space</h3><p>When Git creates a pack, it applies three main optimizations:</p><ol><li><strong>Grouping: </strong>Git clusters related objects (for example, multiple versions of the same file) so it can compress them effectively.</li><li><strong>Delta compression: </strong>Instead of storing every version in full, Git stores one full version and then stores <strong>deltas</strong> (differences) for the others. Older versions can be reconstructed by applying deltas.</li><li><strong>Compression: </strong>The packed data is compressed (zlib), just like loose objects, but now Git can often compress even better because it is working with a larger, more structured dataset.</li></ol><h3>The Impact on Repository Size</h3><p>Imagine a 1MB configuration file modified 100 times.</p><ul><li>Without packing, Git would store many full versions (each compressed, but still substantial). You might end up with something on the order of <strong>tens of megabytes</strong> or more across history.</li><li>With packing, Git can store one full version plus small deltas for the other 99 versions. If each change touches only a few lines, each delta could be only a few kilobytes, so the total might be closer to <strong>a couple of megabytes</strong>.</li></ul><p>This is why repositories with years of history and thousands of commits can still clone in a reasonable size. Git is not shipping every full file version. It is shipping a compact representation built from packed objects and deltas.</p><h3>When Packing Happens</h3><p>You usually do not need to trigger packing manually. Git does it for you:</p><ul><li>git gc explicitly runs garbage collection and repacking</li><li>git push / git fetch / git clone often involve packing or repacking for efficient transfer</li><li>Git can also run GC automatically when loose objects grow past certain thresholds</li></ul><p>You rarely think about pack files day to day, but they are a big reason Git scales so well and why repository sizes are manageable despite storing complete history.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f151e64e8707" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How AWS Lambda Supports Container Images up to 10 GiB in Size]]></title>
            <link>https://mallikarjunkonemane.medium.com/how-aws-lambda-supports-container-images-up-to-10-gib-in-size-c1951838a26c?source=rss-ccde10d76290------2</link>
            <guid isPermaLink="false">https://medium.com/p/c1951838a26c</guid>
            <dc:creator><![CDATA[Mallikarjun 17]]></dc:creator>
            <pubDate>Thu, 15 Jan 2026 09:51:44 GMT</pubDate>
            <atom:updated>2026-01-15T09:51:44.990Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Rapid Scaling in FaaS: High Performance Approach by AWS Lambda</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KL0T0QBdPwBH1ijcMWrRCQ.png" /></figure><p>Over the past decade, Function-as-a-Service (FaaS) has revolutionized software development. It empowers engineers to concentrate solely on writing code, without the burden of managing intricate infrastructure provisioning and scaling. From a cost perspective, FaaS takes efficiency to the next level by charging based on function execution time.</p><p>While the internet abounds with articles discussing the advantages and disadvantages of FaaS, this article specifically delves into how AWS Lambda, one of the most popular FaaS platforms, supports on-demand loading of container images up to 10 GiB in size while maintaining rapid scalability (up to tens of thousands of new containers per customer), high request rates (millions of requests/sec), and low start-up times (~50ms).</p><h3>Core Challenge</h3><p>Prior to the ability to support loading up to 10GiB of containers, Lambda functions were limited to 250MB of code packaged as a simple compressed archive. This means there was not a lot of data movement when scaling up allowing to keep the scale up time, popularly known as <em>cold start time</em>, under a certain acceptable limit. However, to allow on-demand container images up to 10GiB in size will require moving significant amounts of data across the network, posing a great challenge for a service so popular to achieve the desired scalability and cold-start latency targets.</p><h3>Solution</h3><h4>TL;DR</h4><p>The aforementioned problem was solved by <em>caching </em>and <em>deduping </em>the most frequently used container image layers which reduced the data movement for all the container images inheriting them.</p><h4>Details</h4><p>Lambda achieves this by flattening the container image deterministically into small chunks. The deterministic flattening process produces unique chunks for the customized parts of the image, and similar chunks for the common parts (layers inherited by multiple images like nodejs layer etc.). This reduces the data storage and movement significantly as single copy of commonly used chunk needs to be stored once and can be cached as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wPruAngckoa637_m.png" /></figure><p>In simpler terms, say we have two container images A and B. When passed through the deterministic flattening function, it generates unique chunks for customized layer (layer #2, #3, 4) and generate similar chunks for common layers (layer #0, #1). The deduping operation removes the duplicates.</p><h4>Further Details</h4><p>To avoid unauthorized access to the code, the chunks are encrypted, however, this increases complexity while deduping because encryption can generate different cipher texts for the same chunks when encrypted with different keys. Something like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/837/0*G9HW5yrD_IdA4vMM.png" /></figure><p>This problem is solved using <a href="https://en.wikipedia.org/wiki/Convergent_encryption"><em>convergent encryption</em></a><em>, </em>where</p><ul><li>a cryptographic hash of the given chunk is generated by using some metadata as salt</li><li>this hash is then used as key to encrypt the chunk,</li><li>and finally, the key is encrypted using customer’s unique key</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/969/0*aNtO-weRu1anBBo7.png" /></figure><p>This allows the decryption keys to stay unique to the customer and only the functions authorized by the customer can access them.</p><h4>Production Nuggets</h4><ul><li>To limit the failure points, even the common chunks shared across many images are hashed with different salt values. Although, this generates different hash for same chunk, but it also saves the system from issues like hot-sharding and single point of failure. For eg. if a common chunk, say chunk #A, is hashed to the same value all the time, then any failure in the caching service will cause a performance hit for all the images dependent on chunk #A. Besides that, popular chunks will end up creating hot shards as all images will refer to the same hashed value of chunk #A. Having a common chunk hashed to different values, allows it to spread the traffic across multiple different hashed copies of the same chunk, which in return avoids single point of failures and hot shards.</li><li>The chunks are cached locally by the functions, if not available locally, its fetched from a remote availability-zone level (AZ-level) cache, and finally, if not available at AZ-level, its fetched from a persistent storage and loaded in to the cache.</li><li>The cache eviction strategy preferred is LRU-k over LRU (Least Recently Used). This helps to keep hot entries in the cache for longer and avoid them getting replaced by infrequently used entries as any drop of a hot entry from the cache can cause a significant performance hit to all the callers.</li></ul><h3>References</h3><ul><li><a href="https://arxiv.org/pdf/2305.13162">On-demand Container Loading in AWS Lambda</a></li><li><a href="https://en.wikipedia.org/wiki/Convergent_encryption">Convergent Encryption</a></li><li><a href="https://en.wikipedia.org/wiki/Page_replacement_algorithm">Page Replacement Algorithm</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c1951838a26c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linux Essentials for Cloud — Part 1]]></title>
            <link>https://mallikarjunkonemane.medium.com/linux-essentials-for-cloud-part-1-91543db88c91?source=rss-ccde10d76290------2</link>
            <guid isPermaLink="false">https://medium.com/p/91543db88c91</guid>
            <dc:creator><![CDATA[Mallikarjun 17]]></dc:creator>
            <pubDate>Mon, 12 Jan 2026 11:03:42 GMT</pubDate>
            <atom:updated>2026-01-12T11:03:42.545Z</atom:updated>
            <content:encoded><![CDATA[<h3><a href="https://cloudhandbook.substack.com/p/linux-essential-for-cloud-part-1"><strong>Linux Essentials for Cloud — Part 1</strong></a></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CDoQ5GrHpCKnMbChBlMVvA.png" /></figure><p>Linux is an open-source, Unix-like operating system.</p><p>From official <a href="https://www.linux.com/what-is-linux/"><strong>Linux.com</strong></a> website:</p><blockquote><em>Just like Windows, iOS, and Mac OS, Linux is an operating system. In fact, one of the most popular platforms on the planet, Android, is powered by the Linux operating system. An operating system is software that manages all of the hardware resources associated with your desktop or laptop. To put it simply, the operating system manages the communication between your software and your hardware. Without the operating system (OS), the software wouldn’t function.</em></blockquote><p>Linux kernel source code can be found at: <a href="https://www.kernel.org/">https://www.kernel.org/</a></p><p>In cloud computing, Linux dominates for several key reasons:</p><p><strong>Cost Effectiveness</strong>: No licensing fees make it ideal for large-scale deployments where hundreds or thousands of instances might be running simultaneously.</p><p><strong>Performance and Resource Efficiency</strong>: Linux’s lightweight nature means more resources are available for applications rather than the operating system overhead.</p><p><strong>Security and Stability</strong>: The open-source nature allows for rapid security patches, and Linux systems can run for months without requiring restarts.</p><p><strong>Containerization Ready</strong>: Linux provides native support for containers through features like namespaces and cgroups, making it the natural choice for Docker and Kubernetes deployments.</p><p><strong>Automation Friendly</strong>: Linux’s command-line interface and scripting capabilities make it perfect for Infrastructure as Code and automation workflows.</p><h3>Linux Distributions Commonly Used in the Cloud</h3><p><a href="https://ubuntu.com/"><strong>Ubuntu</strong></a>: The most popular choice for cloud deployments, especially for development and web applications. Ubuntu’s Long Term Support (LTS) versions provide 5 years of security updates, making them ideal for production environments.</p><p><a href="https://aws.amazon.com/amazon-linux-2/"><strong>Amazon Linux</strong></a>: AWS’s own distribution, optimized for EC2 instances. It comes pre-configured with AWS CLI tools and is tuned for optimal performance on AWS infrastructure.</p><p><a href="https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux"><strong>Red Hat Enterprise Linux (RHEL)</strong></a>: Enterprise-grade distribution favored by large organizations. Provides commercial support and is known for stability and security.</p><p><a href="https://www.centos.org/"><strong>CentOS/Rocky Linux</strong></a>: Community-driven alternatives to RHEL, offering similar features without licensing costs. Popular for enterprise environments that need RHEL compatibility.</p><p><a href="https://www.alpinelinux.org/"><strong>Alpine Linux</strong></a>: Ultra-lightweight distribution (typically 5MB base image) commonly used for containers and microservices due to its minimal attack surface.</p><p><a href="https://www.debian.org/"><strong>Debian</strong></a>: Known for stability and security, often used as a base for other distributions. Popular for servers that need long-term reliability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kkLjTz-Ogdt3RzcI.png" /></figure><p>There are tens of thousands of Linux distros available today. You can learn more about distros at <a href="https://distrowatch.com/dwres.php?resource=popularity">https://distrowatch.com/dwres.php?resource=popularity</a>.</p><h3>Using SSH to Connect to Linux Servers</h3><p>SSH (Secure Shell) is the primary method for connecting to Linux servers in the cloud. Understanding SSH is fundamental for cloud engineers.</p><p><strong>Basic SSH Connection</strong>:</p><pre>ssh username@server-ip-address<br>ssh ubuntu@192.168.1.100</pre><p><strong>Using SSH Keys (Recommended)</strong>: SSH keys provide more security than passwords. Cloud providers typically use key-based authentication by default.</p><pre># Generate an SSH key pair<br>ssh-keygen -t rsa -b 4096 -C &quot;your-email@example.com&quot;</pre><pre># Connect using a specific private key<br>ssh -i /path/to/private-key username@server-ip<br>ssh -i ~/.ssh/aws-key.pem ubuntu@ec2-instance-ip</pre><p><strong>SSH Configuration File</strong>: Create ~/.ssh/config to simplify connections:</p><pre>Host web-server<br>    HostName 192.168.1.100<br>    User ubuntu<br>    IdentityFile ~/.ssh/web-server-key.pem<br>    Port 22</pre><p><strong>SSH Security Best Practices</strong>:</p><ul><li>Disable password authentication</li><li>Change default SSH port from 22</li><li>Regularly rotate SSH keys</li><li>Disable root login over SSH</li></ul><h3>Terminal Essentials and Shell Overview</h3><p>The shell is your primary interface for interacting with Linux systems. Understanding shell basics is crucial for cloud operations.</p><p><a href="https://www.gnu.org/software/bash/"><strong>Bash (Bourne Again Shell)</strong></a>: The default shell on most Linux distributions. Provides command history, tab completion, and extensive scripting capabilities.</p><p><a href="https://ohmyz.sh/"><strong>Zsh (Z Shell)</strong></a>: Popular alternative shell with enhanced features like better tab completion, spell correction, and theme support.</p><p><strong>Essential Shell Concepts</strong>:</p><ul><li><strong>Command Prompt</strong>: Shows current user, hostname, and working directory</li><li><strong>Command History</strong>: Access previous commands with up arrow or history command</li><li><strong>Tab Completion</strong>: Press Tab to auto-complete commands and file names</li><li><strong>Pipes and Redirection</strong>: Combine commands and redirect output</li><li><strong>Environment Variables</strong>: Store configuration and system information</li></ul><h3>2. Basic Linux Commands</h3><p>You will use this basic commands frequently. So, understand this commands and what they do.</p><ul><li>File and directory navigation: ls, cd, pwd, tree</li><li>File operations: cp, mv, rm, mkdir, touch</li><li>Viewing and editing files: cat, less, more, head, tail, nano, vim</li><li>Permissions and ownership: chmod, chown, ls -l, umask</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*odYejww0xbslD1cz.png" /></figure><h3>Permissions and Ownership</h3><p>Linux permissions are crucial for security, especially in cloud environments where multiple users and services interact.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*helPQmx3TJNOn2TZ.png" /></figure><p><strong>Permission Types</strong>:</p><ul><li><strong>r (read)</strong>: Permission to read file contents or list directory</li><li><strong>w (write)</strong>: Permission to modify file or create/delete files in directory</li><li><strong>x (execute)</strong>: Permission to run file as program or enter directory</li></ul><p>chmod<strong> - Change Permissions</strong>:</p><pre>chmod 755 script.sh                 # rwxr-xr-x (owner: rwx, group: r-x, others: r-x)<br>chmod +x script.sh                  # Add execute permission for all<br>chmod u+w file.txt                  # Add write permission for owner<br>chmod go-r file.txt        # Remove read permission for group and others<br>chmod -R 644 /var/www/html/         # Recursively set permissions</pre><p><strong>Common Permission Patterns</strong>:</p><ul><li><strong>644</strong>: Files (owner: rw-, group: r — , others: r — )</li><li><strong>755</strong>: Directories and executables (owner: rwx, group: r-x, others: r-x)</li><li><strong>600</strong>: Private files (owner: rw-, group: — -, others: — -)</li><li><strong>700</strong>: Private directories (owner: rwx, group: — -, others: — -)</li></ul><p>chown<strong> - Change Ownership</strong>:</p><pre>chown user:group file.txt           # Change owner and group<br>chown user file.txt                 # Change only owner<br>chown :group file.txt               # Change only group<br>chown -R user:group directory/      # Recursively change ownership</pre><p>ls -l<strong> - View Detailed File Information</strong>:</p><pre>ls -l                          # Show permissions, ownership, size, date<br>ls -la                         # Include hidden files</pre><p>If you are still confused, you can watch this tutorial here.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FLnKoncbQBsM%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DLnKoncbQBsM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FLnKoncbQBsM%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/80fbdb6b1d2cd59232e8b1eeb1dc18e6/href">https://medium.com/media/80fbdb6b1d2cd59232e8b1eeb1dc18e6/href</a></iframe><h3>Process and Resource Management</h3><ul><li>Checking system usage: top, htop, free, uptime</li><li>Managing processes: ps, kill, killall, nice, renice</li><li>Background jobs: &amp;, jobs, fg, bg, nohup</li></ul><h3>Checking System Usage</h3><p>top<strong> - Real-time System Monitor</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*146DpND19aDpOxhc.png" /></figure><pre>$ top # Interactive process viewer<br>      # Press &#39;q&#39; to quit, &#39;k&#39; to kill process, &#39;1&#39; to show all CPU cores</pre><p>htop<strong> - </strong><a href="https://htop.dev/"><strong>Enhanced Process Viewer</strong></a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YrT3a-wIUsJKPPGw.png" /></figure><pre>$ htop                                # More user-friendly than top<br># Use arrow keys to navigate, F9 to kill, F10 to quit</pre><p>free<strong> - Memory Usage</strong>:</p><pre>$ free                                # Show memory usage in KB<br>$ free -h                             # Human-readable format (MB/GB)<br>$ free -s 5                           # Update every 5 seconds</pre><p>uptime<strong> - System Load and Uptime</strong>:</p><pre>$ uptime                              # Show uptime and load averages<br># Load averages: 1-minute, 5-minute, 15-minute</pre><h3>Managing Processes</h3><p>ps<strong> - List Running Processes</strong>:</p><pre>ps                                  # Show processes for current user<br>ps aux                              # Show all processes with detailed info<br>ps -ef                              # Show all processes in different format<br>ps -C nginx                         # Show processes by command name</pre><p>kill<strong> and </strong>killall<strong> - Terminate Processes</strong>:</p><pre>kill 1234                           # Kill process by PID<br>kill -9 1234                        # Force kill (SIGKILL)<br>kill -15 1234                       # Graceful termination (SIGTERM)<br>killall nginx                       # Kill all processes named nginx<br>killall -9 nginx                    # Force kill all nginx processes</pre><p>nice<strong> and </strong>renice<strong> - Process Priority</strong>:</p><pre>nice -n 10 command                  # Start command with priority 10<br>renice -10 1234                     # Change priority of existing process<br># Priority range: -20 (highest) to 19 (lowest)</pre><h3>Background Jobs</h3><p><strong>Running Commands in Background</strong>:</p><pre>command &amp;                           # Run command in background<br>nohup command &amp;                     # Run command immune to hangups</pre><p><strong>Job Control</strong>:</p><pre>jobs                                # List active jobs<br>fg %1                               # Bring job 1 to foreground<br>bg %1                               # Send job 1 to background<br>disown %1</pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FTJzltwv7jJs%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DTJzltwv7jJs&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FTJzltwv7jJs%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/8b08202435c1cbcf3bf35ffbf2640a4b/href">https://medium.com/media/8b08202435c1cbcf3bf35ffbf2640a4b/href</a></iframe><h3>Conclusion</h3><p>Basic Linux Commands, Process management, Permissions, ssh are non negotiable skills while you are getting started in cloud. You will require these concepts at work frequently.</p><p>In the Part II of this series, we will be talking about</p><ul><li>File System and Storage</li><li>Users, Groups and Permissions</li><li>Package Management</li><li>System Logs and Troubleshooting</li></ul><p>Thanks for reading.. Stay tuned for next content…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=91543db88c91" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DevOps vs. MLOps vs. LLMOps: Understanding the Evolution of Operations]]></title>
            <link>https://mallikarjunkonemane.medium.com/devops-vs-mlops-vs-llmops-understanding-the-evolution-of-operations-22348bbd3717?source=rss-ccde10d76290------2</link>
            <guid isPermaLink="false">https://medium.com/p/22348bbd3717</guid>
            <dc:creator><![CDATA[Mallikarjun 17]]></dc:creator>
            <pubDate>Wed, 24 Dec 2025 13:26:09 GMT</pubDate>
            <atom:updated>2025-12-24T13:26:09.346Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D1Ujgk4OKQxlqec07T4BAQ.png" /><figcaption><strong>DEVOPS VS MLOPS VS LLMOPS</strong></figcaption></figure><p>The world of software operations has evolved dramatically over the past decade. What started as DevOps has branched into specialized disciplines like MLOps and LLMOps, each addressing unique challenges in their respective domains. While many teams attempt to apply traditional DevOps practices to machine learning and LLM applications, this approach often falls short because these disciplines solve fundamentally different problems.</p><p>Let’s break down these three operational paradigms and understand why each exists.</p><h3>DevOps: The Foundation of Software Operations</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4Ow3Y3hcwWPJIip7-_vrNQ.png" /><figcaption><strong>DEVOPS</strong></figcaption></figure><p>DevOps is fundamentally <strong>software-centric</strong>. The workflow is straightforward: you write code, test it, and deploy it to production. The feedback loop is binary and immediate — either your code works or it doesn’t.</p><p><strong>Key characteristics of DevOps:</strong></p><ul><li>Focus on continuous integration and continuous deployment (CI/CD)</li><li>Predictable compute costs</li><li>Clear success metrics (does it compile? do tests pass?)</li><li>Static behavior once deployed</li><li>Version control for code</li></ul><p>The beauty of DevOps lies in its determinism. The same code with the same inputs produces the same outputs every single time.</p><h3>MLOps: When Models Enter the Picture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rWuHak8x-m2boDFePPwSKw.png" /><figcaption><strong>MLOPS</strong></figcaption></figure><p>MLOps emerged because traditional DevOps practices couldn’t handle the unique challenges of machine learning systems. MLOps is <strong>model-centric</strong>, and here’s where things get interesting.</p><p>Unlike traditional software, machine learning models don’t remain static after deployment. The world changes, and so does your model’s performance.</p><p><strong>What makes MLOps different:</strong></p><ul><li><strong>Data drift</strong>: The distribution of incoming data changes over time, causing model performance to degrade</li><li><strong>Model decay</strong>: Even with stable data, models can become outdated as patterns evolve</li><li><strong>Continuous retraining</strong>: Models need regular updates with fresh data</li><li><strong>Multiple artifacts</strong>: You’re versioning not just code, but also data, models, hyperparameters, and training configurations</li><li><strong>Complex monitoring</strong>: Beyond uptime, you’re tracking accuracy, precision, recall, and data quality metrics</li></ul><p>The feedback loop in MLOps is more nuanced. Your code might be perfectly fine, but your model’s accuracy could drop from 95% to 70% simply because user behavior shifted or seasonal patterns changed.</p><p><strong>The MLOps workflow typically includes:</strong></p><ul><li>Data versioning and lineage tracking</li><li>Experiment tracking across multiple model iterations</li><li>Model registry and version management</li><li>A/B testing infrastructure for model comparison</li><li>Automated retraining pipelines</li><li>Feature stores for consistent data access</li></ul><h3>LLMOps: The Foundation Model Revolution</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YhMre-wvRKFlfdrOglVtuQ.png" /><figcaption><strong>LLMOPS</strong></figcaption></figure><p>LLMOps represents the latest evolution, driven by the rise of large language models like GPT, Claude, and Llama. It’s <strong>foundation-model-centric</strong>, which means you’re typically not training models from scratch. Instead, you’re leveraging pre-trained models and optimizing them for your specific use case.</p><p><strong>The three primary optimization paths in LLMOps:</strong></p><ol><li><strong>Prompt Engineering</strong>: Crafting instructions that guide the model to produce desired outputs</li><li><strong>Context/RAG Setup</strong>: Implementing Retrieval-Augmented Generation to ground responses in your specific knowledge base</li><li><strong>Fine-Tuning</strong>: Adapting the foundation model to your domain with targeted training</li></ol><h3>What Makes LLMOps Uniquely Challenging</h3><p><strong>Monitoring is fundamentally different.</strong> While MLOps focuses on statistical metrics like accuracy and drift, LLMOps requires monitoring for:</p><ul><li><strong>Hallucination detection</strong>: Is the model making up information?</li><li><strong>Bias and toxicity</strong>: Are outputs safe and fair?</li><li><strong>Token usage and cost</strong>: How much is each query costing you?</li><li><strong>Groundedness</strong>: Are responses based on actual context?</li><li><strong>Human feedback loops</strong>: Qualitative assessment of response quality</li></ul><p>You can’t simply check if an output is “correct.” Natural language is nuanced, and context matters enormously.</p><p><strong>The evaluation loop is non-linear.</strong> When an LLM application fails evaluation, the solution isn’t always obvious. You might need:</p><ul><li>Better prompt engineering to clarify instructions</li><li>Enhanced RAG setup to provide more relevant context</li><li>Fine-tuning to improve domain-specific performance</li><li>All of the above simultaneously</li></ul><p>This creates a complex, iterative optimization process where multiple levers are adjusted in concert.</p><p><strong>Cost dynamics are wildly different.</strong> In traditional DevOps, compute costs are relatively predictable. In MLOps, training costs can be high but are mostly one-time expenses. In LLMOps, costs scale directly with usage and can spiral out of control quickly.</p><p>A poorly optimized prompt can 10x your token consumption overnight. Teams have blown through monthly budgets in days by not monitoring token usage per query. Every API call incurs a cost based on input tokens (your prompt + context) and output tokens (the model’s response).</p><h3>Automated Agent Optimization</h3><p>One of the most exciting developments in LLMOps is automated agent optimization. Tools like Comet’s Opik implement techniques to automatically find the best prompts for your agentic workflows.</p><p>The process is elegantly simple:</p><ol><li>Start with an initial prompt and evaluation dataset</li><li>Let the optimizer iteratively improve the prompt based on performance metrics</li><li>Receive an optimized prompt automatically</li></ol><p>This can be accomplished with just a few lines of code, dramatically reducing the manual effort required for prompt engineering while improving results.</p><h3>Comparative Summary</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*3IgMjvnOwYBv_v1JHuQRCA.png" /></figure><h3>Why This Matters</h3><p>Understanding these distinctions is crucial for building effective operations practices. Applying DevOps principles to an LLM application is like using a hammer when you need a scalpel — the fundamental assumptions don’t align.</p><p>Each discipline requires its own tooling, processes, and expertise. As AI continues to evolve, we’ll likely see even more specialized operational practices emerge. The key is recognizing that one size definitely doesn’t fit all when it comes to operations in the age of AI.</p><p>Whether you’re building traditional software, training custom models, or developing LLM-powered applications, choosing the right operational framework is essential for success. The complexity increases as you move from DevOps to MLOps to LLMOps, but so does the potential for creating intelligent, adaptive systems that can transform how we interact with technology.</p><p><em>Ready to dive deeper? Start with understanding MLOps fundamentals, then progress to LLMOps as foundation models become central to your architecture. The journey from DevOps to LLMOps represents not just technical evolution, but a fundamental shift in how we think about building and maintaining intelligent systems.</em></p><p>Just tell me what you want next.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22348bbd3717" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Docker Image: Normal vs Hardened]]></title>
            <link>https://mallikarjunkonemane.medium.com/docker-image-normal-vs-hardened-9c3f114a70e2?source=rss-ccde10d76290------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c3f114a70e2</guid>
            <dc:creator><![CDATA[Mallikarjun 17]]></dc:creator>
            <pubDate>Wed, 24 Dec 2025 11:38:09 GMT</pubDate>
            <atom:updated>2025-12-24T11:38:09.296Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>Same app. Very different security.</strong><br> Hardened images cut vulnerabilities, reduce attack surface, and improve compliance 🚀</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6-MSQYcvRLjICAdyiagSbw.png" /></figure><h3>Why Container Security Should Be Your First Priority</h3><p>In the rush to containerize applications, many teams overlook a critical security decision: <strong>choosing the right base image</strong>. This isn’t just about storage or performance — it’s about your application’s security posture in production.</p><p>Today, I’ll show you a real-world comparison between a standard Node.js image and a hardened alternative, revealing why this choice matters more than you might think.</p><h3>The Hidden Cost of Convenience</h3><p>The official Node.js images are fantastic for development. They come pre-loaded with everything you need: build tools, package managers, system utilities, and more. But in production, this convenience becomes a liability.</p><p>Every package in your container is a potential attack vector. Every utility that sits unused is still being scanned by security tools, flagged in compliance reports, and requiring patches when vulnerabilities are discovered.</p><h3>The Numbers Tell the Story</h3><p>Let me show you what happened when I compared two Node:20 images using Docker Scout:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KUZhdqRDgRQ4lVXDscXYuQ.png" /></figure><h3>Standard Node:20 Image</h3><p><strong>The Bloat:</strong></p><ul><li><strong>Image Size:</strong> 1.1GB</li><li><strong>Base:</strong> Full Debian OS with all utilities</li><li><strong>Included:</strong> Shell, package managers, build tools, Python, curl, wget, and hundreds of system libraries</li></ul><p><strong>The Security Impact:</strong></p><ul><li><strong>CVE Count:</strong> Multiple vulnerabilities in OS packages, shells, and system utilities</li><li><strong>Attack Surface:</strong> Every installed package represents a potential entry point</li><li><strong>Maintenance Burden:</strong> Hundreds of packages to track and patch</li></ul><p><strong>What You Get:</strong></p><ul><li>✅ Complete toolchain for development</li><li>✅ Familiar Debian environment</li><li>✅ Root access by default</li><li>❌ Massive attack surface</li><li>❌ Slow deployments</li><li>❌ High vulnerability count</li></ul><h3>Hardened Image (dhi.io/node:20)</h3><p><strong>The Minimalism:</strong></p><ul><li><strong>Image Size:</strong> 112MB (90% reduction!)</li><li><strong>Base:</strong> Distroless/Alpine with only essential runtime</li><li><strong>Included:</strong> Only Node.js runtime and required libraries</li></ul><p><strong>The Security Impact:</strong></p><ul><li><strong>CVE Count:</strong> Significantly fewer vulnerabilities</li><li><strong>Attack Surface:</strong> Minimal — only application binaries</li><li><strong>Maintenance Burden:</strong> A handful of components to track</li></ul><p><strong>What You Get:</strong></p><ul><li>✅ Minimal attack surface</li><li>✅ 90% smaller size</li><li>✅ Faster deployments</li><li>✅ Non-root user by default</li><li>✅ No shell or package managers</li><li>✅ Lower vulnerability count</li></ul><h3>Understanding the Architecture Differences</h3><h3>Traditional Approach (Full Image)</h3><pre>┌─────────────────────────────────┐<br>│     Your Application (10MB)     │<br>├─────────────────────────────────┤<br>│    Node.js Runtime (50MB)       │<br>├─────────────────────────────────┤<br>│   Build Tools &amp; Utilities       │<br>│   (gcc, make, python, etc)      │<br>│         (200MB)                 │<br>├─────────────────────────────────┤<br>│   System Libraries (300MB)      │<br>├─────────────────────────────────┤<br>│   Package Managers (50MB)       │<br>├─────────────────────────────────┤<br>│   Base OS - Debian (500MB)      │<br>└─────────────────────────────────┘<br>Total: ~1.1GB</pre><h3>Hardened Approach (Minimal Image)</h3><pre>┌─────────────────────────────────┐<br>│     Your Application (10MB)     │<br>├─────────────────────────────────┤<br>│    Node.js Runtime (50MB)       │<br>├─────────────────────────────────┤<br>│   Essential Libraries (52MB)    │<br>└─────────────────────────────────┘<br>Total: ~112MB</pre><h3>Real-World Impact</h3><h3>For Your Security Team</h3><ul><li><strong>Reduced Vulnerability Window:</strong> Fewer components mean fewer CVEs to track and patch</li><li><strong>Faster Incident Response:</strong> Smaller attack surface makes threat analysis simpler</li><li><strong>Better Compliance:</strong> Easier to pass security audits with minimal dependencies</li><li><strong>Lower Risk Profile:</strong> No shells or package managers means attackers have fewer tools if they breach the container</li></ul><h3>For Your DevOps Team</h3><ul><li><strong>10x Faster Deployments:</strong> 112MB images pull in seconds, not minutes</li><li><strong>Lower Bandwidth Costs:</strong> Especially significant in multi-region deployments</li><li><strong>Faster CI/CD Pipelines:</strong> Smaller images = faster builds and tests</li><li><strong>Reduced Storage Costs:</strong> Across development, staging, and production environments</li></ul><h3>For Your Development Team</h3><ul><li><strong>Cleaner Production Environment:</strong> What you test locally matches production</li><li><strong>Forced Best Practices:</strong> No shell access encourages proper logging and monitoring</li><li><strong>Better Resource Utilization:</strong> More pods per node means better cluster efficiency</li><li><strong>Simplified Debugging:</strong> Fewer components mean fewer things that can go wrong</li></ul><h3>Hands-On: Auditing Your Images with Docker Scout</h3><p>Let’s get practical. Docker Scout is an excellent tool for understanding what’s actually in your container images. Here’s how to audit your Node.js images and interpret the results.</p><h3>Prerequisites</h3><p>First, ensure you have Docker Scout installed:</p><pre># Docker Scout comes with Docker Desktop 4.17+<br># Or install the CLI plugin<br>docker scout version</pre><h3>Step 1: Scan the Official Node:20 Image</h3><pre># Pull the official image<br>docker pull node:20</pre><pre># Run a comprehensive CVE scan<br>docker scout cves node:20</pre><p><strong>What you’ll see:</strong></p><ul><li>Detailed vulnerability breakdown by severity</li><li>Package-by-package analysis</li><li>CVE identifiers with descriptions</li><li>Recommendations for remediation</li></ul><p><strong>Sample Output Structure:</strong></p><pre>Target: node:20<br>  Size: 1.1GB<br>  Packages: 44<br>  Vulnerabilities: 171<br>    Critical: 0<br>    High: 5<br>    Medium: 6<br>    Low: 156<br>    Unspecified: 4</pre><h3>Step 2: Scan Your Hardened Image</h3><pre># Pull or build your hardened image<br>docker pull dhi.io/node:20</pre><pre># Run the same scan<br>docker scout cves dhi.io/node:20</pre><p><strong>Sample Output Structure:</strong></p><pre>Target: dhi.io/node:20<br>  Size: 112MB<br>  Packages: 2<br>  Vulnerabilities: 8<br>    Critical: 0<br>    High: 0<br>    Medium: 0<br>    Low: 8</pre><h3>Step 3: Compare Side-by-Side</h3><p>Docker Scout can generate comparison reports:</p><pre># Compare images directly<br>docker scout compare --to node:20 dhi.io/node:20</pre><pre># Or export to JSON for reporting<br>docker scout cves node:20 --format json &gt; official-node.json<br>docker scout cves dhi.io/node:20 --format json &gt; hardened-node.json</pre><h3>Step 4: Continuous Monitoring</h3><p>Integrate scanning into your CI/CD pipeline:</p><pre># GitHub Actions example<br>- name: Scan container image<br>  uses: docker/scout-action@v1<br>  with:<br>    command: cves<br>    image: ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}<br>    sarif-file: scout-report.sarif<br>    <br>- name: Upload to GitHub Security<br>  uses: github/codeql-action/upload-sarif@v2<br>  with:<br>    sarif_file: scout-report.sarif</pre><h3>Building Your Own Hardened Image</h3><h3>Option 1: Distroless Base (Highest Security)</h3><pre># Multi-stage build<br>FROM node:20 AS builder</pre><pre>WORKDIR /app</pre><pre># Copy dependency definitions<br>COPY package*.json ./</pre><pre># Install only production dependencies<br>RUN npm ci --only=production &amp;&amp; \<br>    npm cache clean --force</pre><pre># Copy application code<br>COPY . .</pre><pre># Production stage - Distroless<br>FROM gcr.io/distroless/nodejs20-debian12</pre><pre># Copy from builder<br>COPY --from=builder /app /app</pre><pre>WORKDIR /app</pre><pre># Distroless images run as non-root by default<br>CMD [&quot;server.js&quot;]</pre><p><strong>Benefits:</strong></p><ul><li>No shell, no package manager</li><li>Minimal attack surface</li><li>Runs as non-root user</li><li>Smallest possible image</li></ul><p><strong>Trade-offs:</strong></p><ul><li>No shell for debugging (use docker exec with debugging tools in dev)</li><li>Requires multi-stage builds</li></ul><h3>Option 2: Alpine Base (Good Balance)</h3><pre>FROM node:20-alpine</pre><pre># Install only if you need additional tools<br># RUN apk add --no-cache tini</pre><pre>WORKDIR /app</pre><pre># Copy dependency files<br>COPY package*.json ./</pre><pre># Install production dependencies<br>RUN npm ci --only=production &amp;&amp; \<br>    npm cache clean --force &amp;&amp; \<br>    # Remove npm to reduce attack surface<br>    rm -rf /usr/local/lib/node_modules/npm</pre><pre># Copy application<br>COPY . .</pre><pre># Use non-root user<br>USER node</pre><pre># Health check<br>HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \<br>  CMD node healthcheck.js</pre><pre>CMD [&quot;node&quot;, &quot;server.js&quot;]</pre><p><strong>Benefits:</strong></p><ul><li>Small size (Alpine base is ~5MB)</li><li>Shell available for debugging if needed</li><li>Wide compatibility</li><li>Easy to understand</li></ul><p><strong>Trade-offs:</strong></p><ul><li>Slightly larger than distroless</li><li>Still includes package manager (apk)</li></ul><h3>Option 3: Chainguard Images (Enterprise-Grade)</h3><pre>FROM cgr.dev/chainguard/node:latest</pre><pre>WORKDIR /app</pre><pre># Chainguard images run as non-root by default<br>COPY --chown=node:node package*.json ./</pre><pre>RUN npm ci --only=production</pre><pre>COPY --chown=node:node . .</pre><pre>CMD [&quot;server.js&quot;]</pre><p><strong>Benefits:</strong></p><ul><li>Daily updates</li><li>Ultra-minimal (similar to distroless)</li><li>SBOM included</li><li>Enterprise support available</li></ul><p><strong>Trade-offs:</strong></p><ul><li>May require registry authentication</li><li>Less familiar to teams</li></ul><h3>Best Practices Checklist</h3><h3>Image Building</h3><ul><li>[ ] Use multi-stage builds to separate build and runtime</li><li>[ ] Install only production dependencies</li><li>[ ] Remove package manager caches</li><li>[ ] Pin specific base image versions (avoid latest)</li><li>[ ] Use .dockerignore to exclude unnecessary files</li></ul><h3>Security Hardening</h3><ul><li>[ ] Run as non-root user</li><li>[ ] Remove shells and package managers in production images</li><li>[ ] Use read-only root filesystem where possible</li><li>[ ] Set resource limits (memory, CPU)</li><li>[ ] Implement proper health checks</li></ul><h3>Scanning &amp; Monitoring</h3><ul><li>[ ] Scan images in CI/CD pipeline before deployment</li><li>[ ] Set up automated scanning on schedule</li><li>[ ] Configure vulnerability thresholds (fail builds on high/critical)</li><li>[ ] Monitor running containers for runtime threats</li><li>[ ] Keep base images updated regularly</li></ul><h3>Development Workflow</h3><ul><li>[ ] Use full images for development</li><li>[ ] Use hardened images for production</li><li>[ ] Document image choices in repository</li><li>[ ] Train team on security implications</li><li>[ ] Establish image update cadence</li></ul><h3>Common Pitfalls to Avoid</h3><h3>1. Using latest Tag</h3><pre># Bad<br>FROM node:latest</pre><pre># Good<br>FROM node:20.10.0-alpine</pre><h3>2. Running as Root</h3><pre># Bad<br>FROM node:20<br>COPY . /app<br>CMD [&quot;node&quot;, &quot;server.js&quot;]</pre><pre># Good<br>FROM node:20<br>COPY --chown=node:node . /app<br>USER node<br>CMD [&quot;node&quot;, &quot;server.js&quot;]</pre><h3>3. Including Build Tools in Production</h3><pre># Bad - Single stage with build tools<br>FROM node:20<br>RUN npm install &amp;&amp; npm run build<br>CMD [&quot;node&quot;, &quot;dist/server.js&quot;]</pre><pre># Good - Multi-stage build<br>FROM node:20 AS builder<br>RUN npm install &amp;&amp; npm run build</pre><pre>FROM node:20-alpine<br>COPY --from=builder /app/dist /app/dist<br>CMD [&quot;node&quot;, &quot;dist/server.js&quot;]</pre><h3>4. Not Cleaning Package Manager Cache</h3><pre># Bad<br>RUN npm install --production</pre><pre># Good<br>RUN npm ci --only=production &amp;&amp; \<br>    npm cache clean --force</pre><h3>Migration Strategy</h3><h3>Phase 1: Assessment (Week 1)</h3><ol><li>Scan all current images</li><li>Document vulnerabilities and sizes</li><li>Identify images to prioritize</li><li>Set security thresholds</li></ol><h3>Phase 2: Proof of Concept (Week 2–3)</h3><ol><li>Build hardened version of one service</li><li>Run security scans and compare</li><li>Test in staging environment</li><li>Measure performance impact</li></ol><h3>Phase 3: Rollout (Week 4+)</h3><ol><li>Update CI/CD pipelines</li><li>Deploy to production gradually</li><li>Monitor for issues</li><li>Document lessons learned</li></ol><h3>Phase 4: Maintenance (Ongoing)</h3><ol><li>Schedule regular base image updates</li><li>Automate security scanning</li><li>Review and respond to new CVEs</li><li>Continuously optimize images</li></ol><h3>Measuring Success</h3><p>Track these metrics to quantify the impact:</p><h3>Security Metrics</h3><ul><li>CVE count by severity</li><li>Time to patch critical vulnerabilities</li><li>Number of security audit findings</li><li>Compliance score improvements</li></ul><h3>Operational Metrics</h3><ul><li>Image pull time</li><li>Deployment duration</li><li>Storage costs</li><li>Bandwidth usage</li><li>CI/CD pipeline duration</li></ul><h3>Development Metrics</h3><ul><li>Time spent on security issues</li><li>Image build time</li><li>Developer feedback scores</li></ul><h3>Conclusion</h3><p>Container image hardening isn’t just a security checkbox — it’s a fundamental architectural decision that affects security, performance, and operational efficiency.</p><p>The journey from a 1.1GB image with hundreds of vulnerabilities to a 112MB hardened image with minimal attack surface is straightforward, but it requires intention and best practices.</p><p><strong>The key takeaways:</strong></p><ol><li>Official images are great for development, not production</li><li>Minimal base images reduce vulnerabilities by orders of magnitude</li><li>Smaller images deploy faster and cost less</li><li>Multi-stage builds give you the best of both worlds</li><li>Continuous scanning catches issues before production</li></ol><p>Start with one service, measure the impact, and expand from there. Your security team will thank you, your operations team will thank you, and your compliance auditors will thank you.</p><h3>Resources &amp; Further Reading</h3><ul><li><a href="https://docs.docker.com/scout/">Docker Scout Documentation</a></li><li><a href="https://github.com/GoogleContainerTools/distroless">Distroless Images GitHub</a></li><li><a href="https://www.chainguard.dev/unchained">Chainguard Images</a></li><li><a href="https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-190.pdf">NIST Container Security Guide</a></li><li><a href="https://www.cisecurity.org/benchmark/docker">CIS Docker Benchmark</a></li><li><a href="https://cheatsheetseries.owasp.org/cheatsheets/Docker_Security_Cheat_Sheet.html">OWASP Container Security</a></li></ul><p><strong>Have you hardened your container images? What challenges did you face? What were your results? Share your experience in the comments below!</strong></p><p><em>If you found this guide helpful, please share it with your team and follow for more practical DevSecOps content.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c3f114a70e2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Reality of VM Lifecycle Management in Enterprise Cloud Environments ]]></title>
            <link>https://mallikarjunkonemane.medium.com/the-reality-of-vm-lifecycle-management-in-enterprise-cloud-environments-daafbcbfd1e0?source=rss-ccde10d76290------2</link>
            <guid isPermaLink="false">https://medium.com/p/daafbcbfd1e0</guid>
            <dc:creator><![CDATA[Mallikarjun 17]]></dc:creator>
            <pubDate>Mon, 22 Dec 2025 12:44:52 GMT</pubDate>
            <atom:updated>2025-12-22T12:44:52.481Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/745/1*Ze7qZwg7BbhMi-iwrPEpAA.png" /><figcaption><strong>VM lifecycle management</strong></figcaption></figure><h3>What They Don’t Teach You in Cloud Tutorials 💡</h3><p>When you first dive into cloud computing, the tutorials make it look simple: spin up a VM, pick an Amazon Linux or Ubuntu image, and you’re good to go! But step into a real enterprise environment, and you’ll quickly discover that the reality is far more complex and structured.</p><p>Let me walk you through how VM lifecycle management actually works in secured, compliant project environments. 🔐</p><h3>The Enterprise Reality Check 🏢</h3><p>Here’s what changes when you move from learning to working in production environments:</p><h3>1. No More “Off-the-Shelf” Base Images 🚫</h3><p><strong>The Learning Phase:</strong> Pick any base image from your cloud provider — Ubuntu, Amazon Linux, CentOS — whatever you like!</p><p><strong>The Reality:</strong> In secured environments, you cannot use cloud provider base images directly. Why? Because they don’t meet your organization’s security and compliance requirements.</p><p>Every organization creates custom base images hardened with:</p><ul><li>Standard security tools and agents 🛡️</li><li>LDAP configurations for centralized authentication 🔑</li><li>Monitoring and logging agents 📊</li><li>Compliance tools and configurations 📋</li><li>Organizational security policies baked in 🔒</li></ul><p>Think of it as your organization’s “golden image” — a carefully crafted, security-approved foundation that every VM must be built upon.</p><h3>2. Centralized Image Management 🎯</h3><p>These aren’t created by individual developers or teams. A dedicated platform team or security team maintains these base images. This centralization ensures:</p><ul><li>Consistent security posture across the organization 🎖️</li><li>Standardized configurations 📐</li><li>Quality control and testing ✅</li><li>Single source of truth for approved images 📚</li></ul><p>Once certified and approved, these base images are shared organization-wide, becoming available to all teams through a central repository.</p><h3>3. Multi-Account Distribution Strategy 🌐</h3><p>The distribution can happen in two ways:</p><p><strong>Single Cloud Account:</strong> All teams access the base image from one central account.</p><p><strong>Multi-Account Setup:</strong> The base image is replicated across multiple child accounts within the organization’s cloud structure.</p><p>This flexibility allows organizations to maintain security while accommodating different organizational structures and compliance requirements.</p><h3>4. Building Application Images 🏗️</h3><p>Now comes your team’s part! You take the approved base image and layer your application on top of it. This is where tools like <strong>Packer</strong> shine ✨</p><p>Your team creates a custom image that includes:</p><ul><li>The approved base image as the foundation 🧱</li><li>Your application code and dependencies 💻</li><li>Application-specific configurations ⚙️</li><li>Runtime environments and libraries 📦</li></ul><p>This approach follows the “bake, don’t fry” philosophy — everything is pre-configured in the image rather than configured at runtime.</p><h3>5. Production Deployment 🚢</h3><p>Your newly created application image gets deployed to production environments. But the story doesn’t end here — in fact, it’s just beginning!</p><h3>6. The Continuous Update Cycle 🔄</h3><p>Here’s where things get interesting. Base images aren’t static — they receive regular updates and patches for:</p><ul><li>Security vulnerabilities 🐛</li><li>OS updates 🔧</li><li>New tool versions 🆕</li><li>Policy changes 📝</li></ul><p>When a new version of the base image is released, the platform or security team notifies all project teams. This triggers a cascade of updates across the organization.</p><h3>7. Understanding Patching Lifecycles ⏰</h3><p>Organizations establish clear patching guidelines. Common timelines include:</p><ul><li><strong>Monthly patching:</strong> High-security environments 🔴</li><li><strong>Quarterly patching:</strong> Balanced approach 🟡</li><li><strong>Custom schedules:</strong> Based on risk assessment 🟢</li></ul><p>Two primary patching strategies exist:</p><p><strong>In-Place Patching:</strong> Updating existing VM instances directly. Think of it as renovating your current house. 🔨</p><p><strong>Immutable Infrastructure:</strong> Replacing existing instances with new ones built from updated images. Like moving to a newly built house instead of renovating. 🏠➡️🏡</p><p>The immutable approach is becoming the gold standard as it ensures consistency and reduces configuration drift.</p><h3>8. The Continuous Improvement Loop ♻️</h3><p>Based on the patching lifecycle, teams must rebuild their application images with the new base image and redeploy to production — <strong>even if the application code hasn’t changed</strong>.</p><p>This might seem excessive, but it’s crucial for:</p><ul><li>Maintaining security compliance 🔐</li><li>Ensuring all VMs have the latest patches 🆙</li><li>Preventing security vulnerabilities ⚠️</li><li>Meeting audit requirements 📊</li></ul><h3>Why This Matters 🎯</h3><p>Understanding this workflow is crucial because:</p><blockquote><strong>It shapes your deployment strategy</strong> 📋 — You need to build automation that can handle regular image rebuilds</blockquote><blockquote><strong>It affects your CI/CD pipelines</strong> 🔄 — Your pipelines must accommodate base image updates, not just code changes</blockquote><blockquote><strong>It influences your infrastructure-as-code approach</strong> 💾 — Your IaC must be flexible enough to handle image updates seamlessly</blockquote><blockquote><strong>It impacts your testing strategy</strong> 🧪 — You need to test not just your application changes but also base image updates</blockquote><h3>Key Takeaways 💭</h3><ul><li>Enterprise cloud isn’t about individual VMs — it’s about <strong>standardized, secure, and manageable infrastructure at scale</strong> 📈</li><li><strong>Security and compliance drive many decisions</strong> that might seem like overhead but are essential for enterprise operations 🛡️</li><li><strong>Automation is non-negotiable</strong> — manual processes simply don’t scale in this environment 🤖</li><li><strong>Collaboration between teams</strong> (security, platform, and application teams) is essential for smooth operations 🤝</li></ul><h3>Final Thoughts 💬</h3><p>When you’re learning cloud technologies, the simplified tutorials serve their purpose — they help you understand the core concepts. But as you transition into enterprise environments, remember that production systems require additional layers of security, compliance, and governance.</p><p>The VM lifecycle management process might seem complex, but it exists for good reasons: protecting organizational assets, maintaining compliance, and ensuring consistent security posture across thousands of VMs.</p><p>So the next time you spin up a VM in production, remember — there’s an entire ecosystem working behind the scenes to make sure that VM is secure, compliant, and ready for the enterprise! 🌟</p><p><em>What’s your experience with VM lifecycle management in your organization? Share your thoughts in the comments below!</em> 💬</p><p><strong>#CloudComputing #DevOps #Security #EnterpriseIT #InfrastructureAsCode #CloudSecurity</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=daafbcbfd1e0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Docker vs ☸️ Kubernetes vs ⎈ Helm: The Complete Guide to Modern Container Orchestration]]></title>
            <link>https://mallikarjunkonemane.medium.com/docker-vs-%EF%B8%8F-kubernetes-vs-helm-the-complete-guide-to-modern-container-orchestration-7674e87f0802?source=rss-ccde10d76290------2</link>
            <guid isPermaLink="false">https://medium.com/p/7674e87f0802</guid>
            <dc:creator><![CDATA[Mallikarjun 17]]></dc:creator>
            <pubDate>Thu, 18 Dec 2025 05:22:23 GMT</pubDate>
            <atom:updated>2025-12-18T05:22:23.827Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>From Building Containers to Production-Ready Deployments 🚀</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*8FvOvMCZOWTwhwXi0fkecg.png" /><figcaption><strong>Cloud Native Tools</strong></figcaption></figure><p>In the cloud-native ecosystem, three names consistently dominate conversations: <strong>Docker</strong>, <strong>Kubernetes</strong>, and <strong>Helm</strong>. Yet despite their popularity, confusion abounds. 🤔</p><p><strong>The reality check:</strong></p><ul><li>Docker is often mistaken for an orchestration tool (it’s not ❌)</li><li>Kubernetes is the true orchestrator but comes with a steep learning curve 📈</li><li>Helm isn’t a replacement for Kubernetes — it’s a package manager that makes deployments manageable ✅</li></ul><p>This guide cuts through the confusion with theory, hands-on examples, and real-world best practices. By the end, you’ll understand how these three technologies work together to power modern DevOps pipelines. 💡</p><h3>Part 1: Understanding the Core Concepts 📚</h3><h3>🐳 Docker — The Containerization Engine</h3><p>Docker is a <strong>container runtime</strong> that packages your applications and dependencies into portable, self-contained units. Think of it as a standardized shipping container for your code. 📦</p><p><strong>What Docker does:</strong></p><ul><li>Packages apps with all dependencies ✅</li><li>Ensures consistency across environments 🔄</li><li>Runs containers on a single host 🖥️</li><li>Includes Docker Compose for multi-container apps 🎼</li></ul><p><strong>Best used for:</strong> Local development, testing, packaging applications, and single-node deployments. 👨‍💻</p><p><strong>What Docker doesn’t do:</strong> Orchestrate containers across multiple machines or provide automatic scaling and self-healing. ⚠️</p><h3>☸️ Kubernetes — The Container Orchestrator</h3><p>Kubernetes (K8s) is an <strong>orchestration platform</strong> that manages containerized applications across clusters of machines. If Docker is the shipping container, Kubernetes is the entire logistics network. 🌐</p><p><strong>What Kubernetes provides:</strong></p><ul><li><strong>Scheduling:</strong> Intelligently places containers across nodes 🎯</li><li><strong>Scaling:</strong> Automatically adjusts replicas based on load 📊</li><li><strong>Self-healing:</strong> Restarts failed containers automatically 🔧</li><li><strong>Load balancing:</strong> Distributes traffic across healthy pods ⚖️</li><li><strong>Rolling updates:</strong> Deploys new versions without downtime 🔄</li></ul><p><strong>Best used for:</strong> Production-grade orchestration of distributed systems at scale. 🏭</p><h3>⎈ Helm — The Kubernetes Package Manager</h3><p>Helm is to Kubernetes what apt is to Ubuntu or npm is to Node.js—a <strong>package manager</strong> that simplifies deployments. 📦</p><p>Instead of maintaining dozens of interconnected YAML files, Helm uses <strong>charts</strong>: pre-configured packages of Kubernetes resources that can be versioned, shared, and reused. 📋</p><p><strong>What Helm provides:</strong></p><ul><li>Templating engine for dynamic configurations 🎨</li><li>Version control for deployments 📝</li><li>Easy rollbacks and upgrades ⏮️</li><li>Reusable application packages 🔁</li><li>Simplified CI/CD integration 🔗</li></ul><p><strong>Best used for:</strong> Managing complex Kubernetes deployments, environment-specific configurations, and maintaining deployment consistency. 🎯</p><h3>Part 2: Hands-On Practical Examples 🛠️</h3><p>Let’s deploy a Node.js application using all three tools to see how they work together. 👇</p><h3>Step 1: Building with Docker 🐳</h3><p>First, create a Dockerfile to containerize your application:</p><pre>FROM node:18<br>WORKDIR /app<br>COPY package.json .<br>RUN npm install<br>COPY . .<br>CMD [&quot;node&quot;, &quot;server.js&quot;]<br>EXPOSE 3000</pre><p>Build and run your container:</p><pre>docker build -t myapp:v1 .<br>docker run -d -p 3000:3000 myapp:v1</pre><p><strong>Result:</strong> Your app now runs in an isolated container on your local machine. But what happens when you need to scale to 100 instances across multiple servers? That’s where Kubernetes enters. 🚀</p><h3>Step 2: Orchestrating with Kubernetes ☸️</h3><p>Create a deployment.yaml file to define how Kubernetes should run your app:</p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: myapp<br>spec:<br>  replicas: 3<br>  selector:<br>    matchLabels:<br>      app: myapp<br>  template:<br>    metadata:<br>      labels:<br>        app: myapp<br>    spec:<br>      containers:<br>      - name: myapp<br>        image: myapp:v1<br>        ports:<br>        - containerPort: 3000</pre><p>Deploy to your Kubernetes cluster:</p><pre>kubectl apply -f deployment.yaml<br>kubectl get pods</pre><p><strong>Result:</strong> Your application now runs as three replicas with automatic health checks, restarts, and load balancing across your cluster. ⚡</p><h3>Step 3: Simplifying with Helm ⎈</h3><p>Managing multiple YAML files becomes unwieldy as applications grow. Helm solves this with charts. 📊</p><p>Create a Helm chart:</p><pre>helm create myapp-chart</pre><p>Edit values.yaml to configure your deployment:</p><pre>replicaCount: 3</pre><pre>image:<br>  repository: myapp<br>  tag: v1</pre><pre>service:<br>  type: ClusterIP<br>  port: 3000</pre><p>Deploy everything with a single command:</p><pre>helm install myapp ./myapp-chart<br>helm list</pre><p><strong>Upgrading is just as simple:</strong></p><pre>helm upgrade myapp ./myapp-chart</pre><p><strong>Need to rollback?</strong></p><pre>helm rollback myapp 1</pre><p><strong>Result:</strong> Clean, version-controlled deployments that can be replicated across environments with minimal configuration changes. 🎉</p><h3>Part 3: When to Use Each Tool 🤔</h3><p>Scenario Tool Why Building portable application images 🐳 Docker Packages app with dependencies Running containers locally 🐳 Docker Simple, single-host runtime Orchestrating at scale ☸️ Kubernetes Handles scheduling, scaling, self-healing Managing complex deployments ⎈ Helm Templates and packages K8s resources CI/CD pipelines 🔄 All three Docker builds → K8s deploys → Helm manages</p><p><strong>The typical workflow:</strong> 🔄</p><ol><li><strong>Docker</strong> builds your container image 🐳</li><li><strong>Kubernetes</strong> orchestrates and manages the containers in production ☸️</li><li><strong>Helm</strong> simplifies deployment and configuration management ⎈</li></ol><p>They’re not competitors — they’re complementary pieces of a complete solution. 🧩</p><h3>Part 4: Production Best Practices ✅</h3><p><strong>Container Images:</strong> 🐳</p><ul><li>✅ Always tag images with specific versions (preferably Git SHA)</li><li>✅ Never use the latest tag in production</li><li>✅ Implement multi-stage builds to minimize image size</li><li>✅ Scan images for vulnerabilities regularly 🔍</li></ul><p><strong>Kubernetes Deployments:</strong> ☸️</p><ul><li>✅ Define resource requests and limits for every container</li><li>✅ Implement readiness and liveness probes 💓</li><li>✅ Use namespaces to isolate environments 🏷️</li><li>✅ Enable RBAC (Role-Based Access Control) 🔒</li><li>✅ Set up horizontal pod autoscaling for dynamic workloads 📈</li></ul><p><strong>Helm Management:</strong> ⎈</p><ul><li>✅ Use values.yaml for environment-specific configurations</li><li>✅ Store charts in version control 📚</li><li>✅ Implement secrets management (use tools like Sealed Secrets or External Secrets) 🔐</li><li>✅ Document chart configurations thoroughly 📝</li></ul><p><strong>Monitoring &amp; Observability:</strong> 📊</p><ul><li>✅ Deploy Prometheus and Grafana for metrics</li><li>✅ Implement centralized logging (ELK/EFK stack) 📋</li><li>✅ Set up distributed tracing for microservices 🔍</li><li>✅ Configure alerting for critical issues 🚨</li></ul><h3>Part 5: Common Pitfalls to Avoid ⚠️</h3><p><strong>❌ Treating Docker as an orchestrator</strong><br> Docker runs containers, but it doesn’t provide cluster-level orchestration, automatic scaling, or self-healing. Use Kubernetes for production workloads. 🚫</p><p><strong>❌ Writing massive YAML files manually</strong><br> As applications grow, raw Kubernetes YAML becomes unmanageable. Helm’s templating significantly reduces complexity and improves maintainability. 📄</p><p><strong>❌ Using </strong><strong>latest tags in production</strong><br> This leads to unpredictable deployments and difficult debugging. Always use specific, immutable tags. 🏷️</p><p><strong>❌ Ignoring security and RBAC</strong><br> Lock down your cluster with proper authentication, authorization, and network policies. Apply the principle of least privilege. 🔒</p><p><strong>❌ Skipping resource limits</strong><br> Containers without resource limits can consume all available resources, affecting other workloads. Always define requests and limits. ⚡</p><p><strong>❌ Not planning for rollbacks</strong><br> Deployments fail. Always have a rollback strategy, and Helm makes this trivial with helm rollback. ⏮️</p><h3>The Complete Picture: How They Work Together 🎨</h3><p>Imagine you’re building a modern e-commerce platform: 🛒</p><p><strong>Development:</strong> You use Docker to containerize your microservices — payment service, inventory service, user service — ensuring consistency from laptop to production. 💻</p><p><strong>Orchestration:</strong> You deploy to Kubernetes, which schedules these services across your cloud infrastructure, automatically scaling during Black Friday traffic spikes and self-healing when containers crash. 🎯</p><p><strong>Management:</strong> You use Helm charts to package each microservice with its databases, caches, and configurations, making it simple to deploy the entire stack to dev, staging, and production environments with different settings. 📦</p><p><strong>The result?</strong> A resilient, scalable, maintainable system that leverages the strengths of each tool. 🏆</p><h3>Conclusion 🎯</h3><p>Docker, Kubernetes, and Helm aren’t competing technologies — they’re different layers of the cloud-native stack: 🏗️</p><ul><li><strong>Docker</strong> handles containerization and packaging 🐳</li><li><strong>Kubernetes</strong> manages orchestration and scaling ☸️</li><li><strong>Helm</strong> simplifies deployment and configuration ⎈</li></ul><p>Together, they form the foundation of modern DevOps workflows, enabling teams to build, deploy, and manage applications at scale with confidence. 💪</p><p><strong>Ready to dive deeper?</strong> Start experimenting with these tools in a local Minikube cluster, then graduate to managed Kubernetes services like EKS, GKE, or AKS. The cloud-native future is containerized — and now you’re equipped to build it. 🚀</p><p><em>What’s your experience with Docker, Kubernetes, and Helm? Share your insights or questions in the comments below! 💬👇</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7674e87f0802" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How NGINX Handles Millions of Concurrent Connections: The Power of Event-Driven Architecture!!]]></title>
            <link>https://mallikarjunkonemane.medium.com/how-nginx-handles-millions-of-concurrent-connections-the-power-of-event-driven-architecture-49fd5085923a?source=rss-ccde10d76290------2</link>
            <guid isPermaLink="false">https://medium.com/p/49fd5085923a</guid>
            <dc:creator><![CDATA[Mallikarjun 17]]></dc:creator>
            <pubDate>Wed, 17 Dec 2025 10:39:49 GMT</pubDate>
            <atom:updated>2025-12-17T10:39:49.274Z</atom:updated>
            <content:encoded><![CDATA[<p>Have you wondered how a single NGINX instance can handle millions of concurrent connections? 🤔</p><p>The secret sauce behind NGINX’s scalability and performance is the event-driven non-blocking I/O architecture. It seamlessly handles growing traffic and efficiently utilizes the CPU and memory resources.</p><p>In the early 2000s, NGINX was one of the first web servers that was designed for scalability, performance and concurrent connections. The architecture has inspired many other web servers, reverse proxies such as Pingora, CDNs, and cloud load balancers.</p><p>In this article, we will learn how NGINX efficiently scales to handle millions of concurrent connections. We will explore different approaches and understand their limitations. We will then learn how NGINX architecture solves the scalability and performance challenges.</p><p>With that, let’s begin with some basics of web services and why we need NGINX.</p><h3>What does NGINX do ?</h3><p>NGINX acts as an intermediary between the client and the web services. It handles the client requests and routes it to the backend web service.It is also known as a reverse proxy and can load balance the request among multiple backend servers.</p><p>Further, it performs all infra-related heavy lifting such as SSL termination, connection management, rate limiting, etc. The backend web services can efficiently scale since the infra logic is centralized in NGINX.</p><p>The following diagram shows the interaction between a client and the server using NGINX:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aQsJxIHNOLCwjvFE.png" /><figcaption><strong>How nginx works</strong></figcaption></figure><p>While NGINX solves most of the problems with traditional web service architecture, it still needs to solve:</p><ul><li><strong>Concurrent Connections</strong> — Managing thousands or millions of simultaneous client connections</li><li><strong>Performance</strong> — Maintaining responsiveness as traffic grows</li><li><strong>Resource Efficiency</strong> — Optimizing memory and CPU utilization</li></ul><p>Before diving into the solution, let’s revisit connection management basics and understand the scalability bottlenecks.</p><h3>How are the connections handled ?</h3><p>When a web server starts, it calls the operating System and passes the port on which it listens. For e.g., Web servers would pass port 80 (http) or 443 (https) to listen.</p><p>When the client connects, the OS’s kernel stack performs a TCP handshake and establishes a connection. The OS assigns a file descriptor or a socket for each connection.</p><p>The below diagram illustrates the connection establishment between the client and the server:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jQ7QXj_uivBRY6dp.png" /><figcaption><strong>Connection establishment between client-server</strong></figcaption></figure><p>By default, sending and receiving data over a network (<strong>Network I/O</strong>) is blocking. A thread or a process goes into waiting state while writing or reading data to/from the network.</p><p>Also, the network I/O is dependent on the client’s bandwidth. Data transfer may take a long time for slow clients.</p><p>The following diagram shows how a process waits until the complete data transfer:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7NRZW65AoxQcBJUb.png" /><figcaption><strong>Process waiting for data transfer</strong></figcaption></figure><p>As a result, the server can’t accept new connections if it’s already processing request from a client. This hinders the system’s scalability and performance both.</p><p>There are several ways to tackle this problem and handle more connections. Let’s understand the different approaches and their limitations.</p><p>NGINX uses a modular architecture and consists of several components such as:</p><ul><li><strong>Master Process</strong> — Central controller managing worker lifecycle</li><li><strong>Worker Processes</strong> — Execute core logic: connection handling, request forwarding, load balancing</li><li><strong>Cache Loader</strong> — Loads cached metadata at startup</li><li><strong>Cache Manager</strong> — Periodically purges expired cache entries</li><li><strong>Shared Memory</strong> — Facilitates inter-process communication and state management</li></ul><p>The following diagram shows the different components of NGINX architecture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7vb8Je0lEPMfL-Zv.png" /><figcaption><strong>NGINX architecture</strong></figcaption></figure><p>Let’s now dive into the details of how NGINX can scale to million concurrent connections.</p><h3>Event-driven Non-blocking I/O</h3><p>In case of non-blocking I/O, the web server or the application doesn’t wait for the client’s data. Instead, the OS informs the application once the data is available.</p><p>This makes the process event-driven. Whenever the client’s data is available, the application would get interrupted and it would process the data. Otherwise, it would continue to do something else.</p><p>Further, the application doesn’t go into a waiting state. It can execute other tasks and efficiently utilize the CPU.</p><p>Internally, the application uses a system call called <strong>epoll</strong> or <strong>kqueue</strong> and then registers the sockets. The operating system uses a kernel data structure (<strong>Epoll instance</strong>) to keep track of the sockets that an application is interested in.</p><p>Once data is available in a subset of sockets, those sockets are moved into a ready list. The OS then informs the application about those sockets. Finally, the application then processes the data.</p><p>The below diagram illustrates this flow:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XJZvOPiTkQpCSonP.png" /><figcaption><strong>Event-driven Non-blocking I/O using Epoll</strong></figcaption></figure><p>As seen from the above diagram, once data becomes available on <em>fd3</em>, and <em>fd4</em>, the process is notified by the OS.</p><blockquote><strong>NGINX WORKER</strong></blockquote><p>Each NGINX worker is single-threaded and it runs an event loop. The event loop works like a while loop and checks for any activity on the socket or new connections.</p><p>Further, the NGINX worker is pinned to a CPU to avoid context switches. This eliminates the context switching overhead and improves the performance.</p><p>Here’s the pseudo code that explains what happens behind the scenes in a worker:</p><pre>while True:<br>    # Wait for events on the monitored sockets<br>    events = epoll_wait(epoll_fd, MAX_EVENTS, timeout=-1)  # Block indefinitely<br>    if events == -1:<br>        raise Exception(&quot;epoll_wait failed&quot;)<br><br>    # Process each event<br>    for event in events:<br>        fd = event.data.fd<br><br>        # Case 1: New connection on the server socket<br>        if fd == server_socket:<br>            # Accept the new connection<br>        # Case 2: Data available on a client socket<br>        elif event.events &amp; EPOLLIN:<br>            # Read data from the client socket<br>            data = client_socket.recv(BUFFER_SIZE)<br>            if not data:  # Client closed the connection<br>                epoll_ctl(epoll_fd, EPOLL_CTL_DEL, client_socket, None)<br>                client_socket.close()<br>                del client_sockets[client_socket]<br>            else:<br>                # Append data to the client&#39;s buffer<br>                client_sockets[client_socket][&quot;buffer&quot;] += data<br><br>                 # Process the request (takes ~100s of microseconds)<br>                 request = client_sockets[client_socket][&quot;buffer&quot;]<br>                 response = process_request(request)  # Assume this function exists<br><br>                 # Send the response<br>                 client_socket.sendall(response)<br><br>        # Case 3: Client socket ready for writing (if needed)<br>        elif event.events &amp; EPOLLOUT:<br>            # Handle writing data to the client (if applicable)<br>            pass</pre><p>With non-blocking sockets, the worker doesn’t need to wait till the data is completely sent to the client. It can quickly move onto the next connection and process the request. (<em>Case-1</em>)</p><p>In case the data is available on multiple sockets, it iterates on each and process the client request. (<em>Case-2</em>)</p><p>Since network I/O is non-blocking, the process doesn’t wait for the data transfer. And the worker uses CPU only for request parsing, filtering, and other compute operations.</p><p>Compute operations are less time-taking (in order of <strong>micro-seconds</strong>). As a result, a single worker can process <strong>100K</strong> requests every second concurrently.</p><p>Assuming that a single worker can handle <strong>100K</strong> connections, if it’s a 10-core CPU, the server can handle 1 million concurrent connections. (Example for illustration only, in real world, things might be different).</p><blockquote><em>Note: A server must have sufficient memory to serve </em><strong><em>1 million connections</em></strong><em> since each connection needs </em><strong><em>100KB-1MB</em></strong><em> memory. But the OS kernel can be tuned to reduce the connection’s memory.(there are trade-offs to this approach)</em></blockquote><p>The event-driven non-blocking I/O efficiently utilizes the CPU and doesn’t consume memory like Process-Per-Request or Thread-Per-Request approach.</p><h3>Conclusion</h3><p>A key challenge in building scalable web architecture is to handle simultaneous concurrent client connections. Also, the web service needs to handle concurrent requests and efficiently utilize CPU and memory resources.</p><p>NGINX uses the event-driven non-blocking I/O architecture and tackles the following challenges :-</p><ol><li><strong>Concurrent connections</strong> — It uses several workers to handle client connections. Non-blocking I/O allows it to accept new connections while already processing other connections.</li><li><strong>Performance</strong> — Each worker is single threaded and pinned to a CPU. This greatly improves the throughput and performance due to no context switches.</li><li><strong>Efficient resource utilization</strong> — Instead of launching new process or a thread for each connection, a single worker is able to manage multiple connections. The only overhead if a connection’s memory usage. Further, due to event-driven nature, the worker doesn’t go into waiting state frequently. This improves the CPU utilization.</li></ol><p>Before you leave, what do you think would happen if the server running NGINX crashed? Would NGINX become a single point of failure? 🤔</p><p>Share your thoughts in the comments below.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=49fd5085923a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Load Balancer vs Reverse Proxy vs API Gateway: A Complete Guide]]></title>
            <link>https://mallikarjunkonemane.medium.com/load-balancer-vs-reverse-proxy-vs-api-gateway-a-complete-guide-3d9c9668a0d5?source=rss-ccde10d76290------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d9c9668a0d5</guid>
            <dc:creator><![CDATA[Mallikarjun 17]]></dc:creator>
            <pubDate>Thu, 11 Dec 2025 07:22:49 GMT</pubDate>
            <atom:updated>2025-12-11T07:22:49.621Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_xAIHz7r6HixplXDClHIIQ.png" /></figure><p>In system design discussions, the terms <strong>Load Balancer</strong>, <strong>API Gateway</strong>, and <strong>Reverse Proxy</strong> often come up. Although they are sometimes used interchangeably and their functionalities sometimes overlap, each serves a distinct purpose in backend architecture.</p><p>Understanding the differences between these components, their strengths, and when to use them can help you design more scalable, efficient, and maintainable systems.</p><h3>What We’ll Cover</h3><ul><li>What each component is and how it works</li><li>Core capabilities that set them apart</li><li>When to choose a load balancer, reverse proxy, or API gateway</li><li>How they can work together in modern architectures</li></ul><h3>1. Load Balancer</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pxEgRnxe3NZ-mc94QIbsYA.png" /><figcaption>Loadbalancer</figcaption></figure><p>A <strong>load balancer</strong> distributes incoming network traffic across multiple backend servers (nodes) to ensure no single server is overwhelmed. By balancing the load, it helps improve the overall performance, availability, fault tolerance, and scalability of applications.</p><p><strong>Examples:</strong> AWS Elastic Load Balancer (ELB), Google Cloud Load Balancing, HAProxy (TCP/HTTP mode)</p><h3>Key Features of a Load Balancer</h3><h4>1. Traffic Distribution</h4><p>The core function of a load balancer is to evenly distribute traffic across multiple backend servers. The decision to determine which backend server should handle the request is based on predefined algorithms like:</p><ul><li><strong>Round Robin:</strong> Requests are sent to servers in a fixed, rotating order</li><li><strong>Least Connections:</strong> Requests are directed to the server with the fewest active connections</li><li><strong>Weighted Distribution:</strong> Assigns more traffic to more powerful servers based on configured weights</li></ul><h4>2. Health Checks</h4><p>A good load balancer continuously monitors the health and responsiveness of backend servers. If a server is found to be unresponsive, slow, or returning errors, the load balancer temporarily removes it from the rotation.</p><h4>3. Session Persistence</h4><p>In some scenarios, it is important for all requests from a particular user to go to the same server during a session. This is known as <strong>session persistence</strong> or <strong>sticky sessions</strong>.</p><p>Load balancers can use:</p><ul><li>IP-based affinity</li><li>Cookie-based tracking</li></ul><p>to consistently route user requests to the same backend server.</p><h4>4. SSL Termination</h4><p>Handling SSL/TLS encryption and decryption can be computationally expensive. A load balancer can offload this task by decrypting incoming HTTPS traffic and forwarding unencrypted requests to the backend servers.</p><h4>5. High Availability and Failover</h4><p>Load balancers provide high availability by ensuring that requests are only sent to operational servers. If a server crashes or is taken down for maintenance, the load balancer reroutes traffic to the remaining healthy servers without affecting users.</p><p>Many load balancers themselves are deployed in a redundant setup, often with multiple instances across availability zones or regions, to eliminate single points of failure.</p><h3>Types of Load Balancers</h3><p>Load balancers can be classified based on the network layer at which they operate in the OSI model. The two most common types are:</p><h4>Layer 4 Load Balancer (Transport Layer)</h4><p>A Layer 4 load balancer makes routing decisions based on data from the transport layer of the OSI model. It uses information such as:</p><ul><li>Source and destination IP addresses</li><li>TCP/UDP ports</li></ul><p>These load balancers are protocol-agnostic and forward packets without inspecting the content. They are faster and more efficient but less flexible when it comes to intelligent routing.</p><h4>Layer 7 Load Balancer (Application Layer)</h4><p>A Layer 7 load balancer operates at the application layer and makes decisions based on the content of the request. It can inspect:</p><ul><li>HTTP methods</li><li>URLs and query strings</li><li>Headers and cookies</li><li>Application-specific logic</li></ul><p>This allows for advanced routing, such as sending requests for /api to one server group and /images to another.</p><h3>2. Reverse Proxy.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*es1Xd6CYRQrNNIFj2TtjVA.png" /><figcaption>Reverse Proxy</figcaption></figure><p>A <strong>reverse proxy</strong> is a server that sits between clients and one or more backend services. When a client sends a request, the reverse proxy intercepts it. Based on predefined rules, it decides which internal service should handle the request. The proxy then forwards the request to the backend service and returns the response to the client.</p><p>To the client, it appears as if all content comes from a single server.</p><p><strong>Examples:</strong> NGINX, Apache HTTP Server, HAProxy (Layer 7), Traefik</p><h3>Key Features of a Reverse Proxy</h3><h4>1. Security and Abstraction</h4><p>One of the most important roles of a reverse proxy is to shield backend servers from direct access. It hides IP addresses, port configurations, and other identifying information, making backend services less vulnerable to attacks such as:</p><ul><li>DDoS (Distributed Denial of Service) attacks</li><li>Port scanning</li><li>Application fingerprinting</li></ul><h4>2. Centralized SSL/TLS Termination</h4><p>A reverse proxy can handle SSL/TLS encryption and decryption, allowing all traffic between the client and the proxy to be secure, while traffic from the proxy to backend servers can remain unencrypted (if acceptable within a trusted internal network).</p><h4>3. Caching of Static and Dynamic Content</h4><p>Reverse proxies can cache frequently accessed content such as images, JavaScript files, CSS stylesheets, and even HTML pages. By serving cached responses directly, the proxy reduces:</p><ul><li>Load on backend servers</li><li>Response times for clients</li><li>Network bandwidth usage</li></ul><p>This is particularly effective for high-traffic websites with large amounts of static or infrequently changing content.</p><h4>4. Compression</h4><p>To improve performance and reduce bandwidth usage, reverse proxies often compress server responses before sending them to the client. Common algorithms like Gzip or Brotli shrink the size of the response, speeding up page loads, especially for users on slow connections.</p><h4>5. Load Balancing Capabilities</h4><p>Although load balancing is typically considered a separate function, many reverse proxies support built-in load balancing across multiple backend servers. This overlap allows a reverse proxy to distribute traffic efficiently in addition to routing and caching.</p><h4>6. URL Rewriting and Routing</h4><p>Reverse proxies can rewrite incoming URLs before they are forwarded to backend services. This enables:</p><ul><li>Clean, user-friendly URLs</li><li>Internal path mapping</li><li>Seamless routing to microservices</li></ul><p>For example, a request to /products could be internally routed to <a href="http://product-service.internal/api/v1/items.">http://product-service.internal/api/v1/items.</a></p><h3>Using Both Reverse Proxy and Load Balancer</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*phy4-nd5mJfNO2Djxbcc-Q.png" /></figure><p>In real-world systems, reverse proxies and load balancers are often used together, and sometimes a single tool like NGINX can perform both functions.</p><p>A typical pattern involves placing a reverse proxy (e.g., NGINX) in front of several load balancers, each of which manages a dedicated group of backend servers:</p><ol><li>A client request (e.g., from a browser or mobile app) hits the reverse proxy</li><li>Based on the request path (e.g., /orders), the proxy routes the traffic to the appropriate load balancer</li><li>The load balancer then forwards the request to one of the healthy servers in its assigned server group</li><li>The selected server processes the request and sends the response back through the chain to the client</li></ol><h3>3. API Gateway.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*csdFIeM-3k90Ib7h_s3wQg.png" /><figcaption>API GATEWAY</figcaption></figure><p>An <strong>API Gateway</strong> is a server that functions as a central entry point for all client interactions with backend services. It is especially valuable in microservices architectures, where multiple services exist and client requests need to be managed, secured, routed, and orchestrated efficiently.</p><p><strong>Examples:</strong> Amazon API Gateway, Apigee (Google Cloud), Kong Gateway, Zuul (Netflix)</p><h3>Key Features of an API Gateway</h3><h4>1. Single Point of Entry</h4><p>The gateway provides a unified interface for all backend APIs. Instead of exposing every service endpoint to the client, you only expose the gateway’s endpoint.</p><p>This simplifies client logic, reduces surface area for attacks, and allows you to evolve internal services without impacting external users.</p><h4>2. Request Routing</h4><p>The API Gateway can route incoming requests to the correct backend service based on:</p><ul><li>URL path (e.g., /api/users → user service)</li><li>HTTP method (e.g., POST vs GET)</li><li>Request headers or query parameters</li><li>Service discovery metadata</li></ul><h4>3. Authentication and Authorization</h4><p>An API gateway can centralize security across the system. It can:</p><ul><li>Integrate with identity providers (e.g., OAuth 2.0, OpenID Connect)</li><li>Validate tokens (e.g., JWT)</li><li>Enforce role-based or scope-based access controls</li></ul><p>This ensures consistent enforcement of security policies across all backend services, reducing the risk of misconfigured individual services.</p><h4>4. Rate Limiting and Throttling</h4><p>An API gateway can protect backend services from overuse or abuse by restricting the number of requests a client can make per time unit. This prevents individual services from being overwhelmed and ensures fair usage.</p><h4>5. Request and Response Transformation</h4><p>An API Gateway can transform the format or structure of data as it passes through. For example:</p><ul><li>Add or remove headers</li><li>Convert between formats (e.g., XML ↔ JSON)</li><li>Filter or reshape response payloads</li><li>Modify query parameters or request bodies</li></ul><p>This is especially useful when backend services and clients follow different protocols or formats.</p><h4>6. API Composition and Aggregation</h4><p>The gateway can aggregate responses from multiple microservices into a single response, reducing the number of round-trips the client needs to make.</p><p>For example, a /user-dashboard endpoint can fetch user profile, orders, and notifications from three different services and return them as one payload.</p><h4>7. Caching</h4><p>To reduce backend load and improve latency, gateways can cache:</p><ul><li>Frequently requested data (e.g., public product listings)</li><li>Authentication token validations</li><li>Static or slow-changing API responses</li></ul><p>This reduces redundant calls and significantly improves scalability.</p><h4>8. Logging, Monitoring, and Analytics</h4><p>Gateways provide centralized logging and metrics for all API traffic, including:</p><ul><li>Request counts and response times</li><li>Error rates and status codes</li><li>User behavior and usage patterns</li><li>Latency bottlenecks</li></ul><p>These insights help with observability, debugging, and performance optimization.</p><h4>9. Protocol Translation</h4><p>An API Gateway can translate between different protocols, such as:</p><ul><li>HTTP ↔ gRPC</li><li>WebSocket ↔ REST</li><li>SOAP ↔ REST</li></ul><p>This allows clients to use simpler protocols while internal services operate using more efficient ones.</p><h3>4. When to Choose a Load Balancer, Reverse Proxy, or API Gateway</h3><p>Below is a breakdown of when to use each based on the goals and requirements of your application.</p><h3>When to Use a Load Balancer</h3><p>Use a load balancer when your primary goal is to ensure <strong>high availability, scalability, and fault tolerance</strong> by distributing incoming traffic across multiple servers or services.</p><p><strong>Ideal scenarios:</strong></p><ul><li>You are hosting multiple identical instances of a web application or microservice and need to distribute traffic among them</li><li>You want to scale your application horizontally to handle increased traffic</li><li>You need automatic failover so that requests are only routed to healthy backend nodes</li><li>You want to implement traffic distribution strategies (e.g., round-robin, least connections, IP-hash)</li><li>You are serving stateless applications, where any instance can handle any request</li><li>You are running containerized services behind an orchestrator (e.g., Kubernetes, ECS) and need internal or external traffic distribution</li></ul><h3>When to Use a Reverse Proxy</h3><p>Use a reverse proxy when you need a <strong>flexible traffic router, performance optimizer, or security layer</strong> in front of your backend services or web servers.</p><p><strong>Ideal scenarios:</strong></p><ul><li>You want to hide your backend infrastructure from external clients</li><li>You need SSL/TLS termination to reduce the burden on application servers</li><li>You want to cache static or dynamic content to improve performance</li><li>You need to compress server responses before sending them to the client</li><li>You want to rewrite URLs, add custom headers, or apply routing logic based on the request path</li><li>You are hosting multiple services or applications behind the same domain or IP address</li><li>You want to provide basic load balancing along with caching and routing features</li></ul><h3>When to Use an API Gateway</h3><p>Use an API Gateway when your application exposes <strong>multiple APIs or microservices</strong> and you need centralized control over security, routing, and API lifecycle management.</p><p><strong>Ideal scenarios:</strong></p><ul><li>You have a microservices architecture and need a single entry point for all APIs</li><li>You need to enforce authentication and authorization using tokens (e.g., JWT, OAuth2)</li><li>You want to apply rate limiting, request quotas, or throttling to protect backend APIs</li><li>You want to transform requests and responses (e.g., modify headers, convert formats)</li><li>You want to aggregate responses from multiple microservices into a single API call</li><li>You are exposing APIs to external developers or partners and need API documentation, key management, or a developer portal</li><li>You want to version APIs, manage deprecated routes, or route traffic based on API versions.</li></ul><h3>5. Can They Work Together?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*jBTW1goROJYRPM7PXqexKQ.png" /></figure><p><strong>Yes, absolutely.</strong></p><p>In modern, large-scale web architectures, Load Balancer, Reverse Proxy, and API Gateway are often used together as part of a layered infrastructure.</p><p><strong>For example:</strong></p><ul><li>Applications deployed on AWS often use Amazon API Gateway to manage and secure API traffic, while using Elastic Load Balancer (ELB) to distribute incoming HTTP or TCP traffic across EC2 instances or containers</li><li>NGINX, a highly flexible tool, is frequently used both as a reverse proxy (for SSL termination, caching, and request forwarding) and as a Layer 7 load balancer that distributes traffic based on content-aware routing</li></ul><h3>Typical Architecture Using All Three</h3><p>Here’s how a modern web application can incorporate all three components in a single architecture:</p><p><strong>1. Client Request</strong></p><p>The journey begins when a user’s browser or mobile application sends a request to your system.</p><p><strong>2. Edge Load Balancer (Optional)</strong></p><p>A global or regional load balancer (e.g., AWS Route 53 + Global Accelerator, Cloudflare Load Balancer) receives the request. It routes the traffic to the nearest or most responsive data center or region, based on geolocation, latency, or health checks.</p><p><strong>3. Reverse Proxy / Web Tier Load Balancer</strong></p><p>The request then arrives at a reverse proxy or web-tier load balancer. At this layer, the component may perform several critical tasks:</p><ul><li><strong>SSL/TLS termination:</strong> Decrypts HTTPS traffic before forwarding it internally</li><li><strong>Caching static content:</strong> Serves HTML, CSS, JavaScript, and images without hitting backend services</li><li><strong>Logging and header manipulation:</strong> Adds, removes, or rewrites headers for security or analytics</li><li><strong>Load balancing:</strong> Distributes traffic to web servers or directly to the API Gateway</li></ul><p><strong>4. API Gateway</strong></p><p>The request is then forwarded to an API Gateway, which handles API-specific responsibilities, including:</p><ul><li>Routing the request to the appropriate microservice or backend API</li><li>Authentication and authorization, using mechanisms like OAuth 2.0 or JWT</li><li>Rate limiting and throttling to prevent abuse or overload</li><li>Request and response transformation, such as reformatting JSON or XML payloads</li><li>API version routing to support multiple client versions</li><li>Response aggregation from multiple services into a single response payload</li></ul><p><strong>5. Internal Load Balancer</strong></p><p>Once the API Gateway determines the appropriate microservice, it may forward the request through an internal load balancer or service mesh. This layer is responsible for:</p><ul><li>Distributing traffic evenly across multiple instances of the target microservice</li><li>Failover and retry logic in case a particular instance is unhealthy or unresponsive</li></ul><p><strong>6. Backend Services / Microservices</strong></p><p>Finally, the designated backend service or microservice receives the request. It:</p><ul><li>Executes the business logic</li><li>Interacts with databases, caches, or other services as needed</li><li>Returns the response to the API Gateway, which may further process or format it before sending it back to the client</li></ul><h3>Key Takeaways</h3><ul><li><strong>Load Balancers</strong> focus on distributing traffic across multiple servers for high availability and scalability</li><li><strong>Reverse Proxies</strong> provide security, caching, SSL termination, and flexible routing capabilities</li><li><strong>API Gateways</strong> offer comprehensive API management with authentication, rate limiting, transformation, and aggregation</li></ul><p>Understanding when to use each component — and how they complement each other — is essential for building robust, scalable, and secure distributed systems.</p><p><em>Thank you for reading! If you found this valuable, hit the like button ❤️ and consider following for more system design content.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d9c9668a0d5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[13 Command-Line Tools to 10x Your Productivity as a Data Engineer]]></title>
            <link>https://mallikarjunkonemane.medium.com/13-command-line-tools-to-10x-your-productivity-as-a-data-engineer-cdcc13edf2ef?source=rss-ccde10d76290------2</link>
            <guid isPermaLink="false">https://medium.com/p/cdcc13edf2ef</guid>
            <dc:creator><![CDATA[Mallikarjun 17]]></dc:creator>
            <pubDate>Wed, 10 Dec 2025 08:14:57 GMT</pubDate>
            <atom:updated>2025-12-10T08:14:57.791Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xBJagjGhBidU5Sizq7bUEg.png" /></figure><p>Greetings, Data Engineer,</p><p>Navigating massive data workflows using the terminal can feel slow and inefficient. Without the right command-line tools, your productivity takes a hit — and your workflow becomes chaotic.</p><p>In this list I’ll show you powerful, lightweight CLI tools that help you move faster, automate tasks, and explore data seamlessly.</p><h3>🔧 1. jq — JSON Parser and Transformer</h3><p><strong>jq</strong> is a lightweight command-line tool for parsing, filtering, and transforming JSON. It’s designed for speed and simplicity, giving you the ability to reshape JSON in real time — without needing to spin up a Python script or import pandas.</p><p>As a data engineer, JSON is everywhere. APIs return it. Log aggregators output it. Metadata services store it.</p><p>jq makes it effortless to extract what you need and discard the rest.</p><p>Whether you’re quickly debugging an API response or chaining transformations in a shell script, jq keeps you in flow.</p><p>You stay in the terminal. You stay fast.</p><p><strong>Example:</strong> Let’s say you’re testing an external data source and want to preview the title of a blog post from a mock API. Try this:</p><pre>curl -s https://jsonplaceholder.typicode.com/posts/1 | jq &#39;.title&#39;</pre><p>It’s one line, but it scales. Pipe it into xargs, combine with awk, or feed it into a scheduler. This tool turns messy JSON into actionable input.</p><h3>🌐 2. httpie — User-Friendly HTTP Client</h3><p><strong>httpie</strong> is a modern HTTP client for the terminal. It simplifies API testing with readable output and intuitive syntax.</p><p>httpie beats curl when you want to quickly test webhooks or check response payloads during data ingestion.</p><p>When testing APIs, most people would use Postman, but if you, like myself, live in the terminal, httpie is the best.</p><p><strong>Example:</strong> Run this to see a blog post from a public fake API:</p><pre>http GET https://jsonplaceholder.typicode.com/posts/1</pre><p>Or simulate a POST request:</p><pre>http POST https://jsonplaceholder.typicode.com/posts title=&quot;CLI Tools&quot; body=&quot;This is great&quot; userId:=1</pre><h3>💾 3. pgcli — PostgreSQL CLI with Auto-Completion</h3><p><strong>pgcli</strong> adds tab-completion and syntax highlighting to your Postgres sessions. It helps you move faster across large schemas.</p><p>pgcli reduces typos and boosts efficiency when querying your data warehouse or staging DB. When using pgcli you are blazingly fast compared to old-school psql.</p><p><strong>Example:</strong> Spin up a local Postgres container:</p><pre>docker run --name pg -e POSTGRES_PASSWORD=pass -p 5432:5432 -d postgres</pre><p>Connect using:</p><pre>pgcli -h localhost -U postgres</pre><p>Now just start typing a query and hit TAB:</p><pre>SELECT * FROM pg_&lt;TAB&gt;</pre><p>Want the same functionality with MySQL, Vertica, or another database? Check <strong>DBCLI</strong>.</p><h3>🔎 4. fzf — Fuzzy Finder</h3><p><strong>fzf</strong> is an interactive fuzzy finder. It helps you instantly search files, commands, or text in large codebases.</p><p>With fzf, you’ll find anything faster — SQL scripts, logs, even past shell history. And previewing files in the terminal looks like magic to others.</p><p><strong>Example:</strong> Search all .sql files:</p><pre>find . -name &quot;*.sql&quot; | fzf</pre><p>To search your command history:</p><pre>history | fzf</pre><p>It’s a rapid way to rerun commands without digging.</p><p>Aside from that, fzf has some nice keyboard shortcuts and functionalities like file preview.</p><h3>🦇 5. bat — Enhanced cat Command</h3><p><strong>bat</strong> replaces cat with a better interface — showing syntax highlighting, line numbers, and Git changes.</p><p>bat makes reviewing YAMLs, SQL files, and Python scripts easier on the eyes.</p><p><strong>Example:</strong> View a file with syntax highlighting:</p><pre>bat ~/.bashrc</pre><p>It detects the file type and colours it accordingly.</p><p><strong>ProTip:</strong> Replace cat with bat and you won’t need to learn the new command.</p><h3>🚀 6. starship — Customisable Prompt</h3><p><strong>starship</strong> is a fast, minimal prompt. It adds Git status, DB names, and language versions directly to your CLI prompt.</p><p>starship gives you real-time context without extra commands — perfect when switching projects or environments.</p><p><strong>Example:</strong> Install with:</p><pre>curl -sS https://starship.rs/install.sh | sh</pre><p>Then add to your shell config:</p><pre>eval &quot;$(starship init zsh)&quot; # or bash (I use fish, btw)</pre><p>Now you have all the info about your projects’ tech stack just by cd-ing in them.</p><h3>📂 7. zoxide — Smart Directory Jumper</h3><p><strong>zoxide</strong> remembers where you go. It replaces cd with smarter navigation based on your habits.</p><p>Navigating between code, logs, and config folders becomes lightning fast. Just type a part of the directory you want to go to, and zoxide will read your mind and magically get you there.</p><p><strong>Example:</strong> Install and configure:</p><pre>curl -sS https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | bash<br>eval &quot;$(zoxide init zsh --cmd cd)&quot;</pre><p>Now jump like this:</p><pre>cd airflow</pre><p>It finds the directory based on your usage history.</p><h3>⚙️ 8. direnv — Environment Variable Manager</h3><p>My buddy Alex Campbell showed me this tool 5+ years ago. Now, I can’t live without it.</p><p><strong>direnv</strong> automatically loads environment variables when you enter a directory.</p><p>direnv helps you manage different project setups — DB creds, API keys, configs — without manual sourcing.</p><p><strong>Example:</strong> In a project folder:</p><pre>echo &#39;export DATABASE_URL=postgres://postgres:pass@localhost:5432/mydb&#39; &gt; .envrc<br>direnv allow</pre><p>Now, every time you cd into that folder, your environment is ready to go.</p><h3>📝 9. lnav — Log File Navigator</h3><p><strong>lnav</strong> provides a terminal-based UI for browsing logs with SQL queries and filters.</p><p>It speeds up debugging by letting you inspect logs directly — no need to import them elsewhere.</p><p><strong>Example:</strong> Try with system logs:</p><pre>lnav /var/log/syslog # or any other log file</pre><p>Or write a SQL query to filter:</p><pre>SELECT * FROM syslog_log WHERE log_level = &#39;error&#39;</pre><h3>🦙 10. ollama — AI-Powered Terminal Assistant</h3><p><strong>ollama</strong> lets you run LLMs like Code Llama locally from your terminal — without sending data to the cloud.</p><p>For you, as a data engineer, ollama is important, because it allows you to use AI against your data in a secure sandbox.</p><p>This means you can build smart data products without the risk of exposing sensitive data.</p><p><strong>Example:</strong> After installing and downloading a model:</p><pre>ollama run codellama</pre><p>Then prompt:</p><pre>Write a bash script to back up a Postgres DB every night.</pre><p>Instant bash automation, no browser required.</p><h3>😎 11. visidata — Terminal Spreadsheet</h3><p><strong>visidata</strong> is an interactive CLI spreadsheet viewer. Load CSVs, TSVs, SQLite, or even JSON.</p><p>You can profile and explore datasets without loading them into Spark or Pandas. As a bonus, you can use your favourite vim motions.</p><p><strong>Example:</strong> Try with a CSV:</p><pre>curl -O https://people.sc.fsu.edu/~jburkardt/data/csv/hw_200.csv<br>vd hw_200.csv</pre><p>You’ll see an interactive table where you can sort, summarise, and filter.</p><h3>♻️ 12. delta — Git Diff Highlighter</h3><p><strong>delta</strong> enhances git diff with colour, syntax highlighting, and line indicators.</p><p>With delta, you can spot schema changes or logic bugs instantly. It’s ideal for reviewing SQL or Python pipelines.</p><p><strong>Example:</strong> Pipe a diff through it:</p><pre>git diff | delta</pre><p>Much easier than parsing raw output.</p><h3>🔄 13. tmux — Terminal Multiplexer</h3><p><strong>tmux</strong> lets you split your terminal into multiple panes and manage long-running sessions. Everything stays live — even across reboots or dropped SSH connections.</p><p>With tmux paired to a launcher like <strong>tmuxinator</strong>, you just need to type mux to spin up entire project environments instantly.</p><p>Your dbt workspace might have Neovim on one side and a terminal running tests on the other. Your Airflow setup might show scheduler logs, DAG code, and a CLI tool — all in separate windows, ready to go.</p><p><strong>Example:</strong> Instead of manually opening terminals, just run:</p><pre>mux dbt</pre><p>Now you’re in a full dbt dev environment with a vertical split: code on the left, terminal on the right. Another window handles tests or builds.</p><p>Switch context?</p><pre>mux etl</pre><p>You’re now in an ETL-focused workspace — one pane for logs, another for debugging Python scripts, another for editing DAGs. Each layout is defined once and re-used forever.</p><p>This isn’t just multitasking. It’s mental clarity.</p><p>Each project lives in its own contained universe. Nothing gets mixed up. You focus, build, and switch environments without losing flow.</p><h3>🚀 Optimising Their Use</h3><p>Combine these tools for powerful workflows. Use fzf to find SQL scripts, then open them with bat. Launch pgcli in a tmux pane while monitoring logs in another. Use ollama to generate new bash scripts, and direnv to auto-load secrets.</p><p>Set up aliases. Add functions to your .zshrc. Build a workflow where everything you need is one keystroke away.</p><p><strong>What command-line tools have transformed your workflow? Share your favorites in the comments below!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cdcc13edf2ef" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>