<?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 Sowndapan M V on Medium]]></title>
        <description><![CDATA[Stories by Sowndapan M V on Medium]]></description>
        <link>https://medium.com/@sowndapan14?source=rss-5c1bbfa15c18------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*XI5McU0vhnz5L6PG4El1Wg.png</url>
            <title>Stories by Sowndapan M V on Medium</title>
            <link>https://medium.com/@sowndapan14?source=rss-5c1bbfa15c18------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 10:42:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sowndapan14/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[AI Memory Isn’t a Database — But It Has Many of the Same Design Challenges]]></title>
            <link>https://medium.com/@sowndapan14/ai-memory-isnt-a-database-but-it-has-many-of-the-same-design-challenges-742c14c46b14?source=rss-5c1bbfa15c18------2</link>
            <guid isPermaLink="false">https://medium.com/p/742c14c46b14</guid>
            <category><![CDATA[ai-memory]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Sowndapan M V]]></dc:creator>
            <pubDate>Sat, 11 Jul 2026 09:36:10 GMT</pubDate>
            <atom:updated>2026-07-11T09:36:10.813Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rAY6PcFvahI_gOvYUlcbXg.png" /></figure><h3>Why building intelligent applications is becoming a memory engineering problem.</h3><p>When ChatGPT remembers your previous message…</p><p>When an AI coding assistant recalls files you opened earlier…</p><p>When an AI support agent remembers the customer’s last conversation…</p><p>It feels like magic.</p><p>In reality, it’s memory engineering.</p><p>And I believe it’s becoming one of the most important backend engineering problems in AI systems.</p><h3>We Used to Think AI Was Just About Models</h3><p>When Large Language Models first became popular, many engineers focused on choosing the right model.</p><p>GPT.</p><p>Claude.</p><p>Gemini.</p><p>Llama.</p><p>But after building real AI applications, teams discovered something surprising.</p><p>The model often isn’t the biggest challenge.</p><p>Memory is.</p><p>Without memory, an LLM is surprisingly forgetful.</p><p>Every request starts from scratch unless you explicitly provide context.</p><h3>The Memory Problem</h3><p>Imagine asking an AI travel assistant:</p><blockquote><em>Plan a trip to Japan.</em></blockquote><p>A minute later:</p><blockquote><em>Make it under $2,000.</em></blockquote><p>Later:</p><blockquote><em>I prefer direct flights.</em></blockquote><p>And finally:</p><blockquote><em>Book the first option.</em></blockquote><p>For the final request to make sense, the system needs to remember:</p><ul><li>the destination</li><li>the budget</li><li>the preferred flight type</li><li>the shortlisted itinerary</li></ul><p>None of this lives inside the model.</p><p>Your application has to manage it.</p><h3>Memory Comes in Different Forms</h3><p>Not every piece of information deserves to be remembered forever.</p><p>That’s why AI systems typically separate memory into different layers.</p><h3>Short-Term Memory</h3><p>This is the working memory for the current interaction.</p><p>Examples:</p><ul><li>current conversation</li><li>intermediate reasoning</li><li>tool outputs</li><li>temporary variables</li></ul><p>It disappears when the task ends.</p><p>Think of it as RAM for an AI application.</p><h3>Long-Term Memory</h3><p>Some information should survive future conversations.</p><p>Examples:</p><ul><li>preferred language</li><li>timezone</li><li>favorite airline</li><li>notification preferences</li></ul><p>This is usually stored outside the model in persistent storage.</p><h3>Semantic Memory</h3><p>Sometimes you don’t want exact matches.</p><p>You want related information.</p><p>Example:</p><p>User asks:</p><blockquote><em>Show me restaurants similar to the Italian place I liked last month.</em></blockquote><p>The application isn’t searching for identical text.</p><p>It’s searching for similar meaning.</p><p>This is where embeddings and vector search become valuable.</p><h3>The Context Window Is the New Cache</h3><p>Traditional applications have cache limits.</p><p>AI applications have context limits.</p><p>Every model has a maximum number of tokens it can process.</p><p>If you keep sending the entire conversation forever:</p><ul><li>latency increases</li><li>token cost increases</li><li>response quality often decreases</li></ul><p>Eventually something has to go.</p><p>Just like a cache.</p><h3>Memory Eviction Is Suddenly an Engineering Decision</h3><p>Suppose an AI assistant has 500 previous messages.</p><p>Which ones should stay?</p><p>The newest?</p><p>The most important?</p><p>The most frequently referenced?</p><p>The ones explicitly marked by the user?</p><p>Sound familiar?</p><p>Backend engineers have solved similar questions for decades.</p><p>LRU.</p><p>LFU.</p><p>TTL.</p><p>AI systems now face comparable decisions — except the unit isn’t cached data, it’s conversational context.</p><h3>Context Compression</h3><p>Instead of keeping every interaction, many systems periodically summarize conversations.</p><p>For example:</p><p>Instead of storing:</p><pre>200 chat messages</pre><p>The system stores:</p><pre>Customer prefers economy flights.</pre><pre>Budget under $2,000.</pre><pre>Travels with family.</pre><pre>Prefers morning departures.</pre><p>A good summary preserves meaning while consuming far fewer tokens.</p><p>This reduces cost without losing important context.</p><h3>Retrieval Is Replacing “Load Everything”</h3><p>Early AI applications often sent every available document to the model.</p><p>That doesn’t scale.</p><p>Modern systems retrieve only what’s relevant.</p><p>Questions become:</p><ul><li>Which memories matter?</li><li>Which documents should be retrieved?</li><li>How many are enough?</li><li>How fresh should they be?</li></ul><p>This starts to resemble query optimization more than prompt engineering.</p><h3>Memory Has to Stay Fresh</h3><p>Imagine a customer changes their preferred language from English to Japanese.</p><p>If the AI continues responding in English because it retrieved stale information, the experience degrades.</p><p>Memory isn’t useful if it isn’t current.</p><p>Keeping memory synchronized becomes just as important as storing it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jxIMowiySBFXZUTEFVdAvQ.png" /></figure><h3>The Architecture Is Changing</h3><p>A typical AI application today looks less like this:</p><pre>Client<br>↓<br>LLM<br>↓<br>Response</pre><p>and more like this:</p><pre>Client<br>↓<br>Memory Layer<br>↓<br>Retriever<br>↓<br>LLM<br>↓<br>Tools<br>↓<br>Memory Update<br>↓<br>Response</pre><p>The model becomes only one component in a much larger system.</p><h3>What This Means for Backend Engineers</h3><p>Many of the challenges are surprisingly familiar.</p><p>We’re still thinking about:</p><ul><li>persistence</li><li>indexing</li><li>retrieval</li><li>consistency</li><li>latency</li><li>cache management</li><li>lifecycle</li><li>cost</li></ul><p>The difference is that we’re managing knowledge instead of rows.</p><h3>Final Thoughts</h3><p>A few years ago, choosing the right database was one of the biggest architectural decisions in an application.</p><p>Today, building AI systems introduces a new question:</p><blockquote><strong><em>How should this application remember?</em></strong></blockquote><p>The answer isn’t hidden inside the LLM.</p><p>It’s hidden in the memory layer you design around it.</p><p>As AI applications become more capable, I believe memory engineering will become just as important as database engineering.</p><p>Because intelligence isn’t only about generating good answers.</p><p>It’s also about remembering the right things — and forgetting the right things.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=742c14c46b14" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HTTP QUERY: The Missing HTTP Method We Didn’t Know We Needed]]></title>
            <link>https://medium.com/@sowndapan14/http-query-the-missing-http-method-we-didnt-know-we-needed-cd5ec89a81e5?source=rss-5c1bbfa15c18------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd5ec89a81e5</guid>
            <category><![CDATA[https]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[query]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[protocol]]></category>
            <dc:creator><![CDATA[Sowndapan M V]]></dc:creator>
            <pubDate>Sat, 04 Jul 2026 12:20:37 GMT</pubDate>
            <atom:updated>2026-07-04T12:20:37.238Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QTBG3Z84W3TBtKbeCdhGPg.png" /></figure><p><em>For decades, backend engineers have been forced to choose between two imperfect options: GET or POST. HTTP QUERY finally gives us a third choice.</em></p><h3>Every Backend Engineer Has Written This API</h3><p>Imagine you’re building a ticket search endpoint.</p><p>Users want to search using:</p><ul><li>Status</li><li>Priority</li><li>Assignee</li><li>Date ranges</li><li>Labels</li><li>Full-text keywords</li><li>Multiple sorting options</li><li>Pagination</li></ul><p>Your first attempt probably looks like this:</p><pre>GET /tickets?status=open&amp;priority=high&amp;assignee=alice&amp;created_after=2026-01-01&amp;labels=bug,customer&amp;sort=-updated&amp;page=2</pre><p>Looks fine.</p><p>Until Product asks for:</p><ul><li>Nested filters</li><li>OR conditions</li><li>Multiple date ranges</li><li>Dynamic field selection</li><li>Custom search rules</li></ul><p>Suddenly your URL becomes…</p><pre>GET /tickets?filter[0][field]=status&amp;filter[0][operator]=in&amp;filter[0][values]=open,pending&amp;filter[1][field]=priority...</pre><p>Nobody enjoys debugging URLs like this.</p><h3>The “POST for Search” Pattern</h3><p>Eventually most teams give up.</p><p>Instead they write:</p><pre>POST /tickets/search</pre><p>with</p><pre>{<br>  &quot;filters&quot;: {<br>    &quot;status&quot;: [&quot;open&quot;,&quot;pending&quot;],<br>    &quot;priority&quot;: [&quot;high&quot;],<br>    &quot;assignee&quot;: &quot;alice&quot;<br>  },<br>  &quot;sort&quot;: &quot;-updated&quot;,<br>  &quot;page&quot;: 2<br>}</pre><p>Much cleaner.</p><p>Almost every large application does this.</p><p>But something always feels wrong.</p><p>You’re not creating anything.</p><p>You’re just reading data.</p><p>Yet you’re using POST.</p><p>Why?</p><p>Because GET wasn’t designed for complex request bodies.</p><h3>The Problem Was Never About URLs</h3><p>People often think this is about URL length.</p><p>That’s only part of the story.</p><p>The real issue is HTTP semantics.</p><p>GET means:</p><blockquote><em>This operation is safe.</em></blockquote><p>POST means:</p><blockquote><em>This request may change server state.</em></blockquote><p>Searching tickets…</p><p>Searching products…</p><p>Searching invoices…</p><p>These don’t modify anything.</p><p>They’re read operations.</p><p>Yet for years we’ve been telling our APIs:</p><blockquote><em>“Pretend this search is a POST.”</em></blockquote><p>HTTP never had a standard way to express:</p><blockquote><em>“This is a read operation, but I need to send a request body.”</em></blockquote><p>Until now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q5KQeVfs8aQNz8eLJc2Osw.png" /></figure><p>The newly standardized <strong>QUERY</strong> method fills exactly this gap. It allows clients to send a request body while preserving the semantics of a <strong>safe and idempotent</strong> operation.</p><p>Instead of:</p><pre>POST /tickets/search</pre><p>we can now express the intent more accurately:</p><pre>QUERY /tickets</pre><p>with</p><pre>{<br>  &quot;filters&quot;: {<br>    &quot;status&quot;: [&quot;open&quot;,&quot;pending&quot;],<br>    &quot;priority&quot;: [&quot;high&quot;]<br>  },<br>  &quot;sort&quot;: &quot;-updated&quot;<br>}</pre><p>The API now communicates exactly what it is doing:</p><p>“I’m querying data.”</p><p>Nothing more.</p><p>Nothing less.</p><h3>Why This Matters</h3><p>At first glance it looks like a tiny addition.</p><p>It isn’t.</p><p>QUERY separates <strong>what a request does</strong> from <strong>how much information it needs</strong>.</p><p>For years we associated:</p><ul><li>GET → Read</li><li>POST → Body</li></ul><p>QUERY breaks that unnecessary coupling.</p><p>Now we have:</p><pre>Method Request Body           Safe                           Typical Purpose<br>GET    Usually URL parameters ✅                              Read<br>POST   Yes                    ❌ Potentially modifies state   Create / Execute<br>QUERY  Yes                    ✅                              Complex reads</pre><p>This is arguably a more expressive HTTP model.</p><h3>A Creative Example</h3><p>Imagine you’re building a travel platform.</p><p>A customer searches for:</p><ul><li>Flights</li><li>Hotels</li><li>Budget below $2000</li><li>Beach destination</li><li>Departure within two weeks</li><li>Airline preference</li><li>Refundable tickets only</li></ul><p>Representing that in a URL quickly becomes awkward.</p><p>With QUERY:</p><pre>QUERY /travel/search</pre><pre>{<br>  &quot;budget&quot;: 2000,<br>  &quot;tripType&quot;: &quot;beach&quot;,<br>  &quot;departureWindow&quot;: {<br>    &quot;from&quot;: &quot;2026-08-01&quot;,<br>    &quot;to&quot;: &quot;2026-08-14&quot;<br>  },<br>  &quot;airlines&quot;: [<br>    &quot;Singapore Airlines&quot;,<br>    &quot;Emirates&quot;<br>  ],<br>  &quot;hotelRating&quot;: 4,<br>  &quot;refundable&quot;: true<br>}</pre><p>The request remains a read operation.</p><p>The payload stays structured.</p><p>The intent remains obvious.</p><h3>Another Example Backend Engineers Will Appreciate</h3><p>Suppose your analytics API supports:</p><ul><li>20 dimensions</li><li>15 metrics</li><li>Dynamic grouping</li><li>Nested filters</li><li>Aggregations</li><li>Time windows</li></ul><p>Today’s API often becomes:</p><pre>POST /analytics/query</pre><p>Tomorrow it could naturally become:</p><pre>QUERY /analytics</pre><p>The API becomes easier to understand because the HTTP method reflects the business operation.</p><h3>What Problems Does QUERY Actually Solve?</h3><p>Not everything.</p><p>But it addresses several long-standing issues.</p><h3>✅ Complex query payloads</h3><p>No more forcing nested JSON into query strings.</p><h3>✅ Correct HTTP semantics</h3><p>Searches are reads. Reads should look like reads.</p><h3>✅ Safe retries</h3><p>Since QUERY is defined as safe and idempotent, intermediaries and clients can reason about retries more confidently than with POST.</p><h3>✅ Better API readability</h3><p>Developers immediately understand:</p><blockquote><em>QUERY means “I’m asking for information.”</em></blockquote><p>Not:</p><blockquote><em>Maybe this modifies data.</em></blockquote><h3>What QUERY Doesn’t Solve</h3><p>It’s equally important to understand what QUERY is <strong>not</strong>.</p><p>It is <strong>not</strong>:</p><ul><li>A replacement for POST</li><li>A replacement for GraphQL</li><li>A replacement for REST</li><li>A performance optimization</li><li>A solution to authorization or validation</li></ul><p>It simply gives HTTP a missing semantic that many APIs have wanted for years.</p><h3>Should You Use It Today?</h3><p>Not necessarily.</p><p>Although QUERY is now standardized, ecosystem support is still evolving.</p><p>Frameworks, API gateways, reverse proxies, load balancers, SDKs, and developer tooling may take time to adopt the new method consistently.</p><p>For many production systems, POST-based search endpoints will remain the pragmatic choice for some time.</p><p>That doesn’t make QUERY unimportant.</p><p>Many protocol improvements take years before they become commonplace.</p><h3>Final Thoughts</h3><p>One of the things I enjoy about backend engineering is that sometimes the biggest improvements aren’t new databases or faster algorithms.</p><p>Sometimes they’re small protocol changes that fix decades-old design compromises.</p><p>HTTP QUERY is one of those changes.</p><p>It doesn’t replace GET.</p><p>It doesn’t replace POST.</p><p>Instead, it fills the semantic gap between them.</p><p>Whether it becomes widely adopted or not, it represents an important step toward APIs that communicate intent more clearly.</p><p>And in software architecture, clarity is often just as valuable as capability.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd5ec89a81e5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ From LLMs to Agentic AI: Understanding the Building Blocks of Autonomous Systems ]]></title>
            <link>https://medium.com/@sowndapan14/from-llms-to-agentic-ai-understanding-the-building-blocks-of-autonomous-systems-09bd832314ea?source=rss-5c1bbfa15c18------2</link>
            <guid isPermaLink="false">https://medium.com/p/09bd832314ea</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[ai-workflow]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <dc:creator><![CDATA[Sowndapan M V]]></dc:creator>
            <pubDate>Sat, 27 Jun 2026 06:37:07 GMT</pubDate>
            <atom:updated>2026-06-27T06:37:07.256Z</atom:updated>
            <content:encoded><![CDATA[<p>Why modern AI systems are starting to look more like distributed systems than traditional applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bIyOSI-sVBQg8z839xSbXg.png" /></figure><h3>AI Is Evolving Beyond Text Generation</h3><p>Over the last year, terms such as <strong>LLM</strong>, <strong>Agent</strong>, <strong>Agentic AI</strong>, <strong>Workflow</strong>, and <strong>Graph-based execution</strong> have become increasingly common.</p><p>At first glance, they all seem interchangeable.</p><p>In reality, they solve different problems and operate at different levels of autonomy.</p><p>As backend engineers, understanding these concepts is becoming important because AI applications are gradually adopting many principles we’ve already encountered while building distributed systems.</p><p>Let’s break them down.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XnleWc3hWT-xWYwKLh__rw.png" /></figure><p>Large Language Models are fundamentally prediction engines.</p><p>They generate tokens based on patterns learned during training.</p><p>They excel at:</p><ul><li>Summarization</li><li>Translation</li><li>Content generation</li><li>Question answering</li><li>Code generation</li></ul><p>However, an LLM by itself cannot interact with external systems.</p><p>For example,</p><blockquote><em>What is the area of a rectangle with length 10 and width 5?</em></blockquote><p>The model can answer this directly.</p><p>But if we ask,</p><blockquote><em>What is the current stock price of Apple?</em></blockquote><p>It cannot reliably know.</p><p>Because it has no mechanism to access real-time information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XgR_E0jqzab2xFG9pskMNA.png" /></figure><p>An <strong>Agent</strong> extends an LLM with the ability to reason and interact with external tools.</p><p>Unlike a standalone LLM, an agent can decide:</p><ul><li>Which tool to use</li><li>When to invoke it</li><li>What parameters to provide</li><li>How to use the returned result</li></ul><p>Examples include coding assistants such as Cursor and Claude Code.</p><p>Suppose a user asks:</p><blockquote><em>Calculate the area of a rectangle with length 10 and width 5</em></blockquote><p>Instead of estimating the answer, the agent may invoke a calculator tool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6kR4fcRrlIHOgSvMbgaNLA.png" /></figure><p>Agentic AI represents systems with a higher degree of autonomy.</p><p>These systems can:</p><ul><li>Plan multiple steps</li><li>Interact with several tools</li><li>Maintain execution state</li><li>Recover from failures</li><li>Ask for clarification</li><li>Adjust plans based on intermediate outcomes</li></ul><p>Imagine asking an assistant:</p><blockquote><em>Plan a 5-day trip to Japan within a budget of $2000</em></blockquote><p>The system might:</p><ul><li>Search flights</li><li>Compare hotels</li><li>Detect unavailable options</li><li>Retry with alternate dates</li><li>Ask for approval</li><li>Continue execution</li></ul><p>While powerful, this flexibility introduces engineering challenges.</p><h3>Challenge 1 — Non-Deterministic Execution</h3><p>Traditional software generally behaves predictably.</p><p>The same input produces the same output.</p><p>Agentic systems often exhibit non-deterministic behavior because planning decisions depend on model outputs, sampling strategies, and evolving model versions.</p><p>Two executions of the same request may result in different action sequences.</p><p>This makes debugging and reproducibility harder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*jni-SqRfGv2ohG4j6Nnm4g.png" /></figure><h3>Challenge 2 — Token Consumption</h3><p>Autonomous planning comes at a cost.</p><p>Every reasoning step consumes tokens.</p><p>Retries consume additional tokens.</p><p>Course corrections require re-evaluation.</p><p>As workflows become longer, latency and cost increase significantly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/990/1*gy7HlAefgdoCAf13H05OqA.png" /></figure><h3>AI Workflows to AI Graphs</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9aFWEgMvQ-mQ5aWSPZBuCQ.png" /></figure><h3>AI Workflows: Trading Flexibility for Predictability</h3><p>To reduce unpredictability, many teams design AI workflows.</p><p>Workflows provide deterministic orchestration.</p><p>Execution paths are predefined.</p><p>Advantages:</p><p>✔ Predictable execution</p><p>✔ Lower token usage</p><p>✔ Easier debugging</p><p>Disadvantages:</p><p>✖ Limited fault tolerance</p><p>✖ Reduced flexibility</p><p>It’s worth noting that while the orchestration is deterministic, individual LLM steps inside the workflow may still produce varying outputs.</p><h3>AI Graphs: Introducing Stateful Execution</h3><p>Graphs address some of these limitations.</p><p>Instead of treating execution as a linear pipeline, they model it as a stateful graph.</p><p>Each node stores progress.</p><p>Execution can resume from the last completed node rather than starting over.</p><h3>Example Graph</h3><pre>Start<br> │<br> ▼<br>Search Flights<br> │<br> ▼<br>Search Hotels<br> │<br> ▼<br>Generate Plan<br> │<br> ▼<br>Human Approval<br> │<br> ▼<br>Payment</pre><p>Suppose payment processing fails.</p><p>A graph-based system can resume from:</p><pre>Payment</pre><p>rather than repeating:</p><pre>Search Flights<br>Search Hotels<br>Generate Plan</pre><p>Graphs enable:</p><ul><li>Shared state</li><li>Checkpointing</li><li>Human-in-the-loop interactions</li><li>Long-running execution</li><li>Resumability after interruptions</li></ul><p>A workflow may pause for hours or days while waiting for external approval and continue execution once approval arrives.</p><h3>Framework Landscape</h3><h3>LangChain</h3><p>LangChain provides abstractions for:</p><ul><li>Chains</li><li>Tools</li><li>Agents</li><li>Retrieval pipelines</li><li>Memory components</li></ul><p>It is commonly used for building orchestrated AI applications.</p><h3>LangGraph</h3><p>LangGraph models applications as stateful graphs.</p><p>It supports:</p><ul><li>Checkpointing</li><li>Branching</li><li>Human approval loops</li><li>Long-running execution</li></ul><p>It is particularly useful for resilient Agentic AI systems.</p><h3>Google ADK</h3><p>Google’s Agent Development Kit provides building blocks for constructing and orchestrating agents.</p><p>It coordinates tool invocation and execution while maintaining execution context.</p><h3>Agno</h3><p>Agno is a lightweight framework designed for building multi-agent systems.</p><h3>How Tool Binding Actually Works</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DnkNbgJBlOyp0Sqrt25aaA.png" /></figure><p>One common misconception is that LLMs execute tools directly.</p><p>They don’t.</p><p>Models only understand metadata exposed about tools.</p><p>A tool definition might contain:</p><ul><li>Name</li><li>Description</li><li>Parameter schema</li><li>Constraints</li><li>Allowed values</li></ul><p>For example:</p><pre>calculate_area(length,width)</pre><p>The model receives something conceptually similar to:</p><pre>Tool Name:<br>calculate_area<br></pre><pre>Description:<br>Calculates the area of a rectangle<br></pre><pre>Parameters:</pre><pre>length : number</pre><pre>width : number</pre><p>The model determines that the tool is relevant and generates structured arguments.</p><pre>{<br> &quot;length&quot;:10,<br> &quot;width&quot;:5<br>}</pre><p>The framework then takes over.</p><p>It may:</p><ul><li>Invoke an API</li><li>Execute a function</li><li>Query a database</li><li>Trigger another service</li></ul><p>After execution, the framework returns the result back to the model.</p><pre>Result : 50</pre><p>The model finally responds:</p><blockquote><em>The area is 50 square units.</em></blockquote><h3>AI Systems Are Beginning to Resemble Distributed Systems</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B2drh_C6AZPdckwL1pNQZA.png" /></figure><p>What fascinated me most while exploring these concepts was how closely they resemble challenges we’ve already solved in distributed systems.</p><p>Distributed SystemsAgentic AIRetry LogicRe-planningCheckpointingGraph StateCircuit BreakersHuman ApprovalEvent SourcingExecution HistoryCompensationUndoing ActionsIdempotencySafe Tool InvocationLong Running JobsPaused Graph Execution</p><p>Many engineering principles remain unchanged.</p><p>Only the execution model is evolving.</p><h3>Choosing the Right Pattern</h3><p>RequirementBest ChoiceText generationLLMSingle external actionAgentStructured orchestrationWorkflowFault tolerant executionGraphHuman approval loopsGraphAutonomous planningAgentic AI</p><h3>Final Thoughts</h3><p>LLMs are only the starting point.</p><p>The interesting engineering problems begin once models start taking actions.</p><p>As AI systems become more autonomous, concerns such as retries, checkpointing, state management, observability, cost optimization, and fault tolerance become increasingly important.</p><p>For backend engineers, this should feel surprisingly familiar.</p><p>We’re not just building AI applications anymore.</p><p>We’re gradually building distributed systems that happen to reason.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=09bd832314ea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Hidden Costof Backward Compatibility]]></title>
            <link>https://medium.com/@sowndapan14/the-hidden-cost-of-backward-compatibility-4dfcfdd20f97?source=rss-5c1bbfa15c18------2</link>
            <guid isPermaLink="false">https://medium.com/p/4dfcfdd20f97</guid>
            <category><![CDATA[feature-engineering]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[backward-compatibility]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[deleting-code]]></category>
            <dc:creator><![CDATA[Sowndapan M V]]></dc:creator>
            <pubDate>Sun, 21 Jun 2026 10:33:27 GMT</pubDate>
            <atom:updated>2026-06-21T10:33:27.941Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hi8cH0KFphNh66_79Q3eSg.png" /></figure><h3>Why deleting code is often harder than building new systems</h3><p>As engineers, we love building things.</p><p>New APIs.</p><p>New services.</p><p>New event streams.</p><p>New authentication mechanisms.</p><p>New infrastructure.</p><p>What we rarely talk about is the other side of software engineering:</p><p>Deleting things.</p><p>Surprisingly, removing a feature, endpoint, column, or service is often far more dangerous than introducing one.</p><p>Because by the time software becomes successful, it accumulates something far more difficult to manage than technical complexity.</p><p>It accumulates <strong>backward compatibility obligations</strong>.</p><h3>Software Ages Differently Than We Expect</h3><p>When a system is first designed, backward compatibility feels easy.</p><p>A service exposes an endpoint.</p><p>Clients consume it.</p><p>Everyone agrees on a contract.</p><p>Life is simple.</p><p>Three years later things look different.</p><p>Teams have changed.</p><p>Integrations have multiplied.</p><p>Documentation is outdated.</p><p>Consumers have copied examples from old wikis.</p><p>Someone built a script around undocumented behavior.</p><p>Another team depends on a field that was never officially supported.</p><p>And nobody remembers who owns what anymore.</p><p>At this stage, removing something becomes a gamble.</p><h3>The Feature Nobody Wanted</h3><p>Imagine a notification service exposing an API.</p><pre>POST /notifications</pre><pre>{<br>   &quot;user_id&quot;:123,<br>   &quot;message&quot;:&quot;Hello&quot;,<br>   &quot;priority&quot;:&quot;high&quot;<br>}</pre><p>The service originally supported three priorities.</p><pre>high<br>medium<br>low</pre><p>Several years later, engineers notice something strange.</p><p>There is a fourth priority.</p><pre>legacy</pre><p>Nobody remembers adding it.</p><p>No documentation mentions it.</p><p>The code handling it looks suspicious.</p><pre>if priority == &quot;legacy&quot;:<br>    delay_delivery()</pre><p>An engineer investigates.</p><p>The commit history shows it was introduced four years ago.</p><p>The author left the company long ago.</p><p>Metrics indicate only 0.2% of requests still use it.</p><p>The conclusion seems obvious.</p><p>Remove it.</p><h3>The Cleanup</h3><p>The team removes support.</p><p>Tests pass.</p><p>Staging behaves correctly.</p><p>Performance improves slightly.</p><p>Deployment proceeds smoothly.</p><p>Everything looks healthy.</p><p>Until several hours later.</p><p>Customer complaints begin arriving.</p><p>Notifications are delayed.</p><p>Reports are missing.</p><p>Automated workflows stop executing.</p><p>The team eventually discovers the issue.</p><p>A partner integration developed years ago still sends:</p><pre>priority = legacy</pre><p>Nobody informed them.</p><p>Nobody even knew they existed.</p><p>The compatibility layer was silently protecting a workflow that survived multiple reorganizations and platform changes.</p><p>Removing fifteen lines of code broke a business process that had worked for years.</p><h3>Compatibility Debt Is Different From Technical Debt</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J0u5v3ik6f7fAoyxDn6_YQ.png" /></figure><p>Most engineers understand technical debt.</p><p>Duplicate code.</p><p>Poor abstractions.</p><p>Missing tests.</p><p>Outdated libraries.</p><p>Compatibility debt is different.</p><p>Compatibility debt is the obligation to preserve behavior that other systems depend on.</p><p>Even when that behavior is poorly designed.</p><p>Even when nobody likes it.</p><p>Even when documentation says it shouldn’t exist.</p><p>Because software contracts are defined by usage.</p><p>Not intentions.</p><h3>The Most Dangerous Dependencies Are Invisible</h3><p>Backward compatibility problems rarely come from documented consumers.</p><p>They come from hidden consumers.</p><p>Examples include:</p><ul><li>Internal scripts</li><li>Partner integrations</li><li>Mobile applications that haven’t been updated</li><li>Scheduled jobs</li><li>Legacy SDKs</li><li>Reporting pipelines</li><li>Browser extensions</li><li>Customer automations</li></ul><p>These consumers don’t participate in design discussions.</p><p>They don’t attend architecture meetings.</p><p>They don’t review pull requests.</p><p>They simply continue working.</p><p>Until they don’t.</p><h3>Why Versioning Alone Doesn’t Solve This</h3><p>Many teams believe API versioning solves backward compatibility.</p><p>It helps.</p><p>But it doesn’t eliminate the problem.</p><p>Versioning introduces another challenge.</p><p>Eventually old versions need to disappear.</p><p>And deleting old versions creates exactly the same question.</p><p>Who still depends on them?</p><p>Without usage visibility, deprecating a version becomes guesswork.</p><h3>Strategies That Actually Work</h3><p>Over time, I’ve found several approaches that significantly reduce compatibility risks.</p><h3>Observe Before You Remove</h3><p>Never delete behavior blindly.</p><p>Measure usage first.</p><p>Questions worth answering:</p><ul><li>How many consumers still use this?</li><li>Has usage changed recently?</li><li>Is traffic seasonal?</li><li>Is usage concentrated among a few customers?</li></ul><p>Metrics often reveal dependencies nobody knew existed.</p><h3>Deprecate Softly</h3><p>Instead of removing functionality immediately:</p><p>Mark it as deprecated.</p><p>Add warning logs.</p><p>Notify consumers.</p><p>Expose deprecation metrics.</p><p>Monitor adoption.</p><p>Deletion should be the final step.</p><p>Not the first one.</p><h3>Prefer Compatibility Windows</h3><p>Give consumers time.</p><p>Thirty days.</p><p>Sixty days.</p><p>Ninety days.</p><p>The exact duration matters less than providing predictability.</p><p>Consumers adapt surprisingly well when expectations are clear.</p><h3>Shadow Reads And Dual Writes</h3><p>For data migrations:</p><p>Read from both systems.</p><p>Write to both systems.</p><p>Compare outputs.</p><p>Validate assumptions.</p><p>Only remove old behavior once confidence is high.</p><p>This approach increases operational complexity but dramatically reduces migration risks.</p><h3>Building Is Exciting</h3><p>Deleting is terrifying.</p><p>Building something new means controlling the contract.</p><p>Deleting something old means discovering contracts you never knew existed.</p><p>And that’s why mature engineering organizations invest heavily in deprecation strategies.</p><p>Because software rarely fails when features are introduced.</p><p>Software often fails when features are removed.</p><h3>Final Thoughts</h3><p>One of the most valuable architectural lessons I’ve learned is this:</p><blockquote><em>Every successful system eventually accumulates compatibility debt.</em></blockquote><p>Some of it is intentional.</p><p>Most of it isn’t.</p><p>As engineers, we celebrate creation.</p><p>But the true test of system maturity is not how easily new capabilities can be added.</p><p>It’s how safely old capabilities can disappear.</p><p>The next time you remove code and think,</p><p><em>“Nobody uses this anymore.”</em></p><p>Pause for a moment.</p><p>Someone probably does.</p><p>And chances are, they don’t even know they’re depending on it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4dfcfdd20f97" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Shared Infrastructure  Assumptions Become Production Incidents ]]></title>
            <link>https://medium.com/@sowndapan14/why-shared-infrastructure-assumptions-become-production-incidents-70834b846fe6?source=rss-5c1bbfa15c18------2</link>
            <guid isPermaLink="false">https://medium.com/p/70834b846fe6</guid>
            <category><![CDATA[shared-infrastructure]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[production]]></category>
            <category><![CDATA[hld]]></category>
            <category><![CDATA[domain-validation]]></category>
            <dc:creator><![CDATA[Sowndapan M V]]></dc:creator>
            <pubDate>Sat, 13 Jun 2026 06:38:27 GMT</pubDate>
            <atom:updated>2026-06-13T06:38:27.366Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c_muMPXbAtOYTqz0uTTj2Q.png" /></figure><p>Most large systems eventually develop shared infrastructure.</p><p>Shared authentication.</p><p>Shared middleware.</p><p>Shared request pipelines.</p><p>Shared event processing.</p><p>Shared caching layers.</p><p>At first, this feels like a win.</p><p>Less duplication.<br>Centralized logic.<br>Consistent behavior.</p><p>But over time, shared infrastructure creates a different kind of risk:</p><p><strong>Assumptions become infrastructure.</strong></p><p>And assumptions are much harder to see than code.</p><h3>The Problem With Shared Infrastructure</h3><p>When a component is reused across multiple consumers, teams naturally start assuming that all consumers behave similarly.</p><p>For example:</p><ul><li>Every request enters through the same path</li><li>Every client follows the same contract</li><li>Every service resolves context the same way</li><li>Every consumer expects the same validations</li></ul><p>These assumptions are often true when the system is first built.</p><p>Years later, they rarely are.</p><p>Different teams evolve different workflows.</p><p>Integrations introduce alternate execution paths.</p><p>New products reuse old infrastructure in unexpected ways.</p><p>The infrastructure remains shared.</p><p>The behavior does not.</p><h3>The Most Dangerous Change</h3><p>In my experience, the most dangerous production changes are not large architectural migrations.</p><p>They are small changes that appear obviously correct.</p><p>Examples:</p><ul><li>Adding a validation</li><li>Tightening access checks</li><li>Standardizing request handling</li><li>Centralizing authentication</li><li>Enforcing stricter contracts</li></ul><p>These changes are often reviewed quickly because they improve consistency.</p><p>Ironically, that’s exactly why they can be risky.</p><p>A validation that is correct for 95% of consumers may silently break the remaining 5%.</p><h3>A Lesson I Learned Years Ago</h3><p>Several years ago, I worked on a system where a shared validation was introduced into a common request-processing path.</p><p>The validation itself was correct.</p><p>The problem was that one integration using the same infrastructure followed a different context resolution model.</p><p>The shared validation assumed all consumers behaved identically.</p><p>They didn’t.</p><p>The result wasn’t a coding bug.</p><p>The result was a hidden coupling between infrastructure and business assumptions.</p><p>That incident fundamentally changed how I review shared infrastructure changes.</p><p>Today, whenever a change is made to a shared component, I ask:</p><blockquote><em>Which consumers are we assuming behave the same?</em></blockquote><p>That question has prevented more incidents than any code review checklist I’ve used.</p><h3>What Architects Should Look For</h3><p>When modifying shared infrastructure, I usually evaluate changes across five dimensions.</p><h3>1. Consumer Diversity</h3><p>Who actually uses this component?</p><p>Not who was originally intended to use it.</p><p>Who uses it today?</p><p>Many production surprises come from forgotten consumers.</p><h3>2. Context Resolution</h3><p>Does every consumer establish context the same way?</p><p>Shared infrastructure often assumes a single source of truth.</p><p>Reality is usually messier.</p><h3>3. Implicit Contracts</h3><p>What behavior exists that is not documented?</p><p>Many systems depend on contracts that were never formally defined.</p><p>Those contracts become visible only when they break.</p><h3>4. Environment Parity</h3><p>Can the exact behavior be tested before production?</p><p>If production behaves differently from lower environments, confidence is often misleading.</p><h3>5. Failure Isolation</h3><p>If this change is wrong, what breaks?</p><p>One service?</p><p>One integration?</p><p>Or every consumer of the shared component?</p><p>The larger the blast radius, the more scrutiny the change deserves.</p><h3>Shared Infrastructure Is a Force Multiplier</h3><p>One of the reasons shared infrastructure is powerful is also the reason it is dangerous.</p><p>A single improvement benefits many systems.</p><p>A single incorrect assumption impacts many systems.</p><p>The multiplier works both ways.</p><p>As platforms mature, architectural failures are less often caused by implementation mistakes and more often caused by assumptions embedded into common layers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tK2VyBbq7XYL7jEDUSljwg.png" /></figure><h3>Final Thoughts</h3><p>Most production incidents aren’t caused by code that is obviously wrong.</p><p>They’re caused by code that is correct within a particular set of assumptions.</p><p>The challenge is that shared infrastructure serves many consumers, and those consumers rarely share all the same assumptions.</p><p>Whenever you touch a shared component, don’t just ask:</p><blockquote><em>Is this change correct?</em></blockquote><p>Also ask:</p><blockquote><em>What assumptions about every consumer does this change introduce?</em></blockquote><p>That’s usually where the real risk lives 💣.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=70834b846fe6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Rate Limiting Actually Works in Production.]]></title>
            <link>https://medium.com/@sowndapan14/how-rate-limiting-actually-works-in-production-11ec9f63c401?source=rss-5c1bbfa15c18------2</link>
            <guid isPermaLink="false">https://medium.com/p/11ec9f63c401</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[rate-limiting]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[rest-api]]></category>
            <dc:creator><![CDATA[Sowndapan M V]]></dc:creator>
            <pubDate>Sun, 22 Mar 2026 06:25:32 GMT</pubDate>
            <atom:updated>2026-03-22T06:25:32.150Z</atom:updated>
            <content:encoded><![CDATA[<h3>How Rate Limiting Actually Works in Production. Token Bucket vs Leaky Bucket vs Sliding Window — and What Breaks at Scale</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R8WBgRJKmge4VREzntorQQ.png" /></figure><p>Rate limiting looks simple on paper:</p><blockquote><em>“Allow N requests per second.”</em></blockquote><p>In production, it’s anything but simple.</p><p>Once you introduce:</p><ul><li>burst traffic</li><li>distributed systems</li><li>retries</li><li>multiple regions</li></ul><p>Rate limiting stops being a guardrail and becomes a <strong>consistency and reliability problem</strong>.</p><p>This article breaks down how rate limiting actually works in real systems — and where each approach fails.</p><h3>The Reality: Traffic Is Not Smooth</h3><p>Most diagrams assume uniform traffic:</p><pre>| | | | | | | | |</pre><p>Production traffic looks like this:</p><pre>||||||||        |||||</pre><p>Bursts happen because of:</p><ul><li>Client retries after timeouts</li><li>Batch jobs firing simultaneously</li><li>External integrations sending spikes</li><li>Cache invalidation storms</li><li>Deployments triggering synchronized requests</li></ul><p>If your rate limiter assumes smooth traffic, it will either:</p><ul><li>Over-throttle legitimate traffic</li><li>Or allow dangerous spikes</li></ul><h3>Core Algorithms</h3><h3>1️⃣ Token Bucket</h3><p><strong>How it works:</strong></p><ul><li>Tokens are added at a fixed rate (e.g., 10/sec)</li><li>Each request consumes 1 token</li><li>If tokens are available → request allowed</li><li>If empty → request rejected</li></ul><p><strong>Key property:</strong> allows bursts</p><h3>Example</h3><p>Capacity: 10 tokens<br>Refill: 10/sec</p><p>If the system is idle for 1 second → bucket fills to 10</p><p>Now a burst of 10 requests arrives → all pass instantly</p><h3>Where It Works Well</h3><ul><li>APIs with burst tolerance</li><li>User-facing systems</li><li>Systems where occasional spikes are acceptable</li></ul><h3>Where It Breaks</h3><p>Under heavy burst traffic:</p><ul><li>A large number of clients may accumulate tokens simultaneously</li><li>Sudden synchronized bursts can overwhelm downstream systems</li></ul><p>Example failure pattern:</p><ul><li>1,000 clients idle → all accumulate tokens</li><li>All send requests at once → downstream DB gets hammered</li></ul><p>Token bucket protects <em>rate</em>, not <em>concurrency</em>.</p><h3>2️⃣ Leaky Bucket</h3><p><strong>How it works:</strong></p><ul><li>Requests enter a queue</li><li>They are processed at a fixed rate</li><li>Excess requests are dropped or delayed</li></ul><p>Think of it as:</p><blockquote><em>A constant drain, regardless of incoming burst</em></blockquote><h3>Example</h3><ul><li>Incoming: 100 requests instantly</li><li>Processing rate: 10/sec</li></ul><p>Requests are smoothed over time.</p><h3>Where It Works Well</h3><ul><li>Systems requiring <strong>steady throughput</strong></li><li>Protecting fragile downstream systems</li><li>Queue-based processing pipelines</li></ul><h3>Where It Breaks</h3><ul><li>Adds latency under burst</li><li>Can drop legitimate traffic</li><li>Queue buildup can cause cascading delays</li></ul><p>Example:</p><ul><li>Burst arrives → queue grows</li><li>Processing delays increase</li><li>Clients retry → more load → collapse</li></ul><p>Leaky bucket protects <em>throughput</em>, but may hurt <em>latency</em>.</p><h3>3️⃣ Sliding Window</h3><p><strong>How it works:</strong></p><ul><li>Track requests over a rolling time window</li><li>Example: 100 requests in last 60 seconds</li></ul><p>Unlike fixed windows, it avoids boundary spikes.</p><h3>Example Problem (Fixed Window)</h3><p>Limit: 100/min</p><ul><li>100 requests at 00:59</li><li>100 requests at 01:00</li></ul><p>→ 200 requests in 2 seconds (bad spike)</p><p>Sliding window fixes this by smoothing across time.</p><h3>Where It Works Well</h3><ul><li>Fair usage enforcement</li><li>APIs with strict limits</li><li>Billing-sensitive systems</li></ul><h3>Where It Breaks</h3><ul><li>Requires tracking request timestamps</li><li>High memory/compute cost at scale</li><li>Difficult to implement efficiently in distributed systems</li></ul><h3>The Real Problem: Distributed Rate Limiting</h3><p>Single-node rate limiting is easy.</p><p>Production systems are not single-node.</p><p>You have:</p><ul><li>Multiple instances</li><li>Auto-scaling</li><li>Load balancers</li><li>Multi-region deployments</li></ul><p>Now the question becomes:</p><blockquote><em>How do all nodes agree on the current rate?</em></blockquote><h3>Redis-Based Rate Limiting (Common Approach)</h3><p>Typical setup:</p><ul><li>Shared Redis store</li><li>Counters or sorted sets</li><li>Atomic operations (INCR, LUA scripts)</li></ul><h3>What Can Go Wrong</h3><h4>1️⃣ Race Conditions</h4><p>Multiple nodes incrementing counters simultaneously:</p><ul><li>Temporary limit violations</li><li>Inconsistent enforcement</li></ul><p>Even with atomic operations, network latency introduces gaps.</p><h4>2️⃣ Hot Keys</h4><p>Popular APIs → same Redis key:</p><ul><li>High contention</li><li>Increased latency</li><li>Redis CPU spikes</li></ul><p>This becomes a bottleneck under scale.</p><h4>3️⃣ Partial Failures</h4><p>If Redis is:</p><ul><li>Slow → rate limiting delays requests</li><li>Down → do you allow all traffic or block everything?</li></ul><p>Both choices are dangerous.</p><h4>4️⃣ Clock Drift</h4><p>Sliding window algorithms rely on time.</p><p>Across distributed systems:</p><ul><li>Clocks are not perfectly synced</li><li>Window calculations become inconsistent</li></ul><h3>Multi-Region Challenges</h3><p>Now add multiple regions:</p><ul><li>Region A: handles traffic locally</li><li>Region B: handles traffic locally</li></ul><p>If limits are global:</p><blockquote><em>How do you enforce a shared limit across regions?</em></blockquote><h3>Common Problems</h3><h3>1️⃣ Inconsistent Limits</h3><p>Each region enforces limits independently:</p><ul><li>Total traffic exceeds global quota</li></ul><h3>2️⃣ Replication Lag</h3><p>If using shared storage:</p><ul><li>Updates propagate with delay</li><li>Temporary over-allowing occurs</li></ul><h3>3️⃣ Latency Tradeoff</h3><p>Global coordination requires:</p><ul><li>Cross-region communication</li><li>Increased latency per request</li></ul><p>Most systems choose:</p><blockquote><em>Slight inconsistency over high latency</em></blockquote><h3>Real Production Tradeoffs</h3><p>There is no perfect rate limiter.</p><p>You choose based on priorities:</p><pre>| Requirement        | Preferred Approach |<br>| ------------------ | ------------------ |<br>| Allow bursts       | Token Bucket       |<br>| Smooth traffic     | Leaky Bucket       |<br>| Fairness           | Sliding Window     |<br>| Simplicity         | Fixed window       |<br>| Global consistency | Hard problem       |</pre><h3>What Actually Works in Production</h3><p>Most mature systems combine approaches:</p><ul><li>Token bucket at edge (allow bursts)</li><li>Leaky bucket internally (smooth processing)</li><li>Sliding window for billing / fairness</li><li>Local rate limiting per node + approximate global limits</li></ul><h3>A Practical Example</h3><p>Imagine an API with:</p><ul><li>Limit: 100 requests/sec per user</li><li>Burst tolerance: 200</li><li>Multi-region deployment</li></ul><pre>Edge layer:<br><br> - Token bucket per user (fast, local)<br><br>Regional layer:<br><br> - Redis-backed sliding window (approximate)<br><br>Backend:<br><br> - Queue (leaky bucket behavior)<br><br>Observability:<br><br> - Track rate limit violations<br><br> - Detect abuse patterns</pre><p>This is not “perfect” — but it is resilient.</p><h3>The Mindset Shift</h3><p>Junior thinking:</p><blockquote><em>“Set limit = 100 req/sec”</em></blockquote><p>Mid-level:</p><blockquote><em>“Use token bucket”</em></blockquote><p>Senior:</p><blockquote><em>“How does this behave under burst?”</em></blockquote><p>Architect:</p><blockquote><em>“How does this behave under burst, retries, partial failures, Redis latency, and multi-region inconsistency?”</em></blockquote><h3>Final Thought</h3><p>Rate limiting is not just about rejecting requests.</p><p>It is about:</p><ul><li>Protecting systems</li><li>Maintaining fairness</li><li>Preserving availability under stress</li></ul><p>And most importantly:</p><blockquote><em>Designing for imperfect conditions.</em></blockquote><p>Because in production, traffic is bursty, systems are distributed, and failure is guaranteed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=11ec9f63c401" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Lifecycle of a Production Request: What Really Happens After You Click an API ♽]]></title>
            <link>https://medium.com/@sowndapan14/the-lifecycle-of-a-production-request-what-really-happens-after-you-click-an-api-606af8b26adc?source=rss-5c1bbfa15c18------2</link>
            <guid isPermaLink="false">https://medium.com/p/606af8b26adc</guid>
            <category><![CDATA[product-design]]></category>
            <category><![CDATA[rest-api]]></category>
            <category><![CDATA[hld]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[api-lifecycle]]></category>
            <dc:creator><![CDATA[Sowndapan M V]]></dc:creator>
            <pubDate>Sat, 14 Mar 2026 16:01:07 GMT</pubDate>
            <atom:updated>2026-03-14T16:01:07.197Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5OJFmSHRywkxByVEefdRww.png" /></figure><p>When developers call an API, it often feels simple.</p><pre>Client → API → Response</pre><p>But in real production systems, a request usually travels through <strong>multiple layers of infrastructure and services</strong> before returning a response.</p><p>Understanding this lifecycle is extremely useful for:</p><ul><li>debugging production issues</li><li>improving performance</li><li>designing scalable systems</li><li>diagnosing latency problems</li></ul><p>Let’s walk through what actually happens when a request hits a modern production system.</p><h3>1. The Client Sends a Request</h3><p>Everything begins with a client.</p><p>This could be:</p><ul><li>a web browser</li><li>a mobile app</li><li>another backend service</li><li>a scheduled job</li></ul><p>Example request:</p><pre>POST /api/orders</pre><p>The request contains:</p><ul><li>headers</li><li>authentication tokens</li><li>request body</li><li>metadata</li></ul><p>But the API server <strong>usually isn’t the first system that receives it</strong>.</p><h3>2. DNS Resolution</h3><p>Before reaching the server, the client resolves the domain name.</p><p>Example:</p><pre>api.example.com</pre><p>DNS translates it into an IP address.</p><pre>api.example.com → 52.14.210.19</pre><p>Without this step, the request would have no idea where to go.</p><p>DNS issues can sometimes cause <strong>unexpected outages or latency spikes</strong>.</p><h3>3. Load Balancer</h3><p>The request now reaches a <strong>load balancer</strong>.</p><p>Example systems:</p><ul><li>NGINX</li><li>HAProxy</li><li>AWS ALB</li><li>Cloudflare</li></ul><p>Purpose:</p><ul><li>distribute traffic</li><li>prevent server overload</li><li>improve availability</li></ul><p>The flow now looks like this:</p><pre>Client<br>   ↓<br>Load Balancer<br>   ↓<br>Application Servers</pre><p>The load balancer selects one server among many.</p><h3>4. API Gateway / Edge Layer</h3><p>In many architectures, requests pass through an <strong>API gateway</strong>.</p><p>Responsibilities often include:</p><ul><li>authentication</li><li>rate limiting</li><li>request validation</li><li>routing</li><li>logging</li></ul><p>Example flow:</p><pre>Client<br> ↓<br>Load Balancer<br> ↓<br>API Gateway<br> ↓<br>Backend Service</pre><p>This layer protects backend services from <strong>uncontrolled traffic</strong>.</p><h3>5. Application Server</h3><p>The request finally reaches the application.</p><p>Example frameworks:</p><ul><li>Ruby on Rails</li><li>Node.js</li><li>Spring Boot</li><li>Django</li></ul><p>Here the application performs:</p><ul><li>request parsing</li><li>authentication checks</li><li>authorization</li><li>business logic</li></ul><p>Example controller logic:</p><pre>def create_order<br>  OrderService.create(current_user, params)<br>end</pre><p>But the application rarely works alone.</p><h3>6. Cache Layer (Optional but Common)</h3><p>Before hitting the database, many systems check a <strong>cache</strong>.</p><p>Common technologies:</p><ul><li>Redis</li><li>Memcached</li></ul><p>Example:</p><pre>Application<br>   ↓<br>Cache<br>   ↓<br>Database</pre><p>If the data exists in cache:</p><pre>Cache hit → response returned immediately</pre><p>If not:</p><pre>Cache miss → query database</pre><p>Caching significantly reduces database load.</p><h3>7. Database Query</h3><p>Most requests eventually interact with a database.</p><p>Examples:</p><ul><li>MySQL</li><li>PostgreSQL</li><li>MongoDB</li></ul><p>Example query:</p><pre>SELECT * FROM orders WHERE user_id = 123;</pre><p>This step is often the <strong>most expensive part</strong> of the request lifecycle.</p><p>Performance problems usually originate here due to:</p><ul><li>missing indexes</li><li>slow queries</li><li>large scans</li><li>locking issues</li></ul><h3>8. Background Jobs (Sometimes Triggered)</h3><p>Some operations shouldn’t block the request.</p><p>Instead, they are delegated to <strong>background workers</strong>.</p><p>Example tasks:</p><ul><li>sending emails</li><li>processing payments</li><li>generating reports</li><li>syncing external systems</li></ul><p>Flow:</p><pre>Application<br>   ↓<br>Message Queue<br>   ↓<br>Background Worker</pre><p>Popular systems:</p><ul><li>Kafka</li><li>RabbitMQ</li><li>Sidekiq</li><li>SQS</li></ul><p>This keeps the API <strong>fast and responsive</strong>.</p><h3>9. Response Construction</h3><p>After completing the work, the server constructs a response.</p><p>Example:</p><pre>{<br>  &quot;status&quot;: &quot;success&quot;,<br>  &quot;order_id&quot;: 8421<br>}</pre><p>The response travels back through the same infrastructure:</p><pre>Application<br> ↓<br>API Gateway<br> ↓<br>Load Balancer<br> ↓<br>Client</pre><p>Finally, the client receives the result.</p><h3>10. Observability and Logging</h3><p>Behind the scenes, the system records important data:</p><ul><li>logs</li><li>metrics</li><li>traces</li></ul><p>These help engineers answer questions like:</p><ul><li>Why is the request slow?</li><li>Where did it fail?</li><li>Which service caused the issue?</li></ul><p>Modern systems rely heavily on <strong>observability</strong> to understand request lifecycles.</p><h3>Why Understanding This Lifecycle Matters</h3><p>When debugging production issues, knowing this flow helps engineers quickly isolate problems.</p><p>A failure might occur at:</p><ul><li>DNS</li><li>load balancer</li><li>gateway</li><li>application</li><li>cache</li><li>database</li><li>background worker</li></ul><p>Without understanding the full lifecycle, it’s easy to blame the wrong component. Take a look at this picture !</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_Ig9sqLadzdsoon5gllcfw.png" /></figure><h3>Final Thoughts</h3><p>A simple API request hides a surprisingly complex journey.</p><p>What looks like a single operation often involves:</p><ul><li>networking</li><li>infrastructure layers</li><li>application logic</li><li>caching systems</li><li>databases</li><li>asynchronous processing</li></ul><p>Understanding this lifecycle helps engineers design systems that are <strong>faster, more reliable, and easier to debug</strong>.</p><p>The next time you call an API, remember:</p><p>A lot more happens behind the scenes than a simple request and response.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=606af8b26adc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why “Exactly Once” Processing Is a Myth in Distributed Systems]]></title>
            <link>https://medium.com/@sowndapan14/why-exactly-once-processing-is-a-myth-in-distributed-systems-aed5f04b57bf?source=rss-5c1bbfa15c18------2</link>
            <guid isPermaLink="false">https://medium.com/p/aed5f04b57bf</guid>
            <category><![CDATA[distributed-systems]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[database-design]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[idempotency]]></category>
            <dc:creator><![CDATA[Sowndapan M V]]></dc:creator>
            <pubDate>Sat, 07 Mar 2026 11:14:31 GMT</pubDate>
            <atom:updated>2026-03-07T11:14:31.218Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xI1GnekcI4-x5mbOJCuuMg.png" /></figure><p>Modern backend systems are built on distributed components — APIs, message queues, databases, background workers, and external services.</p><p>In these environments, developers often hear about <strong>exactly-once processing</strong> — the idea that a task or message is processed <strong>one and only one time</strong>.</p><p>It sounds ideal.</p><p>But in reality, <strong>exactly-once processing is mostly a myth</strong>.</p><p>In distributed systems, the best we can realistically achieve is:</p><ul><li><strong>At-most-once</strong></li><li><strong>At-least-once</strong></li><li><strong>Effectively-once (via idempotency)</strong></li></ul><p>Understanding this distinction is critical when designing reliable backend systems.</p><h3>The Illusion of Exactly Once</h3><p>Imagine a simple system:</p><pre>Client → API → Queue → Worker → Database</pre><p>A user performs an action, the API enqueues a job, and a worker processes it.</p><p>Seems straightforward.</p><p>But distributed systems introduce unavoidable problems:</p><ul><li>Network failures</li><li>Timeouts</li><li>Process crashes</li><li>Message redelivery</li><li>Partial writes</li><li>Unknown state</li></ul><p>Because of these realities, <strong>systems cannot always know whether an operation succeeded or failed</strong>.</p><p>And when a system cannot know the outcome, it will often <strong>retry</strong>.</p><p>Retries are the root of the “exactly once” illusion.</p><h3>The Three Real Delivery Guarantees</h3><p>Distributed systems typically operate under one of these guarantees.</p><h3>At-most-once</h3><p>The operation happens <strong>zero or one time</strong>.</p><p>If a failure occurs, the system <strong>does not retry</strong>.</p><p>Pros:</p><ul><li>No duplicates</li></ul><p>Cons:</p><ul><li>Work may be lost</li></ul><p>Example:<br>A fire-and-forget logging system.</p><h3>At-least-once</h3><p>The operation happens <strong>one or more times</strong>.</p><p>If the system is unsure about completion, it <strong>retries</strong>.</p><p>Pros:</p><ul><li>Work is not lost</li></ul><p>Cons:</p><ul><li><strong>Duplicates may occur</strong></li></ul><p>This is the <strong>most common model</strong> used by:</p><ul><li>Kafka</li><li>RabbitMQ</li><li>SQS</li><li>background job systems</li></ul><h3>Exactly-once (The Myth)</h3><p>Exactly once means:</p><pre>The operation executes one time<br>and never more than once<br>and never zero times</pre><p>In distributed systems this is <strong>extremely difficult</strong> because failures create <strong>uncertainty</strong>.</p><p>A system cannot always distinguish between:</p><pre>operation succeeded but response lost<br>vs<br>operation never executed</pre><p>When the system cannot know, it <strong>retries</strong> — creating duplicates.</p><h3>An Imaginary Example: The Duplicate Wallet Credit</h3><p>Let’s consider a fictional fintech platform called <strong>PayFlow</strong>.<br>Users can add money to their wallet.</p><h3>Step 1 — User Request</h3><pre>POST /wallet/topup<br>{<br>  user_id: 123,<br>  amount: 100<br>}</pre><p>The API enqueues a job.</p><pre>Queue → wallet_credit_job</pre><h3>Step 2 — Worker Processes the Job</h3><p>Worker consumes the job:</p><pre>credit_wallet(user_id: 123, amount: 100)</pre><p>The worker performs:</p><pre>UPDATE wallets<br>SET balance = balance + 100</pre><h3>Step 3 — Network Failure</h3><p>After updating the database:</p><pre>Worker → Queue ACK</pre><p>But the <strong>network drops before the ACK reaches the queue</strong>.</p><p>Now the queue assumes:</p><pre>Worker never processed the job</pre><p>So it <strong>redelivers the job</strong>.</p><h3>Step 4 — Duplicate Processing</h3><p>Another worker receives the same job.</p><pre>credit_wallet(user_id: 123, amount: 100)</pre><p>Wallet balance becomes:</p><pre>100 → 200</pre><p>The user just received <strong>double credit</strong>.</p><h3>Did the System Do Something Wrong?</h3><p>No.</p><p>The system behaved exactly as designed:</p><ol><li>Worker processed the message</li><li>ACK was lost</li><li>Queue retried</li></ol><p>This is <strong>normal behavior in distributed systems</strong>.</p><p>Which means:</p><blockquote><em>Exactly-once processing was never guaranteed.</em></blockquote><h3>Why Retries Are Necessary</h3><p>Without retries, failures would cause <strong>data loss</strong>.</p><p>Example:</p><pre>Worker crashes before processing message</pre><p>If the queue never retries:</p><pre>User&#39;s wallet top-up disappears forever</pre><p>Retries ensure <strong>reliability</strong>, but they introduce <strong>duplicates</strong>.</p><p>This is the core tradeoff.</p><h3>The Real Solution: Idempotency</h3><p>Instead of chasing exactly-once guarantees, systems aim for:</p><blockquote><strong><em>Effectively-once processing through idempotency</em></strong></blockquote><p>An operation is <strong>idempotent</strong> if executing it multiple times produces the same result.</p><p>Example:</p><pre>credit_wallet(transaction_id)</pre><p>Instead of blindly updating the balance, the system records processed transactions.</p><h3>Improved Implementation</h3><p>Worker logic:</p><pre>BEGIN TRANSACTION</pre><pre>if transaction_id already exists<br>   ignore request<br>else<br>   insert transaction<br>   update wallet balance</pre><pre>COMMIT</pre><p>Now even if the message is processed multiple times:</p><pre>Wallet balance changes only once</pre><p>Duplicates become <strong>harmless</strong>.</p><h3>Patterns Used in Real Systems</h3><p>Production systems use several techniques to simulate effectively-once behavior.</p><h3>Idempotency Keys</h3><p>Clients provide a unique request ID.</p><p>Example:</p><pre>POST /payments<br>Idempotency-Key: abc123</pre><p>Server ensures the request is processed only once.</p><h3>Deduplication Tables</h3><p>Maintain a table of processed operations.</p><p>Example:</p><pre>processed_events<br>---------------<br>event_id<br>processed_at</pre><p>If event already exists → skip.</p><h3>Transactional Outbox</h3><p>Ensures events and database writes stay consistent.</p><p>Pattern:</p><pre>DB Transaction<br>   write business data<br>   write event to outbox</pre><p>A background process later publishes the event.</p><h3>Exactly-once Within a Boundary</h3><p>Some systems offer exactly-once <strong>inside a single system boundary</strong>, such as:</p><ul><li>Kafka transactional producers</li><li>database transactions</li></ul><p>But once communication crosses systems, the guarantee disappears.</p><h3>The Mental Model Every Backend Engineer Should Have</h3><p>Instead of designing for:</p><pre>exactly once</pre><p>Design for:</p><pre>at least once + idempotency</pre><p>Assume that any operation can happen:</p><ul><li>twice</li><li>three times</li><li>many times</li></ul><p>Your system should still produce <strong>correct results</strong>.</p><h3>Final Thoughts</h3><p>Exactly-once processing is a powerful idea — but in most distributed systems, it is <strong>not achievable in practice</strong>.</p><p>Failures introduce uncertainty, and uncertainty leads to retries.</p><p>Retries create duplicates.</p><p>Instead of trying to eliminate duplicates entirely, resilient systems <strong>embrace them</strong> and design operations to be <strong>idempotent</strong>.</p><p>The best distributed systems are not the ones that prevent retries.</p><p>They are the ones that <strong>remain correct despite them</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aed5f04b57bf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Idempotency Beyond Database Constraints ]]></title>
            <link>https://medium.com/@sowndapan14/idempotency-beyond-database-constraints-15e6dea5e6eb?source=rss-5c1bbfa15c18------2</link>
            <guid isPermaLink="false">https://medium.com/p/15e6dea5e6eb</guid>
            <category><![CDATA[backend-engineering]]></category>
            <category><![CDATA[idempotency]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[database-design]]></category>
            <dc:creator><![CDATA[Sowndapan M V]]></dc:creator>
            <pubDate>Sat, 28 Feb 2026 09:43:00 GMT</pubDate>
            <atom:updated>2026-02-28T09:43:00.429Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XcssEG55CVOe1Unt6rsWXg.png" /></figure><h3>Why “UNIQUE” Is Not a Distributed Systems Strategy</h3><p>In backend engineering, idempotency is often reduced to a database trick:</p><blockquote><em>“Just add a unique constraint.”</em></blockquote><p>That works — until it doesn’t.</p><p>In distributed systems, retries are not edge cases.<br>They are the norm.</p><ul><li>Clients retry on timeouts</li><li>Load balancers retry on broken connections</li><li>Background workers retry on failures</li><li>Orchestrators restart containers</li><li>Network partitions cause duplicate submissions</li></ul><p>If your system cannot tolerate duplicate execution, it is not production-ready.</p><p>This article explores why idempotency is not just a database concern — it is an architectural concern.</p><h3>The Real Problem: Retries Are Everywhere</h3><p>In a distributed environment:</p><ul><li>HTTP requests may time out after the server processes them</li><li>Background jobs may crash after partially completing work</li><li>Containers may restart mid-transaction</li><li>Message queues may redeliver events</li></ul><p>From the system’s perspective, the same logical request may arrive multiple times.</p><p>The question is:</p><blockquote><em>Can your system safely execute the same operation twice?</em></blockquote><p>If not, you will eventually create:</p><ul><li>Duplicate records</li><li>Inconsistent associations</li><li>Broken invariants</li><li>Data integrity issues</li><li>Production incidents</li></ul><h3>A Real Production Pattern: Duplicate Ticket Creation</h3><p>Consider a common backend workflow:</p><ol><li>An external system sends an event.</li><li>The backend creates or associates a ticket.</li><li>A background process enriches it.</li></ol><p>Now imagine:</p><ul><li>The external system retries because it didn’t receive a response.</li><li>Or the background worker crashes after persisting partial data.</li><li>Or the orchestrator restarts a pod mid-processing.</li></ul><p>The same event is processed twice.</p><p>If the logic assumes “this runs only once,” you now have:</p><ul><li>Duplicate tickets</li><li>Broken mappings</li><li>Inconsistent reference associations</li></ul><p>In one root cause analysis I worked on, a mapping logic relied on the <em>first reference identifier</em> in an inbound payload. When the upstream system changed reference ordering and a retry occurred, the association logic failed. The system created a new record instead of linking to the existing one.</p><p>No database constraint was violated.</p><p>But the system behavior was wrong.</p><p>This is the difference between <strong>data integrity</strong> and <strong>behavioral correctness</strong>.</p><h3>Why Unique Constraints Are Not Enough</h3><p>A database unique constraint protects against:</p><ul><li>Exact duplicate rows</li><li>Duplicate keys</li><li>Concurrent insert collisions</li></ul><p>It does not protect against:</p><ul><li>Partial side effects</li><li>External system retries</li><li>Conditional logic errors</li><li>Multi-step workflows</li><li>Cross-service interactions</li></ul><p>Let’s examine a multi-step operation:</p><ol><li>Create entity A</li><li>Create entity B</li><li>Update mapping table</li><li>Emit event</li></ol><p>If the process fails at step 3 and retries:</p><ul><li>Step 1 may succeed twice (if not guarded)</li><li>Step 4 may emit duplicate events</li><li>Step 2 may violate business invariants</li></ul><p>The database only guards individual writes.<br>It does not guard the entire semantic operation.</p><p>Idempotency must be defined at the <strong>business operation level</strong>, not the row level.</p><h3>The Myth of “Exactly Once”</h3><p>Many systems attempt to guarantee “exactly-once processing.”</p><p>In distributed environments, this is largely a myth.</p><p>You can realistically achieve:</p><ul><li>At-most-once (risk of loss)</li><li>At-least-once (risk of duplication)</li></ul><p>Production systems operate in the at-least-once world.</p><p>Which means:</p><blockquote><em>Your system must tolerate duplicate execution.</em></blockquote><p>If you design assuming exactly-once, retries will eventually break you.</p><h3>Idempotency as a Design Principle</h3><p>To design idempotent systems, you must answer:</p><ul><li>What defines a logical operation?</li><li>What is the idempotency boundary?</li><li>How do we detect replay?</li><li>How do we prevent duplicate side effects?</li><li>What happens if execution stops mid-flow?</li></ul><h3>Strategy 1: Idempotency Keys</h3><p>Instead of relying on implicit uniqueness, define an explicit idempotency key.</p><p>This key must:</p><ul><li>Represent the logical operation</li><li>Be stable across retries</li><li>Be persisted before side effects occur</li></ul><p>For example:</p><ul><li>External event ID</li><li>Request UUID</li><li>Deterministic hash of operation payload</li></ul><p>The system flow becomes:</p><ol><li>Check if idempotency key exists</li><li>If yes → return previous result</li><li>If no → execute and persist key atomically</li></ol><p>This protects the entire operation, not just a row.</p><h3>Strategy 2: Natural Idempotency</h3><p>Some operations are naturally idempotent:</p><ul><li>Setting a value to X (not incrementing)</li><li>Upserting based on deterministic identifiers</li><li>Rebuilding derived data from source of truth</li></ul><p>But many business operations are not:</p><ul><li>Sending emails</li><li>Charging payments</li><li>Emitting external events</li><li>Creating relational mappings</li></ul><p>These require explicit protection.</p><h3>Strategy 3: Idempotent Consumers</h3><p>In event-driven systems:</p><ul><li>Messages may be delivered multiple times.</li><li>Workers may crash mid-processing.</li><li>Brokers may redeliver.</li></ul><p>Consumers must:</p><ul><li>Track processed message IDs</li><li>Guard state transitions</li><li>Avoid non-deterministic updates</li></ul><p>Otherwise, replay becomes corruption.</p><h3>Where Systems Commonly Break</h3><p>From real production cases, idempotency breaks most often in:</p><h3>1. Mapping Layers</h3><p>Associating entities based on partial identifiers.</p><h3>2. Configuration-Driven Logic</h3><p>When behavior depends on dynamic config, retries may behave differently.</p><h3>3. Multi-Tenant Boundaries</h3><p>Duplicate execution may create cross-tenant inconsistencies.</p><h3>4. Background Workers</h3><p>Workers retrying after partial side effects.</p><h3>5. Feature Flag Transitions</h3><p>A retry under a different flag state changes execution path.</p><p>These are architectural weak points, not syntax issues.</p><h3>Observability and Idempotency</h3><p>You cannot design idempotency without observability.</p><p>You need:</p><ul><li>Request correlation IDs</li><li>Structured logs</li><li>Event tracing</li><li>Clear retry visibility</li></ul><p>In one debugging scenario, duplicate processing was not visible because logs lacked correlation identifiers. Only after reconstructing the timeline across retries did the duplication pattern emerge.</p><p>Idempotency failures often look like random data corruption — until you trace retries.</p><h3>Architectural Tradeoffs</h3><p>Idempotency introduces tradeoffs:</p><pre>| Approach              | Tradeoff                     |<br>| --------------------- | ---------------------------- |<br>| Unique constraint     | Protects data, not behavior  |<br>| Idempotency key table | Extra storage &amp; coordination |<br>| Distributed locks     | Latency &amp; complexity         |<br>| Stateless retries     | Risk of side effects         |<br>| Compensation logic    | Operational complexity       |</pre><p>There is no universal solution.</p><p>But ignoring idempotency is not an option.</p><h3>A Shift in Thinking</h3><p>Junior mindset:</p><blockquote><em>“Does this work?”</em></blockquote><p>Mid-level mindset:</p><blockquote><em>“Does this handle concurrency?”</em></blockquote><p>Senior mindset:</p><blockquote><em>“What happens if this executes twice?”</em></blockquote><p>Architect mindset:</p><blockquote><em>“What happens if this executes twice, partially fails, restarts, and runs under a different configuration?”</em></blockquote><p>Idempotency is not about preventing duplicates.</p><p>It is about designing systems that remain correct under uncertainty.</p><h3>Final Thought</h3><p>In distributed systems, retries are inevitable.</p><p>If your correctness depends on single execution, your system is fragile.</p><p>Database constraints are useful.<br>But they are not an idempotency strategy.</p><p>Idempotency must be:</p><ul><li>Explicit</li><li>Operation-level</li><li>Observable</li><li>Designed, not assumed</li></ul><p>When you move from row-level thinking to operation-level thinking, you stop writing code that “usually works” — and start designing systems that survive production reality.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15e6dea5e6eb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 Backend Mistakes I Made Early in My Career (That Cost Me More Than I Expected)]]></title>
            <link>https://medium.com/@sowndapan14/5-backend-mistakes-i-made-early-in-my-career-that-cost-me-more-than-i-expected-5e7a1994e5bb?source=rss-5c1bbfa15c18------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e7a1994e5bb</guid>
            <category><![CDATA[learning-from-mistakes]]></category>
            <category><![CDATA[backend-engineering]]></category>
            <category><![CDATA[communication]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[legacy-systems]]></category>
            <dc:creator><![CDATA[Sowndapan M V]]></dc:creator>
            <pubDate>Sat, 14 Feb 2026 06:44:38 GMT</pubDate>
            <atom:updated>2026-02-14T06:44:38.504Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8JvqIrKu4VnRRhgXdYKC1g.png" /></figure><p>When I started my backend engineering career, I believed one thing very strongly:</p><blockquote><strong>“If my technical skills are good, everything else will fall into place.”</strong></blockquote><p>I focused on learning frameworks, databases, performance tuning, and system design. I thought mastering these was enough.</p><p>It wasn’t.</p><p>Over the years, through production issues, late-night debugging, and difficult conversations, I learned that being a good backend engineer is much more than writing correct code.</p><p>Here are five mistakes I made early in my career — and what they taught me.</p><h3>1. Believing Technical Knowledge Was Enough</h3><p>In my early days, I assumed:</p><blockquote><strong><em>“If my technical skills are good, everything else will fall into place.”</em></strong></blockquote><p>I focused heavily on:</p><ul><li>Clean architecture</li><li>Optimized queries</li><li>Scalable systems</li></ul><p>But I didn’t spend enough time understanding <strong>why</strong> a feature existed.</p><p>As I worked across different domains, I slowly realized something important:</p><p><strong>The same technical issue can have very different business impacts.</strong></p><ul><li>In <strong>fintech</strong>, a small bug can directly cost money.</li><li>In <strong>CRM systems</strong>, downtime can destroy customer trust.</li><li>In <strong>e-commerce</strong>, slow performance can mean lost interest and abandoned carts.</li></ul><p>Technically, these might look like “just another bug.”</p><p>Business-wise, they are completely different.</p><p>Early in my career, I didn’t think this way.</p><p>I once delivered a technically solid solution. It worked perfectly.<br>But the business team wasn’t satisfied.</p><p>Why?</p><p>Because it didn’t solve the real problem.</p><p>I had optimized the wrong thing.</p><p>That’s when I realized:</p><blockquote><strong><em>Understanding business impact matters more than technical elegance.</em></strong></blockquote><p>Now, before writing code, I ask:</p><ul><li>Who is affected if this fails?</li><li>What is the business risk?</li><li>What does “success” really mean here?</li></ul><p>That shift changed everything.</p><h3>2. Treating Production Issues as “Just Bugs”</h3><p>Earlier, when something broke in production, my only goal was:</p><blockquote><em>“Fix it fast and move on.”</em></blockquote><p>I didn’t think much about:</p><ul><li>Root cause</li><li>System gaps</li><li>Prevention</li></ul><p>As long as the error disappeared, I felt successful.</p><p>But the same issues kept coming back.</p><p>Again and again.</p><p>Each incident cost time, trust, and energy.</p><p>Eventually, I learned:</p><blockquote><strong><em>A quick fix is cheap today — but expensive tomorrow.</em></strong></blockquote><p>Now, I spend more time understanding <em>why</em> it happened, not just <em>how</em> to stop it.</p><h3>3. Avoiding Legacy Code</h3><p>Like many engineers, I disliked legacy systems.</p><p>When I saw old code, my first thought was:</p><blockquote><em>“I hope I don’t have to touch this.”</em></blockquote><p>So I avoided it when possible.</p><p>But most real-world systems are built on years of legacy.</p><p>Avoiding them meant:</p><ul><li>Slower learning</li><li>Less impact</li><li>More dependency on others</li></ul><p>When I finally forced myself to dive in, I realized:</p><p>Legacy code is a history book of decisions.</p><p>Understanding it helped me understand the product, the users, and the system’s evolution.</p><p>Now, <strong>I see it as an opportunity, not a burden.</strong></p><h3>4. Underestimating Communication</h3><p>Early on, I believed:</p><blockquote><em>“Good work will speak for itself.”</em></blockquote><p>So I didn’t:</p><ul><li>Proactively update stakeholders</li><li>Clearly explain risks</li><li>Document decisions</li></ul><p>During incidents, this caused confusion.<br>People didn’t know:</p><ul><li>What was happening</li><li>When it would be fixed</li><li>What the impact was</li></ul><p>That created unnecessary stress.</p><p>I learned that:</p><blockquote><strong><em>Engineering is as much about communication as it is about code.</em></strong></blockquote><p>Today, I prioritize:</p><ul><li>Clear status updates</li><li>Honest timelines</li><li>Simple explanations</li></ul><p>It builds trust faster than any feature.</p><h3>5. Trying to Do Everything Alone</h3><p>In the beginning, I wanted to prove myself.</p><p>So I tried to handle everything:</p><ul><li>Debugging</li><li>Designing</li><li>Deploying</li><li>Fixing incidents</li></ul><p>Alone.</p><p>I thought asking for help meant weakness.</p><p>It doesn’t.</p><p>It means maturity.</p><p>Some of my best learning moments came from:</p><ul><li>Pair debugging</li><li>Design reviews</li><li>Post-incident discussions</li><li>Pair Programming</li></ul><p><strong>Strong engineers don’t work alone.<br>They build strong networks.</strong></p><h3>What These Mistakes Taught Me</h3><p>Looking back, these mistakes cost me:</p><ul><li>Time</li><li>Confidence</li><li>Missed opportunities</li></ul><p>But they also gave me something valuable: <strong>perspective</strong>.</p><p>I learned that being a good backend engineer means:</p><p>✅ Understanding business goals<br>✅ Thinking long-term<br>✅ Communicating clearly<br>✅ Learning continuously<br>✅ Staying calm under pressure</p><p>Not just writing good code.</p><h3>Final Thoughts</h3><p>If you’re early in your career, you don’t need to avoid all mistakes.</p><p>You can’t.</p><p>But you can learn faster.</p><p>If I could give my younger self one piece of advice, it would be:</p><blockquote><strong><em>“Don’t just focus on becoming a better coder.<br>Focus on becoming a better problem solver.”</em></strong></blockquote><p>Everything else will follow.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e7a1994e5bb" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>