<?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 Waibhav Deogade on Medium]]></title>
        <description><![CDATA[Stories by Waibhav Deogade on Medium]]></description>
        <link>https://medium.com/@waibhav.deogade?source=rss-82175c9b1339------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*2Whbv9V4gUflrudcsuf8LA.png</url>
            <title>Stories by Waibhav Deogade on Medium</title>
            <link>https://medium.com/@waibhav.deogade?source=rss-82175c9b1339------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 11:07:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@waibhav.deogade/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[The Claude Code Mental Model: How All the Pieces Fit Together]]></title>
            <link>https://medium.com/@waibhav.deogade/the-claude-code-mental-model-how-all-the-pieces-fit-together-a90a4a098c07?source=rss-82175c9b1339------2</link>
            <guid isPermaLink="false">https://medium.com/p/a90a4a098c07</guid>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[developer-tools]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[ai-agent]]></category>
            <dc:creator><![CDATA[Waibhav Deogade]]></dc:creator>
            <pubDate>Fri, 02 Oct 2026 07:14:23 GMT</pubDate>
            <atom:updated>2026-10-02T07:14:23.994Z</atom:updated>
            <content:encoded><![CDATA[<p><em>How </em><strong><em>CLAUDE.md, skills, subagents, agent teams</em></strong><em>, and </em><strong><em>plugins</em></strong><em> work together at each stage.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8_er598j6xpiX1A4ZSJmvg.png" /></figure><p>If you’ve opened Claude Code for the first time, you’ve probably met a lot of new words: <strong>CLAUDE.md, skills, subagents, tasks, agent teams, plugins.</strong> Each one is simple on its own, but together they can feel like alphabet soup.</p><p>This post gives you one mental model that connects them all. By the end, you’ll know what each piece does, when Claude uses it, and how a single request travels from your keyboard to finished code.</p><h3>The big idea: one main agent, with helpers</h3><p>At the center of everything is the <strong>main agent</strong>, the Claude you’re chatting with. Everything else exists to help it do three things:</p><ol><li><strong>Know your rules</strong> (CLAUDE.md)</li><li><strong>Know how to do specific jobs</strong> (skills)</li><li><strong>Get help when the job is big</strong> (subagents and agent teams)</li></ol><p><strong>Plugins</strong> are the box you put all of this in so you can share it.</p><p>Let’s follow a request through the whole system.</p><h3>Step 1: You send a request</h3><p>Everything starts with your prompt. It can be anything:</p><ul><li>“Rename this function.”</li><li>“Fix this bug.”</li><li>“Review my pull request.”</li><li>“Add a new feature.”</li></ul><p>Before Claude even thinks about your request, it has already loaded some background knowledge. That’s the next piece.</p><h3>Step 2: CLAUDE.md, the always-on rulebook</h3><p><strong>CLAUDE.md</strong> is a plain text file where you write down the things you’d otherwise repeat in every conversation. Think of it as the notes you’d hand a new teammate on their first day.</p><p>For example:</p><blockquote><em>Use pnpm, not npm. Tests live in the /tests folder. Follow our naming conventions.</em></blockquote><p>Claude reads this file at the start of every session, and it stays in context the whole time. You can have one at the <strong>project level</strong> (rules for this codebase) and one at the <strong>user level</strong> (your personal preferences everywhere). They add together, so Claude sees both.</p><p><strong>Use it for:</strong> rules that always apply, such as coding standards, folder structure, and preferences.</p><p><strong>One tip:</strong> keep it short. The docs suggest staying under about 200 lines. Anything long or specialized belongs in a skill, which is our next piece.</p><h3>Step 3: Skills, knowledge that loads only when needed</h3><p>CLAUDE.md is always on, so you don’t want to stuff everything into it. Long, specialized instructions would waste Claude’s attention on things that aren’t relevant right now.</p><p>That’s where <strong>skills</strong> come in. A skill is a folder with a SKILL.md file that teaches Claude how to do one specific job, like running a deployment checklist or writing a report in your company&#39;s format.</p><p>Skills load in three stages:</p><ol><li>At the start of the session, Claude sees only each skill’s <strong>name and short description</strong>.</li><li>When you ask for something, Claude checks whether any skill is <strong>relevant</strong>.</li><li>If one is, Claude <strong>loads the full instructions</strong> at that moment.</li></ol><p>It works like a library. Claude knows what books exist, but it only takes one off the shelf when it needs it.</p><p>You can also trigger a skill yourself with a slash command, such as /deploy-checklist.</p><h3>Step 4: The decision, work inline or dispatch?</h3><p>Now the main agent has your request, your rules, and any relevant skills. It makes a choice:</p><ul><li><strong>Small job?</strong> Do it directly. This is called working <strong>inline</strong>.</li><li><strong>Bounded but heavy job?</strong> Hand it to a <strong>subagent</strong>.</li><li><strong>Big job with parts that depend on each other?</strong> Coordinate an <strong>agent team</strong>.</li></ul><p>Let’s walk through all three using one imaginary codebase. These examples are illustrations, not real projects.</p><h3>Path A: Work inline (simple tasks)</h3><blockquote><strong><em>You ask:</em></strong><em> “Rename </em><em>getUser to </em><em>fetchUser in </em><em>auth.ts.&quot;</em></blockquote><p>This is one file and one clear change. Spinning up helpers would cost more than it saves. The main agent follows your CLAUDE.md rules, makes the edit, and replies.</p><h3>Path B: Dispatch to subagents (bounded tasks)</h3><blockquote><strong><em>You ask:</em></strong><em> “Find everywhere we log passwords and fix it.”</em></blockquote><p>This job is clear but noisy. Searching a big codebase fills the conversation with file after file of results. Here the main agent uses a <strong>task</strong>, which is simply the mechanism for handing a job to a helper. It sends a bounded assignment plus a prompt, and can choose which skills the helper should start with.</p><p>The helpers are <strong>subagents</strong>. Each one:</p><ul><li>works in its <strong>own isolated context window</strong>, so the mess stays out of your main conversation</li><li>has its <strong>own instructions and tools</strong></li><li>handles <strong>one bounded job</strong></li><li><strong>returns a result</strong>, not its whole working process</li></ul><p>In our example, three subagents might search the API, the background workers, and the scripts. Each comes back with a short list. The main agent merges the lists and makes the fixes.</p><p>Two details worth knowing. First, by default, subagents simply report back to the main agent rather than collaborating with each other. Second, a subagent doesn’t automatically inherit your skills. If you want it to use one, you list that skill in the subagent’s setup.</p><h3>Path C: Coordinate an agent team (multi-step, multi-domain work)</h3><blockquote><strong><em>You ask:</em></strong><em> “Migrate checkout from REST to GraphQL.”</em></blockquote><p>Now the pieces depend on each other. The backend schema affects the frontend queries, and both affect the tests. Independent subagents aren’t enough, because they can’t compare notes while they work.</p><p>An <strong>agent team</strong> solves this. One session acts as the team lead, and the teammates:</p><ul><li>work together on the same goal</li><li>share a <strong>task list</strong> with the plan and progress</li><li><strong>message each other directly</strong></li></ul><p>So Teammate A builds the schema, Teammate B updates the queries, and Teammate C writes tests. When A changes the schema, A tells B right away, mid-task.</p><p><strong>Heads up:</strong> agent teams are experimental and disabled by default. To try them, set CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 in your settings. Each teammate is a full Claude session, so they use more tokens than subagents. Reach for them only when the work really needs collaboration.</p><p><strong>The simplest way to tell them apart:</strong> subagents are focused workers who report back, and teammates are collaborators who coordinate as they go.</p><h3>Step 5: Results come back</h3><p>Whichever path was taken, everything ends in the same place:</p><ul><li>Subagents and agent teams <strong>return results</strong> to the main agent.</li><li>The main agent <strong>integrates</strong> those results and makes the final code changes.</li><li>You get <strong>one final response</strong>.</li></ul><p>You always talk to the main agent. The helpers work behind the scenes.</p><h3>Where plugins fit</h3><p>So far, CLAUDE.md, skills, and agents live in your own setup. What if you want your whole team to use the same ones?</p><p>A <strong>plugin</strong> is a package that bundles them for sharing. A typical plugin might contain:</p><ul><li>skills/ with your SKILL.md files and assets</li><li>agents/ with your custom subagents</li><li>hooks/ (optional)</li><li>MCP/ connections to outside tools (optional)</li><li>other resources, like templates and configs</li></ul><p>Install it once and Claude Code gets all those skills and agents. They’re <strong>namespaced</strong> under the plugin’s name, so they don’t clash with your own. For example, a team could ship a plugin called acme-toolkit, and its deployment skill would be invoked as /acme-toolkit:deploy-checklist.</p><p>Skills and subagents also work together. A subagent can <strong>preload skills</strong> to bring in expertise for its job. A skill can also run in its own <strong>forked, isolated context</strong>, so it behaves like a subagent.</p><h3>The whole model at a glance</h3><ul><li><strong>CLAUDE.md:</strong> always-on rules and conventions. Loaded every session.</li><li><strong>Skill:</strong> reusable instructions in a SKILL.md file. Loaded when relevant, or when you run a slash command.</li><li><strong>Task:</strong> the way the main agent hands work to a helper. Used when it dispatches.</li><li><strong>Subagent:</strong> an isolated worker that reports back. Best for bounded, heavy jobs.</li><li><strong>Agent team:</strong> workers that share a plan and talk to each other. Best for complex, multi-step jobs. Experimental.</li><li><strong>Plugin:</strong> a shareable package of the above. Best when you want reuse across repos and teams.</li></ul><h3>A quick way to decide what to build</h3><ul><li>Does Claude need to know this <strong>every time</strong>? Put it in <strong>CLAUDE.md</strong>.</li><li>Is it a <strong>specialized job</strong> Claude only needs sometimes? Make it a <strong>skill</strong>.</li><li>Is the job <strong>big and noisy</strong> but self-contained? Use a <strong>subagent</strong>.</li><li>Do the parts of the job <strong>depend on each other</strong>? Try an <strong>agent team</strong>.</li><li>Do you want to <strong>share</strong> your setup? Wrap it in a <strong>plugin</strong>.</li></ul><h3>Final thoughts</h3><p>The whole system comes down to a simple idea: give Claude the right knowledge at the right time, and the right helpers for the size of the job. CLAUDE.md is what it always knows. Skills are what it knows when needed. Subagents and teams are the extra hands. Plugins are how you share them.</p><p>Start small. Write a few lines in CLAUDE.md, turn one repeated task into a skill, and add subagents or teams only when a job is truly too big for one agent.</p><p><em>Want to go deeper? The official Claude Code docs cover each of these features in detail.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a90a4a098c07" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Confused About Agent and Skills .md? Here’s the Simple Mental Model]]></title>
            <link>https://medium.com/@waibhav.deogade/confused-about-agent-and-skills-md-heres-the-simple-mental-model-cd86ea10c8b2?source=rss-82175c9b1339------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd86ea10c8b2</guid>
            <category><![CDATA[ai-engineering]]></category>
            <category><![CDATA[ai-skills]]></category>
            <category><![CDATA[ai-agent]]></category>
            <dc:creator><![CDATA[Waibhav Deogade]]></dc:creator>
            <pubDate>Thu, 01 Oct 2026 13:17:22 GMT</pubDate>
            <atom:updated>2026-10-01T13:17:22.878Z</atom:updated>
            <content:encoded><![CDATA[<p>Are you still confused about what should go into Agent .md and what belongs in a Skill .md? 🤔</p><p>You’re not alone. The easiest way to think about it is:<br> 🧠 Agent = 𝗛𝗼𝘄 𝘁𝗵𝗲 𝗮𝗴𝗲𝗻𝘁 𝘁𝗵𝗶𝗻𝗸𝘀 𝗮𝗻𝗱 𝗱𝗲𝗰𝗶𝗱𝗲𝘀 <br>🛠️ 𝗦𝗸𝗶𝗹𝗹𝘀 = 𝗛𝗼𝘄 𝘁𝗵𝗲 𝗮𝗴𝗲𝗻𝘁 𝗮𝗰𝘁𝘂𝗮𝗹𝗹𝘆 𝗱𝗼𝗲𝘀 𝘁𝗵𝗲 𝘄𝗼𝗿𝗸</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QxfPGgYX6xjATrqpfM0Kog.png" /></figure><p>Agent .md defines the agent’s:<br> • Role and responsibilities <br> • Priorities <br> • Boundaries <br> • Things to be careful about <br> • When to ask for help <br> • When to stop <br>Think of it as the 𝗷𝘂𝗱𝗴𝗺𝗲𝗻𝘁 𝗮𝗻𝗱 𝗼𝗽𝗲𝗿𝗮𝘁𝗶𝗻𝗴 𝗽𝗿𝗶𝗻𝗰𝗶𝗽𝗹𝗲𝘀 𝗼𝗳 𝗮 𝘀𝗲𝗻𝗶𝗼𝗿 𝗲𝗻𝗴𝗶𝗻𝗲𝗲𝗿.</p><p>𝗦𝗸𝗶𝗹𝗹𝘀, on the other hand, define:<br> • The actual steps to perform a task <br> • Which tools to use <br> • How to investigate <br> • How to validate the result <br> • What to do when something fails <br>Think of a 𝗦𝗸𝗶𝗹𝗹 𝗮𝘀 𝗮 𝗯𝗮𝘁𝘁𝗹𝗲-𝘁𝗲𝘀𝘁𝗲𝗱 𝗿𝘂𝗻𝗯𝗼𝗼𝗸.</p><p>A simple example:<br><strong>Agent .md:</strong><br> • “Be careful with production changes. Don’t make destructive changes without approval.”</p><p>𝗦𝗸𝗶𝗹𝗹:<br> 1. Check the logs <br> 2. Identify the issue <br> 3. Run diagnostics <br> 4. Apply the fix <br> 5. Validate the result <br> 6. Recover if the fix fails</p><p>So:<br>Agent .md → 𝗝𝘂𝗱𝗴𝗺𝗲𝗻𝘁<br>Skill .md → 𝗘𝘅𝗲𝗰𝘂𝘁𝗶𝗼𝗻</p><p>Without Agent .md, you have an agent that can 𝗮𝗰𝘁 𝘄𝗶𝘁𝗵𝗼𝘂𝘁 𝗴𝗼𝗼𝗱 𝗷𝘂𝗱𝗴𝗺𝗲𝗻𝘁.<br>Without Skills .md, you have an agent that 𝗸𝗻𝗼𝘄𝘀 𝘄𝗵𝗮𝘁 𝘀𝗵𝗼𝘂𝗹𝗱 𝗯𝗲 𝗱𝗼𝗻𝗲 𝗯𝘂𝘁 𝗱𝗼𝗲𝘀𝗻’𝘁 𝗵𝗮𝘃𝗲 𝗮 𝗿𝗲𝗹𝗶𝗮𝗯𝗹𝗲 𝘄𝗮𝘆 𝘁𝗼 𝗱𝗼 𝗶𝘁.</p><p>And when you combine both:<br>Agent .md + 𝗦𝗸𝗶𝗹𝗹𝘀 = A capable agent that knows 𝘄𝗵𝗮𝘁 𝘁𝗼 𝗱𝗼 𝗔𝗡𝗗 𝗵𝗼𝘄 𝘁𝗼 𝗱𝗼 𝗶𝘁</p><p>Let’s use one very simple example: <strong>“Fix a production bug.”</strong></p><h3><strong>1. Agent.md → Rules for how the agent should behave</strong></h3><p>Agent.md does <strong>not</strong> need to explain every command. It says things like:</p><pre># Agent.md<br><br>## Role<br>You are a production support engineer.<br>## Priorities<br>1. Protect production.<br>2. Diagnose before changing anything.<br>3. Prefer the safest fix.<br>## Boundaries<br>- Do not delete production data.<br>- Do not make destructive changes without approval.<br>- Ask for confirmation before restarting a critical service.<br>## When to ask<br>Ask for help when:<br>- The cause is unclear.<br>- The fix could cause downtime.<br>- Multiple risky options exist.<br>## When to stop<br>Stop if you cannot safely determine the cause.</pre><p>Think:</p><blockquote><strong><em>“What kind of engineer are you, and what rules should you follow?”</em></strong></blockquote><h3>2. Skill.md → Exact procedure for doing the task</h3><p>Now the Skill tells the agent <strong>how to actually fix the bug</strong>.</p><pre># Skill: Fix Production Bug<br><br>## Steps<br>1. Check the monitoring dashboard.<br>2. Identify the failing service.<br>3. Check the application logs.<br>4. Find the error and determine the likely cause.<br>5. Check recent deployments.<br>6. If the fix is safe, apply it.<br>7. Verify the service is healthy.<br>8. Confirm the error rate has returned to normal.<br><br>## Tools<br>- Monitoring tool<br>- Log search tool<br>- Deployment tool<br><br>## Validation<br>- Error rate is back to normal.<br>- Health check passes.<br>- No new alerts appear.<br><br>## If something fails<br>- Do not continue blindly.<br>- Roll back the change if appropriate.<br>- Re-check logs.<br>- Escalate if the problem cannot be safely resolved.</pre><p>Think:</p><blockquote><strong><em>“Okay, I know the rules. Now show me exactly how to do the job.”</em></strong></blockquote><h3>The difference in one example</h3><p>Imagine the agent discovers that restarting a production service might fix the problem.</p><p><strong>Agent.md says:</strong></p><blockquote><em>“Be careful with production. Avoid actions that may cause downtime. Ask before taking a risky action.”</em></blockquote><p><strong>Skill.md says:</strong></p><blockquote><em>“Before restarting, check X → run Y → confirm Z → restart using tool A → verify health check B.”</em></blockquote><p>So the agent uses <strong>Agent.md to decide whether it should do something</strong> and <strong>Skill.md to know how to do it correctly</strong>.</p><h3>One-line rule</h3><p><strong>Agent.md = “Think before you act.”</strong><br><strong>Skill.md = “Here is how to act.”</strong></p><p>The key is: <strong>don’t put the detailed procedure in Agent.md. Put the reusable procedure in a Skill.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd86ea10c8b2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Does 99.9% Really Mean? A Simple Guide to SLI, SLO, SLA, and Error Budgets]]></title>
            <link>https://medium.com/@waibhav.deogade/what-does-99-9-really-mean-a-simple-guide-to-sli-slo-sla-and-error-budgets-5ce65c765450?source=rss-82175c9b1339------2</link>
            <guid isPermaLink="false">https://medium.com/p/5ce65c765450</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[slo]]></category>
            <category><![CDATA[cloud-engineering]]></category>
            <category><![CDATA[site-reliability-engineer]]></category>
            <category><![CDATA[sla]]></category>
            <dc:creator><![CDATA[Waibhav Deogade]]></dc:creator>
            <pubDate>Sun, 27 Sep 2026 06:42:53 GMT</pubDate>
            <atom:updated>2026-09-27T06:42:53.278Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A beginner-friendly explanation of how reliable your service needs to be, and why you shouldn’t pick a number just because it sounds good</em></p><p>Many engineering teams start their reliability planning the same way. Someone asks, “How reliable should our service be?” and someone else says, “99.9%.” Everyone agrees, and the meeting moves on. But few people stop to ask what 99.9% actually means.</p><blockquote>How much downtime does it allow? <br>Has our service ever reached it? <br>Who is this number for, our own team or our customers?</blockquote><p>In this article, we’ll answer those questions in plain language. We’ll use one simple example the whole way through: an <strong>online shop</strong> where people buy things at checkout.</p><h3>Three Words You Need to Know</h3><p>People often mix up these three terms. They are different, and they build on each other like steps on a ladder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HJD1J327AzKopy8hMXwlFg.png" /></figure><p><strong>SLI: what is happening.</strong> SLI stands for <em>Service Level Indicator</em>. It is a measurement of how your service is doing right now. For our shop, it could be: “Out of every 100 checkouts, how many worked?” If 998 out of 1,000 worked, your SLI is 99.8%.</p><p>The key idea: measure what the <strong>user</strong> feels. A user doesn’t care if your server is busy. They care if the checkout worked and whether it was fast.</p><p><strong>SLO: what you aim for.</strong> SLO stands for <em>Service Level Objective</em>. It is the goal your team sets for itself. For example: “99.9% of checkouts should work over the last 30 days.” This is an <strong>internal</strong> goal. Customers don’t see it.</p><p><strong>SLA: what you promise.</strong> SLA stands for <em>Service Level Agreement</em>. It is a promise you make to your customers, usually written in a contract. If you break it, you may have to pay them back, for example, with refunds or credits.</p><p><strong>The simple order is: measure first (SLI), then set a goal (SLO), then make a promise (SLA).</strong> Many teams do it backwards. They promise something first, before they even know what their system can do.</p><h3>What the “Nines” Really Mean</h3><p>Here is the part most people skip. Adding one more “9” is a much bigger deal than it looks.</p><p>Going from 99.9% to 99.99% doesn’t sound like much. But it means you are allowed <strong>10 times less downtime</strong>.</p><p>Here’s how much downtime each level allows in one month (30 days):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9y3U2633A7Xv4PWV-3j1qw.png" /></figure><p>So when a team says “99.9%,” they are really saying: <strong>“Our service can be broken for only 43 minutes in a whole month.”</strong></p><p>Now think about a real problem. It takes a few minutes for someone to notice something is wrong. Then a few more minutes to figure out the cause. Then more time to fix it. One normal problem can easily take 30 minutes or more. Two problems in the same month, and you’ve missed your goal.</p><h3>How to Measure (the SLI)</h3><p>The formula is simple:</p><pre>SLI = (Good events ÷ All events) × 100</pre><p>For our shop:</p><pre>SLI = (Checkouts that worked ÷ All checkouts) × 100</pre><p>If 9,990 checkouts worked out of 10,000, your SLI is 99.9%.</p><p>You can also measure <strong>speed</strong>. For example: “How many checkouts finished in under half a second?” A checkout that works but takes 15 seconds doesn’t feel like a success to the person waiting.</p><h3>How to Pick a Realistic Goal (the SLO)</h3><p><strong>Look at your past numbers.</strong> Check how your service did over the last 2 to 3 months. If it was around 99.8%, don’t set a goal of 99.99%. You’ll fail from day one, and the team will stop taking the goal seriously. Start with what’s real, and improve over time.</p><p><strong>Remember that you depend on others.</strong> Your shop probably uses other services, like a database and a payment company. If any of them go down, your checkout goes down too. Your service can’t be more reliable than the parts it depends on.</p><p><strong>Start with one thing.</strong> Don’t try to measure everything at once. Pick the most important action for your users (like checkout) and measure that well first.</p><h3>The Error Budget: Your “Allowed Mistakes”</h3><p>This is one of the most useful ideas in reliability. The <strong>error budget</strong> is how much failure you are allowed.</p><pre>Error Budget = 100% − Your Goal</pre><p>If your goal is 99.9%, your error budget is 0.1%.</p><p>Let’s make it real. If your shop gets 1,000,000 checkouts in a month:</p><pre>1,000,000 × 0.1% = 1,000 checkouts are allowed to fail</pre><p>Think of it like a monthly allowance of mistakes. How you use it is a team rule:</p><ul><li><strong>Plenty left?</strong> Keep building and releasing new features.</li><li><strong>Using it up fast?</strong> Slow down and be more careful.</li><li><strong>All gone?</strong> Stop adding new features. Focus only on fixing and stabilizing the service.</li></ul><p>This helps teams avoid arguments. Instead of “Should we release or not?”, the error budget gives a clear answer.</p><p>And here’s the important lesson: <strong>a stricter goal means a smaller allowance.</strong> A 99.99% goal leaves almost no room for mistakes, which means your team can release new things much less often. That may be right for a payment system. It’s probably too much for a simple internal tool.</p><h3>Keep Your Promise Easier Than Your Goal</h3><p>Your SLA (promise to customers) should always be <strong>lower</strong> than your SLO (your own goal).</p><p>For example:</p><ul><li><strong>Your team’s goal (SLO):</strong> 99.5%</li><li><strong>Your promise to customers (SLA):</strong> 99%</li></ul><p>Why? The gap gives you a safety cushion. If things start going wrong, you’ll miss your own goal first. That’s your warning sign. You still have time to fix things before you break your promise to customers.</p><p>If your promise and your goal are the same number, there’s no warning. The first problem is already a broken promise.</p><p>One more small difference:</p><ul><li><strong>SLOs</strong> are usually checked over the <strong>last 30 days</strong>, updated every day.</li><li><strong>SLAs</strong> are usually checked by <strong>calendar month</strong> (like March 1 to March 31), because contracts and bills work that way.</li></ul><h3>Don’t Forget Maintenance Time</h3><p>Sometimes teams shut the service down on purpose to do updates. This is called a <strong>maintenance window</strong>. Usually, customers are told about it ahead of time.</p><p>Many contracts (SLAs) say planned maintenance doesn’t count as downtime. That’s fair for a contract.</p><p><strong>But your users still can’t use the service during that time.</strong> Someone trying to buy something at 2 a.m. doesn’t care that you announced it last week.</p><p>Here’s a common problem. A team says their goal is 99.9% (43 minutes of downtime a month). But they also do 4 hours of planned maintenance every month. On paper, everything looks fine. In reality, users are seeing much more downtime than 99.9% allows.</p><p>There are three honest ways to fix this:</p><ol><li><strong>Count maintenance as downtime</strong> in your own goal, so your number matches what users really see.</li><li><strong>Do updates without shutting down</strong>, so users never notice.</li><li><strong>Pick a lower goal</strong> that fits how you actually work, like 99.5%.</li></ol><p>What you shouldn’t do is keep a nice-looking number that ignores downtime your users can feel.</p><h3>So, Do You Really Need 99.9%?</h3><p>Not always. Ask yourself:</p><ul><li><strong>What do users really need?</strong> A payment page needs to be very reliable. An internal report that people check once a day does not.</li><li><strong>Would users even notice?</strong> If people use your app on slow mobile internet, their connection may fail more often than your service does.</li><li><strong>What do your past numbers say?</strong> Start from reality, not from a wish.</li><li><strong>Is it worth the cost?</strong> Each extra “9” takes a lot more time, money, and effort.</li></ul><p>It’s completely fine to have different goals for different parts of your service. For example: 99.9% for checkout, 99.5% for search, and 99% for an admin page. That’s not lowering the bar. It’s putting your effort where it matters most.</p><h3>Putting It All Together</h3><p>Here’s how everything connects:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*64EiNJhtSFAJnP0I-ovbJg.png" /></figure><p>Change one piece and the others change too. A stricter goal means fewer allowed mistakes. More maintenance time uses up your allowance. A promise that’s too close to your goal leaves no safety cushion.</p><h3>Quick Checklist</h3><p>Before your team picks a number, make sure you can answer these:</p><ol><li>Which user action is this goal for?</li><li>How exactly are we measuring success?</li><li>What did our numbers look like over the last 2 to 3 months?</li><li>How many minutes of downtime does this goal allow each month?</li><li>Does planned maintenance count?</li><li>What do we do when the error budget runs out?</li><li>Is our promise to customers lower than our own goal?</li></ol><p>A reliability number should be the <strong>result</strong> of careful thinking, not the starting point. Measure first, set a realistic goal, and only then make a promise. When your team understands what the number means, it stops being just a number on a slide and starts being useful.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ce65c765450" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HikariCP Internals Explained with a Restaurant Analogy]]></title>
            <link>https://medium.com/@waibhav.deogade/hikaricp-internals-explained-with-a-restaurant-analogy-65299ab0ec27?source=rss-82175c9b1339------2</link>
            <guid isPermaLink="false">https://medium.com/p/65299ab0ec27</guid>
            <dc:creator><![CDATA[Waibhav Deogade]]></dc:creator>
            <pubDate>Sat, 08 Aug 2026 12:47:59 GMT</pubDate>
            <atom:updated>2026-08-08T14:52:19.808Z</atom:updated>
            <content:encoded><![CDATA[<h4>Introduction</h4><p>If you have built a Spring Boot application that talks to PostgreSQL, MySQL, or another relational database, there is a good chance you are already using <strong>HikariCP</strong> — even if you have never configured it directly.</p><p>At first glance, a database connection pool sounds simple: instead of creating a new database connection for every request, keep a set of connections ready and reuse them. But once an application starts running for days or weeks, especially in cloud environments, some interesting questions appear:</p><blockquote>What happens when all connections are busy? What happens to connections sitting idle for a long time? What if the database or network silently closes a connection? Can HikariCP remove a connection while a query is running? And what exactly is the difference between keepalive-time, idle-timeout, and max-lifetime?</blockquote><p>Before we touch a single configuration property, let’s build the right mental model. HikariCP is a <strong>connection pool</strong> — a manager that keeps a set of pre-opened database connections ready to hand out, so your application doesn’t pay the cost of opening a new TCP connection on every request.</p><p>Think of it as a restaurant with a fixed number of waiters. Your application is the restaurant, each database connection is a waiter, and every incoming HTTP request is a customer who needs to be seated and served.</p><p>Let’s begin our journey into HikariCP with a simple restaurant analogy that makes its concepts and lifecycle easier to understand.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5z8uhagBInGJI6R35DQhuw.png" /></figure><blockquote>Now that we have our restaurant analogy, let’s see the complete journey of a HikariCP connection — from the moment the application starts to the moment a connection is borrowed, used, returned, checked, and eventually replaced.</blockquote><blockquote>The diagram below gives us the big picture first. We’ll then walk through each stage in simple terms.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kvM43w2CbRRiVlKIl8CmyQ.png" /></figure><p><strong>1. The Restaurant Opens — Pool Initialisation</strong></p><p>The manager arrives before anyone else. She doesn’t wait for the first customer to walk in before thinking about staff. She brings two waiters in early (minimumIdle = 2), walks them through their setup:</p><ul><li>Uniform on — TCP socket opened</li><li>Kitchen introduction — authentication handshake done</li><li>Notepad ready — connection-init-sql run</li><li>Position taken at the back — sitting IDLE, waiting</li></ul><p>By the time the sign flips to open, the restaurant is already alive. The customer who walks in first never sees the setup. That’s exactly the point.</p><p><strong>2. A Customer Walks In — Connection Borrow</strong></p><p>When a customer arrives, the manager’s eyes go to the floor before they’ve even finished coming through the door. Someone idle? They’re moving to the table before the question is fully formed — ACTIVE, immediately.</p><p>But on a busy Friday with every waiter occupied, she still has options:</p><ul><li><strong>Under the limit?</strong> She hires on the spot — a fresh connection opened, assigned right away</li><li><strong>Already at maximum (10)?</strong> The customer waits in the queue</li><li><strong>Waited 30 seconds, still no one free?</strong> They’re turned away — SQLException timeout, connection pool exhausted</li></ul><p>She holds herself to ten waiters because beyond that the kitchen can’t keep up. It’s not arbitrary. It’s just how many the system can honestly serve.</p><p><strong>3. Taking the Order — Query Execution</strong></p><p>Once a waiter is at the table, the manager leaves them completely alone. They take the order, carry it to the kitchen, wait for the food, bring it back — SQL sent over TCP, PostgreSQL executes, result returned. The whole time:</p><ul><li>The manager will not reassign them mid-service</li><li>She will not let them go even if their max-lifetime is nearly up</li><li>The customer in front of them gets seen through to the end, always</li></ul><p>The contract might be expiring. Doesn’t matter. The table finishes first.</p><p><strong>4. The Customer Leaves — Connection Return</strong></p><p>When the table clears, the waiter comes back and the manager takes a quiet look at them. Three things she checks, in order:</p><ul><li><strong>Something went wrong during service?</strong> Bad state, error mid-query — waiter let go, fresh hire to stay above minimumIdle</li><li><strong>Contract flagged for expiry mid-service?</strong> They’re released now that the table is clear, replaced immediately</li><li><strong>Everything fine, contract still valid?</strong> They head back to the idle area — IDLE again, clock starts ticking</li></ul><p>No ceremony. Just a quiet decision, made every time.</p><p><strong>5. Standing Idle — Background Timers</strong></p><p>The manager never fully switches off, even when the floor is quiet. Three checks run continuously in the background, without fanfare:</p><p><strong>Keepalive check</strong> (keepalive-time — every ~30s) She asks each idle waiter to knock on the kitchen window — a quick SELECT 1, nothing more. Kitchen responds? All good. No response? That connection was silently cut from the server side. Waiter let go, replacement hired.</p><p><strong>Contract expiry</strong> (max-lifetime — every ~4m20s) Every connection has a natural lifespan — not because anything is wrong, but because long-lived connections drift in ways you can&#39;t always see. When someone hits their limit: idle means gone now, mid-service means flagged and released the moment the table clears.</p><p><strong>Idle overflow</strong> (idle-timeout — every ~2m30s) A quiet Tuesday doesn&#39;t need ten waiters standing around staring at walls. She trims back to her minimum of two, letting the surplus go gradually, keeping the floor lean without ever dropping below minimumIdle.</p><p><strong>6. The Restaurant Breathes — Pool Scaling</strong></p><p>Across a full day, the pool expands and contracts almost like something alive:</p><ul><li>Slow afternoon — idle-timeout fires, excess waiters released, back to minimum 2</li><li>Dinner rush hits — idle connections grabbed instantly, new ones opened on demand, climbing toward max 10</li><li>Rush fades — waiters drift back to idle one by one, timeout checks quietly trim the excess, pool exhales back to 2</li></ul><p>Nobody makes a decision. It just happens, automatically, on every shift.</p><p><strong>7. The Night the Kitchen Closed the Window — Dead Connection Scenario</strong></p><p>This is the part nobody talks about until it happens to them.</p><p>The restaurant goes quiet. Two waiters standing idle at the back. What nobody announces — what the waiters have no way of knowing — is that the kitchen has quietly closed its service window. A server-side idle timeout, the kind managed databases impose after long stretches of inactivity. The window is shut. But the waiters are just standing there, patient as ever, notepads in hand.</p><p>And if the manager never configured the keepalive check — never asked her idle staff to knock on the window — nobody finds out.</p><p>Morning arrives. The rush starts. She sends the first waiter to a table. He walks to the kitchen. Window closed. Comes back with nothing. Customer gets nothing ❌. Second waiter, same story ❌. Table after table, the same quiet failure — both connections dead, the pool none the wiser.</p><p>Eventually she figures it out:</p><ul><li>Both waiters let go</li><li>Fresh hires brought in</li><li>Kitchen opens new windows for them ✓</li><li>Service resumes</li></ul><p>But every customer from that first wave was already gone.</p><p>An app restart clears it — the pool closes and reopens, fresh connections made, kitchen acknowledges them all. But that’s damage control, not prevention. The real fix is the one that happens the night before, while the restaurant is still quiet: configurekeepalive-time, ask your idle waiters to knock on the window every thirty seconds, and find out the window is closed before anyone walks through the door expecting to be served.</p><h3>Background Health Checks</h3><p>While connections sit idle, three background processes run continuously. These are the heart of keeping a pool reliable over long periods.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WanNlSsa5wHf6YqNUluu1w.png" /></figure><p><strong>Keepalive-time: </strong>Pings idle connections with SELECT 1 to detect dead sockets early — before a request tries to use them. The early warning system. Disabled by default; always enable in production.</p><p><strong>Max-lifetime</strong>: Forces connection rotation after a set age, even if the connection is perfectly healthy. Prevents session memory leaks, stale locks, and server-side resource buildup over time. The mandatory shift change.</p><p><strong>Idle-timeout:</strong> During quiet periods, excess idle connections are evicted down to minimumIdle. Saves database resources. The pool size regulator.</p><h3>Eviction &amp; Active Connection Safety</h3><p>A running query is never interrupted. This is a guarantee, not a best-effort. HikariCP implements deferred eviction: if a timer fires on a connection that is currently executing a query, the eviction is scheduled — the connection gets a flag saying “when you come back, don’t pool yourself.” The query completes normally; the connection is discarded on return rather than being returned to the pool.</p><blockquote>Same rule for keepalive-time: it only pings <em>idle</em> connections. It will never send a SELECT 1 ping to a connection that is mid-query.</blockquote><h4>The dead connection scenario</h4><p>Here’s the most common production failure pattern — and why keepalive-time is not optional:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EffRrELLj7H8ZfcuHgdl4g.png" /></figure><h3>Keepalive-time vs max-lifetime — No Conflict</h3><p>A common point of confusion: if max-lifetime rotates connections anyway, why do you also need keepalive-time? They do completely different things, and you need both.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h--omLKfhTreXBqfQ36KGQ.png" /></figure><p>A waiter can knock on the kitchen window and get a healthy response <em>and</em> have their shift end at the same moment. No conflict — one is a health check, the other is a rotation schedule.</p><blockquote>⚠️ max-lifetime only fires once at the end of the shift. Between T=0 and T=260s, the database server could silently close its socket on your connection at any moment. keepalive-time is the only thing that catches this in the window between rotation cycles.</blockquote><h3>Conclusion</h3><p>HikariCP can look complicated when we first encounter properties such as minimumIdle, maximumPoolSize, keepalive-time, idle-timeout, and max-lifetime. But the restaurant analogy gives us a much simpler way to think about what is happening.</p><p>HikariCP is essentially the <strong>restaurant manager</strong>.</p><p>It keeps enough <strong>waiters (database connections)</strong> ready, assigns them to <strong>customers (application requests)</strong> when needed, and returns them to the pool when their work is complete. Behind the scenes, it also makes sure those connections remain healthy and that the pool does not grow unnecessarily.</p><p>The most important distinction to remember is that the background settings solve <strong>different problems</strong>:</p><ul><li><strong>keepalive-time</strong> asks: <em>“Can this connection still reach the database?”</em> It is the health check.</li><li><strong>max-lifetime</strong> asks: <em>“Has this connection lived long enough?”</em> It provides connection rotation.</li><li><strong>idle-timeout</strong> asks: <em>“Do we still need this extra idle connection?”</em> It helps control pool size.</li><li><strong>minimumIdle</strong> defines the floor—the connections we want ready for work.</li><li><strong>maximumPoolSize</strong> defines the ceiling—the maximum number of connections the pool can use.</li></ul><p>And perhaps the most important behavior to understand is what happens to an <strong>active connection</strong>. If a connection is currently serving a request, HikariCP does not interrupt the running query simply because its lifetime has expired. Instead, the connection can be marked for eviction and removed after it is returned to the pool.</p><p>So the next time you see HikariCP configuration, don’t think of it as just a collection of mysterious timeout values.</p><p>Think of a busy restaurant:</p><blockquote>Keep enough waiters ready. Make sure they can still reach the kitchen. Replace them when their shift is over. Send unnecessary waiters home when things are quiet. And most importantly — never take a waiter away while they are serving a customer.</blockquote><p>Once that mental model clicks, HikariCP becomes much easier to understand, configure, and troubleshoot.</p><h3>Extra Take</h3><p>While reading this, you might have these questions come to mind</p><pre>**Question 1** - Does `keepalive-time` Conflict with `max-lifetime`?<br><br>**No — they measure completely different things.**<br><br>### Restaurant Analogy<br>```<br>keepalive-time  =  manager tapping the waiter on the shoulder every 30s<br>                   &quot;hey, can you still get through to the kitchen?&quot;<br>                   → waiter knocks on kitchen window (SELECT 1 ping)<br>                   → kitchen responds → waiter is fine, carry on<br>                   → no response    → kitchen has cut them off<br>                                      fire the waiter immediately<br>                                      hire a fresh replacement<br><br>max-lifetime    =  every waiter has a fixed shift length (4m20s)<br>                   &quot;regardless of how well you are doing,<br>                    time for a fresh waiter after your shift ends&quot;<br>                   → even a perfectly healthy waiter gets rotated out<br>                   → prevents stale sessions, memory leaks,<br>                     long-lived locks building up over time<br>```<br><br>A waiter can knock on the kitchen window and get a response (healthy) <br>AND still have their shift end at the same moment. <br>No conflict — one is a **health check**, the other is a **rotation schedule**.<br><br>**Question 2** -How They Work Together in Practice<br><br>```<br>Waiter (connection) starts their shift at T=0<br>    │<br>    T=60s  → manager checks kitchen access → kitchen responds → fine ✓<br>    T=120s → manager checks kitchen access → kitchen responds → fine ✓<br>    T=180s → manager checks kitchen access → kitchen responds → fine ✓<br>    ...<br>    T=540s → manager checks kitchen access → kitchen responds → fine ✓<br>    │<br>    T=260s → shift ends (max-lifetime fires) simultaneously<br>    │<br>    ▼<br>Shift rotation wins — waiter let go regardless of health check result<br>Even though kitchen access was just confirmed a moment ago<br>A brand new waiter is hired to replace them<br>```<br><br>**Question 3** - Why Have `keepalive-time` at All if `max-lifetime` Rotates Anyway?<br><br>`max-lifetime` only fires **once** at the end of a shift. <br>Between the start and end of a shift, the kitchen could close its window <br>on the waiter at any moment.<br><br>```<br>Without keepalive-time:<br>    T=200s → kitchen closes window on waiter (dead socket)<br>    T=201s → customer arrives → waiter goes to kitchen → window closed<br>             → comes back empty handed → customer gets nothing ❌<br>    T=260s → shift ends → waiter let go (too late, damage done)<br><br>With keepalive-time:<br>    T=200s → kitchen closes window on waiter (dead socket)<br>    T=230s → manager checks kitchen access → no response (every 30s)<br>             → waiter fired immediately ✓<br>             → fresh waiter hired → kitchen opens window for them ✓<br>    Next customer → served by fresh waiter with open kitchen access ✓<br>```<br><br>&gt; `keepalive-time` is the **early warning system** — catches a closed <br>kitchen window within 30 seconds.<br><br>&gt; `max-lifetime` is the **guaranteed shift rotation** — regardless of <br>kitchen access status.<br><br>---<br><br>**Question 4** - What Happens to an Active Connection During Eviction?<br><br>**It is never interrupted.** HikariCP uses a deferred eviction mechanism:<br><br>```<br>max-lifetime timer fires on a connection mid-query<br>    │<br>    ▼<br>HikariCP checks: is this connection currently serving a customer?<br>    │<br>    ├── YES (query is running)<br>    │       → Marks it &quot;evict when returned&quot; — a deferred flag<br>    │       → Does NOT interrupt the running query<br>    │       → Connection finishes the query normally<br>    │       → When returned to pool → discarded instead of pooled<br>    │       → Replacement created if below minimumIdle<br>    │<br>    └── NO (connection is idle)<br>            → Evicted immediately<br>            → Replacement created if below minimumIdle<br>```<br><br>Same applies to `keepalive-time` — it only pings **idle** connections. <br>It will never touch a connection that is actively executing a query.<br>---</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=65299ab0ec27" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Design Patterns Explained Through Everyday Analogies — No Code Required]]></title>
            <link>https://medium.com/@waibhav.deogade/design-patterns-explained-through-everyday-analogies-no-code-required-b5708fa10f89?source=rss-82175c9b1339------2</link>
            <guid isPermaLink="false">https://medium.com/p/b5708fa10f89</guid>
            <dc:creator><![CDATA[Waibhav Deogade]]></dc:creator>
            <pubDate>Sun, 26 Jul 2026 16:58:13 GMT</pubDate>
            <atom:updated>2026-07-26T16:58:13.089Z</atom:updated>
            <content:encoded><![CDATA[<p>A conversation inspired this article with one of my junior teammates.</p><p>He was trying to learn design patterns, and I was walking him through the concepts. As I explained each pattern with programming examples, I noticed something wasn’t quite right. He wasn’t confused because he could not understand — it was simply that the ideas weren’t connecting.</p><p>After a while, I realized the problem wasn’t the topic. It was the way I was explaining it. The examples I was using assumed he already had a solid understanding of how software systems are structured, but he was still building that foundation. I was expecting him to connect concepts that didn’t yet have anything familiar to attach to.</p><p>So I changed my approach.</p><p>I put the code aside and started explaining the same design patterns using something much more relatable: building a house. Instead of classes and objects, we talked about architects, builders, blueprints, and construction.</p><p>The difference was immediate.</p><p>His expressions changed from confusion to curiosity. He started asking thoughtful questions — not just about what each pattern does, but why it exists in the first place and what problem it solves. By the end of our conversation, he wasn’t memorizing design patterns anymore; he was actually understanding the reasoning behind them.</p><p>That moment stayed with me.</p><p>It reminded me that the best explanations don’t always start with code. Sometimes, connecting a new idea to something people already understand makes all the difference. That’s why I decided to write this article. If a simple real-world analogy helped one person finally understand design patterns, there’s a good chance it can help many others too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m4KFDbsUeotnhbCg2hECSA.png" /></figure><h3>So What Exactly Is a Design Pattern?</h3><p>Let’s start from scratch. Forget code. Forget programming. Let’s think about houses.</p><p>Imagine you’re a builder who has been constructing homes for thirty years. Early in your career, you figured out the hard way that if you don’t put a damp-proof layer between the ground and the brickwork, moisture creeps up the walls and causes all sorts of problems. You learned that the roof trusses need to be spaced a certain way or they’ll sag. You discovered that certain room layouts flow better than others — kitchen next to the dining area, bathrooms near bedrooms, hallways that connect everything sensibly.</p><p>These lessons, worked out through trial and error over decades, are what builders pass down from generation to generation. They’re not laws. You don’t have to follow them. But if you ignore them, you’ll probably run into the same problems everyone else ran into before you figured them out.</p><blockquote><strong>Simply put: </strong>A design pattern is a proven, reusable solution to a problem that keeps coming up again and again. It’s not a finished recipe you copy exactly. It’s more like a trusted approach — a shape of solution that has worked for others and can be adapted to your situation.</blockquote><p>Back in 1994, four software engineers, known as the <strong>Gang of Four (GoF)</strong>, noticed that the same design problems kept appearing in different software projects. They also saw that experienced developers were solving these problems in similar ways. So they collected and documented 23 common design patterns in a single book.</p><p>To make them easier to understand, they grouped the patterns into three categories based on the type of problem they solve:</p><ul><li>🏗️ <strong>Creational Patterns</strong> — How do we create objects?</li><li>🏛️ <strong>Structural Patterns</strong> — How do we connect objects together?</li><li>🤝 <strong>Behavioral Patterns</strong> — How do objects communicate and work with each other?</li></ul><blockquote>Think of a house. First, you build it (<strong>Creational</strong>). Then you connect all the parts — walls to floors, pipes to taps, wires to sockets (<strong>Structural</strong>). Then you think about how everything works together day-to-day — who controls the thermostat, how you know when the postman has arrived, how alarms are triggered (<strong>Behavioural</strong>).</blockquote><p>Those three phases map almost perfectly to the three families of design patterns. Let’s walk through all of them — and since covering all 23 patterns in a single article would make for quite a long read, we’ll take it one phase at a time.</p><p><a href="https://medium.com/@waibhav.deogade/%EF%B8%8F-part-1-creational-patterns-%EF%B8%8F-980eedec1f9a"><strong><em>Part 1: Creational Patterns</em></strong></a></p><p><a href="https://medium.com/@waibhav.deogade/%EF%B8%8F-part-2-structural-patterns-%EF%B8%8F-4c44dd15f9cb"><strong><em>Part 2: Structural Patterns</em></strong></a></p><p><a href="https://medium.com/@waibhav.deogade/part-3-behavioral-patterns-44e7c39245e5"><strong><em>Part 3: Behavioral Patterns</em></strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b5708fa10f89" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Part 3: Behavioral Patterns ]]></title>
            <link>https://medium.com/@waibhav.deogade/part-3-behavioral-patterns-44e7c39245e5?source=rss-82175c9b1339------2</link>
            <guid isPermaLink="false">https://medium.com/p/44e7c39245e5</guid>
            <dc:creator><![CDATA[Waibhav Deogade]]></dc:creator>
            <pubDate>Sun, 26 Jul 2026 16:54:53 GMT</pubDate>
            <atom:updated>2026-07-26T16:57:45.407Z</atom:updated>
            <content:encoded><![CDATA[<h3>Behavioural Patterns: How Do Things Work Together?</h3><p>A building can be perfectly constructed and beautifully put together — and still be chaotic inside if nobody knows who does what, who talks to whom, or what happens when something goes wrong.</p><p>Behavioural patterns are about coordination and communication. How does information flow? Who is responsible for what? How does one part of a system tell another part that something has happened?</p><p>Think of a well-run hospital. The building is structurally perfect. But what makes it work is the coordination — nurses handing over to other nurses, doctors receiving results from labs, patients being moved through the system in a defined order. That’s what behavioural patterns capture.</p><h4><strong>Pattern 1: Chain of Responsibility — The Complaints Escalation Desk</strong></h4><p>You call a company’s customer service line with a complaint. The first person who picks up is a junior agent. They can handle simple things — change your address, resend an invoice. Your complaint is more complicated, so they transfer you to a senior agent. The senior agent handles more complex cases, but yours is really serious, so they escalate it to the complaints manager. The manager has the authority to resolve it. You didn’t decide who would handle your complaint. You just submitted it. The chain figured out who was the right person to deal with it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fAgmBQujtbRk_BK0drCvHA.png" /></figure><p>🔑 <strong>The Pattern: </strong>Chain of Responsibility means: pass a request along a chain of handlers. Each one decides whether to deal with it or pass it on. The person making the request doesn’t need to know who will ultimately handle it.</p><p><strong>🌍 Everyday example: </strong>Planning permission for a home extension. A small shed? Your local council officer approves it. A larger extension? Goes to the planning committee. Something affecting the whole street? Goes to a higher authority. You submit once; the chain routes it.</p><p><strong>💻 In software: </strong>A web server processing incoming requests through a pipeline of middleware — first authentication checks, then rate limiting, then input validation, then business logic. Each middleware handler either processes the request itself or passes it to the next handler in the chain. If authentication fails, the chain stops there; the business logic never even sees the request.</p><h4><strong>Pattern 2: Command — The Written Work Order</strong></h4><p>A site manager needs to instruct many different teams throughout the day. If they just shout instructions across the site, things get forgotten, misunderstood, or done in the wrong order. And if something goes wrong, there’s no record of what was asked. Instead, the site manager writes formal Work Orders. Each Work Order is a document: what to do, who should do it, when, and with what materials. Work Orders can be queued, prioritised, handed to someone else, or even reversed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H-jgif-Mw_kbaB1Wgao9Qg.png" /></figure><p>🔑 <strong>The Pattern: </strong>Command means: turn an action into a physical object — an instruction that can be stored, queued, scheduled, or undone. The instruction is separated from the moment of its execution.</p><p><strong>🌍 Everyday example: </strong>The undo button. Every time you type a word, delete something, or change a colour, that action is stored as a Command. When you press Ctrl+Z, you’re reversing the most recent command. Press it again, reverse the one before.</p><p><strong>💻 In software: </strong>A “macro recorder” in any tool — or a task queue in a backend system. Each user action or background job is wrapped in a Command object with everything needed to execute it (and roll it back). This is also how database transaction logs work: every change is recorded as a Command so it can be replayed or reversed.</p><h4><strong>Pattern 3: Iterator — The Building Inspection Checklist</strong></h4><p>A health and safety inspector arrives at a multi-storey office building. They need to inspect every room — all 120 of them — without missing any, without repeating any, and without needing to memorise the floor layout. They’re given a numbered checklist and a map. Room 1, Room 2, Room 3… The checklist tells them which room to visit next. They don’t need to plan the route. They just follow the list.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-uAr4KqaGDhaO7Pdej8jKw.png" /></figure><p>🔑 <strong>The Pattern: </strong>Iterator means: provide a simple, consistent way to move through a collection of things one at a time — regardless of how complex the collection is underneath. “Give me the next one” is all you need to ask.</p><p><strong>🌍 Everyday example: </strong>Swiping through photos on your phone. You don’t know how the photos are stored internally. You just swipe right to get the next one. The Iterator handles the navigation.</p><p><strong>💻 In software: </strong>In software, you might have data stored in an array, a linked list, a tree, or a database result set — all completely different structures. The Iterator pattern gives every one of them the same interface: hasNext() and next(). The code that wants to loop through items doesn’t need to know what kind of collection it’s walking through.</p><h4><strong>Pattern 4: Mediator — The Air Traffic Control Tower</strong></h4><p>Imagine if every plane in the sky communicated directly with every other plane — “Hey, I’m coming from the west, can you move?” Thousands of planes, all talking to each other simultaneously. It would be catastrophic. Instead, every plane talks to the control tower. The tower knows where everyone is. The tower issues instructions. Planes don’t coordinate among themselves — they coordinate through the hub.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ne_SiTfBUlPTPSal6RaDRw.png" /></figure><p>🔑 <strong>The Pattern: </strong>Mediator means: instead of everyone talking to everyone else (which gets very complicated very quickly), all communication goes through a central coordinator. The coordinator manages everything.</p><p><strong>🌍 Everyday example: </strong>A group chat on WhatsApp. Instead of 12 people sending individual messages to each other (144 messages to manage!), everyone posts to one chat. The chat is the mediator.</p><p><strong>💻 In software: </strong>A chat application where users send messages to a central ChatRoom object rather than directly to each other. The ChatRoom decides who receives what. This means adding a new user to the room requires no changes to how existing users communicate — they all still just talk to the ChatRoom. Without a Mediator, every user would need a reference to every other user.</p><h4><strong>Pattern 5: Memento — The Architect’s Saved Drafts</strong></h4><p>An architect has been working on a design for weeks and has finally arrived at a version they’re proud of. But they want to explore a bold new idea — moving the entire staircase to the other side of the building. It might look amazing. It might look terrible. They don’t want to ruin what they already have. So they photograph and scan everything: a complete snapshot labelled “Version 3 — Good.” Now they experiment freely. If the new idea fails, they restore from that snapshot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eZk8prABeKyCdxXiuSzIHA.png" /></figure><p>🔑 <strong>The Pattern: </strong>Memento means: capture and store the exact state of something at a particular moment, so you can restore it later if needed. It enables safe experimentation and rollback.</p><p><strong>🌍 Everyday example: </strong>Google Docs version history. Every few minutes, Docs saves a snapshot of your document. If you accidentally delete three paragraphs and only notice a week later, you can go back to the saved version from before the mistake.</p><p><strong>💻 In software: </strong>The Memento pattern is behind every “undo history” feature and every “save state” in games. The object saves a snapshot of itself (the Memento) before a risky operation. If things go wrong, the snapshot is restored. The clever part: the snapshot is kept private to the original object — nothing else can read or tamper with it.</p><h4><strong>Pattern 6: Observer — The Doorbell</strong></h4><p>You’re at home. A delivery van pulls up outside. Everyone in your house who wants to know about arrivals — you, your flatmate, the dog — needs to be alerted. You don’t want to assign someone to stand at the window all day watching the street. Instead, you have a doorbell. When someone arrives and presses the bell, the alert goes to everyone who is “subscribed” — your phone, the speaker in the kitchen, the display panel in the hallway. The delivery person doesn’t know or care how many devices are listening. They just press the bell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KeVb8e5qaaVFw1fewI572Q.png" /></figure><p>🔑 <strong>The Pattern: </strong>Observer means: when something changes or happens, automatically notify everyone who said they wanted to know. The source of the event doesn’t manage who’s listening — it just announces the event.</p><p><strong>🌍 Everyday example: </strong>Newsletter subscriptions. A writer publishes a new article. Every subscriber gets an email automatically. The writer didn’t email each person individually — they published once, and the subscription system notified all observers.</p><p><strong>💻 In software: </strong>A stock price feed. Multiple components are watching the same stock — a price chart, an alert engine, a portfolio calculator, a trade history log. When the price changes, the stock object notifies all of them automatically. Adding a new watcher doesn’t require changing the stock object at all — the new watcher simply subscribes.</p><h4><strong>Pattern 7: State — The Traffic Light</strong></h4><p>A traffic light is one object — one pole, one set of lights — but it behaves completely differently depending on its current state. When it’s Red, it stops cars and allows pedestrians. When it’s Green, it does the opposite. When it’s Amber, it’s a warning that a change is coming. The same physical object, three completely different behaviours. Far better to have each state define its own behaviour clearly than to write a long list of “if Red, do this; if Green, do that.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b5aoHwJTYIrq0XbuF_WbvA.png" /></figure><p>🔑 <strong>The Pattern: </strong>State means: an object changes what it does based on what state it’s currently in. Each state is its own clearly defined set of rules.</p><p><strong>🌍 Everyday example: </strong>Your phone’s volume settings. When it’s on Silent, pressing the volume button shows a silent icon. When it’s on Ring, pressing volume changes the ringtone level. When it’s on Vibrate, different behaviour again. One phone, one volume button — completely different results depending on the current state.</p><p><strong>💻 In software: </strong>A vending machine. In the “Waiting for coin” state, pressing a product button does nothing. In the “Coin inserted” state, pressing a button dispenses the item. In the “Out of stock” state, inserting a coin triggers an immediate refund. The machine’s behaviour is completely governed by which state it’s currently in — no sprawling if-else chains needed.</p><h4><strong>Pattern 8: Strategy — The Route Planner</strong></h4><p>You need to get from Chennai to Mumbai. There are several ways: fly, take the train, drive, take a bus. Each is a valid strategy. Each has different tradeoffs — cost, time, comfort. You choose the one that fits your current situation. Next time you might choose differently. The destination is the same. The starting point is the same. Only the strategy for getting there changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AGLEn_G47hRmRWQooArTmQ.png" /></figure><p>🔑 <strong>The Pattern: </strong>Strategy means: define a family of interchangeable approaches to doing something, and let whoever needs it pick the right one for their situation. Swapping strategies doesn’t change the goal — just the method.</p><p><strong>🌍 Everyday example: </strong>Google Maps. Same destination, same starting point — but you can choose driving, walking, cycling, or public transport. Each is a Strategy. The map app doesn’t change; only the strategy you select changes.</p><p><strong>💻 In software: </strong>A sorting feature in a data grid. For small datasets, a simple bubble sort is fine. For large datasets, quicksort is faster. For nearly-sorted data, insertion sort wins. Rather than one giant sorting method with if-else branches, you define a SortStrategy interface and swap in the right algorithm at runtime — without changing the grid at all.</p><h4><strong>Pattern 9: Template Method — The Standard Recipe with Your Own Twist</strong></h4><p>Every morning, you make breakfast. The sequence is always the same: boil water, prepare your toast, add the main ingredient, let it brew or cook, eat. That sequence never changes. But what you actually make varies — some mornings it’s oats, some mornings scrambled eggs, some mornings just toast with peanut butter. The template is the fixed sequence. The specific content within each stage is yours to fill in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bfo3USQLgWUeF7n6QgFCCQ.png" /></figure><p>🔑 <strong>The Pattern: </strong>Template Method means: define the skeleton of a process — the steps and their order — but allow the specific content of each step to be filled in for each situation.</p><p><strong>🌍 Everyday example: </strong>A job application process. Every company follows roughly the same template: submit application → screening call → technical interview → final interview → offer. The template is universal. The specific questions and people differ company to company.</p><p><strong>💻 In software: </strong>A data import pipeline: always the same steps — open source, read data, validate, transform, write to destination, close source. The sequence is fixed. But what “validate” means differs for a CSV import versus a JSON import versus a database migration. The Template defines the steps; each specific importer fills in the details of each step.</p><h4><strong>Pattern 10: Visitor — The Specialist Inspector</strong></h4><p>A newly built shopping mall is ready for its final inspections before opening. Several different experts need to assess it: a fire safety officer, a structural engineer, an electrical inspector, and an accessibility auditor. Each expert tours the same building. Each applies their own expertise. Each writes a completely different report. The building doesn’t change for each visitor. The visitors bring their own specialised perspective.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rKdE3_eXqRbRUzsJz5kHeA.png" /></figure><p>🔑 <strong>The Pattern: </strong>Visitor means: allow new operations to be performed on a set of things, without changing those things themselves. The Visitor comes in, does its specific job on each element, and leaves.</p><p><strong>🌍 Everyday example: </strong>A tax auditor visiting a business. The accounts are the same accounts they always were. The auditor applies their own specific rules and calculations. A different auditor (a fraud investigator) would apply completely different rules to the same accounts. The accounts don’t change — the visitor’s lens does.</p><p><strong>💻 In software: </strong>A document object model where elements are headings, paragraphs, images, and tables. You want to export to PDF, export to plain text, and count words — three completely different operations. Rather than adding all three methods to every element class, you create three Visitors. Each Visitor knows what to do with each element type. Adding a fourth operation (say, spell-check) means adding one new Visitor — nothing else changes.</p><h4><strong>Pattern 11: Interpreter — The Building Code</strong></h4><p>Every city has a building code — a thick book of rules: minimum ceiling height is 2.4 metres, every habitable room needs a window of at least a certain size, the staircase must have a handrail, fire exits must be accessible within a certain distance. When a builder submits new plans, a planning officer reads the plans against those rules — rule by rule — and produces a compliance verdict.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nt_kK2DbhKslmAFFGdcKHg.png" /></figure><p>🔑 <strong>The Pattern: </strong>Interpreter means: define a set of rules or a grammar, and build a way to read and evaluate any input against those rules. It’s used when you have structured instructions or expressions that need to be methodically read and acted upon.</p><p><strong>🌍 Everyday example: </strong>A search bar with filters. You type: “flights Chennai to London under ₹50,000 next month direct only.” The system interprets each part — destination, price limit, timeframe, flight type — and returns matching results.</p><p><strong>💻 In software: </strong>A rule engine in a business application — for example, discount rules: “if customer is Gold tier AND order value exceeds ₹10,000 AND product is not excluded, apply 15% discount.” Each condition is a small interpreted expression. The Interpreter evaluates these rules at runtime, so business teams can change discount logic without any code deployment.</p><h3><strong>Final thought</strong></h3><p>Design patterns were not invented by one genius in one afternoon. They were discovered — noticed by thoughtful people who saw the same problems cropping up again and again, and recognised the same elegant solutions working again and again. They wrote those solutions down so nobody else would have to reinvent them. Just as a master builder passes their hard-won knowledge to an apprentice, design patterns are that knowledge — available to anyone willing to learn them.</p><p><a href="https://medium.com/@waibhav.deogade/%EF%B8%8F-part-1-creational-patterns-%EF%B8%8F-980eedec1f9a"><strong><em>Part 1: Creational Patterns</em></strong></a></p><p><a href="https://medium.com/@waibhav.deogade/%EF%B8%8F-part-2-structural-patterns-%EF%B8%8F-4c44dd15f9cb"><strong><em>Part 2: Structural Patterns</em></strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=44e7c39245e5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[️ Part 2: Structural Patterns ️]]></title>
            <link>https://medium.com/@waibhav.deogade/%EF%B8%8F-part-2-structural-patterns-%EF%B8%8F-4c44dd15f9cb?source=rss-82175c9b1339------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c44dd15f9cb</guid>
            <dc:creator><![CDATA[Waibhav Deogade]]></dc:creator>
            <pubDate>Sat, 25 Jul 2026 14:56:48 GMT</pubDate>
            <atom:updated>2026-07-26T16:57:50.212Z</atom:updated>
            <content:encoded><![CDATA[<h3>Structural Patterns: How Do We Connect the Pieces?</h3><p>You’ve got your walls, your floors, your roof, your plumbing, your electrics, your furniture. Now comes the next challenge: how do all of these things fit together? How do you connect a new extension to an old house? How do you make a small flat feel like it flows naturally? How do you hide all the messy pipes and wires behind clean walls?</p><p>Structural patterns are about the connections — how you assemble, link, and combine parts into something coherent and functional. They focus on the relationships between things.</p><h4><strong>Pattern 1: Adapter — The Travel Plug</strong></h4><p>You’ve just returned from living in the USA and brought your American laptop charger back to the UK. American plugs have two flat pins. UK sockets have three rectangular holes. Your charger will not fit. You don’t buy a new laptop. You don’t rewire your house. You buy a small travel adapter — a little device that sits between your plug and the socket, converting one format to the other. Both sides remain exactly as they were. The adapter does the translation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D1cq8zUG4t3yASBBvoOGuw.png" /></figure><p>🔑 <strong>The Pattern: </strong>Adapter means: when two things aren’t designed to work together, you put a translator in between. Neither side needs to change. The adapter handles the conversion.</p><p><strong>🌍 Everyday example: </strong>A language interpreter at a business meeting. The French executive and the Japanese CEO speak completely different languages. The interpreter sits between them, converting one to the other in real time. Neither executive has to learn the other’s language.</p><p><strong>💻 In software: </strong>Your new payment service speaks a modern JSON-based API, but your legacy accounting system expects XML in an old format. Rather than rewriting either, you write an Adapter that sits between them — it takes what the payment service sends, converts it, and passes it along in the format the accounting system understands. Both sides are untouched.</p><h4><strong>Pattern 2: Bridge — The Adjustable Bed Frame</strong></h4><p>Imagine you’re designing beds. You make them in three sizes (single, double, king) and in three materials (wood, metal, upholstered). That’s 9 combinations. If you designed a completely separate product for each combination, you’d have 9 entirely different beds to manage. A smarter approach: design the size separately from the material. The size design connects to — bridges to — any material design. Now adding a fourth size doesn’t mean creating 3 new products; it means creating one new size that connects to all three existing materials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lXbPD8rEhPcMIXgmoblpwA.png" /></figure><p>🔑 <strong>The Pattern: </strong>Bridge means: keep two things that vary independently — separate but connected by a bridge. Changing one side doesn’t force you to rebuild the other.</p><p><strong>🌍 Everyday example: </strong>A TV remote. The remote (the controller) works with multiple brands of TV (the device). Logitech makes one universal remote that bridges to hundreds of different TVs.</p><p><strong>💻 In software: </strong>A reporting system that produces reports in multiple formats (PDF, Excel, HTML) across multiple data sources (Sales, HR, Finance). Without Bridge, you’d need a separate class for every combination. With Bridge, the “report type” and the “output format” are designed independently and connected — adding a new format doesn’t touch any report logic.</p><h4><strong>Pattern 3: Composite — The Company Org Chart</strong></h4><p>You’re the CEO of a construction company. You want to send one message: “Everyone takes the day off on Friday.” You shouldn’t have to personally contact all 500 employees one by one. You tell your four division heads. Each division head tells their team managers. Each team manager tells their team members. The message cascades down. Here’s the clever part: you treated the division heads, the team managers, and the individual workers all the same way — as “<em>people who can receive a message and pass it on if they have people below them.</em>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4DKl9DagtmmpKqR7U_GWkQ.png" /></figure><p>🔑 <strong>The Pattern: </strong>Composite means: treat individuals and groups the same way. Give an instruction to one person or to a whole team — the same instruction works at any level of the hierarchy.</p><p><strong>🌍 Everyday example: </strong>Folders on your computer. A folder can contain files or other folders. When you copy a folder, everything inside copies too. You don’t need to handle files and folders differently; they both respond to the same “copy” action.</p><p><strong>💻 In software: </strong>A UI rendering system where a Button is a component and a Panel is also a component — but a Panel can contain other components (including other Panels). When you call render() on a Panel, it automatically calls render() on everything inside it, all the way down. A single “render the screen” call triggers the whole tree, no matter how deeply nested.</p><h4><strong>Pattern 4: Decorator — The Home Extension</strong></h4><p>You own a perfectly good house. You decide you want a conservatory. You don’t demolish the house and rebuild it from scratch with a conservatory included. You attach the conservatory to the existing house. The house stays exactly as it was. You’ve added something on top. Then a loft conversion. Then a garden room. Each addition wraps around the original, enhancing it without disturbing it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gHLktIyphyO6h2ZkRByv0A.png" /></figure><p>🔑 <strong>The Pattern: </strong>Decorator means: add new features by wrapping them around something that already exists, rather than changing the thing itself. Layer on enhancements as you need them.</p><p><strong>🌍 Everyday example: </strong>A plain coffee. Start with an espresso. Add milk — you’ve got a latte. Add flavoured syrup — decorated further. Add whipped cream on top. Each addition wraps around what was already there. The espresso underneath never changed.</p><p><strong>💻 In software: </strong>A data stream that you want to first compress, then encrypt, then log. Rather than writing one giant class that does all three, you wrap the base stream in a CompressionDecorator, then wrap that in an EncryptionDecorator, then in a LoggingDecorator. Each layer adds one concern; removing any layer doesn’t affect the others.</p><h4><strong>Pattern 5: Facade — The Hotel Concierge</strong></h4><p>You arrive at a large hotel. Behind the scenes, the hotel is an incredibly complex operation — 200 rooms, a kitchen, laundry service, a spa, a concierge desk, security, IT, cleaning rotas, room service, and more. You don’t need to understand any of it. You walk up to the concierge and say “I’d like dinner at 7pm and a taxi to the airport at 9am.” The concierge handles everything. You interacted with one friendly face, and a whole complex machine operated invisibly behind them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JKDutjtY1Ex6Bw0zrulJIA.png" /></figure><p>🔑 <strong>The Pattern: </strong>Facade means: provide one simple front door to a complicated system. The person using it only sees the simple interface. All the complexity is hidden behind it.</p><p><strong>🌍 Everyday example: </strong>Ordering food on an app like Swiggy or Zomato. You tap “Order.” Behind that one tap: your payment is processed, the restaurant is notified, a delivery driver is assigned, your location is confirmed, and a notification is scheduled. One button. Enormous complexity. You see none of it.</p><p><strong>💻 In software: </strong>A “PlaceOrder” method in an e-commerce system. Internally it coordinates the inventory service, the payment gateway, the shipping service, the email service, and the audit log. The calling code just invokes PlaceOrder() — it doesn’t know those five systems exist. The Facade shields everything behind one clean call.</p><h4><strong>Pattern 6: Flyweight — The Standard Brick</strong></h4><p>Imagine if every single brick in a building were custom-made — different size, different colour, different texture for each position. The cost would be astronomically wasteful. And completely pointless, because most of those bricks are identical. Instead, you manufacture one standard brick specification and produce millions of them. The only thing that varies is where each brick is placed — the brick itself is shared.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O43OEwTZpm94e9ah0u9MQg.png" /></figure><p>🔑 <strong>The Pattern: </strong>Flyweight means: when you have huge numbers of similar things, create one shared version of what’s common, and only vary what’s truly different per instance.</p><p><strong>🌍 Everyday example: </strong>Fonts on a webpage. The letter “e” appears thousands of times on a page. The computer stores the shape of “e” once, and simply reuses that shape wherever the letter appears — only its position on the page varies.</p><p><strong>💻 In software: </strong>A game map rendering 100,000 trees. Every pine tree looks the same — same texture, same shape, same colour. The Flyweight stores one shared Tree object with all that visual data. Each tree on the map only stores its unique position (x, y coordinates). Memory usage drops from storing 100,000 full objects to storing one object plus 100,000 coordinate pairs.</p><h4><strong>Pattern 7: Proxy — The Personal Assistant</strong></h4><p>A very senior partner at a law firm is brilliant but constantly busy. They cannot take every phone call, answer every email, or attend every routine meeting. If every small request went directly to them, they’d never get any real work done. So they have a personal assistant. The PA screens every incoming call. Simple requests — the PA handles directly. Only the genuinely important matters get escalated to the partner. The PA represents the partner, protects their time, and handles the rest.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eXpL9Qe3ro16jkjQtGISKA.png" /></figure><p>🔑 <strong>The Pattern: </strong>Proxy means: put a stand-in in front of something valuable to control, filter, or manage access to it. The stand-in handles routine things; only what truly matters reaches the real thing.</p><p><strong>🌍 Everyday example: </strong>A bouncer at a restaurant. Not everyone who shows up gets a table immediately. The bouncer checks if there’s a reservation and manages the waiting list. Only then do you get through to the dining room. The bouncer is the proxy.</p><p><strong>💻 In software: </strong>A caching proxy in front of a slow database. When something requests data, the proxy checks its cache first — if the data is there, it returns it instantly without touching the database. Only if the data is missing or stale does the request go through to the real database. Same interface, dramatically better performance for repeated reads.</p><p><a href="https://medium.com/@waibhav.deogade/%EF%B8%8F-part-1-creational-patterns-%EF%B8%8F-980eedec1f9a"><strong><em>Part 1: Creational Patterns</em></strong></a></p><p><a href="https://medium.com/@waibhav.deogade/part-3-behavioral-patterns-44e7c39245e5"><strong><em>Part 3: Behavioral Patterns</em></strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c44dd15f9cb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[️ Part 1: Creational Patterns ️]]></title>
            <link>https://medium.com/@waibhav.deogade/%EF%B8%8F-part-1-creational-patterns-%EF%B8%8F-980eedec1f9a?source=rss-82175c9b1339------2</link>
            <guid isPermaLink="false">https://medium.com/p/980eedec1f9a</guid>
            <dc:creator><![CDATA[Waibhav Deogade]]></dc:creator>
            <pubDate>Sat, 25 Jul 2026 14:56:27 GMT</pubDate>
            <atom:updated>2026-07-26T16:59:22.125Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Creational Patterns: How Do We Build the Thing?</strong></h3><p>Before you lay a single brick, someone has to answer the question: how exactly are we going to create this building? Who designs it? Who makes the parts? Do we build each piece from scratch, or do we use templates? Do different rooms get built in different ways?</p><p>Creational patterns are all about that first step — the act of creation. They make sure that the process of bringing something into existence is controlled, consistent, and doesn’t cause confusion down the line.</p><p>The big idea that ties all of them together is this: separate the act of creating something from the act of using it. You shouldn’t need to know how a door was made in order to open it.</p><h4><strong>Pattern 1: Singleton — The One Official Noticeboard</strong></h4><p>Imagine a busy construction site with 50 workers — electricians, plumbers, bricklayers, carpenters. The site manager posts daily instructions on a noticeboard. But here’s the problem: some workers made their own copies of yesterday’s notice and are working from those. One team is following the old fire escape plan. Another is using the outdated materials list. The site is chaos — not because the workers are bad at their jobs, but because there are multiple versions of the truth floating around. The fix is simple: there is ONE official noticeboard. If you want to know anything, you go to that board. No copies. No printed-out versions you take home. One board. Everyone reads from the same source.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ag-8SYC5SJzKDc8kKFqaKQ.png" /></figure><p>🔑 <strong>The Pattern: </strong>Singleton means: there is exactly one of something, and everyone shares it. When anyone needs it, they go to that one place. It’s never duplicated.</p><p><strong>🌍 Everyday example: </strong>The clock on your office wall. There’s one. Everyone glances at the same clock. If every person had their own clock set slightly differently, meetings would be a disaster. One clock, one truth.</p><p><strong>💻 In software: </strong>Think of a logging service in a system — the component that records every event and error. You want one logger, not fifty. If every part of the system created its own logger, you’d end up with scattered, inconsistent logs. The Singleton ensures the whole system writes to the same single logger.</p><h4><strong>Pattern 2: Factory Method — The Order Form</strong></h4><p>You’re managing a large housing estate. You need three types of homes built — standard brick houses, timber-frame cottages, and prefabricated flat-pack homes. Each type is built differently, uses different materials, and requires different skills. You don’t want to personally manage every detail of how each type gets built. You just want to say “I need five timber cottages” — and have someone else handle the specifics. So you create three specialised workshops. Each workshop knows exactly how to build its type of home. You fill in a standard order form and hand it to the right workshop. The workshop does the rest.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SyLb8SdUSCPITRSdlQ4yqw.png" /></figure><p>🔑 <strong>The Pattern: </strong>Factory Method means: you define a standard way to request something, and you leave it to a specialist “factory” to figure out exactly how to make it. You say what you want; the factory decides how to make it.</p><p><strong>🌍 Everyday example: </strong>You walk into a coffee shop and say “One flat white, please.” You don’t tell the barista how to steam the milk or what temperature to use. There’s a process behind the counter — you just place the order. The coffee shop is the factory.</p><p><strong>💻 In software: </strong>Imagine a notification system that can send alerts via email, SMS, or push notification. The calling code just says “send a notification” — it doesn’t know (or care) which delivery channel is used. A factory decides the right type based on the user’s settings and creates it. Adding a new channel (WhatsApp, say) means adding a new factory, nothing else changes.</p><h4><strong>Pattern 3: Abstract Factory — The Interior Design Package</strong></h4><p>You’ve just bought a new home and you want to furnish it. You want everything to look coordinated — the sofa, the curtains, the coffee table, the light fittings. If you go to five different shops and pick things randomly, you might end up with a Victorian chandelier above a plastic garden chair next to a Nordic minimalist bookshelf. It will look terrible. So instead, you walk into an interior design studio and say “I want the Scandinavian Modern package.” The studio gives you a sofa, curtains, table, and lights — all from the same design family. Everything matches. You didn’t pick each item; you picked a family.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bqBFQvOsOlkVNkb7jM0K6w.png" /></figure><p>🔑 <strong>The Pattern: </strong>Abstract Factory means: instead of creating each item one by one, you choose a “family” and get everything in that family at once — all guaranteed to be compatible with each other.</p><p><strong>🌍 Everyday example: </strong>Booking a holiday package — you choose “Beach Resort Package” and get flights, hotel, and transfers all bundled together and compatible. If you booked each part from a different provider, things might clash (your flight lands at midnight, but hotel check-in closes at 10pm). The package guarantees it all fits.</p><p><strong>💻 In software: </strong>A UI theme engine. When a user switches to Dark Mode, the system doesn’t swap one button colour — it swaps the whole family: buttons, backgrounds, input fields, icons, all produced by the “Dark Theme Factory.” Switch to Light Mode, and a different factory produces a matching set. No mix-and-match, no mismatched colours.</p><h4><strong>Pattern 4: Builder — The “Build Your Own” Order</strong></h4><p>You’re at a sandwich shop. You don’t want a pre-made sandwich — you want to build your own. Bread first (white or wholegrain?), then protein (chicken, tuna, or falafel?), then salad, then sauce. Step by step, choice by choice, you end up with exactly the sandwich you wanted — nothing you didn’t ask for, nothing missing that you did. If the shop only offered three fixed sandwiches on the menu, some customers would be happy and many wouldn’t. The “build your own” approach handles everyone.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hYs8PLSbi3Z8KdV2vIkDfw.png" /></figure><p>🔑 <strong>The Pattern: </strong>Builder means: you construct something complex step by step, making choices at each stage. The final result reflects exactly the decisions made along the way.</p><p><strong>🌍 Everyday example: </strong>Online pizza ordering. You choose the base, the sauce, the cheese, the toppings, the size, the crust. Each choice is a step. The same ordering process handles a plain margherita and a fully-loaded meat feast.</p><p><strong>💻 In software: </strong>Constructing a complex database query. Rather than writing one giant query string upfront, a Query Builder lets you add filters, sort orders, joins, and limits one by one — only including what this specific request needs. The result is assembled step by step, and two different callers can build two completely different queries using the same builder.</p><h4><strong>Pattern 5: Prototype — The Copy-Paste House</strong></h4><p>A housing developer builds a beautiful show home — fully furnished, beautifully decorated, every detail perfect. Now they need to build 200 more homes on the same estate with the same layout. Are they going to start from a blank sheet of paper 200 times? Of course not. They use the show home as the template. Copy it. Then let each new buyer personalise their own copy — change the paint colour here, upgrade the kitchen there — but start from the same foundation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ysCAfUm54zSmug_6IaClCw.png" /></figure><p>🔑 <strong>The Pattern: </strong>Prototype means: instead of building something from scratch every time, you copy an existing, working version and tweak the copy. Fast, reliable, consistent.</p><p><strong>🌍 Everyday example: </strong>CV templates. You find a great CV layout online and copy it. Then you fill in your own details. You didn’t design the layout yourself — you cloned a proven one and made it yours.</p><p><strong>💻 In software: </strong>When a user creates a “New Document from Template” in a document editor, the system clones a pre-configured template object rather than constructing a blank document piece by piece. The clone starts with the right fonts, margins, and placeholder text already in place. The user edits their own copy without touching the original template.</p><p><a href="https://medium.com/@waibhav.deogade/design-patterns-explained-through-everyday-analogies-no-code-required-b5708fa10f89"><strong><em>Main Page</em></strong></a></p><p><a href="https://medium.com/@waibhav.deogade/%EF%B8%8F-part-2-structural-patterns-%EF%B8%8F-4c44dd15f9cb"><strong><em>Part 2: Structural Patterns</em></strong></a></p><p><a href="https://medium.com/@waibhav.deogade/part-3-behavioral-patterns-44e7c39245e5"><strong><em>Part 3: Behavioral Patterns</em></strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=980eedec1f9a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Different Personalities in Project Meetings]]></title>
            <link>https://medium.com/@waibhav.deogade/understanding-different-personalities-in-project-meetings-a7e2eb65be40?source=rss-82175c9b1339------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7e2eb65be40</guid>
            <category><![CDATA[teamwork]]></category>
            <category><![CDATA[professional-growth]]></category>
            <category><![CDATA[team-productivity]]></category>
            <category><![CDATA[leadership]]></category>
            <category><![CDATA[learning-journey]]></category>
            <dc:creator><![CDATA[Waibhav Deogade]]></dc:creator>
            <pubDate>Sun, 28 Jun 2026 08:00:14 GMT</pubDate>
            <atom:updated>2026-06-28T08:00:14.421Z</atom:updated>
            <content:encoded><![CDATA[<p>This week, I spent some time learning about team dynamics and leadership from multiple sources, including articles, videos, and real workplace experiences. One topic that stood out to me was how different personalities participate in project meetings and how recognizing these patterns can help leaders build stronger, more productive teams.</p><p>Meetings are more than just discussions — they are where ideas are shared, decisions are made, and collaboration begins. However, simply attending a meeting does not guarantee meaningful participation. Every individual contributes differently based on their personality, experience, confidence, and current circumstances.</p><p>As leaders and team members, our goal should not be to change people. Instead, we should understand different working styles, leverage individual strengths, and create an environment where everyone can contribute effectively. When meetings are inclusive and well-managed, teams become more engaged, execution improves, and overall project productivity increases.</p><p>Below are eight common meeting personalities and the leadership lessons they offer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R_l_xGNeBMDK2-BJ9cekGg.png" /></figure><h3>1. The Nodder</h3><p>The Nodder is usually seated in the front row, listens carefully, and agrees with almost every point discussed. During the meeting, they appear fully aligned with every decision, making it easy to assume they completely understand and will execute everything.</p><p>However, agreement during a meeting does not always translate into action afterward.</p><p><strong>Example: </strong>A project manager explains a new reporting process. The Nodder enthusiastically agrees, but when the deadline arrives, the reports are either incomplete or never submitted.</p><h4>Leadership Lesson</h4><p>Agreement and execution are two different things. Effective leadership is not measured by how many people say “yes” during a meeting, but by how consistently actions are completed afterward. Regular follow-ups and clear ownership are the real indicators of progress.</p><h3>2. The WhatsApp Spy</h3><p>This person is physically present but mentally elsewhere. Their attention is divided between the meeting and their phone. If asked a question unexpectedly, they may ask for your opinion first and then quickly agree without fully understanding the discussion.</p><p><strong>Example: </strong>During a sprint planning meeting, someone spends most of the time responding to messages. Later, they forget the assigned tasks because they missed key decisions.</p><h4>Leadership Lesson</h4><p>Meeting attendance and meeting engagement are not the same. Leaders should encourage interaction by asking questions, inviting opinions, and involving participants throughout the discussion rather than allowing passive attendance.</p><h3>3. The Complaint King or Queen</h3><p>Whenever a new initiative, process, or assessment is introduced, this person immediately points out potential problems. Sometimes it may feel like every solution raises another concern in return.</p><p>Interestingly, not every complaint is negativity. Many experienced employees raise genuine concerns based on past experiences.</p><p><strong>Example: </strong>A new project management tool is introduced. While others welcome the change, one team member highlights adoption challenges experienced during a previous implementation. Their concerns help the team prepare better training.</p><h4>Leadership Lesson</h4><p>It is important to distinguish between negativity and genuine concern. One-on-one conversations often uncover valuable insights and clear misunderstandings that may not surface in larger meetings.</p><h3>4. The Meeting Star</h3><p>This individual speaks confidently, shares innovative ideas, participates in leadership programs, collaborates across teams, and often becomes highly visible during meetings. Their enthusiasm can create the impression that they are driving every initiative.</p><p>However, visibility does not always equal execution.</p><p><strong>Example: </strong>A team member proposes several creative solutions during meetings but contributes very little during implementation, while quieter colleagues complete most of the actual work.</p><h4>Leadership Lesson</h4><p>Meeting performance and execution are different skills. Leaders should appreciate strong communicators while also recognizing the quiet contributors who consistently deliver results behind the scenes.</p><h3>5. The Veteran</h3><p>The Veteran has years of experience and remembers the organization’s history. When a new idea is proposed, they often respond with, “We tried this five years ago.”</p><p>Although this may initially seem resistant to change, their perspective frequently comes from valuable experience.</p><p><strong>Example: </strong>A team plans to introduce a process previously attempted several years ago. The Veteran explains why it failed and suggests improvements based on lessons learned.</p><h4>Leadership Lesson</h4><p>Veterans carry valuable organizational knowledge. Rather than viewing them as obstacles, involve them as mentors. When experienced employees support a change, the rest of the team often follows with greater confidence.</p><h3>6. The Emotional Leaker</h3><p>Sometimes declining performance is not caused by a lack of commitment. Personal stress, family responsibilities, or health challenges may gradually affect someone’s energy, productivity, and ability to meet deadlines.</p><p><strong>Example: </strong>A consistently reliable employee begins missing deadlines after facing a family emergency. Instead of assuming poor performance, the manager checks in privately and offers temporary support while maintaining clear expectations.</p><h4>Leadership Lesson</h4><p>Not every performance issue is laziness. Compassion and accountability can coexist. Supporting employees through difficult times while maintaining clear expectations creates trust without compromising project goals.</p><h3>7. The Silent Assassin</h3><p>This person rarely disagrees during meetings. They are polite, respectful, and appear fully supportive. However, after the meeting ends, they express concerns privately, influencing colleagues and gradually building resistance.</p><p><strong>Example: </strong>During a planning meeting, they remain silent. Later, informal conversations begin spreading doubts about the proposed approach, eventually affecting team morale.</p><h4>Leadership Lesson</h4><p>Silence does not always mean agreement. Invite quieter team members to share their perspectives during meetings. Giving them ownership and involving them in solutions often reduces resistance and increases commitment.</p><h3>8. The Attendance Sprinter</h3><p>The Attendance Sprinter joins just before the meeting begins and leaves moments before it ends, often mentioning another urgent meeting. While technically present, they may miss important discussions, action items, or decisions.</p><p><strong>Example: </strong>Someone joins at 3:59 PM for a 4:00 PM meeting and leaves two minutes before action items are assigned, later asking for updates that were already discussed.</p><h4>Leadership Lesson</h4><p>Being present is more than marking attendance. Encourage participants to stay engaged throughout the meeting, especially during discussions about decisions, responsibilities, and next steps. A concise meeting summary can also help those with genuine scheduling conflicts.</p><h3>Final Leadership Reflection</h3><p>Leadership is not about changing every personality in the room.</p><p>It is about understanding different working styles, recognizing individual strengths, and managing challenges with <strong>fairness and empathy.</strong></p><p>Every personality brings something valuable:</p><ul><li>The Nodder reminds us to follow up.</li><li>The WhatsApp Spy reminds us to make meetings engaging.</li><li>The Complaint King or Queen helps us identify hidden risks.</li><li>The Meeting Star inspires ideas.</li><li>The Veteran preserves organizational knowledge.</li><li>The Emotional Leaker reminds us to lead with empathy.</li><li>The Silent Assassin highlights the importance of inclusion and ownership.</li><li>The Attendance Sprinter reminds us that participation matters more than presence.</li></ul><p><em>Great organizations are not built because every employee is perfect. They are built through strong systems, effective communication, and thoughtful leadership that enables people with different personalities to work together successfully.</em></p><p>When leaders understand these meeting dynamics, meetings become more productive, collaboration improves, and teams are better equipped to turn discussions into meaningful results.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7e2eb65be40" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[One Trace to Rule Them All: End-to-End Observability for Spring Boot with OpenTelemetry]]></title>
            <link>https://medium.com/@waibhav.deogade/one-trace-to-rule-them-all-end-to-end-observability-for-spring-boot-with-opentelemetry-c2504e6083bb?source=rss-82175c9b1339------2</link>
            <guid isPermaLink="false">https://medium.com/p/c2504e6083bb</guid>
            <category><![CDATA[observability]]></category>
            <category><![CDATA[distributed-tracing]]></category>
            <category><![CDATA[opentelemetry]]></category>
            <dc:creator><![CDATA[Waibhav Deogade]]></dc:creator>
            <pubDate>Sat, 13 Jun 2026 18:08:52 GMT</pubDate>
            <atom:updated>2026-06-14T04:02:29.866Z</atom:updated>
            <content:encoded><![CDATA[<p>This article walks through a complete, vendor-neutral setup: two Spring Boot services instrumented with the OpenTelemetry Java agent, an OpenTelemetry Collector in the middle, and a choice of backends — <strong>SigNoz, Datadog, Jaeger, or Grafana + Tempo </strong>— on the far end. By the end, you’ll understand not just <em>what</em> the pieces are, but <em>why</em> they fit together the way they do.</p><h4><strong>The three pillars (and the thing that connects them)</strong></h4><p>Most observability conversations start with the three pillars: <strong><em>traces, logs, and metrics</em></strong>. They’re worth defining precisely, because each answers a different question.</p><p><strong>Trace:</strong> tells you what happened to one request as it moved across services. It’s a tree of spans, where each span is one unit of work — an HTTP handler, a database query, a call to another service. A trace answers <em>”where did this request spend its time, and where did it fail?”</em></p><p><strong>Logs:</strong> are the timestamped narrative your code emits: <em>handling order ORD-5</em>, <em>invoice not found</em>, <em>retrying.</em> They answer,<em>” What was the service thinking at this exact moment?”</em></p><p><strong>Metrics:</strong> are aggregated numbers over time: request rate, error rate, and p99 latency. <em>They answer that the system is healthy right now, and is it getting worse? </em>A common framing here is <strong>RED</strong> — Rate, Errors, and Duration — three numbers that summarize the health of any request-driven service.</p><p>The pillars are useful, but the real magic is what links them. In this setup, every log line carries the <strong><em>trace_id</em></strong> and <strong><em>span_id</em></strong> of the request that produced it. That single decision is what turns three separate tools into one investigation: you see a slow trace, click into it, and immediately read the exact log lines that the service emitted <em>during that span</em>. No timestamp archaeology required.</p><h4><strong>The architecture at a glance</strong></h4><p>Here’s the shape of the system, following a request from left to right:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J65IoL465dUAaj2PjqA0eg.png" /></figure><p>The <strong>order-service</strong> handles it and makes an internal HTTP call to <strong>invoice-service</strong> to fetch invoice details. Both services run Spring Boot with Logback for logging. Both have the OpenTelemetry Java agent attached. The agent emits telemetry over OTLP — the OpenTelemetry Protocol — to a central Collector, which processes the data and fans it out to one or more backends.</p><p>The key design principle: <strong>your application code stays clean.</strong> The instrumentation lives in the agent and the Collector, not scattered through your business logic.</p><h4><strong>Step 1: Instrument the services without touching the code</strong></h4><p>The OpenTelemetry Java agent (opentelemetry-javaagent.jar) is a JVM agent you attach at startup. It uses bytecode instrumentation to wrap popular libraries automatically — Spring MVC, RestTemplate, WebClient, JDBC, and dozens more. You don’t add tracing annotations or import a tracing SDK into your controllers. You just start the JVM with one extra flag:</p><pre>java -javaagent:./opentelemetry-javaagent.jar \<br>-Dotel.service.name=order-service \<br>-Dotel.exporter.otlp.endpoint=http://localhost:4317 \<br>-jar order-service.jar</pre><p>The agent does three jobs:</p><p>1. <strong>Auto-instrumentation -</strong> It creates spans for incoming HTTP requests and outgoing calls automatically.</p><p>2. <strong>Context propagation -</strong> When <em>order-service</em> calls <em>invoice-service</em>, the agent injects a traceparent header into the outgoing HTTP request. The receiving agent reads that header and continues the <em>same</em> trace. This is the mechanism that lets one trace span multiple services.</p><p>3. <strong>Trace and span creation -</strong> Each unit of work becomes a span with timing, status, and attributes.</p><p>That traceparent header is the unsung hero of distributed tracing. It’s a small string that carries the trace ID and parent span ID across the network, so two completely separate processes can contribute to one coherent picture.</p><h4><strong>Step 2: Make logs join the party</strong></h4><p>Auto-instrumentation handles traces and metrics, but your logs need a small nudge to become correlated. The fix is to log in a structured format — JSON — and include the active trace context in every line. With Logback and a JSON encoder, each log entry comes out looking like this:</p><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>&lt;configuration&gt;<br>    &lt;springProperty scope=&quot;context&quot; name=&quot;appName&quot; source=&quot;spring.application.name&quot; defaultValue=&quot;order-service&quot;/&gt;<br><br>    &lt;appender name=&quot;STDOUT&quot; class=&quot;ch.qos.logback.core.ConsoleAppender&quot;&gt;<br>        &lt;encoder class=&quot;net.logstash.logback.encoder.LogstashEncoder&quot;&gt;<br>            &lt;customFields&gt;{&quot;service&quot;:&quot;${appName}&quot;}&lt;/customFields&gt;<br>        &lt;/encoder&gt;<br>    &lt;/appender&gt;<br><br>    &lt;root level=&quot;INFO&quot;&gt;<br>        &lt;appender-ref ref=&quot;STDOUT&quot;/&gt;<br>    &lt;/root&gt;<br>&lt;/configuration&gt;</pre><pre>{<br>    &quot;@timestamp&quot;: &quot;2026–06–13T13:19:49.648Z&quot;,<br>    &quot;message&quot;: &quot;handling order ORD-5&quot;,<br>    &quot;level&quot;: &quot;INFO&quot;,<br>    &quot;service&quot;: &quot;order-service&quot;,<br>    &quot;trace_id&quot;: &quot;93f65d8ec4d94381fdb6914a0e99e84b&quot;,<br>    &quot;span_id&quot;: &quot;222188eec6c89c26&quot;,<br>    &quot;trace_flags&quot;: &quot;03&quot;<br>}</pre><p>The OpenTelemetry agent automatically injects <em>trace_id</em>, <em>span_id</em>, and <em>trace_flags</em> into the logging MDC (Mapped Diagnostic Context), so your encoder can pick them up with no manual plumbing. The service writes this JSON to stdout, which is exactly where you want it in a containerized world — the platform collects stdout, and the Collector (or a log shipper) forwards it on.</p><p>Why JSON instead of a friendly one-line format? Because machines read these logs as much as humans do. Structured fields are queryable:</p><blockquote>“show me every `ERROR` from `invoice-service` where `trace_id` = X”</blockquote><p>It is a clean query against JSON, and an unreliable regex against free text.</p><h4><strong>Step 3: The Collector — the part everyone underestimates</strong></h4><p>You <em>could</em> point each service directly at a backend. You shouldn’t. The OpenTelemetry Collector is a standalone process that sits between your services and your backends, and it pays for itself almost immediately. It has a simple three-stage pipeline.</p><p><strong>a. Receivers -</strong> accept incoming telemetry. The standard is OTLP over two transports: gRPC on port `4317` and HTTP on port `4318`. Your agents talk to one of these.</p><p><strong>b. Processors -</strong> transform data in flight. A few you’ll almost always want:</p><ul><li><strong>batch</strong> groups telemetry into batches before export, which dramatically cuts network overhead.</li><li><strong><em>memory_limiter</em></strong> protects the Collector from running out of memory under load by dropping data rather than crashing.</li><li><strong><em>resourcedetection</em></strong> enriches spans with environment metadata (cloud region, host, container).</li><li><strong><em>attributes</em></strong> lets you add, rename, or redact fields — handy for stripping PII before it leaves your network.</li><li><strong><em>spanmetrics</em></strong> is the clever one: it <em>*derives*</em> RED metrics directly from your spans. You get request rate, error rate, and latency for free, computed from traces you were already collecting.</li></ul><p><strong>c. Exporters </strong>send the processed data onward. The same data can go to several places at once.</p><p>A minimal <strong><em>otel-collector-config.yaml</em></strong> ties it together:</p><pre>receivers:<br>  otlp:<br>    protocols:<br>      grpc:<br>        endpoint: 0.0.0.0:4317<br>      http:<br>        endpoint: 0.0.0.0:4318<br><br>processors:<br>  memory_limiter:<br>    check_interval: 1s<br>    limit_mib: 512<br>  batch: {}<br>  resourcedetection:<br>    detectors: [env, system]<br><br>exporters:<br>  otlp/jaeger:<br>    endpoint: jaeger:4317<br>    tls:<br>      insecure: true<br>  # add datadog, signoz, grafana/tempo exporters here<br><br>service:<br>  pipelines:<br>    traces:<br>      receivers: [otlp]<br>      processors: [memory_limiter, resourcedetection, batch]<br>      exporters: [otlp/jaeger]<br>    metrics:<br>      receivers: [otlp]<br>      processors: [memory_limiter, batch]<br>      exporters: [otlp/jaeger]</pre><p>The strategic value here is <strong>decoupling.</strong> Your services emit OTLP and know nothing about where the data ends up. Want to switch from Datadog to a self-hosted stack? Change the Collector config, redeploy one component, and you’re done. No application redeploys, no code changes. That single property is why the Collector is worth running even for a two-service setup.</p><h4><strong>Step 4: Pick a backend (or several)</strong></h4><p>Because everything speaks OTLP, your backend becomes a swappable choice rather than a lock-in. Four common options, each with a different trade-off:</p><p><strong>SigNoz</strong> is an open-source, self-hosted platform that stores traces, logs, and metrics in ClickHouse and gives you a single UI for all three. It’s a strong “one tool to run yourself” option, with RED metrics derived from spans out of the box.</p><p><strong>Datadog</strong> is the fully-managed SaaS choice. You point the Collector’s Datadog exporter at it with a `DD_API_KEY` and get traces, logs, and metrics in a polished, deeply-featured product — at a cost that scales with your data volume.</p><p><strong>Jaeger</strong> is a long-standing open-source tracing tool. It’s focused and excellent at trace search and dependency visualization, accepts OTLP natively, and is a great pick when traces are your primary concern.</p><p><strong>Grafana + Tempo</strong> stores traces in Tempo and visualizes them in Grafana, which many teams already run for metrics and dashboards. If Grafana is your home base, keeping traces in the same UI is a natural fit.</p><p>The honest answer to “which one?” is that it depends on whether you want to operate the infrastructure yourself, how much you’ll pay for managed convenience, and whether you need all three pillars in one pane of glass or just great traces. The point of this architecture is that you don’t have to decide forever. You can even send to two at once — Jaeger for free local trace search and Datadog for production — and migrate gradually.</p><h4><strong>Putting it together: debugging that timeout</strong></h4><p>Back to our opening scenario. With this stack in place, the investigation looks completely different:</p><ol><li>A metrics dashboard (RED, derived by spanmetrics) shows error rate climbing on `order-service`.</li><li>You open the trace view and find a slow trace. It clearly shows order-service waiting on invoice-service, which waited on a database query that timed out — with the exact span highlighted in red.</li><li>You click that span. Because the logs carry the same trace_id, you instantly see the log lines invoice-service emitted during that request: a connection-pool-exhausted warning.</li></ol><p>Three pillars, one click each, one coherent story. That’s the entire promise of observability, and OpenTelemetry is how you get it without betting your codebase on a single vendor.</p><h4>How does the same trace_id propagate from Service A → B → C?</h4><p>This is called context propagation and uses HTTP headers. The standard header: traceparent (W3C TraceContext spec)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AWsAwV_JNau-lprTT1yoDw.png" /></figure><h4><strong>A few hard-won lessons</strong></h4><p>A handful of things the tutorials tend to gloss over:</p><ul><li><strong>Run the Collector, even for small systems:</strong> The decoupling and batching are worth it from day one, and retrofitting it later is more painful than starting with it.</li><li><strong>Standardize service.name early:</strong> It’s the field everything groups by. Inconsistent service names turn a clean dependency graph into spaghetti.</li><li><strong>Sample deliberately:</strong> At scale, you won’t keep 100% of traces. Decide on a sampling strategy (head-based, tail-based, or error-biased) before your bill or storage tells you to.</li><li><strong>Treat instrumentation as a platform concern: </strong>The agent and Collector config belong in your shared deployment tooling, not copy-pasted per service. Consistency is what makes the data trustworthy.</li></ul><h4>Complete Request Life Cycle</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bGt6IbIiu4Ufg2U54q8TEQ.png" /></figure><h4><strong>Wrapping up</strong></h4><p>The architecture is deliberately boring in the best way: instrument with an agent so application code stays clean, route everything through a Collector so backends stay swappable, log in JSON with trace context so the three pillars correlate, and pick whichever backend matches your budget and operational appetite. OpenTelemetry’s real contribution isn’t any single feature — it’s the standard interface that makes all these pieces interchangeable.</p><p>Start with one Collector and one backend. Get a single trace flowing end-to-end across two services. Once you’ve watched a request light up across your whole system in one view, you won’t want to debug any other way.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c2504e6083bb" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>