<script data-pm-proxy="intercept"></script><?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:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Himanshu’s Substack]]></title><description><![CDATA[My personal Substack]]></description><link>https://singour.substack.com</link><image><url>https://substackcdn.com/image/fetch/$s_!QRtu!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4ec79f2-1f18-4fc1-ae67-3581aaceb587_1280x1280.png</url><title>Himanshu’s Substack</title><link>https://singour.substack.com</link></image><generator>Substack</generator><lastBuildDate>Sat, 05 Sep 2026 05:23:26 GMT</lastBuildDate><atom:link href="/__u/singour.substack.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Himanshu Singour]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[singour@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[singour@substack.com]]></itunes:email><itunes:name><![CDATA[Himanshu Singour]]></itunes:name></itunes:owner><itunes:author><![CDATA[Himanshu Singour]]></itunes:author><googleplay:owner><![CDATA[singour@substack.com]]></googleplay:owner><googleplay:email><![CDATA[singour@substack.com]]></googleplay:email><googleplay:author><![CDATA[Himanshu Singour]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[How to Debug a Production Issue Without Panicking]]></title><description><![CDATA[Production mein issue hai. Payment requests fail ho rahi hain.]]></description><link>https://singour.substack.com/p/how-to-debug-a-production-issue-without</link><guid isPermaLink="false">https://singour.substack.com/p/how-to-debug-a-production-issue-without</guid><dc:creator><![CDATA[Himanshu Singour]]></dc:creator><pubDate>Thu, 20 Aug 2026 06:42:37 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!-E1v!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F626cbf32-fefd-41d2-a1ff-0a0c588fabee_1254x1254.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!-E1v!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F626cbf32-fefd-41d2-a1ff-0a0c588fabee_1254x1254.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!-E1v!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F626cbf32-fefd-41d2-a1ff-0a0c588fabee_1254x1254.png 424w, /__u/substackcdn.com/image/fetch/$s_!-E1v!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F626cbf32-fefd-41d2-a1ff-0a0c588fabee_1254x1254.png 848w, /__u/substackcdn.com/image/fetch/$s_!-E1v!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F626cbf32-fefd-41d2-a1ff-0a0c588fabee_1254x1254.png 1272w, /__u/substackcdn.com/image/fetch/$s_!-E1v!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F626cbf32-fefd-41d2-a1ff-0a0c588fabee_1254x1254.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!-E1v!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F626cbf32-fefd-41d2-a1ff-0a0c588fabee_1254x1254.png" width="1254" height="1254" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/626cbf32-fefd-41d2-a1ff-0a0c588fabee_1254x1254.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1254,&quot;width&quot;:1254,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!-E1v!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F626cbf32-fefd-41d2-a1ff-0a0c588fabee_1254x1254.png 424w, /__u/substackcdn.com/image/fetch/$s_!-E1v!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F626cbf32-fefd-41d2-a1ff-0a0c588fabee_1254x1254.png 848w, /__u/substackcdn.com/image/fetch/$s_!-E1v!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F626cbf32-fefd-41d2-a1ff-0a0c588fabee_1254x1254.png 1272w, /__u/substackcdn.com/image/fetch/$s_!-E1v!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F626cbf32-fefd-41d2-a1ff-0a0c588fabee_1254x1254.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>It was around 2 AM when my phone rang.</p><p>I was half asleep, so for a few seconds I just looked at the screen, hoping whoever was calling would call back in the morning.</p><p>Then I saw the team name. I picked it up.</p><p>&#8220;<em><strong>Production mein issue hai. Payment requests fail ho rahi hain</strong></em>.&#8221;</p><p>Bas. Neend gayi.</p><p>I opened my laptop and joined the call. Everyone was already trying to figure things out. Someone was checking logs, someone was looking at the database, and someone was asking about the latest deployment. And honestly, my first thought wasn&#8217;t some amazing debugging strategy.</p><p>It was simply, <strong>&#8220;Yaar, ab kya hua?&#8221;</strong></p><p>That&#8217;s the thing about production issues. When something breaks on your local machine, you have time. You can add logs, put breakpoints, restart the application, change things and try again.</p><p>Production is different.</p><p>There are real users on the other side. Someone is trying to make a payment. Someone is waiting for an order. Someone is staring at an error message. And while you&#8217;re trying to understand the problem, people are waiting for an answer.</p><p>That&#8217;s where I learned one of the most important things about production debugging:</p><p><strong>Don&#8217;t panic. And don&#8217;t start fixing things before you understand what is actually broken.</strong></p><h1>My First Instinct Used to Be Wrong</h1><p>Earlier, whenever I saw a production issue, I would immediately open the code.</p><p>API failing? Open the controller.</p><p>Then the service.</p><p>Then the repository.</p><p>Then the database query.</p><p>Ten minutes later, I would have twenty tabs open and still wouldn&#8217;t know what was happening.</p><p>The problem wasn&#8217;t that I couldn&#8217;t debug.</p><p>I was just starting from the wrong place.</p><p>Instead of asking <strong>&#8220;Where is the bug?&#8221;</strong>, I should have been asking <strong>&#8220;What exactly is happening?&#8221;</strong></p><p>So that night, I started with the simplest thing: the numbers.</p><p>How many requests were failing?</p><p>When did they start failing?</p><p>Were all payments failing?</p><p>Or only some?</p><p>That immediately gave us an interesting clue.</p><p>Not every payment was failing.</p><p>Some were going through perfectly.</p><p>Now the problem wasn&#8217;t &#8220;payment is down.&#8221;</p><p>Something was failing under a particular condition.</p><p>And suddenly, the problem became much smaller.</p><h1>Don&#8217;t Trust the First Explanation</h1><p>During production incidents, someone will almost always say something like:</p><p>&#8220;Database down hai.&#8221;</p><p>&#8220;API broken hai.&#8221;</p><p>&#8220;Payment service is down.&#8221;</p><p>I&#8217;ve learned not to take these statements as facts.</p><p>Usually, they&#8217;re just someone&#8217;s observation.</p><p>If a payment fails, it doesn&#8217;t necessarily mean the payment service is broken. Maybe the database is fine. Maybe the API is fine. Maybe a third-party service is returning something unexpected.</p><p>So now, whenever I hear <strong>&#8220;X is broken&#8221;</strong>, my first reaction is:</p><p><strong>&#8220;Okay, let&#8217;s verify that.&#8221;</strong></p><p>That one habit can save a lot of time.</p><h1>Start With the Timeline</h1><p>The next thing I usually check is the timeline.</p><p>When did the problem actually start? And more importantly, <strong>what changed just before it started?</strong></p><p>Was there a deployment? A configuration change? A database migration? A traffic spike? A change in another service?</p><p>Production systems have a lot of moving parts, and sometimes your code hasn&#8217;t changed at all.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!m2C2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00df552f-577f-47f0-9d85-d8b6cb7a15ef_1600x671.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!m2C2!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00df552f-577f-47f0-9d85-d8b6cb7a15ef_1600x671.png 424w, /__u/substackcdn.com/image/fetch/$s_!m2C2!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00df552f-577f-47f0-9d85-d8b6cb7a15ef_1600x671.png 848w, /__u/substackcdn.com/image/fetch/$s_!m2C2!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00df552f-577f-47f0-9d85-d8b6cb7a15ef_1600x671.png 1272w, /__u/substackcdn.com/image/fetch/$s_!m2C2!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00df552f-577f-47f0-9d85-d8b6cb7a15ef_1600x671.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!m2C2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00df552f-577f-47f0-9d85-d8b6cb7a15ef_1600x671.png" width="1456" height="611" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/00df552f-577f-47f0-9d85-d8b6cb7a15ef_1600x671.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:611,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!m2C2!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00df552f-577f-47f0-9d85-d8b6cb7a15ef_1600x671.png 424w, /__u/substackcdn.com/image/fetch/$s_!m2C2!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00df552f-577f-47f0-9d85-d8b6cb7a15ef_1600x671.png 848w, /__u/substackcdn.com/image/fetch/$s_!m2C2!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00df552f-577f-47f0-9d85-d8b6cb7a15ef_1600x671.png 1272w, /__u/substackcdn.com/image/fetch/$s_!m2C2!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00df552f-577f-47f0-9d85-d8b6cb7a15ef_1600x671.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Maybe another service was deployed.</p><blockquote><p><em>Maybe traffic suddenly increased.</em></p><p><em>Maybe a scheduled job started behaving differently.</em></p><p><em>Maybe an external API started responding slowly</em>.</p></blockquote><p>That night, we noticed that the failures had started shortly after a deployment. Interesting. But I didn&#8217;t want to immediately say, <strong>&#8220;Deployment caused it.&#8221;</strong></p><p>It was a clue, not a conclusion.</p><h1>The Production Debugging Flow</h1><p>This is roughly how I approach a production issue now. I start broad, collect evidence, and slowly narrow the problem down until I reach the actual failure point.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!BnS_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F403e9e24-cd6f-410d-a3ed-3a7295fc5ccb_1600x2369.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!BnS_!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F403e9e24-cd6f-410d-a3ed-3a7295fc5ccb_1600x2369.png 424w, /__u/substackcdn.com/image/fetch/$s_!BnS_!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F403e9e24-cd6f-410d-a3ed-3a7295fc5ccb_1600x2369.png 848w, /__u/substackcdn.com/image/fetch/$s_!BnS_!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F403e9e24-cd6f-410d-a3ed-3a7295fc5ccb_1600x2369.png 1272w, /__u/substackcdn.com/image/fetch/$s_!BnS_!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F403e9e24-cd6f-410d-a3ed-3a7295fc5ccb_1600x2369.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!BnS_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F403e9e24-cd6f-410d-a3ed-3a7295fc5ccb_1600x2369.png" width="1456" height="2156" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/403e9e24-cd6f-410d-a3ed-3a7295fc5ccb_1600x2369.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:2156,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!BnS_!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F403e9e24-cd6f-410d-a3ed-3a7295fc5ccb_1600x2369.png 424w, /__u/substackcdn.com/image/fetch/$s_!BnS_!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F403e9e24-cd6f-410d-a3ed-3a7295fc5ccb_1600x2369.png 848w, /__u/substackcdn.com/image/fetch/$s_!BnS_!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F403e9e24-cd6f-410d-a3ed-3a7295fc5ccb_1600x2369.png 1272w, /__u/substackcdn.com/image/fetch/$s_!BnS_!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F403e9e24-cd6f-410d-a3ed-3a7295fc5ccb_1600x2369.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h1>Follow One Failing Request</h1><p>At this point, instead of looking at thousands of logs, I picked one failing request. I wanted to follow its entire journey.</p><p>The request reached our API. The business logic ran. The database responded normally. Then our service called another service. And that&#8217;s where things started looking strange.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!wMkJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31f6cb8a-3c2b-4abb-89da-9f0544fe61f4_1449x821.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!wMkJ!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31f6cb8a-3c2b-4abb-89da-9f0544fe61f4_1449x821.png 424w, /__u/substackcdn.com/image/fetch/$s_!wMkJ!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31f6cb8a-3c2b-4abb-89da-9f0544fe61f4_1449x821.png 848w, /__u/substackcdn.com/image/fetch/$s_!wMkJ!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31f6cb8a-3c2b-4abb-89da-9f0544fe61f4_1449x821.png 1272w, /__u/substackcdn.com/image/fetch/$s_!wMkJ!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31f6cb8a-3c2b-4abb-89da-9f0544fe61f4_1449x821.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!wMkJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31f6cb8a-3c2b-4abb-89da-9f0544fe61f4_1449x821.png" width="1449" height="821" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/31f6cb8a-3c2b-4abb-89da-9f0544fe61f4_1449x821.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:821,&quot;width&quot;:1449,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!wMkJ!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31f6cb8a-3c2b-4abb-89da-9f0544fe61f4_1449x821.png 424w, /__u/substackcdn.com/image/fetch/$s_!wMkJ!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31f6cb8a-3c2b-4abb-89da-9f0544fe61f4_1449x821.png 848w, /__u/substackcdn.com/image/fetch/$s_!wMkJ!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31f6cb8a-3c2b-4abb-89da-9f0544fe61f4_1449x821.png 1272w, /__u/substackcdn.com/image/fetch/$s_!wMkJ!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31f6cb8a-3c2b-4abb-89da-9f0544fe61f4_1449x821.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This is where I usually step back and look at the bigger picture. A production issue rarely gives you the answer from one place.</p><p>I look at the timeline, logs, metrics and request trace together, then compare the evidence before deciding what the actual root cause is.</p><p>The downstream service wasn&#8217;t completely down. It was responding, but in one particular scenario, the response wasn&#8217;t what our application expected.</p><p>That changed everything.</p><p>We weren&#8217;t dealing with a completely broken application.</p><p>We had a specific failure happening between two services.</p><p>This is something production teaches you pretty quickly: your application doesn&#8217;t live alone. It depends on databases, queues, other services, external APIs and infrastructure.</p><p>Sometimes your code is perfectly fine.</p><p>Something around it isn&#8217;t.</p><h1>Find One That Works</h1><p>One of the simplest things I do during debugging is compare a failing request with a successful request.</p><p>Same API?</p><p>Same type of user?</p><p>Same data?</p><p>Same region?</p><p>Same request?</p><p>Same downstream response?</p><p>Usually, there is a difference somewhere.</p><p>Maybe one particular data combination is causing the issue.</p><p>Maybe only older records fail.</p><p>Maybe only a particular user flow triggers it.</p><p>The moment you find that difference, the problem becomes much easier.</p><p>Instead of saying:</p><p><strong>&#8220;The payment system is broken.&#8221;</strong></p><p>You can say:</p><p><strong>&#8220;Payments fail when this specific condition occurs.&#8221;</strong></p><p>That&#8217;s a much better problem to have.</p><h1>Logs Should Tell You a Story</h1><p>I used to think more logs meant easier debugging.</p><p>Not really.</p><p>I&#8217;ve seen systems where a single request generates hundreds of log lines. Everything is logged, but when production breaks, finding the useful information becomes harder.</p><p>What you actually want is a story.</p><p>Which request was this?</p><p>What operation was happening?</p><p>Which service handled it?</p><p>Which dependency was called?</p><p>What happened after that?</p><p>This is where correlation IDs are extremely useful.</p><p>If a request travels through multiple services, you should be able to follow that request across the system.</p><p>At 2 AM, you don&#8217;t want more information.</p><p>You want the <strong>right information</strong>.</p><h1>Don&#8217;t Change Everything at Once</h1><p>This is probably the easiest mistake to make when everyone is waiting for you.</p><p>You increase a timeout.</p><p>Restart the service.</p><p>Change some configuration.</p><p>Modify the query.</p><p>Deploy again.</p><p>And suddenly everything works.</p><p>Great.</p><p>But what actually fixed it?</p><p>You don&#8217;t know.</p><p>Maybe the restart helped. Maybe the configuration change helped. Maybe the external service recovered at the same time.</p><p>That&#8217;s why I try to make one meaningful change at a time.</p><p>Change something.</p><p>Observe.</p><p>Measure.</p><p>Then move forward.</p><p>Otherwise, you might fix the problem without understanding it.</p><p>And the next time it happens, you&#8217;re back at the beginning.</p><h1>Sometimes Rollback Is the Right Fix</h1><p>There is sometimes a strange ego around deployments.</p><p>Engineers don&#8217;t want to rollback because it feels like admitting that the deployment was wrong.</p><p>But production doesn&#8217;t care about your ego.</p><p>If a recent deployment is strongly connected to the incident and rollback is safe, rollback.</p><p>The goal during an incident is not to prove that your code is perfect.</p><p>The goal is to get users back to a stable system.</p><p>You can investigate the real root cause afterward.</p><p><strong>Production first. Ego later.</strong></p><h1>The Hardest Part Is Staying Calm</h1><p>Honestly, the technical problem isn&#8217;t always the hardest part.</p><p>The pressure is.</p><p>Someone asks, &#8220;Any update?&#8221;</p><p>You say you&#8217;re checking.</p><p>Five minutes later:</p><p>&#8220;Any update?&#8221;</p><p>Another team is waiting. Someone wants to know the impact. Meanwhile, you&#8217;re staring at the logs thinking, <strong>&#8220;I still don&#8217;t know what&#8217;s happening.&#8221;</strong></p><p>I&#8217;ve been there.</p><p>And I&#8217;ve learned that not knowing the answer doesn&#8217;t mean you need to start moving faster.</p><p>Sometimes you need to stop for thirty seconds.</p><p>Ask yourself:</p><p><strong>What do I know?</strong></p><p><strong>What don&#8217;t I know?</strong></p><p><strong>What have I already ruled out?</strong></p><p><strong>What&#8217;s the next thing I can check?</strong></p><p>That&#8217;s enough.</p><p>You don&#8217;t need to solve the whole incident in your head.</p><p>You just need to find the next useful clue.</p><h1>The Problem Usually Becomes Smaller</h1><p>At 2 AM, the problem looked huge.</p><p><strong>&#8220;Payment is failing in production.&#8221;</strong></p><p>But after checking the metrics, looking at the timeline, following one request and comparing it with a successful request, the problem became much smaller.</p><p>It wasn&#8217;t the entire payment system.</p><p>It wasn&#8217;t the database.</p><p>It wasn&#8217;t even the whole API.</p><p>It was a specific interaction between services under a specific condition.</p><p>That&#8217;s how I think about debugging now.</p><p>You don&#8217;t magically find the answer.</p><p>You keep removing possibilities.</p><p>One by one.</p><p>Until the giant production problem becomes one service, one request, one dependency and one bug.</p><p>And that&#8217;s when debugging becomes much easier.</p><h1>Fixing the Bug Isn&#8217;t the End</h1><p>Once everything starts working again, it&#8217;s tempting to close the laptop and forget the whole thing.</p><p>But that&#8217;s actually when the important questions start.</p><p>Why did this happen?</p><p>Why didn&#8217;t we catch it earlier?</p><p>Why didn&#8217;t our monitoring detect it?</p><p>Could we have handled the failure better?</p><p>Do we need better validation?</p><p>Better logging?</p><p>A timeout?</p><p>A circuit breaker?</p><p>A test?</p><p>The goal isn&#8217;t just to fix today&#8217;s incident.</p><p>It&#8217;s to make sure the same problem doesn&#8217;t wake you up at 2 AM again.</p><h1>What I Finally Learned</h1><p>I used to think a good engineer was someone who could look at an error and immediately know the answer.</p><p>I don&#8217;t think that anymore.</p><p>The engineers I respect most aren&#8217;t the ones who know everything.</p><p>They&#8217;re the ones who stay calm when they <strong>don&#8217;t</strong> know.</p><p>They don&#8217;t guess.</p><p>They don&#8217;t randomly change five things.</p><p>They don&#8217;t assume the first error message is the root cause.</p><p>They simply keep asking better questions.</p><p>Did the request reach the service?</p><p>Did the database respond?</p><p>Did the downstream service respond?</p><p>When did the problem start?</p><p>What changed?</p><p>Why did this request fail while another one worked?</p><p>Slowly, the huge problem becomes smaller.</p><p>And eventually, you find the answer.</p><p>So the next time your phone rings at 2 AM and someone says, <strong>&#8220;Production mein issue hai,&#8221;</strong> don&#8217;t immediately start changing things.</p><p>Take a breath.</p><p>Understand what is actually happening.</p><p>Follow one failing request.</p><p>Find one that worked.</p><p>Compare them.</p><p>Reduce the possibilities.</p><p>Then fix the thing that is actually broken.</p><p>Because production debugging isn&#8217;t about being the smartest person in the room.</p><p>It&#8217;s about staying calm enough to figure out what the system is trying to tell you.</p><p>And honestly, that&#8217;s one of the most valuable engineering skills I&#8217;ve learned.</p><h1>Before You Go</h1><p>One more thing.</p><p>If you&#8217;re serious about becoming a better software engineer, I&#8217;m building something that might be useful for you.</p><p>Instead of putting everything into one huge learning platform, I&#8217;ve created focused learning paths for different stages of an engineer&#8217;s journey.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!nBoB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3383bd92-2846-4632-ac87-88913bdac4e5_2400x1500.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!nBoB!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3383bd92-2846-4632-ac87-88913bdac4e5_2400x1500.png 424w, /__u/substackcdn.com/image/fetch/$s_!nBoB!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3383bd92-2846-4632-ac87-88913bdac4e5_2400x1500.png 848w, /__u/substackcdn.com/image/fetch/$s_!nBoB!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3383bd92-2846-4632-ac87-88913bdac4e5_2400x1500.png 1272w, /__u/substackcdn.com/image/fetch/$s_!nBoB!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3383bd92-2846-4632-ac87-88913bdac4e5_2400x1500.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!nBoB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3383bd92-2846-4632-ac87-88913bdac4e5_2400x1500.png" width="1456" height="910" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3383bd92-2846-4632-ac87-88913bdac4e5_2400x1500.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:910,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!nBoB!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3383bd92-2846-4632-ac87-88913bdac4e5_2400x1500.png 424w, /__u/substackcdn.com/image/fetch/$s_!nBoB!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3383bd92-2846-4632-ac87-88913bdac4e5_2400x1500.png 848w, /__u/substackcdn.com/image/fetch/$s_!nBoB!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3383bd92-2846-4632-ac87-88913bdac4e5_2400x1500.png 1272w, /__u/substackcdn.com/image/fetch/$s_!nBoB!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3383bd92-2846-4632-ac87-88913bdac4e5_2400x1500.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Master AI Engineering</strong><br>Learn how to build AI-powered applications, understand AI systems, work with LLMs, agents, RAG, and take AI from an idea to something that actually works.</p><p>Master AI Engineering: <a href="https://algorithmxlr8.io/ai/engineering/home">https://algorithmxlr8.io/ai/engineering/home</a></p><p><strong>Master DevOps Engineering</strong><br>Understand the engineering behind deployments, containers, CI/CD, cloud infrastructure, monitoring, scalability, and running applications reliably in production.</p><p>Master DevOps Engineering: <a href="https://algorithmxlr8.io/devops/engineering/home">https://algorithmxlr8.io/devops/engineering/home</a></p><p><strong>Master Software Engineer Interviews</strong><br>DSA, LLD, HLD, System Design and the kind of problems you&#8217;re actually expected to solve in software engineering interviews.</p><p>Master Software Engineer Interviews: </p><p>https://algorithmxlr8.io/</p><p>The goal isn&#8217;t just to help you <strong>clear an interview</strong>.</p><p>It&#8217;s to help you become the engineer who actually understands <strong>what&#8217;s happening behind the code, how systems work, and how to build things properly.</strong></p><p>If that sounds like the kind of engineer you want to become, <strong>come join me on the journey.</strong></p><p>Explore: </p><p>https://algorithmxlr8.io/</p>]]></content:encoded></item><item><title><![CDATA[How to Understand a Large Codebase Without Losing Your Mind]]></title><description><![CDATA[I had worked on plenty of projects before. I knew Java. I knew Spring Boot. I knew APIs, databases, queues, Docker, AWS, all the usual things.]]></description><link>https://singour.substack.com/p/how-to-understand-a-large-codebase</link><guid isPermaLink="false">https://singour.substack.com/p/how-to-understand-a-large-codebase</guid><dc:creator><![CDATA[Himanshu Singour]]></dc:creator><pubDate>Tue, 11 Aug 2026 10:31:16 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!U1hr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ffd51e9-44b0-4bf9-b153-109278827b61_1536x1024.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!U1hr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ffd51e9-44b0-4bf9-b153-109278827b61_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!U1hr!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ffd51e9-44b0-4bf9-b153-109278827b61_1536x1024.png 424w, /__u/substackcdn.com/image/fetch/$s_!U1hr!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ffd51e9-44b0-4bf9-b153-109278827b61_1536x1024.png 848w, /__u/substackcdn.com/image/fetch/$s_!U1hr!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ffd51e9-44b0-4bf9-b153-109278827b61_1536x1024.png 1272w, /__u/substackcdn.com/image/fetch/$s_!U1hr!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ffd51e9-44b0-4bf9-b153-109278827b61_1536x1024.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!U1hr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ffd51e9-44b0-4bf9-b153-109278827b61_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8ffd51e9-44b0-4bf9-b153-109278827b61_1536x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:971,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="/__u/substackcdn.com/image/fetch/$s_!U1hr!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ffd51e9-44b0-4bf9-b153-109278827b61_1536x1024.png 424w, /__u/substackcdn.com/image/fetch/$s_!U1hr!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ffd51e9-44b0-4bf9-b153-109278827b61_1536x1024.png 848w, /__u/substackcdn.com/image/fetch/$s_!U1hr!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ffd51e9-44b0-4bf9-b153-109278827b61_1536x1024.png 1272w, /__u/substackcdn.com/image/fetch/$s_!U1hr!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ffd51e9-44b0-4bf9-b153-109278827b61_1536x1024.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>I still remember the first time I opened a genuinely large codebase.</p><p>I had worked on plenty of projects before. I knew Java. I knew Spring Boot. I knew APIs, databases, queues, Docker, AWS, all the usual things.</p><p>So when someone said, <strong>&#8220;You&#8217;ll need to understand this repository before making the change,&#8221;</strong> I thought:</p><p><em>Okay. Give me a couple of hours.</em></p><p>Then I opened the repository.</p><p>There were hundreds of folders.</p><p><code>controller</code></p><p><code>service</code></p><p><code>repository</code></p><p><code>config</code></p><p><code>client</code></p><p><code>consumer</code></p><p><code>producer</code></p><p><code>handler</code></p><p><code>factory</code></p><p><code>strategy</code></p><p><code>processor</code></p><p><code>scheduler</code></p><p><code>utils</code></p><p>And then there were folders whose names made absolutely no sense.</p><p>I opened one class.</p><p>It called another class.</p><p>That class called another service.</p><p>That service called a client.</p><p>The client published an event.</p><p>The event was consumed somewhere else.</p><p>That consumer triggered another service.</p><p>That service updated the database.</p><p>And somewhere in the middle, there was a Redis cache.</p><p>I closed the file.</p><p>Opened another one.</p><p>Same story.</p><p>After an hour, I had read a lot of code.</p><p>But I understood <strong>nothing</strong>.</p><p>And that&#8217;s when I learned one of the most important lessons of working with large software systems:</p><blockquote><p><em><strong>You don&#8217;t understand a large codebase by reading more code. You understand it by building the right mental model.</strong></em></p></blockquote><p>That completely changed how I approach unfamiliar repositories.</p><div><hr></div><h2><strong>The Biggest Mistake: Starting With the Code</strong></h2><p>When developers join a new project, the first instinct is usually:</p><p><strong>&#8220;Let me start reading the code.&#8221;</strong></p><p>That&#8217;s exactly what I used to do.</p><p>Open <code>UserController</code>.</p><p>Read 200 lines.</p><p>Open <code>UserService</code>.</p><p>Read 400 lines.</p><p>Open <code>UserRepository</code>.</p><p>Read 100 lines.</p><p>Then jump to <code>PaymentService</code>.</p><p>Then <code>OrderService</code>.</p><p>Then some random utility.</p><p>After three hours, you feel productive because you have seen thousands of lines.</p><p>But if someone asks:</p><p><strong>&#8220;So how does an order actually get created?&#8221;</strong></p><p>You have no idea.</p><p>That&#8217;s the trap.</p><p>A large codebase is not a book.</p><p>You don&#8217;t read it from page 1 to the last page.</p><p>A large codebase is more like a <strong>city</strong>.</p><p>If you enter a new city, you don&#8217;t walk into the first building and start studying its walls.</p><p>First, you look at the map.</p><p>You figure out:</p><p>Where is the airport?</p><p>Where is downtown?</p><p>Where are the major roads?</p><p>Where are the important neighborhoods?</p><p>Only then do you start exploring individual buildings.</p><p>A codebase works exactly the same way.</p><div><hr></div><h2><strong>Step 1: Don&#8217;t Read the Code. Find the Business.</strong></h2><p>Before looking at classes, ask:</p><p><strong>What does this system actually do?</strong></p><p>Imagine you join an e-commerce company.</p><p>You are given a repository called:</p><p><code>commerce-platform</code></p><p>You could start with:</p><pre><code><code>src/
 &#9500;&#9472;&#9472; controller/
 &#9500;&#9472;&#9472; service/
 &#9500;&#9472;&#9472; repository/
 &#9500;&#9472;&#9472; config/
 &#9500;&#9472;&#9472; consumer/
 &#9500;&#9472;&#9472; producer/
 &#9492;&#9472;&#9472; client/</code></code></pre><p>But instead, ask a completely different question:</p><blockquote><p><em><strong>What happens when a customer places an order?</strong></em></p></blockquote><p>Now you have a story.</p><p>Customer opens the application.</p><p>They add products to the cart.</p><p>They click <strong>Buy Now</strong>.</p><p>The backend receives the request.</p><p>An order is created.</p><p>Payment is initiated.</p><p>Inventory is reserved.</p><p>The customer receives confirmation.</p><p>That&#8217;s already more useful than reading 500 classes.</p><p>Because now you&#8217;re not trying to understand the entire system.</p><p>You&#8217;re trying to understand <strong>one journey through the system</strong>.</p><p>And that journey becomes your entry point.</p><div><hr></div><h2><strong>Step 2: Find the Entry Point</strong></h2><p>Every important operation has somewhere it enters the system.</p><p>For an HTTP application, it might be:</p><pre><code><code>POST /orders</code></code></pre><p>Search for it.</p><p>Maybe you find:</p><pre><code><code>@PostMapping(&#8221;/orders&#8221;)
public OrderResponse createOrder(
        @RequestBody CreateOrderRequest request) {
return orderService.createOrder(request);
}</code></code></pre><p>Perfect.</p><p>You now have your first door into the system.</p><p>Don&#8217;t immediately understand every line.</p><p>Just follow the path.</p><pre><code><code>Controller
    &#8595;
Service
    &#8595;
Repository
    &#8595;
Database</code></code></pre><p>Maybe the real system is more complicated:</p><pre><code><code>Controller
    &#8595;
OrderService
    &#8595;
InventoryService
    &#8595;
PaymentService
    &#8595;
EventPublisher
    &#8595;
Kafka
    &#8595;
OrderConsumer
    &#8595;
NotificationService</code></code></pre><p>Now something interesting happens.</p><p>You are no longer looking at <strong>classes</strong>.</p><p>You&#8217;re looking at a <strong>story</strong>.</p><p>And stories are much easier for humans to remember.</p><div><hr></div><h2><strong>Step 3: Trace One Request End-to-End</strong></h2><p>This is probably the most powerful technique I&#8217;ve learned.</p><p>Pick one important operation.</p><p>For example:</p><p><strong>&#8220;Create Order.&#8221;</strong></p><p>Then trace it from beginning to end.</p><p>Write it down.</p><p>Literally.</p><pre><code><code>POST /order
&#8595;
OrderController
        &#8595;
OrderService.createOrder()
        &#8595;
InventoryService.reserve()
        &#8595;
PaymentService.charge()
        &#8595;
OrderRepository.save()
        &#8595;
Kafka &#8594; OrderCreatedEvent
        &#8595;
NotificationConsumer
        &#8595;
EmailService</code></code></pre><p>Suddenly the giant repository doesn&#8217;t look so scary anymore.</p><p>You have discovered one path through the forest.</p><p>Now do the same for:</p><p><strong>Cancel Order</strong></p><pre><code><code>DELETE /orders/{id}
&#8595;
OrderController
        &#8595;
OrderService.cancel()
        &#8595;
PaymentService.refund()
        &#8595;
InventoryService.release()
        &#8595;
OrderRepository.update()
        &#8595;
OrderCancelledEvent</code></code></pre><p>Now you understand two important business flows.</p><p>And something magical starts happening.</p><p>The same classes appear again.</p><p>You begin recognizing them.</p><p><em>&#8220;Oh, I&#8217;ve already seen OrderService.&#8221;</em></p><p><em>&#8220;I&#8217;ve already seen PaymentService.&#8221;</em></p><p><em>&#8220;So this event is also consumed by NotificationService.&#8221;</em></p><p>That&#8217;s how a large codebase slowly becomes familiar.</p><div><hr></div><h2><strong>Step 4: Build Your Own Map</strong></h2><p>One mistake I see engineers make is trying to remember everything in their head.</p><p>Don&#8217;t.</p><p>Create a map.</p><p>It can be something as simple as:</p><pre><code><code>                     &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;
                     &#9474;   Client     &#9474;
                     &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;
                            &#8595;
                     &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;
                     &#9474; Controller   &#9474;
                     &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;
                            &#8595;
                     &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;
                     &#9474;   Service    &#9474;
                     &#9492;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9496;
                         &#8595;      &#8595;
                  &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488; &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;
                  &#9474;  DB     &#9474; &#9474; Payment &#9474;
                  &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496; &#9492;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9496;
                                   &#8595;
                                Kafka
                                   &#8595;
                              Consumers</code></code></pre><p>It doesn&#8217;t need to be beautiful.</p><p>It needs to be <strong>useful</strong>.</p><p>Personally, I like writing three things for every unfamiliar system:</p><h2><strong>1. What comes in?</strong></h2><pre><code><code>HTTP
Kafka
Scheduler
External API</code></code></pre><h2><strong>2. What happens in the middle?</strong></h2><pre><code><code>Validation
Business logic
Database
Cache
External services
Events</code></code></pre><h2><strong>3. What goes out?</strong></h2><pre><code><code>HTTP response
Kafka event
Email
Database update
External API call</code></code></pre><p>Once you can answer those three questions, the system becomes much easier to navigate.</p><div><hr></div><h2><strong>Step 5: Understand the Data Before the Classes</strong></h2><p>Here&#8217;s another mistake I made early in my career.</p><p>I spent hours understanding services.</p><p>But I didn&#8217;t understand the data.</p><p>That&#8217;s backwards.</p><p>Suppose you&#8217;re working on a payment system.</p><p>Before understanding <code>PaymentService.java</code>, find out:</p><p><strong>What is a Payment?</strong></p><p>Maybe the database looks something like:</p><pre><code><code>Payment
id
orderId
userId
amount
currency
status
transactionId
createdAt
updatedAt</code></code></pre><p>Now the code starts making sense.</p><p>You see:</p><pre><code><code>payment.setStatus(PaymentStatus.SUCCESS);</code></code></pre><p>You know why it exists.</p><p>You see:</p><pre><code><code>paymentRepository.findByOrderId(orderId);</code></code></pre><p>You understand what relationship is being used.</p><p>You see:</p><pre><code><code>transactionId</code></code></pre><p>And you immediately think:</p><p><em>&#8220;This probably connects our payment record with the external payment provider.&#8221;</em></p><p>Without understanding the data, code is just syntax.</p><p>With the data, code starts telling a story.</p><div><hr></div><h2><strong>Step 6: Find the Database Tables</strong></h2><p>Whenever I enter a new backend project, one of the first things I want to understand is:</p><p><strong>What are the important entities?</strong></p><p>For example:</p><pre><code><code>User
Order
Product
Payment
Inventory
Shipment</code></code></pre><p>Then ask:</p><pre><code><code>User
  &#8595;
Order
  &#8595;
Payment
  &#8595;
Shipment</code></code></pre><p>Maybe:</p><pre><code><code>Order
 &#9500;&#9472;&#9472; userId
 &#9500;&#9472;&#9472; paymentId
 &#9492;&#9472;&#9472; shipmentId</code></code></pre><p>Now you have another mental model.</p><p>You understand not only <strong>what the code does</strong>, but also <strong>what the system is storing</strong>.</p><p>And this becomes extremely useful when debugging.</p><p>Because many production bugs eventually become:</p><blockquote><p><em>&#8220;Something went wrong between these two pieces of data.&#8221;</em></p></blockquote><div><hr></div><h2><strong>Step 7: Don&#8217;t Ignore Configuration</strong></h2><p>This one looks boring.</p><p>It isn&#8217;t.</p><p>I&#8217;ve seen engineers spend hours trying to understand application behavior while completely ignoring:</p><pre><code><code>application.yml
application.properties
.env
Dockerfile
docker-compose.yml</code></code></pre><p>Configuration often tells you more about a system than the Java classes.</p><p>Look for:</p><pre><code><code>Database
Redis
Kafka
S3
AWS
External APIs
Feature flags
Timeouts
Retries
Thread pools
Connection pools</code></code></pre><p>Suppose you find:</p><pre><code><code>payment:
  timeout: 3000
kafka:
  retries: 3
redis:
  ttl: 3600</code></code></pre><p>Now you already know something about the architecture.</p><p>The system talks to a payment provider.</p><p>It uses Kafka.</p><p>It uses Redis.</p><p>The payment call has a timeout.</p><p>Kafka retries failures.</p><p>Redis data expires after an hour.</p><p>You just learned a lot without reading hundreds of classes.</p><div><hr></div><h2><strong>Step 8: Find the External Systems</strong></h2><p>Large systems almost never live alone.</p><p>They talk to other systems.</p><p>Your codebase might interact with:</p><pre><code><code>Payment Gateway
Kafka
Redis
PostgreSQL
MongoDB
S3
Elasticsearch
Notification Service
Identity Service</code></code></pre><p>Find those integrations.</p><p>Search for things like:</p><pre><code><code>RestTemplate
WebClient
FeignClient
KafkaTemplate
RedisTemplate
S3Client
MongoRepository
JpaRepository</code></code></pre><p>Then ask:</p><p><strong>Why does this system depend on that system?</strong></p><p>That&#8217;s important.</p><p>Don&#8217;t just memorize:</p><blockquote><p><em>&#8220;We use Kafka.&#8221;</em></p></blockquote><p>Understand:</p><blockquote><p><em>&#8220;We use Kafka because order processing doesn&#8217;t need to wait for notification processing.&#8221;</em></p></blockquote><p>Now you&#8217;ve understood the <strong>reason</strong>, not just the technology.</p><p>And reasons are easier to remember.</p><div><hr></div><h2><strong>Step 9: Use Git Like a Detective</strong></h2><p>This is one of the most underrated techniques.</p><p>When you don&#8217;t understand why some weird code exists, don&#8217;t stare at it for two hours.</p><p>Check Git history.</p><p>For example:</p><pre><code><code>git log</code></code></pre><p>Or:</p><pre><code><code>git blame PaymentService.java</code></code></pre><p>You might discover:</p><pre><code><code>Added retry logic after payment provider timeout issue</code></code></pre><p>Suddenly that strange-looking code makes sense.</p><p>Maybe you find:</p><pre><code><code>if (attempt &gt; 2) {
    throw new PaymentException();
}</code></code></pre><p>At first you think:</p><p><em>&#8220;Why only two retries?&#8221;</em></p><p>Git history might tell you:</p><p><em>&#8220;Because the payment provider starts rate-limiting requests after three attempts.&#8221;</em></p><p>Boom.</p><p>The code wasn&#8217;t random.</p><p>There was a production incident behind it.</p><p>This is why mature codebases sometimes look messy.</p><p>You&#8217;re not just reading software.</p><p>You&#8217;re reading <strong>the history of decisions</strong>.</p><div><hr></div><h2><strong>Step 10: Read Tests Before Implementation</strong></h2><p>This changed my life.</p><p>Suppose you find:</p><pre><code><code>OrderService.createOrder()</code></code></pre><p>You could open the implementation.</p><p>Or you could first search:</p><pre><code><code>OrderServiceTest</code></code></pre><p>Tests often tell you what the business actually expects.</p><p>For example:</p><pre><code><code>shouldNotCreateOrderWhenInventoryUnavailable()
shouldRefundPaymentWhenOrderCancellationFails()
shouldRetryPaymentWhenProviderTimesOut()
shouldNotDuplicateOrderForSameIdempotencyKey()</code></code></pre><p>Look at those test names.</p><p>You just discovered important business rules.</p><p>And you didn&#8217;t need to read 500 lines of implementation.</p><p>Tests are often the <strong>closest thing to executable documentation</strong>.</p><div><hr></div><h2><strong>Step 11: Learn the &#8220;Happy Path&#8221; First</strong></h2><p>Don&#8217;t start with exceptions.</p><p>Don&#8217;t start with every edge case.</p><p>Don&#8217;t start with the most complicated class.</p><p>First understand:</p><p><strong>What happens when everything goes right?</strong></p><p>For an order:</p><pre><code><code>Request
 &#8595;
Validate
 &#8595;
Create Order
 &#8595;
Reserve Inventory
 &#8595;
Charge Payment
 &#8595;
Save Order
 &#8595;
Publish Event
 &#8595;
Send Confirmation</code></code></pre><p>That&#8217;s your happy path.</p><p>Once you understand that, start asking:</p><p><strong>What happens if payment fails?</strong></p><pre><code><code>Payment fails
      &#8595;
Retry
      &#8595;
Still fails
      &#8595;
Release inventory
      &#8595;
Mark order FAILED
      &#8595;
Return error</code></code></pre><p>Then:</p><p><strong>What happens if Kafka is down?</strong></p><p>Then:</p><p><strong>What happens if the request is sent twice?</strong></p><p>Then:</p><p><strong>What happens if the database succeeds but event publishing fails?</strong></p><p>This is how you move from basic understanding to real engineering understanding.</p><div><hr></div><h2><strong>Step 12: Look for the Weird Parts</strong></h2><p>Once you&#8217;ve understood the normal flow, start looking for things that make you say:</p><p><strong>&#8220;Why the hell are they doing this?&#8221;</strong></p><p>Those places are gold.</p><p>Maybe you find:</p><pre><code><code>Thread.sleep(500);</code></code></pre><p>Why?</p><p>Maybe you find:</p><pre><code><code>cache.put(key, value, 300);</code></code></pre><p>Why 300?</p><p>Maybe you find:</p><pre><code><code>if (retryCount &lt; 3)</code></code></pre><p>Why three?</p><p>Maybe you find:</p><pre><code><code>@Transactional</code></code></pre><p>Why is the transaction boundary here?</p><p>Maybe you find:</p><pre><code><code>eventPublisher.publish(...)</code></code></pre><p>inside a database transaction.</p><p>Now you have interesting questions.</p><p>And these questions often lead you toward the most important architectural decisions in the system.</p><div><hr></div><h2><strong>Step 13: Don&#8217;t Try to Understand Every Class</strong></h2><p>This is probably the most important thing in this entire article.</p><p>You don&#8217;t need to understand 100% of the codebase.</p><p>You need to understand the <strong>20% that matters for your task</strong>.</p><p>Imagine you receive this ticket:</p><blockquote><p><em>&#8220;Fix duplicate payments when the client retries the request.&#8221;</em></p></blockquote><p>You don&#8217;t need to understand:</p><pre><code><code>UserProfileService
RecommendationEngine
SearchService
NotificationService
AnalyticsService
ReportingService</code></code></pre><p>You need to find:</p><pre><code><code>Payment API
      &#8595;
Payment Service
      &#8595;
Payment Provider
      &#8595;
Database</code></code></pre><p>Then ask:</p><p><strong>Where is the request ID?</strong></p><p><strong>Where is idempotency handled?</strong></p><p><strong>Where is the payment persisted?</strong></p><p><strong>What happens when the same request comes twice?</strong></p><p>Your understanding should be <strong>task-driven</strong>.</p><p>Not repository-driven.</p><div><hr></div><h2><strong>A Real Example</strong></h2><p>Let&#8217;s say you join a company and receive this bug:</p><blockquote><p><em>&#8220;Customers are sometimes charged twice when they click Pay multiple times.&#8221;</em></p></blockquote><p>You open the repository.</p><p>You don&#8217;t start reading everything.</p><p>You start with:</p><pre><code><code>POST /payments</code></code></pre><p>You find:</p><pre><code><code>PaymentController
       &#8595;
PaymentService
       &#8595;
PaymentGateway
       &#8595;
PaymentRepository</code></code></pre><p>Then you ask:</p><p><strong>What happens when the same request arrives twice?</strong></p><p>You find:</p><pre><code><code>public PaymentResponse pay(PaymentRequest request) {
paymentGateway.charge(
        request.getAmount()
    );
    Payment payment = new Payment();
    payment.setOrderId(request.getOrderId());
    paymentRepository.save(payment);
    return PaymentResponse.success();
}</code></code></pre><p>And suddenly you see the problem.</p><p>The system charges first.</p><p>Then saves the payment.</p><p>There is no idempotency check.</p><p>So:</p><pre><code><code>Request #1
    &#8595;
Charge &#8377;1000
    &#8595;
Save payment</code></code></pre><p>Then the user retries:</p><pre><code><code>Request #2
    &#8595;
Charge &#8377;1000 AGAIN
    &#8595;
Save another payment</code></code></pre><p>The customer loses &#8377;2000.</p><p>You didn&#8217;t understand the entire repository.</p><p>You didn&#8217;t need to.</p><p>You understood the <strong>payment journey</strong>.</p><p>And that&#8217;s enough to solve the problem.</p><h2><strong>The 30-Minute Rule</strong></h2><p>When I enter an unfamiliar codebase, I now give myself a rule:</p><p><strong>Don&#8217;t try to become an expert in the first 30 minutes.</strong></p><p>The goal of the first 30 minutes is only to answer:</p><pre><code><code>What does this system do?
Where does a request enter?
What are the major services?
Where is the database?
What external systems exist?
Where are the important business flows?
What part is relevant to my task?</code></code></pre><p>That&#8217;s it.</p><p>If you can answer those questions, you&#8217;ve already won.</p><div><hr></div><h2><strong>The &#8220;Breadcrumb&#8221; Technique</strong></h2><p>Here&#8217;s something I use constantly.</p><p>When you find an important method, don&#8217;t read everything around it.</p><p>Follow the breadcrumbs.</p><p>Suppose:</p><pre><code><code>orderService.createOrder()</code></code></pre><p>calls:</p><pre><code><code>inventoryService.reserve()</code></code></pre><p>Follow that.</p><p>Then:</p><pre><code><code>paymentService.charge()</code></code></pre><p>Follow that.</p><p>Then:</p><pre><code><code>eventPublisher.publish()</code></code></pre><p>Follow that.</p><p>Then:</p><pre><code><code>OrderCreatedEvent</code></code></pre><p>Search where it&#8217;s consumed.</p><p>Maybe you discover:</p><pre><code><code>OrderCreatedEvent
        &#8595;
InventoryConsumer
        &#8595;
AnalyticsConsumer
        &#8595;
NotificationConsumer</code></code></pre><p>One search leads to another.</p><p>That&#8217;s how you navigate a large repository.</p><p>Not randomly.</p><p><strong>Breadcrumb by breadcrumb.</strong></p><div><hr></div><h2><strong>Ask &#8220;Why?&#8221; Five Times</strong></h2><p>Sometimes understanding code requires more than knowing what it does.</p><p>You need to understand why it exists.</p><p>For example:</p><p><strong>Why are we using Redis?</strong></p><p>Because database queries are slow.</p><p><strong>Why are database queries slow?</strong></p><p>Because this endpoint gets huge traffic.</p><p><strong>Why does it get huge traffic?</strong></p><p>Because it&#8217;s called every time the user opens the dashboard.</p><p><strong>Why don&#8217;t we calculate the data once?</strong></p><p>Because the data changes frequently.</p><p>Now you understand something much deeper:</p><p>Redis isn&#8217;t there because:</p><blockquote><p><em>&#8220;Redis is cool.&#8221;</em></p></blockquote><p>It&#8217;s there because of a specific performance requirement.</p><p>That&#8217;s the difference between <strong>knowing a system</strong> and <strong>understanding a system</strong>.</p><h2><strong>Eventually, the Codebase Starts Talking to You</strong></h2><p>This is the beautiful part.</p><p>At first:</p><pre><code><code>OrderService
PaymentService
InventoryService
KafkaConsumer
RedisConfig</code></code></pre><p>look like random names.</p><p>After a few days, they become familiar.</p><p>You see:</p><pre><code><code>OrderCreatedEvent</code></code></pre><p>and immediately think:</p><p><em>&#8220;Okay, something happened after an order was created.&#8221;</em></p><p>You see:</p><pre><code><code>@KafkaListener</code></code></pre><p>and think:</p><p><em>&#8220;This isn&#8217;t part of the synchronous request. Something is happening asynchronously.&#8221;</em></p><p>You see:</p><pre><code><code>@Transactional</code></code></pre><p>and think:</p><p><em>&#8220;Okay, these database operations probably need to succeed or fail together.&#8221;</em></p><p>You see:</p><pre><code><code>@Cacheable</code></code></pre><p>and think:</p><p><em>&#8220;This data is probably expensive to calculate or fetch.&#8221;</em></p><p>The code stops looking like thousands of unrelated lines.</p><p>It starts looking like a system.</p><div><hr></div><h2><strong>My Exact Process Today</strong></h2><p>If you give me a repository I&#8217;ve never seen before, I don&#8217;t randomly open files anymore.</p><p>I usually go in this order:</p><pre><code><code>1. README
      &#8595;
2. Project structure
      &#8595;
3. Application entry point
      &#8595;
4. Configuration
      &#8595;
5. Database/entities
      &#8595;
6. API endpoints
      &#8595;
7. One important business flow
      &#8595;
8. External integrations
      &#8595;
9. Events / queues
      &#8595;
10. Tests
      &#8595;
11. Git history
      &#8595;
12. Task-specific code</code></code></pre><p>And while doing this, I keep one document open.</p><p>I call it:</p><p><strong>&#8220;My Mental Model.&#8221;</strong></p><p>Inside it, I keep only:</p><pre><code><code>System purpose
Major components
Important APIs
Important database entities
External dependencies
Important events
Main business flows
Things I don&#8217;t understand yet</code></code></pre><p>That last section is extremely important.</p><p>Because instead of pretending I understand something, I write:</p><pre><code><code>TODO:
Why do we publish OrderCreated twice?
TODO:
Why is Redis used here?
TODO:
Why does payment retry three times?
TODO:
Why is this transaction boundary here?</code></code></pre><p>Now I have questions to investigate.</p><p>That&#8217;s much better than having confusion floating around in my head.</p><p>The biggest shift happens when you stop asking:</p><blockquote><p><em><strong>&#8220;How can I understand this entire codebase?&#8221;</strong></em></p></blockquote><p>and start asking:</p><blockquote><p><em><strong>&#8220;What story is this code trying to tell me?&#8221;</strong></em></p></blockquote><p>Because every large codebase has a story.</p><p>A request comes in.</p><p>Something validates it.</p><p>Some business decision happens.</p><p>Data changes.</p><p>Maybe another service gets called.</p><p>Maybe an event is published.</p><p>Maybe another system reacts.</p><p>Maybe the user gets a response.</p><p>That&#8217;s the story.</p><p>Your job as an engineer isn&#8217;t to memorize every class.</p><p>Your job is to <strong>reconstruct that story</strong>.</p><p>Once you know the story, the classes become characters.</p><p>The APIs become entry points.</p><p>The database becomes the memory.</p><p>The queues become the communication system.</p><p>The external services become the outside world.</p><p>The logs become the clues.</p><p>And Git history becomes the backstory.</p><p>Suddenly, the repository that looked like a monster yesterday starts looking like something you can actually reason about.</p><p>And that&#8217;s when you know you&#8217;ve crossed the line from:</p><p><strong>&#8220;I am reading this code.&#8221;</strong></p><p>to:</p><p><strong>&#8220;I understand this system.&#8221;</strong></p><p>That is the real skill.</p><p>Not knowing every file.</p><p>Not memorizing every class.</p><p>Not reading 10,000 lines a day.</p><p><strong>It&#8217;s knowing where to look, what to follow, what questions to ask, and how to turn thousands of lines of code into one simple story.</strong></p><div><hr></div><h2><strong>One Last Thing</strong></h2><p>And one more thing I want to say.</p><p>Nothing is actually that complex.</p><p>Most of the time, <strong>our mind makes it complex before the problem even becomes complex.</strong> We see a large codebase, a new technology, system design, AI, distributed systems, or an unfamiliar architecture, and immediately think, <em>&#8220;This is too difficult.&#8221;</em></p><p>But it isn&#8217;t.</p><p>You just need to make your mind more <strong>flexible, lean, and adaptable</strong>.</p><p>Don&#8217;t try to understand everything at once. Don&#8217;t try to memorize everything. Just follow what you are reading, understand one thing at a time, connect it with the previous thing, and keep moving.</p><p>Eventually, the things that looked confusing in the beginning start becoming obvious.</p><p>And if you are preparing for an <strong>AI Engineer</strong> or <strong>Software Engineer</strong> role, don&#8217;t try to learn everything randomly. Start exploring the right concepts, understand how they connect, and follow a systematic learning path.</p><p>Once your learning becomes systematic, your confidence naturally starts growing.</p><p>You don&#8217;t need to become a genius.</p><p>You just need to keep learning, keep exploring, and keep making your mind more adaptable.</p><p>That&#8217;s how complicated systems slowly become simple.</p><p>And if you want to take that journey further:</p><p><strong>If you want to master your Software Engineering interviews: </strong></p><p>https://algorithmxlr8.io/</p><p><strong>If you want to master your AI Engineering interviews: </strong></p><p>https://algorithmxlr8.io/</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!jckQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e8826d9-b607-488d-9770-6bf435d879fe_2000x1251.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!jckQ!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e8826d9-b607-488d-9770-6bf435d879fe_2000x1251.png 424w, /__u/substackcdn.com/image/fetch/$s_!jckQ!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e8826d9-b607-488d-9770-6bf435d879fe_2000x1251.png 848w, /__u/substackcdn.com/image/fetch/$s_!jckQ!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e8826d9-b607-488d-9770-6bf435d879fe_2000x1251.png 1272w, /__u/substackcdn.com/image/fetch/$s_!jckQ!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e8826d9-b607-488d-9770-6bf435d879fe_2000x1251.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!jckQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e8826d9-b607-488d-9770-6bf435d879fe_2000x1251.png" width="1456" height="911" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0e8826d9-b607-488d-9770-6bf435d879fe_2000x1251.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:911,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="/__u/substackcdn.com/image/fetch/$s_!jckQ!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e8826d9-b607-488d-9770-6bf435d879fe_2000x1251.png 424w, /__u/substackcdn.com/image/fetch/$s_!jckQ!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e8826d9-b607-488d-9770-6bf435d879fe_2000x1251.png 848w, /__u/substackcdn.com/image/fetch/$s_!jckQ!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e8826d9-b607-488d-9770-6bf435d879fe_2000x1251.png 1272w, /__u/substackcdn.com/image/fetch/$s_!jckQ!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e8826d9-b607-488d-9770-6bf435d879fe_2000x1251.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Keep learning.</p><p>Keep exploring.</p><p>And most importantly, <strong>don&#8217;t let your mind convince you that something is difficult before you have actually tried to understand it.</strong></p>]]></content:encoded></item><item><title><![CDATA[How I Learned AI Engineering]]></title><description><![CDATA[I still remember when I first started getting serious about AI.]]></description><link>https://singour.substack.com/p/how-i-learned-ai-engineering</link><guid isPermaLink="false">https://singour.substack.com/p/how-i-learned-ai-engineering</guid><dc:creator><![CDATA[Himanshu Singour]]></dc:creator><pubDate>Sun, 09 Aug 2026 08:06:27 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!W4OC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a596557-02cc-45cd-b019-498a2b1d54af_2000x1250.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!W4OC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a596557-02cc-45cd-b019-498a2b1d54af_2000x1250.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!W4OC!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a596557-02cc-45cd-b019-498a2b1d54af_2000x1250.png 424w, /__u/substackcdn.com/image/fetch/$s_!W4OC!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a596557-02cc-45cd-b019-498a2b1d54af_2000x1250.png 848w, /__u/substackcdn.com/image/fetch/$s_!W4OC!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a596557-02cc-45cd-b019-498a2b1d54af_2000x1250.png 1272w, /__u/substackcdn.com/image/fetch/$s_!W4OC!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a596557-02cc-45cd-b019-498a2b1d54af_2000x1250.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!W4OC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a596557-02cc-45cd-b019-498a2b1d54af_2000x1250.png" width="728" height="455" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6a596557-02cc-45cd-b019-498a2b1d54af_2000x1250.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:910,&quot;width&quot;:1456,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:&quot;center&quot;,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="/__u/substackcdn.com/image/fetch/$s_!W4OC!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a596557-02cc-45cd-b019-498a2b1d54af_2000x1250.png 424w, /__u/substackcdn.com/image/fetch/$s_!W4OC!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a596557-02cc-45cd-b019-498a2b1d54af_2000x1250.png 848w, /__u/substackcdn.com/image/fetch/$s_!W4OC!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a596557-02cc-45cd-b019-498a2b1d54af_2000x1250.png 1272w, /__u/substackcdn.com/image/fetch/$s_!W4OC!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a596557-02cc-45cd-b019-498a2b1d54af_2000x1250.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>I still remember when I first started getting serious about AI.</p><p>At that time, AI was everywhere. Every second person was talking about ChatGPT, LLMs, RAG, agents and the next big AI framework.</p><p>I was already working as a software engineer, so I initially thought this would be easy for me. I knew how to build APIs, work with databases, write backend services and think about scalable systems. I thought I just needed to learn how to call an LLM.</p><p>I was wrong.</p><p>The first few days were actually exciting. I started with Python because most of the AI ecosystem was built around it. I already knew programming, so Python itself wasn&#8217;t the difficult part.</p><p>But then I started seeing things like embeddings, transformers, vector databases, RAG, LangChain, LangGraph, agents, memory, tool calling and MCP. Every time I understood one thing, I discovered three more things.</p><p>That was probably the first problem I faced.</p><p>I wasn&#8217;t struggling because AI was impossible to learn. I was struggling because I didn&#8217;t know <strong>what I should learn first</strong>.</p><p>So instead of randomly jumping between YouTube videos, blogs and new AI frameworks, I decided to step back and look at AI Engineering from an engineer&#8217;s perspective.</p><p>I asked myself a simple question:</p><p><strong>If I had to build a real AI product from scratch, what would I actually need to know?</strong></p><p>That question changed everything.</p><h2><strong>I Started With Things I Already Knew</strong></h2><p>I didn&#8217;t start my AI journey by trying to understand every mathematical detail behind neural networks. I started from the engineering side.</p><p>I went back to <strong>Python</strong>, because I wanted to become comfortable building AI applications with it. Then I made sure I was comfortable with things that are easy to ignore when you&#8217;re excited about AI: <strong>Git</strong>, APIs, HTTP, JSON, databases, SQL, asynchronous programming, Docker and basic cloud concepts.</p><p>At first, these topics didn&#8217;t feel like AI.</p><p>I remember thinking, &#8220;Why am I learning Git and Docker again? I came here to learn AI.&#8221;</p><p>But later I understood why.</p><p>Suppose you build an AI application that works perfectly on your laptop. Now imagine someone else needs to run it. Your application needs an API. It needs configuration. It needs a database. It needs deployment. It needs logging. It needs error handling. It needs version control.</p><p>The LLM is only one part of the application.</p><p>That realization became very important for me.</p><p>I stopped thinking about AI as a separate world and started looking at it as another type of software system.</p><h2><strong>Then I Went Back to Machine Learning</strong></h2><p>After getting comfortable with the engineering foundations, I started going deeper into <strong>Machine Learning</strong>.</p><p>I didn&#8217;t want to become a research scientist. My goal was to understand what was happening underneath the tools I was using.</p><p>I learned about data, features, training, validation, models, overfitting and evaluation. Then I moved towards <strong>Deep Learning</strong> and started understanding neural networks and how models learn patterns from data.</p><p>This was interesting because I had spent years writing software where I explicitly told the computer what to do.</p><p>With traditional programming, I could write:</p><p>&#8220;If this happens, do this.&#8221;</p><p>Machine Learning felt different.</p><p>Instead of manually writing every rule, I was giving the system data and allowing a model to learn patterns.</p><p>That difference was important to understand before jumping into modern LLM applications.</p><h2><strong>Then I Found Transformers</strong></h2><p>The next big step for me was understanding <strong>Transformers</strong>.</p><p>Before that, LLMs felt almost magical.</p><p>You type a question.</p><p>The model understands it.</p><p>It generates an answer.</p><p>But when I started learning about tokens, embeddings, attention and transformers, the magic started becoming engineering.</p><p>I still didn&#8217;t understand every mathematical detail, and I didn&#8217;t need to.</p><p>What I wanted was a mental model.</p><p>I wanted to understand what happens between:</p><p><strong>Text &#8594; Model &#8594; Output</strong></p><p>That foundation made it much easier for me to understand modern LLMs.</p><h2><strong>Then I Started Building With LLMs</strong></h2><p>Once I understood the basics, I started using LLM APIs.</p><p>This part was fun.</p><p>You could write a small amount of code and suddenly have an application that could summarize text, answer questions, extract structured information or generate content.</p><p>But after building a few simple applications, I hit another problem.</p><p>The model didn&#8217;t know my data.</p><p>I could ask it general questions, but what if I wanted it to answer questions about my own documents?</p><p>What if those documents were private?</p><p>What if the information changed every week?</p><p>What if I had thousands of documents?</p><p>Putting everything inside the prompt obviously wasn&#8217;t going to work.</p><p>That was when I discovered <strong>RAG</strong>.</p><h2><strong>RAG Was a Big Turning Point</strong></h2><p>RAG completely changed how I thought about AI applications.</p><p>Instead of:</p><p><strong>Question &#8594; LLM &#8594; Answer</strong></p><p>the system could become:</p><p><strong>Question &#8594; Retrieve relevant information &#8594; LLM &#8594; Answer</strong></p><p>That sounds simple when you write it like that.</p><p>But when I actually started building one, I realized how many engineering decisions were hiding underneath.</p><p>How should I split a document?</p><p>How large should a chunk be?</p><p>Should I keep metadata?</p><p>How should I create embeddings?</p><p>Where should I store them?</p><p>How many documents should I retrieve?</p><p>What if the retrieved documents are wrong?</p><p>What if the answer isn&#8217;t present in the knowledge base?</p><p>What if the document changes?</p><p>Suddenly my simple RAG application wasn&#8217;t so simple anymore.</p><p>And honestly, this is where I started learning much faster.</p><p>Because I wasn&#8217;t learning RAG from a definition anymore.</p><p>I was learning it because my own application was giving me bad answers.</p><h2><strong>I Started Understanding Embeddings and Vector Databases</strong></h2><p>To make RAG work properly, I needed to understand <strong>embeddings</strong>.</p><p>At first, the idea felt strange.</p><p>How can a piece of text become numbers?</p><p>And how can those numbers help me find similar information?</p><p>I started experimenting with embeddings and <strong>vector databases</strong>.</p><p>Then I understood the basic idea: instead of searching only for exact words, we could represent information in a form that allowed us to find semantically similar content.</p><p>That opened another area of learning.</p><p>Vector search.</p><p>Similarity.</p><p>Metadata filtering.</p><p>Indexing.</p><p>Retrieval.</p><p>Hybrid search.</p><p>And once again, I realized that the AI application was not just an LLM call.</p><p>There was an entire retrieval system around it.</p><h2><strong>Then I Started Building AI APIs</strong></h2><p>At this point I wanted to move beyond notebooks and small experiments.</p><p>I wanted to build proper AI backend services.</p><p>That&#8217;s where <strong>FastAPI</strong> became useful.</p><p>I started thinking about an AI application like any other backend system.</p><blockquote><p>There is an API.</p><p>There is validation.</p><p>There are services.</p><p>There is a database.</p><p>There are external dependencies.</p><p>There are failures.</p><p>There are timeouts.</p><p>There are retries.</p><p>There are logs.</p><p>There are users.</p></blockquote><p>The difference is that somewhere inside the system, there is an LLM making probabilistic decisions.</p><p>That difference creates a completely new set of engineering challenges.</p><p>For example, in a normal API, I can usually predict what a function will return.</p><p>With an LLM, the output can change.</p><p>It can be correct.</p><p>It can be incomplete.</p><p>It can misunderstand the request.</p><p>It can hallucinate.</p><p>It can return something in the wrong format.</p><p>So I started thinking about validation and reliability much more seriously.</p><h2><strong>Then Agents Started Getting Interesting</strong></h2><p>After building RAG systems, I started asking another question.</p><p>What if the AI could actually <strong>do something</strong> instead of just answering?</p><p>What if I gave it a calculator?</p><p>What if I gave it a database?</p><p>What if it could call an API?</p><p>What if it could search something?</p><p>What if it could decide which tool to use?</p><p>That led me into <strong>AI Agents</strong> and <strong>tool calling</strong>.</p><p>The first time I built a simple tool-calling workflow, it felt very different from a chatbot.</p><p>The model wasn&#8217;t just generating text.</p><p>It was deciding what action should happen next.</p><p>But again, the moment I started building more complicated workflows, things became messy.</p><p>What happens when the tool fails?</p><p>What happens when the model calls the wrong tool?</p><p>What happens when the agent keeps repeating the same action?</p><p>Where do we store state?</p><p>How do we retry?</p><p>When should a human take over?</p><p>Those questions pushed me deeper into agent engineering.</p><h2><strong>LangGraph Changed My Mental Model</strong></h2><p>When I started learning <strong>LangGraph</strong>, something clicked.</p><p>Instead of thinking about an agent as some magical autonomous AI, I could think about it as a workflow.</p><p>There is state.</p><p>There are nodes.</p><p>There are decisions.</p><p>There are edges.</p><p>There can be loops.</p><p>There can be retries.</p><p>There can be human intervention.</p><p>That was much easier for me to reason about as a software engineer.</p><p>I started building workflows where one step would retrieve information, another would call a tool, another would validate the result and another would decide what should happen next.</p><p>The more I built, the more I realized that a good AI agent is not about giving the model unlimited freedom.</p><p>It&#8217;s about designing the right boundaries around it.</p><h2><strong>Then I Started Thinking About Memory</strong></h2><p>One problem became obvious after building conversational systems.</p><p>The AI forgets.</p><p>You can have a long conversation with a system, start a new session and suddenly it knows nothing.</p><p>That made me curious about <strong>AI memory</strong>.</p><p>What should an AI remember?</p><p>Should it remember everything?</p><p>Probably not.</p><p>Should it remember user preferences?</p><p>Maybe.</p><p>Should it remember previous tasks?</p><p>Sometimes.</p><p>Should memories expire?</p><p>Probably.</p><p>Where should memories be stored?</p><p>How should they be retrieved?</p><p>These questions made me realize that memory is not just &#8220;store the chat history.&#8221;</p><p>It is another engineering problem.</p><h2><strong>Then Came MCP</strong></h2><p>As I continued exploring AI agents and tools, I came across <strong>MCP</strong>.</p><p>What interested me wasn&#8217;t just the protocol itself.</p><p>It was the idea behind it.</p><p>AI systems need to interact with external tools and data.</p><p>Instead of every AI application creating completely different integrations, there could be a standardized way for models and applications to discover and use capabilities.</p><p>That made me think about AI applications differently again.</p><p>The future AI application isn&#8217;t just a chatbot sitting inside a box.</p><p>It can interact with databases, APIs, files, developer tools and other systems.</p><p>The model becomes one part of a much larger ecosystem.</p><h2><strong>Then Reality Hit: AI Can Be Wrong</strong></h2><p>This was probably one of the most important lessons I learned.</p><p>A demo can look amazing.</p><p>A production system is different.</p><p>You can build a RAG system that works perfectly on five documents.</p><p>Then you put 50,000 documents into it and everything changes.</p><p>You can build an agent that works perfectly ten times.</p><p>Then it gets a slightly different request and enters a loop.</p><p>You can write the perfect prompt.</p><p>Then the model gives you an unexpected answer.</p><p>That forced me to learn about <strong>AI evaluation</strong>.</p><p>I started thinking about questions like:</p><blockquote><p><em>How do I know my retrieval is good?</em></p><p><em>How do I know the answer is correct?</em></p><p><em>How do I detect hallucinations?</em></p><p><em>How do I compare two versions of a prompt?</em></p><p><em>How do I know whether a new model is actually better?</em></p></blockquote><p>Traditional unit tests aren&#8217;t enough for every AI problem.</p><p>AI systems need their own evaluation strategy.</p><p>That was another major shift in my thinking.</p><h2><strong>Then I Started Thinking About Production</strong></h2><p>Once you build enough AI applications, you eventually stop asking:</p><p><strong>&#8220;Can I make this work?&#8221;</strong></p><p>and start asking:</p><p><strong>&#8220;Can I make this reliable?&#8221;</strong></p><p>That&#8217;s a completely different question.</p><p>Now you start thinking about latency.</p><p>Token costs.</p><p>Caching.</p><p>Retries.</p><p>Timeouts.</p><p>Rate limits.</p><p>Streaming.</p><p>Logging.</p><p>Monitoring.</p><p>Tracing.</p><p>Security.</p><p>Authentication.</p><p>Deployment.</p><p>Scaling.</p><p>Model selection.</p><p>Fallbacks.</p><p>This is where my software engineering background became extremely useful.</p><p>Because AI may be new, but production engineering problems are not.</p><p>An AI application still needs good architecture.</p><p>It still needs good APIs.</p><p>It still needs proper databases.</p><p>It still needs observability.</p><p>It still needs security.</p><p>It still needs testing.</p><p>It still needs people who understand what happens when something goes wrong at 2 AM.</p><h2><strong>I Also Made Plenty of Mistakes</strong></h2><p>One thing I don&#8217;t want to hide is that I wasted a lot of time.</p><p>I jumped between frameworks.</p><p>I watched tutorials without building anything.</p><p>I sometimes learned a tool before understanding the problem it was solving.</p><p>I built small demos that looked impressive for five minutes but taught me very little.</p><p>There were also times when I thought I understood something because I could explain the definition.</p><p>Then I tried building it.</p><p>And got stuck.</p><p>That was a good lesson.</p><p>There is a huge difference between knowing:</p><p><strong>&#8220;A vector database stores embeddings.&#8221;</strong></p><p>and actually debugging why your retrieval system is returning irrelevant documents.</p><p>There is a difference between knowing:</p><p><strong>&#8220;Agents can call tools.&#8221;</strong></p><p>and debugging an agent that keeps calling the same tool again and again.</p><p>There is a difference between knowing:</p><p><strong>&#8220;RAG reduces hallucinations.&#8221;</strong></p><p>and actually discovering that bad retrieval can make the final answer even worse.</p><p>Building exposes those gaps very quickly.</p><h2><strong>Eventually I Stopped Learning AI as Separate Topics</strong></h2><p>This was probably the biggest change in my learning.</p><p>Earlier, I saw everything separately.</p><p>Python was one thing.</p><p>Machine Learning was another.</p><p>LLMs were another.</p><p>RAG was another.</p><p>Agents were another.</p><p>Vector databases were another.</p><p>FastAPI was another.</p><p>MCP was another.</p><p>Now I see them as pieces of one system.</p><p>A user sends a request.</p><p>The API receives it.</p><p>The application decides what needs to happen.</p><p>Maybe it retrieves information.</p><p>Maybe it calls a tool.</p><p>Maybe it uses memory.</p><p>Maybe an agent workflow is required.</p><p>The model generates a response.</p><p>The response gets validated.</p><p>The system records what happened.</p><p>Then we evaluate whether the system actually did a good job.</p><p>Suddenly all those individual topics started making sense together.</p><h2><strong>What Actually Helped Me Learn</strong></h2><p>If I had to choose one thing that helped me the most, it wouldn&#8217;t be a course or a particular framework.</p><p>It would be <strong>building things</strong>.</p><p>Whenever I learned something, I tried to build something small around it.</p><p>Learned RAG?</p><p>Build one.</p><p>Learned tool calling?</p><p>Build one.</p><p>Learned agents?</p><p>Build one.</p><p>Learned memory?</p><p>Build one.</p><p>Learned MCP?</p><p>Build one.</p><p>Learned evaluation?</p><p>Add evaluation to an existing project.</p><p>The project didn&#8217;t need to be huge.</p><p>Sometimes a small working project taught me more than spending an entire weekend watching tutorials.</p><p>The pattern became very simple:</p><p><strong>Learn &#8594; Build &#8594; Break &#8594; Debug &#8594; Understand &#8594; Build again.</strong></p><p>That&#8217;s how the knowledge started sticking.</p><h2><strong>I Also Started Explaining What I Learned</strong></h2><p>Another thing that helped me was writing about these concepts.</p><p>When you explain something to another engineer, you quickly discover what you don&#8217;t understand.</p><p>You think you understand RAG.</p><p>Then someone asks:</p><p>&#8220;Why this chunk size?&#8221;</p><p>And you realize you never really thought about it.</p><p>You think you understand agents.</p><p>Then someone asks:</p><p>&#8220;What happens when the tool fails?&#8221;</p><p>And suddenly you have another rabbit hole to explore.</p><p>Writing and teaching forced me to go one level deeper.</p><p>That&#8217;s also one of the reasons I started organizing these topics on AlgorithmXlr8.</p><p>I didn&#8217;t want AI Engineering to feel like a collection of random technologies.</p><p>I wanted to create a path where someone could start from the fundamentals and gradually reach real AI systems.</p><h2><strong>My Biggest Lesson</strong></h2><p>Looking back, I don&#8217;t think I learned AI Engineering by following one perfect roadmap.</p><p>I learned it by repeatedly getting stuck.</p><p>I learned Python because I needed it to build something.</p><p>I learned RAG because my LLM didn&#8217;t know my data.</p><p>I learned vector databases because I needed better retrieval.</p><p>I learned agents because I wanted the AI to take actions.</p><p>I learned LangGraph because agent workflows became difficult to manage.</p><p>I learned memory because conversations needed context.</p><p>I learned MCP because AI systems needed better access to tools.</p><p>I learned evaluation because &#8220;it seems to work&#8221; wasn&#8217;t good enough.</p><p>And I learned production engineering because eventually every demo needs to survive outside your laptop.</p><p>That&#8217;s what made AI Engineering interesting to me.</p><p>It isn&#8217;t just about AI.</p><p>It is about bringing everything together.</p><p>Software Engineering.</p><p>Data.</p><p>Machine Learning.</p><p>LLMs.</p><p>Backend Engineering.</p><p>Systems.</p><p>Infrastructure.</p><p>And a lot of experimentation.</p><h2><strong>If I Were Starting Again</strong></h2><p>If I were starting AI Engineering from zero today, I wouldn&#8217;t try to learn everything at once.</p><p>I&#8217;d first get comfortable with <strong>Python, Git, APIs, databases and basic software engineering</strong>.</p><p>Then I&#8217;d learn the foundations of <strong>Machine Learning and Deep Learning</strong>.</p><p>Then I&#8217;d understand <strong>LLMs and Transformers</strong>.</p><p>Then I&#8217;d build a <strong>RAG system</strong>.</p><p>Then I&#8217;d learn <strong>embeddings, vector databases and retrieval</strong> properly.</p><p>Then I&#8217;d build <strong>AI APIs with FastAPI</strong>.</p><p>Then I&#8217;d move into <strong>tool calling and AI Agents</strong>.</p><p>After that I&#8217;d learn <strong>LangGraph, state and workflows</strong>.</p><p>Then <strong>memory and MCP</strong>.</p><p>Then I&#8217;d spend serious time on <strong>evaluation, guardrails, reliability and production AI</strong>.</p><p>But I wouldn&#8217;t spend months learning each topic before building.</p><p>I&#8217;d learn enough.</p><p>Then build.</p><p>Then let the problems tell me what I need to learn next.</p><h2><strong>The Journey Isn&#8217;t Finished</strong></h2><p>Even after learning all of this, I don&#8217;t consider myself &#8220;done&#8221; with AI Engineering.</p><p>That&#8217;s probably the biggest difference between learning a technology and becoming an engineer.</p><p>There is always another problem.</p><p>A better retrieval strategy.</p><p>A better model.</p><p>A cheaper inference setup.</p><p>A more reliable agent.</p><p>A better evaluation method.</p><p>A new protocol.</p><p>A new architecture.</p><p>A new production problem.</p><p>And that&#8217;s okay.</p><p>I don&#8217;t think the goal is to finish AI Engineering.</p><p>The goal is to become good enough at engineering that when a new AI technology appears, you can understand where it fits, why it exists and when you should actually use it.</p><p>That&#8217;s the mindset I&#8217;m trying to build.</p><p>Don&#8217;t chase every new model.</p><p>Don&#8217;t learn every framework just because it&#8217;s trending.</p><p>Don&#8217;t build another chatbot just to say you built an AI project.</p><p>Understand the fundamentals.</p><p>Build real things.</p><p>Break them.</p><p>Debug them.</p><p>Measure them.</p><p>And keep going.</p><p>That&#8217;s how I learned AI Engineering.</p><p>And honestly, I&#8217;m still learning.</p><h2><strong>Want to Start Your AI Engineering Journey?</strong></h2><p>If you want to start learning AI Engineering and follow the same kind of path I followed, I&#8217;ve put the complete learning journey on my platform, <strong>AlgorithmXlr8</strong>.io</p><p>If you&#8217;re starting your AI Engineering journey, you can start here too.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!nHer!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53b34432-21e9-4717-94ef-f87122992f49_1400x875.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!nHer!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53b34432-21e9-4717-94ef-f87122992f49_1400x875.png 424w, /__u/substackcdn.com/image/fetch/$s_!nHer!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53b34432-21e9-4717-94ef-f87122992f49_1400x875.png 848w, /__u/substackcdn.com/image/fetch/$s_!nHer!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53b34432-21e9-4717-94ef-f87122992f49_1400x875.png 1272w, /__u/substackcdn.com/image/fetch/$s_!nHer!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53b34432-21e9-4717-94ef-f87122992f49_1400x875.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!nHer!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53b34432-21e9-4717-94ef-f87122992f49_1400x875.png" width="1400" height="875" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/53b34432-21e9-4717-94ef-f87122992f49_1400x875.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:875,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="/__u/substackcdn.com/image/fetch/$s_!nHer!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53b34432-21e9-4717-94ef-f87122992f49_1400x875.png 424w, /__u/substackcdn.com/image/fetch/$s_!nHer!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53b34432-21e9-4717-94ef-f87122992f49_1400x875.png 848w, /__u/substackcdn.com/image/fetch/$s_!nHer!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53b34432-21e9-4717-94ef-f87122992f49_1400x875.png 1272w, /__u/substackcdn.com/image/fetch/$s_!nHer!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53b34432-21e9-4717-94ef-f87122992f49_1400x875.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>I&#8217;ve tried to structure it around the same question I had when I started: <strong>what should I learn first, what should I learn next, and how do all these pieces actually connect?</strong></p><p>You can start with the fundamentals and gradually move towards Machine Learning, LLMs, RAG, AI Agents, workflows, memory, MCP and the other concepts required to build real AI systems.</p><p>If you&#8217;re also trying to figure out where to start with AI Engineering, you can start here:</p><p>https://algorithmxlr8.io</p><p>I&#8217;ve learned these concepts by building, breaking, debugging and going back to the fundamentals. I&#8217;ve tried to put that same approach into the platform so you don&#8217;t have to spend months jumping randomly between different resources.</p>]]></content:encoded></item><item><title><![CDATA[I Built My First RAG System Because My Dad Asked One Simple Question]]></title><description><![CDATA[Last Sunday, I was sitting at home with my laptop.]]></description><link>https://singour.substack.com/p/i-built-my-first-rag-system-because</link><guid isPermaLink="false">https://singour.substack.com/p/i-built-my-first-rag-system-because</guid><dc:creator><![CDATA[Himanshu Singour]]></dc:creator><pubDate>Thu, 06 Aug 2026 16:22:04 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!lSgR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4083b7f8-9451-4acb-9787-9c916a5f7287_1254x1254.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!lSgR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4083b7f8-9451-4acb-9787-9c916a5f7287_1254x1254.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!lSgR!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4083b7f8-9451-4acb-9787-9c916a5f7287_1254x1254.png 424w, /__u/substackcdn.com/image/fetch/$s_!lSgR!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4083b7f8-9451-4acb-9787-9c916a5f7287_1254x1254.png 848w, /__u/substackcdn.com/image/fetch/$s_!lSgR!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4083b7f8-9451-4acb-9787-9c916a5f7287_1254x1254.png 1272w, /__u/substackcdn.com/image/fetch/$s_!lSgR!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4083b7f8-9451-4acb-9787-9c916a5f7287_1254x1254.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!lSgR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4083b7f8-9451-4acb-9787-9c916a5f7287_1254x1254.png" width="1254" height="1254" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4083b7f8-9451-4acb-9787-9c916a5f7287_1254x1254.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1254,&quot;width&quot;:1254,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1843349,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://singour.substack.com/i/210096795?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4083b7f8-9451-4acb-9787-9c916a5f7287_1254x1254.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!lSgR!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4083b7f8-9451-4acb-9787-9c916a5f7287_1254x1254.png 424w, /__u/substackcdn.com/image/fetch/$s_!lSgR!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4083b7f8-9451-4acb-9787-9c916a5f7287_1254x1254.png 848w, /__u/substackcdn.com/image/fetch/$s_!lSgR!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4083b7f8-9451-4acb-9787-9c916a5f7287_1254x1254.png 1272w, /__u/substackcdn.com/image/fetch/$s_!lSgR!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4083b7f8-9451-4acb-9787-9c916a5f7287_1254x1254.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>Last Sunday, I was sitting at home with my laptop.</p><p>My father walked in and asked,</p><blockquote><p><em>Beta, what exactly do you build all day?</em></p></blockquote><p>I smiled.</p><p>I said,</p><blockquote><p><em>AI.</em></p></blockquote><p>He looked confused.</p><p>Then he asked another question.</p><blockquote><p><em>If AI is so intelligent, can it answer questions about our family&#8217;s documents?</em></p></blockquote><p>I confidently opened ChatGPT.</p><p>I uploaded nothing.</p><p>Then I asked,</p><blockquote><p><em>&#8220;What is my electricity bill for last month?&#8221;</em></p></blockquote><p>The AI gave a beautiful answer.</p><p>It was also completely wrong.</p><p>My father laughed.</p><blockquote><p><em>&#8220;So this intelligent AI doesn&#8217;t even know our own documents?&#8221;</em></p></blockquote><p>That one sentence stayed in my head.</p><h2><strong>The Real Problem</strong></h2><p>Most people think an AI knows everything.</p><p>It doesn&#8217;t.</p><p>An LLM is like a student who studied millions of books before the exam.</p><p>But once the exam starts&#8230;</p><p>The books are taken away.</p><p>Now the student has to answer only from memory.</p><p>If you ask,</p><blockquote><p><em>&#8220;Who won the Cricket World Cup 2011?&#8221;</em></p></blockquote><p>Easy.</p><p>If you ask,</p><blockquote><p><em>&#8220;What&#8217;s written on page 18 of my company&#8217;s HR policy?&#8221;</em></p></blockquote><p>It has no idea.</p><p>Sometimes it says,</p><blockquote><p><em>&#8220;I don&#8217;t know.&#8221;</em></p></blockquote><p>Sometimes&#8230;</p><p>It confidently makes things up.</p><p>That&#8217;s called a hallucination. RAG was created to reduce those unsupported answers by grounding responses in external information.</p><h2><strong>Then I Thought&#8230;</strong></h2><p>What if the student was allowed to open the library before answering?</p><p>Not the whole library.</p><p>Just the few books related to the question.</p><p>Now imagine the process.</p><p>You ask,</p><blockquote><p><em>&#8220;How many casual leaves do employees get?&#8221;</em></p></blockquote><p>Instead of guessing&#8230;</p><p>Someone first walks into the library.</p><p>Searches the HR policy.</p><p>Finds the correct page.</p><p>Brings it back.</p><p>Only then does the student answer.</p><p>That&#8217;s exactly what RAG does.</p><h2><strong>A Simple Real-Life Example</strong></h2><p>Imagine your mother keeps every recipe in a notebook.</p><p>One day you ask,</p><blockquote><p><em>&#8220;How do we make paneer butter masala?&#8221;</em></p></blockquote><p>You don&#8217;t remember.</p><p>So you open the notebook.</p><p>Find the recipe.</p><p>Read it.</p><p>Then cook.</p><p>You didn&#8217;t magically know the recipe.</p><p>You retrieved it first.</p><p>That&#8217;s Retrieval.</p><p>Then you used that information to create the answer.</p><p>That&#8217;s Generation.</p><p>Together&#8230;</p><p>Retrieval-Augmented Generation.</p><h2><strong>How I Built It</strong></h2><p>I didn&#8217;t start with AI.</p><p>I started with documents.</p><p>I collected PDFs.</p><p>Company policies.</p><p>Technical documentation.</p><p>Product manuals.</p><p>Articles.</p><p>Then I broke every document into smaller pieces.</p><p>Because finding one paragraph is much easier than searching a 500-page PDF.</p><p>Next&#8230;</p><p>Every small paragraph became a numerical representation called an embedding.</p><p>Think of it like giving every paragraph its own GPS coordinates.</p><p>Similar ideas end up close together.</p><p>Different ideas stay far apart.</p><p>These embeddings were stored inside a vector database.</p><p>Now my documents became searchable by meaning instead of exact words. This semantic-search pattern is one of the core ideas behind modern RAG systems.</p><h2><strong>What Happens When Someone Asks a Question?</strong></h2><p>Suppose someone types,</p><blockquote><p><em>&#8220;How many sick leaves can I take?&#8221;</em></p></blockquote><p>The system doesn&#8217;t send that question directly to the LLM.</p><p>Instead&#8230;</p><p>The question is converted into an embedding.</p><p>The vector database searches for paragraphs with similar meaning.</p><p>It finds the most relevant chunks.</p><p>Those chunks are sent to the LLM.</p><p>The LLM reads them.</p><p>Then answers using only that information.</p><p>Not memory.</p><p>Evidence.</p><h2><strong>The Biggest Difference</strong></h2><p>Without RAG: Question &#8594; LLM &#8594; Guess</p><p>With RAG: Question &#8594; Search Documents &#8594; Retrieve Information &#8594; LLM &#8594; Accurate Answer</p><p>One extra step.</p><p>A huge difference.</p><h2><strong>The Funny Part</strong></h2><p>After building it&#8230;</p><p>I went back to my father.</p><p>This time he asked,</p><blockquote><p><em>&#8220;What&#8217;s written in our electricity bill?&#8221;</em></p></blockquote><p>The AI searched the uploaded bill.</p><p>Read the exact amount.</p><p>Answered correctly.</p><p>My father smiled.</p><blockquote><p><em>&#8220;Now this feels intelligent.&#8221;</em></p></blockquote><p>That was the moment I understood.</p><p>RAG doesn&#8217;t make an AI smarter.</p><p>It gives the AI access to the right information before it speaks.</p><h2><strong>Final Thought</strong></h2><p>When people hear &#8220;RAG,&#8221; they often imagine a complicated AI architecture.</p><p>But at its heart, it&#8217;s surprisingly simple.</p><p>Think of three roles:</p><ul><li><p><strong>The Library</strong> &#8594; Your documents.</p></li><li><p><strong>The Librarian</strong> &#8594; Finds the right pages.</p></li><li><p><strong>The Teacher</strong> &#8594; Reads those pages and explains them in simple language.</p></li></ul><p>That&#8217;s all a RAG system really is. (<a href="https://algorithmxlr8.io/ai/engineering/home/rag-vector-search/rag-fundamentals/what-is-rag">https://algorithmxlr8.io/ai/engineering/home/rag-vector-search/rag-fundamentals/what-is-rag</a>)</p><p>And once you understand it this way, building one feels much less intimidating.</p><h2><strong>Want to Learn AI Engineering Step by Step?</strong></h2><p>Programming, Math &amp; Data Foundations<br>&#9474;<br>&#9500;&#9472;&#9472; Statistics &amp; Probability<br>&#9500;&#9472;&#9472; NumPy &amp; Pandas<br>&#9492;&#9472;&#9472; Data Cleaning &amp; Visualization<br>&#9474;<br>Machine Learning &amp; Deep Learning<br>&#9474;<br>&#9500;&#9472;&#9472; Machine Learning Fundamentals<br>&#9500;&#9472;&#9472; Deep Learning Fundamentals<br>&#9492;&#9472;&#9472; PyTorch<br>&#9474;<br>LLM Engineering &amp; Applications<br>&#9474;<br>&#9500;&#9472;&#9472; Prompt Engineering<br>&#9500;&#9472;&#9472; RAG &amp; Vector Search<br>&#9500;&#9472;&#9472; Fine-Tuning<br>&#9500;&#9472;&#9472; MCP<br>&#9492;&#9472;&#9472; Hugging Face<br>&#9474;<br>AI Agents &amp; Orchestration<br>&#9474;<br>&#9500;&#9472;&#9472; AI Agents &amp; Tool Calling<br>&#9492;&#9472;&#9472; LangChain &amp; LangGraph<br>&#9474;<br>Deployment, Safety &amp; Production<br>&#9474;<br>&#9500;&#9472;&#9472; LLMOps<br>&#9500;&#9472;&#9472; AI Safety &amp; Evaluation<br>&#9492;&#9472;&#9472; Security</p><p>Explore the complete at:  https://algorithmxlr8.io/</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!TAeu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf177a3d-ff25-43c1-8296-481b17ba23b5_2880x1800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!TAeu!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf177a3d-ff25-43c1-8296-481b17ba23b5_2880x1800.png 424w, /__u/substackcdn.com/image/fetch/$s_!TAeu!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf177a3d-ff25-43c1-8296-481b17ba23b5_2880x1800.png 848w, /__u/substackcdn.com/image/fetch/$s_!TAeu!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf177a3d-ff25-43c1-8296-481b17ba23b5_2880x1800.png 1272w, /__u/substackcdn.com/image/fetch/$s_!TAeu!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf177a3d-ff25-43c1-8296-481b17ba23b5_2880x1800.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!TAeu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf177a3d-ff25-43c1-8296-481b17ba23b5_2880x1800.png" width="1456" height="910" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/af177a3d-ff25-43c1-8296-481b17ba23b5_2880x1800.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:910,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:510164,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://singour.substack.com/i/210096795?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf177a3d-ff25-43c1-8296-481b17ba23b5_2880x1800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!TAeu!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf177a3d-ff25-43c1-8296-481b17ba23b5_2880x1800.png 424w, /__u/substackcdn.com/image/fetch/$s_!TAeu!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf177a3d-ff25-43c1-8296-481b17ba23b5_2880x1800.png 848w, /__u/substackcdn.com/image/fetch/$s_!TAeu!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf177a3d-ff25-43c1-8296-481b17ba23b5_2880x1800.png 1272w, /__u/substackcdn.com/image/fetch/$s_!TAeu!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf177a3d-ff25-43c1-8296-481b17ba23b5_2880x1800.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p>]]></content:encoded></item><item><title><![CDATA[Before I Switched From My 9–5, I Did This]]></title><description><![CDATA[This is exactly how I prepared before switching jobs the mistakes I made, what worked, and what I'd do differently today]]></description><link>https://singour.substack.com/p/before-i-switched-from-my-95-i-did</link><guid isPermaLink="false">https://singour.substack.com/p/before-i-switched-from-my-95-i-did</guid><dc:creator><![CDATA[Himanshu Singour]]></dc:creator><pubDate>Mon, 20 Jul 2026 07:20:19 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!-aIr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb692134-c2ca-48ae-8ca3-d67bb0cbc6d0_1254x1254.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!-aIr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb692134-c2ca-48ae-8ca3-d67bb0cbc6d0_1254x1254.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!-aIr!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb692134-c2ca-48ae-8ca3-d67bb0cbc6d0_1254x1254.png 424w, /__u/substackcdn.com/image/fetch/$s_!-aIr!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb692134-c2ca-48ae-8ca3-d67bb0cbc6d0_1254x1254.png 848w, /__u/substackcdn.com/image/fetch/$s_!-aIr!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb692134-c2ca-48ae-8ca3-d67bb0cbc6d0_1254x1254.png 1272w, /__u/substackcdn.com/image/fetch/$s_!-aIr!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb692134-c2ca-48ae-8ca3-d67bb0cbc6d0_1254x1254.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!-aIr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb692134-c2ca-48ae-8ca3-d67bb0cbc6d0_1254x1254.png" width="1254" height="1254" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bb692134-c2ca-48ae-8ca3-d67bb0cbc6d0_1254x1254.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1254,&quot;width&quot;:1254,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2016926,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://singour.substack.com/i/207743959?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb692134-c2ca-48ae-8ca3-d67bb0cbc6d0_1254x1254.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!-aIr!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb692134-c2ca-48ae-8ca3-d67bb0cbc6d0_1254x1254.png 424w, /__u/substackcdn.com/image/fetch/$s_!-aIr!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb692134-c2ca-48ae-8ca3-d67bb0cbc6d0_1254x1254.png 848w, /__u/substackcdn.com/image/fetch/$s_!-aIr!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb692134-c2ca-48ae-8ca3-d67bb0cbc6d0_1254x1254.png 1272w, /__u/substackcdn.com/image/fetch/$s_!-aIr!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb692134-c2ca-48ae-8ca3-d67bb0cbc6d0_1254x1254.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h3><span data-color="#9fc5e8" style="color: rgb(159, 197, 232);">Everyone talks about resigning. Very few people talk about the preparation that happens months before that decision.</span></h3><div><hr></div><h1>The Thought Stayed in My Mind for a Long Time</h1><p>I still remember the first time I seriously thought about leaving my 9&#8211;5 job.</p><p>It wasn&#8217;t because I had a bad manager.</p><p>It wasn&#8217;t because I hated my work.</p><p>It wasn&#8217;t even because I wanted to become an entrepreneur overnight.</p><p>The thought came from something much simpler.</p><p>Every evening after work, I would open my laptop again. Not because someone asked me to, but because I genuinely wanted to build something of my own.</p><p>Some days it was a small backend project.</p><p>Some days it was a DSA platform.</p><p>Sometimes I would just spend two hours reading about distributed systems or improving my engineering skills.</p><p>I started noticing something.</p><p>No matter how tired I was after office hours, I still found myself opening my laptop again.</p><p>That&#8217;s when I realized this wasn&#8217;t just a hobby anymore.</p><p>It was becoming something much bigger.</p><p>But even then, I never thought, <em>&#8220;I&#8217;ll resign next month.&#8221;</em></p><p>Instead, I asked myself a different question.</p><p><strong>&#8220;What needs to happen before I can even think about leaving?&#8221;</strong></p><p>Looking back, that single question probably saved me from making a very emotional decision.</p><div><hr></div><h1>Watching People Quit Made Me Realize Something</h1><p>Around the same time, I started seeing a lot of posts on LinkedIn and Twitter.</p><p>Someone would announce,</p><p><em>&#8220;Today is my last working day.&#8221;</em></p><p>Another person would post a picture of their resignation letter.</p><p>A few weeks later they would announce their startup.</p><p>It looked exciting.</p><p>For a few days, I also felt like maybe I should just do the same.</p><p>But social media only shows the final chapter.</p><p>Nobody posts about the months of uncertainty before that.</p><p>Nobody talks about wondering whether they&#8217;ll have enough money six months later.</p><p>Nobody talks about the nights when they question whether they&#8217;re making the biggest mistake of their career.</p><p>The more I thought about it, the more I realized something.</p><p>I wasn&#8217;t interested in quitting my job.</p><p>I was interested in building a life where leaving my job became a natural next step.</p><p>Those are two completely different things.</p><div><hr></div><h1>I Made One Rule for Myself</h1><p>That weekend, I opened my notebook and wrote down one rule.</p><p><strong>&#8220;Don&#8217;t resign because you&#8217;re frustrated. Resign only when you&#8217;re prepared.&#8221;</strong></p><p>It sounds simple.</p><p>But it changed the way I looked at everything.</p><p>Whenever I felt like quitting after a stressful day at work, I would read that line again.</p><p>Frustration lasts for a few hours.</p><p>A resignation lasts much longer.</p><p>I promised myself that I would never make a career decision based on one bad week.</p><p>If I ever left, it would be because I had spent months preparing for it.</p><p>Not because I had a bad meeting on Monday morning.</p><div><hr></div><h1>My Evenings Started Looking Different</h1><p>Earlier, once work was over, I would relax, watch random videos, scroll through social media, and call it a day.</p><p>Slowly, that changed.</p><p>I gave myself a small target.</p><p>Just two hours.</p><p>No unrealistic schedules.</p><p>No &#8220;I&#8217;ll study eight hours after office.&#8221;</p><p>That never worked.</p><p>Some evenings I worked on a side project.</p><p>Some evenings I learned AWS.</p><p>Some days I practiced DSA.</p><p>Other days I read about System Design or tried to understand a technology I had been avoiding.</p><p>There were many nights when I didn&#8217;t feel like doing anything.</p><p>Office had already drained my energy.</p><p>But I made a promise to myself.</p><p>Even if I wasn&#8217;t productive for two hours, I would at least sit in front of my laptop.</p><p>Some days those two hours became twenty minutes.</p><p>Some days they became four hours.</p><p>The important part wasn&#8217;t the duration.</p><p>It was showing up consistently.</p><div><hr></div><h1>I Stopped Waiting for the Perfect Idea</h1><p>One mistake I made in the beginning was thinking I needed an amazing startup idea before I started building.</p><p>So I kept waiting.</p><p>Every week I thought,</p><p><em>&#8220;Maybe I&#8217;ll get a better idea next month.&#8221;</em></p><p>That month never came.</p><p>Eventually, I stopped chasing ideas.</p><p>Instead, I started solving problems I personally cared about.</p><p>If a tool didn&#8217;t exist, I built it.</p><p>If I found learning difficult, I created notes.</p><p>If I wanted a better way to study DSA and System Design, I started working on it little by little.</p><p>None of those projects were perfect.</p><p>Some never even got completed.</p><p>But every project taught me something.</p><p>How to deploy applications.</p><p>How to work with cloud services.</p><p>How to design better APIs.</p><p>How to fix production bugs.</p><p>How to deal with users.</p><p>More importantly, they taught me that building consistently matters far more than waiting for the perfect opportunity.</p><div><hr></div><h1>Money Was the Conversation Nobody Wanted to Have</h1><p>For a long time, I ignored the financial side of leaving a job.</p><p>I only thought about passion.</p><p>Reality doesn&#8217;t work like that.</p><p>Rent doesn&#8217;t stop because you&#8217;re following your dream.</p><p>Bills don&#8217;t disappear.</p><p>Responsibilities don&#8217;t disappear.</p><p>I realized that if I wanted the freedom to make bold career decisions, I first needed financial stability.</p><p>So instead of rushing, I started saving.</p><p>Not because I expected to fail.</p><p>Because I wanted peace of mind.</p><p>Knowing that I could survive for several months without depending on my next salary completely changed the way I looked at risk.</p><p>Confidence doesn&#8217;t only come from skills.</p><p>Sometimes it comes from knowing you have enough time to recover if things don&#8217;t go according to plan.</p><div><hr></div><h1>The Biggest Lesson I Learned</h1><p>Today, whenever someone asks me,</p><p><em>&#8220;How do I prepare before leaving my 9&#8211;5 job?&#8221;</em></p><p>I don&#8217;t tell them to resign.</p><p>I tell them to prepare until resigning feels obvious.</p><p>Build something while you&#8217;re still employed.</p><p>Learn skills that increase your value.</p><p>Save money.</p><p>Create habits that prove you can stay disciplined without someone managing your time.</p><p>If you can&#8217;t stay consistent for two hours after office, quitting your job won&#8217;t magically make you disciplined.</p><p>Freedom is amazing.</p><p>But freedom without discipline quickly turns into procrastination.</p><div><hr></div><h1>Looking Back</h1><p>I&#8217;m glad I didn&#8217;t leave my job the first time I felt frustrated.</p><p>If I had, it would&#8217;ve been an emotional decision.</p><p>Instead, I spent months preparing quietly.</p><p>Nobody noticed those evenings.</p><p>Nobody saw the weekends I spent learning instead of going out.</p><p>Nobody celebrated the small milestones.</p><p>But those small efforts slowly built something much bigger than I had imagined.</p><p>Looking back now, I don&#8217;t think resigning was the hardest part.</p><p>Preparing for it was.</p><p>And that&#8217;s exactly why the transition felt less like jumping into the unknown and more like taking the next logical step.</p><p>If you&#8217;re thinking about switching from your 9&#8211;5, don&#8217;t ask yourself, <strong>&#8220;When should I resign?&#8221;</strong></p><p>Ask yourself, <strong>&#8220;What can I start building today so that when the day comes, leaving feels like a decision not a gamble?&#8221;</strong></p><p>That one question changed everything for me.</p><p>Maybe it&#8217;ll do the same for you.</p><div><hr></div><h1>If You&#8217;re Serious About Making the Switch</h1><p>If you&#8217;ve read this far, chances are you&#8217;re thinking about something bigger than just changing jobs.</p><p>Maybe you want to become a better Software Engineer.</p><p>Maybe you&#8217;re preparing for AI Engineering roles.</p><p>Maybe you&#8217;re aiming for DevOps, SRE, or Backend Engineering interviews.</p><p>Whatever your goal is, one thing is true having a structured learning path makes a huge difference.</p><p>One of the biggest mistakes I made early in my career was learning random topics without any direction. I&#8217;d jump from one YouTube video to another, bookmark dozens of articles, and buy courses I never finished.</p><p>Progress became much faster once I started following a clear roadmap instead of learning whatever looked interesting that day.</p><p>That&#8217;s exactly why I built <strong>AlgorithmXlr8</strong>.</p><p>It isn&#8217;t just another collection of videos or interview questions. It&#8217;s a structured platform designed to help engineers master Software Engineering, AI Engineering, DevOps, DSA, System Design, and other interview-focused skills through a step-by-step learning path.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!Eak3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb5c2499-1c76-459d-bf79-8a992a6e7682_2880x1800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!Eak3!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb5c2499-1c76-459d-bf79-8a992a6e7682_2880x1800.png 424w, /__u/substackcdn.com/image/fetch/$s_!Eak3!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb5c2499-1c76-459d-bf79-8a992a6e7682_2880x1800.png 848w, /__u/substackcdn.com/image/fetch/$s_!Eak3!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb5c2499-1c76-459d-bf79-8a992a6e7682_2880x1800.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Eak3!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb5c2499-1c76-459d-bf79-8a992a6e7682_2880x1800.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!Eak3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb5c2499-1c76-459d-bf79-8a992a6e7682_2880x1800.png" width="1456" height="910" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bb5c2499-1c76-459d-bf79-8a992a6e7682_2880x1800.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:910,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:509324,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://singour.substack.com/i/207743959?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb5c2499-1c76-459d-bf79-8a992a6e7682_2880x1800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!Eak3!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb5c2499-1c76-459d-bf79-8a992a6e7682_2880x1800.png 424w, /__u/substackcdn.com/image/fetch/$s_!Eak3!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb5c2499-1c76-459d-bf79-8a992a6e7682_2880x1800.png 848w, /__u/substackcdn.com/image/fetch/$s_!Eak3!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb5c2499-1c76-459d-bf79-8a992a6e7682_2880x1800.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Eak3!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb5c2499-1c76-459d-bf79-8a992a6e7682_2880x1800.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!BG1Z!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf1c7580-fbf7-4fb3-ad43-23185a2b2977_2880x1800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!BG1Z!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf1c7580-fbf7-4fb3-ad43-23185a2b2977_2880x1800.png 424w, /__u/substackcdn.com/image/fetch/$s_!BG1Z!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf1c7580-fbf7-4fb3-ad43-23185a2b2977_2880x1800.png 848w, /__u/substackcdn.com/image/fetch/$s_!BG1Z!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf1c7580-fbf7-4fb3-ad43-23185a2b2977_2880x1800.png 1272w, /__u/substackcdn.com/image/fetch/$s_!BG1Z!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf1c7580-fbf7-4fb3-ad43-23185a2b2977_2880x1800.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!BG1Z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf1c7580-fbf7-4fb3-ad43-23185a2b2977_2880x1800.png" width="1456" height="910" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cf1c7580-fbf7-4fb3-ad43-23185a2b2977_2880x1800.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:910,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:845181,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://singour.substack.com/i/207743959?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf1c7580-fbf7-4fb3-ad43-23185a2b2977_2880x1800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!BG1Z!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf1c7580-fbf7-4fb3-ad43-23185a2b2977_2880x1800.png 424w, /__u/substackcdn.com/image/fetch/$s_!BG1Z!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf1c7580-fbf7-4fb3-ad43-23185a2b2977_2880x1800.png 848w, /__u/substackcdn.com/image/fetch/$s_!BG1Z!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf1c7580-fbf7-4fb3-ad43-23185a2b2977_2880x1800.png 1272w, /__u/substackcdn.com/image/fetch/$s_!BG1Z!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf1c7580-fbf7-4fb3-ad43-23185a2b2977_2880x1800.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!Vykf!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a33d8d2-fe0d-4ce4-85fd-79ffc3603dcd_2880x1800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!Vykf!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a33d8d2-fe0d-4ce4-85fd-79ffc3603dcd_2880x1800.png 424w, /__u/substackcdn.com/image/fetch/$s_!Vykf!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a33d8d2-fe0d-4ce4-85fd-79ffc3603dcd_2880x1800.png 848w, /__u/substackcdn.com/image/fetch/$s_!Vykf!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a33d8d2-fe0d-4ce4-85fd-79ffc3603dcd_2880x1800.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Vykf!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a33d8d2-fe0d-4ce4-85fd-79ffc3603dcd_2880x1800.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!Vykf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a33d8d2-fe0d-4ce4-85fd-79ffc3603dcd_2880x1800.png" width="1456" height="910" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2a33d8d2-fe0d-4ce4-85fd-79ffc3603dcd_2880x1800.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:910,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:412609,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://singour.substack.com/i/207743959?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a33d8d2-fe0d-4ce4-85fd-79ffc3603dcd_2880x1800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!Vykf!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a33d8d2-fe0d-4ce4-85fd-79ffc3603dcd_2880x1800.png 424w, /__u/substackcdn.com/image/fetch/$s_!Vykf!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a33d8d2-fe0d-4ce4-85fd-79ffc3603dcd_2880x1800.png 848w, /__u/substackcdn.com/image/fetch/$s_!Vykf!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a33d8d2-fe0d-4ce4-85fd-79ffc3603dcd_2880x1800.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Vykf!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a33d8d2-fe0d-4ce4-85fd-79ffc3603dcd_2880x1800.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Everything is organized in the order you should actually learn it, so you always know what to study next instead of wondering where to begin.</p><p>If you&#8217;re serious about switching from your 9&#8211;5 job, growing as an engineer, or preparing for your next interview, I think you&#8217;ll find it genuinely useful.</p><p>You can explore it here: https://algorithmxlr8.io</p>]]></content:encoded></item><item><title><![CDATA[Is Software Engineering Really Dead?]]></title><description><![CDATA[The Story Nobody Is Talking About.]]></description><link>https://singour.substack.com/p/is-software-engineering-really-dead</link><guid isPermaLink="false">https://singour.substack.com/p/is-software-engineering-really-dead</guid><dc:creator><![CDATA[Himanshu Singour]]></dc:creator><pubDate>Tue, 30 Jun 2026 14:25:22 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!YhAL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89867312-d1b7-4da1-b5ca-ac32dbc4300b_1536x1024.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!YhAL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89867312-d1b7-4da1-b5ca-ac32dbc4300b_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!YhAL!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89867312-d1b7-4da1-b5ca-ac32dbc4300b_1536x1024.png 424w, /__u/substackcdn.com/image/fetch/$s_!YhAL!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89867312-d1b7-4da1-b5ca-ac32dbc4300b_1536x1024.png 848w, /__u/substackcdn.com/image/fetch/$s_!YhAL!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89867312-d1b7-4da1-b5ca-ac32dbc4300b_1536x1024.png 1272w, /__u/substackcdn.com/image/fetch/$s_!YhAL!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89867312-d1b7-4da1-b5ca-ac32dbc4300b_1536x1024.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!YhAL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89867312-d1b7-4da1-b5ca-ac32dbc4300b_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/89867312-d1b7-4da1-b5ca-ac32dbc4300b_1536x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:971,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1286903,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://singour.substack.com/i/204283501?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89867312-d1b7-4da1-b5ca-ac32dbc4300b_1536x1024.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!YhAL!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89867312-d1b7-4da1-b5ca-ac32dbc4300b_1536x1024.png 424w, /__u/substackcdn.com/image/fetch/$s_!YhAL!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89867312-d1b7-4da1-b5ca-ac32dbc4300b_1536x1024.png 848w, /__u/substackcdn.com/image/fetch/$s_!YhAL!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89867312-d1b7-4da1-b5ca-ac32dbc4300b_1536x1024.png 1272w, /__u/substackcdn.com/image/fetch/$s_!YhAL!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89867312-d1b7-4da1-b5ca-ac32dbc4300b_1536x1024.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>A few months ago, I met a software engineer at a caf&#233;. He wasn&#8217;t a beginner. He had a decent job, a good salary, and years of experience. But he looked stressed. After a few minutes, he finally said,</p><p><em><strong>&#8220;I think I chose the wrong career.&#8221;</strong></em></p><p>I asked him why.</p><p>He opened <strong>Instagram</strong>.</p><p>Then <strong>LinkedIn</strong>. Then YouTube.</p><p>Everywhere, the headlines looked almost identical.</p><p><strong>&#8220;AI replaced another developer.&#8221;</strong></p><p><strong>&#8220;Software Engineering is dead.&#8221;</strong></p><p><strong>&#8220;Stop learning to code.&#8221;</strong></p><p><strong>&#8220;Developers won&#8217;t exist in five years.&#8221;</strong></p><p>He looked at me and asked one question.</p><p>&#8220;Should I quit Software Engineering?&#8221;&#8377;</p><p>For a moment, I didn&#8217;t answer. Instead, I asked him a different question.</p><h2><strong>If Software Engineering Is Dead&#8230; Then why are companies still hiring?</strong></h2><p>If software engineering is truly over&#8230;</p><p>Why are companies still interviewing engineers every single day?</p><p>Why are startups still building engineering teams?</p><p>Why are experienced engineers still getting multiple offers?</p><p>Why are companies spending lakhs and sometimes crores on skilled developers?</p><p><em>Because companies don&#8217;t hire people to write code. They hire people to solve problems. And those are two very different things.</em></p><h2><strong>Writing Code Was Never the Job</strong></h2><p>Most people think software engineering means writing code.</p><p>That&#8217;s only about 20% of the job. The real job is answering questions like:</p><ul><li><p>Why is the system slow?</p></li><li><p>Why did production crash at 2 AM?</p></li><li><p>Why are users losing payments?</p></li><li><p>How do we scale from 10,000 users to 10 million?</p></li><li><p>How do we protect customer data?</p></li><li><p>How do we build something that still works five years from now?</p></li></ul><p>AI can generate code. But it doesn&#8217;t own your business. It doesn&#8217;t understand your customers.</p><p>It doesn&#8217;t sit in meetings deciding technical trade-offs. And it doesn&#8217;t take responsibility when production goes down. That&#8217;s what software engineers do.</p><h2><strong>Let Me Tell You a Real Story</strong></h2><p>A friend of mine built an application using AI. In just three days.</p><p>He was excited. Everything worked perfectly.</p><p>Until&#8230; Real users started using it. The application became slow. The database started failing. APIs timed out. Memory usage kept increasing. Users couldn&#8217;t log in. Payments failed. Suddenly, AI wasn&#8217;t enough.</p><p>Now he needed someone who understood caching. Database indexing. Load balancing. Distributed systems. System design. Monitoring. Scaling.</p><p>Exactly the skills that experienced software engineers bring to the table. That&#8217;s when he realized something important.</p><p><strong>Building an application is easy. Building one that survives millions of users is software engineering.</strong></p><h2><strong>AI Isn&#8217;t Your Competition</strong></h2><p>It&#8217;s Your New Teammate. Think about calculators. Did calculators kill mathematics?</p><p>No.</p><p>They removed repetitive work. Think about cameras on smartphones. Did they eliminate photographers?</p><p>No.</p><p>Great photographers became even better.</p><p>Think about GPS. Did it replace drivers?</p><p>No.</p><p>It made navigation easier. AI is exactly the same. It removes repetitive coding. Now engineers have more time to think. More time to design. More time to innovate. More time to solve real problems.</p><h2><strong>The Engineers Who Will Struggle</strong></h2><p>Let&#8217;s be honest.</p><p>Some engineers will struggle. Not because of AI. Because they stopped learning. Technology has always changed.</p><p>From Java to Kotlin. From Monoliths to Microservices. From On-Premise to Cloud. From Manual Deployments to DevOps.</p><p>Every generation had to adapt. This generation is no different. The engineers who refuse to learn AI will struggle. The engineers who learn AI will move faster than ever before.</p><h2><strong>What Companies Actually Pay For</strong></h2><p>Imagine two developers.</p><p>The first one writes code very quickly. The second one prevents production outages.</p><p>Improves performance by 70%. Reduces cloud costs. Designs scalable systems. Mentors the team. Builds reliable architecture.</p><p>Which one would you hire?</p><p>Exactly.</p><p>Companies don&#8217;t pay for typing speed. They pay for impact.</p><h2><strong>The Biggest Opportunity Most People Are Missing</strong></h2><p>While thousands of people are posting,</p><blockquote><p><em><strong>&#8220;AI is replacing developers.&#8221;</strong></em></p></blockquote><p>A smaller group is quietly learning:</p><ul><li><p>AI tools</p></li><li><p>System Design</p></li><li><p>Cloud</p></li><li><p>Databases</p></li><li><p>Distributed Systems</p></li><li><p>Architecture</p></li><li><p>Security</p></li><li><p>Performance Optimization</p></li></ul><p>Five years from now&#8230;</p><p>Guess which group will be leading engineering teams.</p><h2><strong>The Future Doesn&#8217;t Need More Coders</strong></h2><p>It Needs Better Engineers.</p><p>The best software engineers of the future won&#8217;t be the ones who memorize every programming language.</p><p>They&#8217;ll be the ones who know:</p><p>How to think.</p><p>How to design.</p><p>How to communicate.</p><p>How to understand business.</p><p>How to use AI effectively.</p><p>How to solve problems nobody else can solve. Because code is becoming cheaper. Good decisions are becoming more valuable.</p><h2><strong>If You&#8217;re Feeling Scared&#8230;</strong></h2><p>That&#8217;s okay. Almost every engineer has felt that way at some point. But don&#8217;t let fear make your decisions.</p><p>Use it as fuel. Learn one new skill. Build one new project. Understand one new concept. Keep improving.</p><p>Small progress every day always beats endless worrying.</p><h2><strong>Here&#8217;s What I Believe</strong></h2><p>Software Engineering isn&#8217;t dying.</p><p>Average engineering is. Copy-paste engineering is. Learning just enough to pass interviews is. But engineers who understand fundamentals, system design, architecture, AI, and problem-solving?</p><p>They are becoming more valuable than ever.</p><h2><strong>So&#8230; Is Software Engineering Dead?</strong></h2><p>No.</p><p>It&#8217;s evolving. And every time technology evolves, the people who adapt become the biggest winners. Don&#8217;t spend your energy competing with AI.</p><p>Learn to work with it. Don&#8217;t fear the future. Build it.</p><p>Because the world will always need people who can solve difficult problems. And that&#8217;s what great software engineers do.</p><p><strong>The keyboard may change. The tools may change. Even programming languages will change. But people who can think, build, and solve real problems will never go out of demand. </strong>So the next time someone tells you,</p><blockquote><p><em><strong>&#8220;Software Engineering is dead.&#8221;</strong></em></p></blockquote><p>One Last Thing&#8230;</p><p>If you&#8217;re serious about building a long-term career in software engineering, don&#8217;t waste your time worrying about whether the industry is dying.</p><p>Spend that time becoming so good that companies want <strong>you</strong>.</p><p><strong>Master Data Structures &amp; Algorithms</strong>. Master <strong>Low-Level Design</strong>. Master <strong>High-Level System Design</strong>. Understand real-world architecture, scalability, trade-offs, and problem-solving.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!brkA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F350578e0-6a46-4046-aa9b-c5363d8cf9f5_2880x1800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!brkA!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F350578e0-6a46-4046-aa9b-c5363d8cf9f5_2880x1800.png 424w, /__u/substackcdn.com/image/fetch/$s_!brkA!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F350578e0-6a46-4046-aa9b-c5363d8cf9f5_2880x1800.png 848w, /__u/substackcdn.com/image/fetch/$s_!brkA!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F350578e0-6a46-4046-aa9b-c5363d8cf9f5_2880x1800.png 1272w, /__u/substackcdn.com/image/fetch/$s_!brkA!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F350578e0-6a46-4046-aa9b-c5363d8cf9f5_2880x1800.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!brkA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F350578e0-6a46-4046-aa9b-c5363d8cf9f5_2880x1800.png" width="1456" height="910" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/350578e0-6a46-4046-aa9b-c5363d8cf9f5_2880x1800.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:910,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="/__u/substackcdn.com/image/fetch/$s_!brkA!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F350578e0-6a46-4046-aa9b-c5363d8cf9f5_2880x1800.png 424w, /__u/substackcdn.com/image/fetch/$s_!brkA!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F350578e0-6a46-4046-aa9b-c5363d8cf9f5_2880x1800.png 848w, /__u/substackcdn.com/image/fetch/$s_!brkA!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F350578e0-6a46-4046-aa9b-c5363d8cf9f5_2880x1800.png 1272w, /__u/substackcdn.com/image/fetch/$s_!brkA!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F350578e0-6a46-4046-aa9b-c5363d8cf9f5_2880x1800.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Visit:</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://algorithmxlr8.io/&quot;,&quot;text&quot;:&quot;Master Software Engineering Interviews&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://algorithmxlr8.io/"><span>Master Software Engineering Interviews</span></a></p><p>These are the skills that will stay valuable no matter how technology evolves. So if you truly want to crack software engineering interviews and become a better engineer, stop overthinking.</p><p>Start learning. Start building. Stay consistent. Your future self will thank you. <strong>The best time to start was yesterday. The second-best time is today.</strong></p>]]></content:encoded></item><item><title><![CDATA[Claude 4.7 Feels Like a Real Developer]]></title><description><![CDATA[The Night I Realized AI Had Quietly Gotten Better]]></description><link>https://singour.substack.com/p/claude-47-feels-like-a-real-developer</link><guid isPermaLink="false">https://singour.substack.com/p/claude-47-feels-like-a-real-developer</guid><dc:creator><![CDATA[Himanshu Singour]]></dc:creator><pubDate>Sat, 18 Apr 2026 11:03:49 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!qmw6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e89d9cb-5ff5-4dbd-bbba-a06b7b8516a1_1600x900.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!qmw6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e89d9cb-5ff5-4dbd-bbba-a06b7b8516a1_1600x900.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!qmw6!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e89d9cb-5ff5-4dbd-bbba-a06b7b8516a1_1600x900.jpeg 424w, /__u/substackcdn.com/image/fetch/$s_!qmw6!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e89d9cb-5ff5-4dbd-bbba-a06b7b8516a1_1600x900.jpeg 848w, /__u/substackcdn.com/image/fetch/$s_!qmw6!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e89d9cb-5ff5-4dbd-bbba-a06b7b8516a1_1600x900.jpeg 1272w, /__u/substackcdn.com/image/fetch/$s_!qmw6!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e89d9cb-5ff5-4dbd-bbba-a06b7b8516a1_1600x900.jpeg 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!qmw6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e89d9cb-5ff5-4dbd-bbba-a06b7b8516a1_1600x900.jpeg" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3e89d9cb-5ff5-4dbd-bbba-a06b7b8516a1_1600x900.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!qmw6!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e89d9cb-5ff5-4dbd-bbba-a06b7b8516a1_1600x900.jpeg 424w, /__u/substackcdn.com/image/fetch/$s_!qmw6!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e89d9cb-5ff5-4dbd-bbba-a06b7b8516a1_1600x900.jpeg 848w, /__u/substackcdn.com/image/fetch/$s_!qmw6!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e89d9cb-5ff5-4dbd-bbba-a06b7b8516a1_1600x900.jpeg 1272w, /__u/substackcdn.com/image/fetch/$s_!qmw6!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3e89d9cb-5ff5-4dbd-bbba-a06b7b8516a1_1600x900.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>It was around 1:30 AM.</p><p>The kind of night where everything feels slow. Your brain is tired, but your code is still not working.</p><p>I was stuck on a simple problem. Not even something big. Just a piece of logic that was running slower than expected.</p><p>I had already spent an hour trying to fix it myself.</p><p>Finally, like always, I opened Claude 4.6.</p><p>I pasted my code and wrote the most lazy prompt possible:</p><blockquote><p>&#8220;Code is slow. Fix it.&#8221;</p></blockquote><p>It replied in a few seconds.</p><p>The answer wasn&#8217;t bad. It pointed out a loop, suggested a small optimization, and gave an updated version.</p><p>I tried it.</p><p>Still not right.</p><p>So I asked again. This time more specific.</p><p>Then again.</p><p>After a few back-and-forth messages, I finally got what I needed.</p><p>At that moment, I didn&#8217;t think much about it.</p><p>Because honestly, that had become normal.</p><p>AI helps&#8230; but you still have to guide it a lot.</p><h3>The Next Day, Same Problem, Different Experience</h3><p>The next evening, I ran into a similar issue.</p><p>Same type of logic. Same frustration.</p><p>But this time, I decided to try Claude 4.7.</p><p>No special reason. Just curiosity.</p><p>I pasted my code again. Same lazy prompt:</p><p>&#8220;Code is slow. Fix it.&#8221;</p><p>And this time, something felt different.</p><h3>It Didn&#8217;t Just Answer It Understood</h3><p>Claude 4.7 didn&#8217;t jump straight into fixing the code.</p><p>It first explained what the code was doing.</p><p>Then it pointed out exactly where the inefficiency was.</p><p>Then it said something that caught my attention:</p><p>&#8220;This might work for small inputs, but it will fail when the data grows.&#8221;</p><p>That line felt real.</p><p>Because that&#8217;s exactly how bugs behave in real life.</p><p>Then it gave:</p><ul><li><p>an optimized approach</p></li><li><p>a cleaner structure</p></li><li><p>and a short explanation of why this approach is better</p></li></ul><p>I copied the code.</p><p>Ran it.</p><p>It worked.</p><p>No second prompt.</p><p>No back-and-forth.</p><p>Just done.</p><h3>That&#8217;s When It Clicked</h3><p>The difference between Claude 4.6 and 4.7 is not something you see in a demo.</p><p>It&#8217;s something you <em>feel</em> while working.</p><blockquote><p>Claude 4.6 felt like someone who knows the answer.</p><p>Claude 4.7 feels like someone who understands the problem.</p></blockquote><p>And that&#8217;s a big difference.</p><h3>Real Difference, Explained Without Tech Words</h3><p>Let&#8217;s keep it simple.</p><p>Imagine two people helping you.</p><h3>Person 1 (Claude 4.6)</h3><ul><li><p>Smart</p></li><li><p>Knows theory</p></li><li><p>Gives correct answers</p></li><li><p>But needs clear instructions</p></li></ul><h3>Person 2 (Claude 4.7)</h3><ul><li><p>Also smart</p></li><li><p>But listens better</p></li><li><p>Understands incomplete questions</p></li><li><p>Thinks a step ahead</p></li></ul><p>In real life, you would always prefer Person 2.</p><p>Not because they are smarter.</p><p>But because they make your life easier.</p><h3>Where You Actually Notice the Change</h3><p>This is important.</p><p>If you just ask:</p><ul><li><p>&#8220;What is a stack?&#8221;</p></li><li><p>&#8220;Explain arrays&#8221;</p></li><li><p>&#8220;Write hello world&#8221;</p></li></ul><p>You won&#8217;t feel much difference.</p><p>Both versions will work fine.</p><p>But things change when problems become real.</p><h3>1. When Your Question Is Not Perfect</h3><p>In real life, we don&#8217;t ask clean questions.</p><p>We say things like:</p><ul><li><p>&#8220;Something is wrong here&#8221;</p></li><li><p>&#8220;This is not working&#8221;</p></li><li><p>&#8220;Why is this slow?&#8221;</p></li></ul><p>Claude 4.6 needs more clarity.</p><p>Claude 4.7 handles this mess better.</p><p>It fills the gaps.</p><h3>2. When You&#8217;re Coding for Real Projects</h3><p>This is where the gap becomes obvious.</p><p>Claude 4.6:</p><ul><li><p>Solves the problem</p></li><li><p>But sometimes gives &#8220;textbook&#8221; answers</p></li></ul><p>Claude 4.7:</p><ul><li><p>Thinks about real usage</p></li><li><p>Handles edge cases</p></li><li><p>Suggests better structure</p></li></ul><p>It feels closer to how a real developer thinks.</p><h3>3. When the Task Is Long</h3><p>Try asking both to:</p><ul><li><p>design a system</p></li><li><p>explain a full concept step by step</p></li><li><p>debug a large piece of code</p></li></ul><p>Claude 4.6 sometimes loses direction midway.</p><p>Claude 4.7 stays more consistent.</p><p>It doesn&#8217;t forget what it started.</p><h3>4. When You Care About Accuracy</h3><p>Earlier, one common issue was confidence.</p><p>Claude 4.6 could sound very sure&#8230; even when slightly wrong.</p><p>Claude 4.7 feels more careful.</p><p>It avoids overconfidence.</p><p>And that builds trust.</p><h3>But Here&#8217;s the Honest Truth</h3><p>Claude 4.7 is not perfect.</p><p>Sometimes:</p><ul><li><p>it over-explains</p></li><li><p>it takes longer</p></li><li><p>it feels like it&#8217;s thinking too much</p></li></ul><p>Some people even prefer faster, shorter answers.</p><p>And that&#8217;s fair.</p><p>Because &#8220;better&#8221; depends on what you need.</p><h3>The Real Upgrade No One Talks About</h3><p>It&#8217;s not speed.</p><p>It&#8217;s not accuracy.</p><p>It&#8217;s not even coding.</p><p>It&#8217;s this:</p><p><strong>Less friction.</strong></p><p>With Claude 4.6:<br>You &#8594; explain &#8594; correct &#8594; refine &#8594; repeat</p><p>With Claude 4.7:<br>You &#8594; ask &#8594; get closer answer immediately</p><p>That small reduction in effort changes the whole experience.</p><h3>Why This Matters More Than It Looks</h3><p>If you use AI once a day, it doesn&#8217;t matter much.</p><p>But if you:</p><ul><li><p>code daily</p></li><li><p>prepare for interviews</p></li><li><p>build projects</p></li><li><p>learn new concepts</p></li></ul><p>Then this difference saves time.</p><p>And more importantly, it saves mental energy.</p><h3>Final Thought</h3><p>There was no big announcement in my life.</p><p>No dramatic moment.</p><p>Just one night where I realized:</p><p>&#8220;I didn&#8217;t have to ask twice.&#8221;</p><p>And that&#8217;s when I knew&#8230;</p><p>Claude 4.7 is not a big leap.</p><p>It&#8217;s just quietly better.</p><p>And sometimes, that&#8217;s exactly what we need.</p><p>Now, what do u all think,</p><p>End of Jobs ?</p><p>&#8220;My opinion is, I don&#8217;t think so.&#8221;</p>]]></content:encoded></item><item><title><![CDATA[Claud: The Ultimate Game Changer for Bug Fixing]]></title><description><![CDATA[How one prompt change stopped my AI from guessing and started making it prove]]></description><link>https://singour.substack.com/p/claud-the-ultimate-game-changer-for</link><guid isPermaLink="false">https://singour.substack.com/p/claud-the-ultimate-game-changer-for</guid><dc:creator><![CDATA[Himanshu Singour]]></dc:creator><pubDate>Wed, 01 Apr 2026 06:06:11 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!2DAf!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e7b6ca2-0cdc-4a65-a3ee-62710bcdf674_1080x390.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!2DAf!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e7b6ca2-0cdc-4a65-a3ee-62710bcdf674_1080x390.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!2DAf!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e7b6ca2-0cdc-4a65-a3ee-62710bcdf674_1080x390.jpeg 424w, /__u/substackcdn.com/image/fetch/$s_!2DAf!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e7b6ca2-0cdc-4a65-a3ee-62710bcdf674_1080x390.jpeg 848w, /__u/substackcdn.com/image/fetch/$s_!2DAf!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e7b6ca2-0cdc-4a65-a3ee-62710bcdf674_1080x390.jpeg 1272w, /__u/substackcdn.com/image/fetch/$s_!2DAf!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e7b6ca2-0cdc-4a65-a3ee-62710bcdf674_1080x390.jpeg 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!2DAf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e7b6ca2-0cdc-4a65-a3ee-62710bcdf674_1080x390.jpeg" width="1080" height="390" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5e7b6ca2-0cdc-4a65-a3ee-62710bcdf674_1080x390.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:390,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:33583,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!2DAf!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e7b6ca2-0cdc-4a65-a3ee-62710bcdf674_1080x390.jpeg 424w, /__u/substackcdn.com/image/fetch/$s_!2DAf!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e7b6ca2-0cdc-4a65-a3ee-62710bcdf674_1080x390.jpeg 848w, /__u/substackcdn.com/image/fetch/$s_!2DAf!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e7b6ca2-0cdc-4a65-a3ee-62710bcdf674_1080x390.jpeg 1272w, /__u/substackcdn.com/image/fetch/$s_!2DAf!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e7b6ca2-0cdc-4a65-a3ee-62710bcdf674_1080x390.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Stop asking AI to fix your bugs. Ask it to reproduce them first.</strong></p><p>This one change made my debugging sessions dramatically better.</p><p>Here&#8217;s what I used to do: paste the buggy code, say &#8220;fix this,&#8221; and hope for the best. Sometimes it worked. More often I got a patch that <em>looked</em> right but didn&#8217;t actually address the root cause or worse, introduced something new.</p><p>The shift that changed everything:</p><p><strong>Write a failing test first. Fix second.</strong></p><p><strong>The workflow that actually works:</strong></p><ol><li><p>Give Claude the full picture logs, relevant code, what you expected vs. what happened</p></li><li><p>Ask it to write a test that <em>reproduces</em> the bug</p></li><li><p>Run the test. If it passes, Claude doesn&#8217;t understand the bug yet&#8202;&#8212;&#8202;go back to step 1</p></li><li><p>Once it fails, ask for 2&#8211;3 different fix approaches</p></li><li><p>Let the tests pick the winner</p></li></ol><h3><strong>Real scenario: Payment double-charge bug</strong></h3><p>Users were occasionally getting charged twice for the same transaction. Support tickets were piling up. The instinct? <em>&#8220;Claude, fix the double charge bug.&#8221;</em></p><p>Bad move.</p><h4><strong>Step 1: Give full context:</strong></h4><blockquote><p>&#8220;Here&#8217;s our payment processor webhook handler and the Stripe logs. Some users are seeing duplicate charges. Expected: one charge per order. Actual: sometimes two charges appear 2&#8211;3 seconds apart with the same order ID.&#8221;</p></blockquote><h4><strong>Step 2: Ask for a failing test, not a fix:</strong></h4><blockquote><p>&#8220;Write a test that reproduces this. Simulate two webhook events arriving simultaneously for the same order. Don&#8217;t fix anything yet.&#8221;</p></blockquote><p>Claude wrote this:</p><pre><code>@Test
void testDuplicateWebhookDoesNotDoubleCharge() throws InterruptedException {
    String orderId = &#8220;order_123&#8221;;

    // Simulate two payment.success webhooks arriving at the same time
    ExecutorService executor = Executors.newFixedThreadPool(2);
    CountDownLatch latch = new CountDownLatch(1);

    Callable&lt;Void&gt; webhookTask = () -&gt; {
        latch.await(); // both threads wait, then fire simultaneously
        paymentWebhookHandler.process(orderId);
        return null;
    };

    List&lt;Future&lt;Void&gt;&gt; futures = executor.invokeAll(
        List.of(webhookTask, webhookTask)
    );
    latch.countDown(); // release both at the same time

    for (Future&lt;Void&gt; f : futures) f.get(); // wait for completion

    List&lt;Charge&gt; charges = chargeRepository.findByOrderId(orderId);
    assertEquals(1, charges.size()); // &#8592; This failed. Returned 2.
}</code></pre><p>Test failed. Bug confirmed. Claude actually understood the problem.</p><h4><strong>Step 3: Now ask for fixes:</strong></h4><blockquote><p>&#8220;Good. Now give me 2&#8211;3 approaches to make this test pass.&#8221;</p></blockquote><p>Claude returned three options:</p><p><em><strong>Option A: Database-level unique constraint + idempotency key (most robust):</strong></em></p><pre><code>// In PaymentWebhookHandler.java
@Transactional
public void process(String orderId) {
    if (chargeRepository.existsByOrderId(orderId)) {
        log.info(&#8221;Duplicate webhook ignored for order: {}&#8221;, orderId);
        return;
    }
    // Schema has UNIQUE constraint on order_id column
    Charge charge = new Charge(orderId, amount);
    chargeRepository.save(charge); // throws on duplicate, transaction rolls back
}java</code></pre><p><em><strong>Option B: Redis distributed lock with TTL (fast, low DB pressure):</strong></em></p><pre><code>@Autowired
private RedissonClient redisson;

public void process(String orderId) {
    RLock lock = redisson.getLock(&#8221;payment-lock:&#8221; + orderId);
    try {
        if (lock.tryLock(0, 10, TimeUnit.SECONDS)) {
            if (!chargeRepository.existsByOrderId(orderId)) {
                chargeRepository.save(new Charge(orderId, amount));
            }
        }
    } finally {
        if (lock.isHeldByCurrentThread()) lock.unlock();
    }
}</code></pre><p><em><strong>Option C: Webhook deduplication table (simplest, no extra infra):</strong></em></p><pre><code>@Transactional
public void process(String orderId) {
    boolean inserted = webhookLogRepository.insertIfAbsent(orderId);
    // INSERT INTO webhook_log (order_id) VALUES (?) ON CONFLICT DO NOTHING
    if (!inserted) {
        log.warn(&#8221;Webhook already processed for order: {}&#8221;, orderId);
        return;
    }
    chargeRepository.save(new Charge(orderId, amount));
}</code></pre><p>Tests ran against all three. <strong>Option A</strong> passed cleanly and handled edge cases the others missed the database constraint acted as the final safety net even if application logic had a gap.</p><p><strong>What &#8220;fix the bug&#8221; would have given:</strong> probably a simple <code>if (charged) return;</code> check which breaks the moment two threads hit it at the same millisecond.</p><p><strong>What the test-first approach gave:</strong> a race condition fix with proof it works, plus a regression test that lives in the codebase forever.</p><p>When you frame it this way, Claude stops being an autocomplete for fixes and starts acting like a proper debugging partner one that has to <em>prove</em> it understands the problem before touching anything.</p><p>Less guesswork. Better fixes. And you walk away with regression coverage that catches it if it ever comes back.</p><p><strong>AI shouldn&#8217;t guess fixes. It should prove them.</strong></p>]]></content:encoded></item><item><title><![CDATA[What If Your Cache Becomes Slower Than Your Database?]]></title><description><![CDATA[Lessons from a production system where the &#8220;fast path&#8221; wasn&#8217;t fast anymore]]></description><link>https://singour.substack.com/p/what-if-your-cache-becomes-slower</link><guid isPermaLink="false">https://singour.substack.com/p/what-if-your-cache-becomes-slower</guid><dc:creator><![CDATA[Himanshu Singour]]></dc:creator><pubDate>Sun, 08 Feb 2026 13:12:45 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!8e7h!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3737387c-0a03-4fbb-b33f-81e6b52e82a4_1189x595.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!8e7h!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3737387c-0a03-4fbb-b33f-81e6b52e82a4_1189x595.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!8e7h!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3737387c-0a03-4fbb-b33f-81e6b52e82a4_1189x595.png 424w, /__u/substackcdn.com/image/fetch/$s_!8e7h!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3737387c-0a03-4fbb-b33f-81e6b52e82a4_1189x595.png 848w, /__u/substackcdn.com/image/fetch/$s_!8e7h!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3737387c-0a03-4fbb-b33f-81e6b52e82a4_1189x595.png 1272w, /__u/substackcdn.com/image/fetch/$s_!8e7h!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3737387c-0a03-4fbb-b33f-81e6b52e82a4_1189x595.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!8e7h!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3737387c-0a03-4fbb-b33f-81e6b52e82a4_1189x595.png" width="1189" height="595" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3737387c-0a03-4fbb-b33f-81e6b52e82a4_1189x595.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:595,&quot;width&quot;:1189,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:34042,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://singour.substack.com/i/187284442?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3737387c-0a03-4fbb-b33f-81e6b52e82a4_1189x595.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!8e7h!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3737387c-0a03-4fbb-b33f-81e6b52e82a4_1189x595.png 424w, /__u/substackcdn.com/image/fetch/$s_!8e7h!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3737387c-0a03-4fbb-b33f-81e6b52e82a4_1189x595.png 848w, /__u/substackcdn.com/image/fetch/$s_!8e7h!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3737387c-0a03-4fbb-b33f-81e6b52e82a4_1189x595.png 1272w, /__u/substackcdn.com/image/fetch/$s_!8e7h!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3737387c-0a03-4fbb-b33f-81e6b52e82a4_1189x595.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Nobody designs a system thinking this will happen.</p><p>Cache is supposed to be the fast path.<br>Database is supposed to be the necessary evil.</p><p>And yet, one day, you realize something terrifying:</p><p><strong>The cache is slowing you down.</strong></p><p>Not breaking things.<br>Not crashing.<br>Just&#8230; quietly adding latency.</p><p>This is the story of how that happens  and the system design lessons hiding inside it.</p><div><hr></div><h2>It Started With a Feeling, Not a Metric</h2><p>Everything looked fine on dashboards.</p><p>Redis was up.<br>Database was healthy.<br>CPU was relaxed.</p><p>But users kept saying:</p><blockquote><p>&#8220;The app feels heavy.&#8221;</p></blockquote><p>That&#8217;s the kind of feedback engineers hate, because there&#8217;s nothing concrete to grab onto. No error code. No stack trace. Just vibes.</p><p>In system design terms, this is your first red flag:</p><p><strong>Average metrics lie. Tail latency tells the truth.</strong></p><div><hr></div><h2>The Architecture Was &#8220;Textbook Correct&#8221;</h2><p>On paper, the flow was clean:</p><p>Client &#8594; API &#8594; Cache &#8594; Database</p><p>Read-heavy traffic?<br>Perfect use case for caching.</p><p>But real systems evolve.</p><p>Over time:</p><ul><li><p>More fields were added to responses</p></li><li><p>More features depended on the same cached object</p></li><li><p>Cache entries grew larger and larger</p></li></ul><p><em><strong>System design lesson #1, learned the hard way:</strong></em></p><p><strong>Caching coarse-grained objects feels convenient&#8230; until it isn&#8217;t.</strong></p><div><hr></div><h2>The Forbidden Experiment</h2><p>Late one night, someone asked a dangerous question:</p><blockquote><p>&#8220;What if we just skip the cache for this endpoint?&#8221;</p></blockquote><p>Not forever.<br>Just to compare.</p><p>Same request.<br>Same user.<br>Same data.</p><p>The response without cache came back faster.</p><p>That moment hurt.</p><p>Because it breaks a core assumption:</p><p><strong>Cache &#8800; faster by default.</strong></p><div><hr></div><h2>The Database Had Quietly Improved</h2><p>Here&#8217;s what we had ignored.</p><p>The database wasn&#8217;t &#8220;slow&#8221; anymore.</p><ul><li><p>Hot data lived in memory</p></li><li><p>Indexes were tuned over months</p></li><li><p>Queries were narrow and predictable</p></li></ul><p>In system design terms:</p><p><strong>Modern databases already behave like partial caches.</strong></p><p>Meanwhile, Redis was:</p><ul><li><p>Remote</p></li><li><p>Shared across services</p></li><li><p>Handling bigger payloads</p></li><li><p>Doing more work per request</p></li></ul><p>Every cache read paid a network cost <em>plus</em> processing cost.</p><div><hr></div><h2>Cache Misses Were Costlier Than We Thought</h2><p>The cache hit rate looked decent around 80&#8211;85%.</p><p>That number gave false confidence.</p><p>But the remaining misses were brutal.</p><p>A cache miss meant:</p><ol><li><p>Network call to cache</p></li><li><p>Miss response</p></li><li><p>Query to DB</p></li><li><p>Write back to cache</p></li></ol><p>So for some users, especially new or inactive ones, we had added an <strong>extra hop</strong> for no benefit.</p><p><em><strong>System design lesson #2:</strong></em></p><p><strong>A cache with poor hit rate can be worse than no cache at all.</strong></p><div><hr></div><h2>Redis Had Become a Bottleneck, Not a Booster</h2><p>Another uncomfortable realization:</p><p>Redis was now on the critical path for <em>everything</em>.</p><p>Even simple reads.<br>Even low-traffic endpoints.</p><p>This violated a core design principle:</p><p><strong>Shared infrastructure becomes a bottleneck before you expect it.</strong></p><p>The DB had connection pooling, parallelism, and isolation.<br>Redis had queues.</p><div><hr></div><h2>The Fix Wasn&#8217;t &#8220;Optimize Redis&#8221;</h2><p>We didn&#8217;t tune Redis.<br>We didn&#8217;t increase memory.<br>We didn&#8217;t add more nodes.</p><p>We stepped back and asked:</p><blockquote><p>&#8220;Should this even be cached?&#8221;</p></blockquote><p>Some data:</p><ul><li><p>Changed often</p></li><li><p>Was cheap to compute</p></li><li><p>Was already optimized in DB</p></li></ul><p>So we let the database handle it.</p><p>Other data:</p><ul><li><p>Truly hot</p></li><li><p>Truly reused</p></li><li><p>Truly expensive</p></li></ul><p>That stayed in cache.</p><p><em><strong>System design lesson #3:</strong></em></p><p><strong>Cache only what is expensive, stable, and frequently reused.</strong></p><div><hr></div><h2>The System Felt Lighter Overnight</h2><p>Nothing dramatic happened.</p><p>No heroic deploy.<br>No massive refactor.</p><p>But the app felt smooth again.</p><p>Support tickets dropped.<br>Latency flattened.<br>The system became boring.</p><p>And boring is the highest compliment in system design.</p><div><hr></div><h2>The Real &#8220;What If&#8221; Question</h2><p>The real question isn&#8217;t:</p><blockquote><p>&#8220;What if cache becomes slower than DB?&#8221;</p></blockquote><p>The real question is:</p><blockquote><p>&#8220;What assumptions am I no longer questioning?&#8221;</p></blockquote><p>Because systems age.<br>Traffic changes.<br>Access patterns shift.</p><p>And cache, if left unquestioned, slowly turns from an optimization into a liability.</p><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[What If Latency Had to Be Under 50ms Everywhere in the World?]]></title><description><![CDATA[The hidden cost of making software feel immediate]]></description><link>https://singour.substack.com/p/what-if-latency-had-to-be-under-50ms</link><guid isPermaLink="false">https://singour.substack.com/p/what-if-latency-had-to-be-under-50ms</guid><dc:creator><![CDATA[Himanshu Singour]]></dc:creator><pubDate>Wed, 04 Feb 2026 05:48:53 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!7L-1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ee25c3c-8a1f-479b-9485-b04315c3e98f_1089x1060.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!7L-1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ee25c3c-8a1f-479b-9485-b04315c3e98f_1089x1060.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!7L-1!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ee25c3c-8a1f-479b-9485-b04315c3e98f_1089x1060.png 424w, /__u/substackcdn.com/image/fetch/$s_!7L-1!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ee25c3c-8a1f-479b-9485-b04315c3e98f_1089x1060.png 848w, /__u/substackcdn.com/image/fetch/$s_!7L-1!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ee25c3c-8a1f-479b-9485-b04315c3e98f_1089x1060.png 1272w, /__u/substackcdn.com/image/fetch/$s_!7L-1!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ee25c3c-8a1f-479b-9485-b04315c3e98f_1089x1060.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!7L-1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ee25c3c-8a1f-479b-9485-b04315c3e98f_1089x1060.png" width="1089" height="1060" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4ee25c3c-8a1f-479b-9485-b04315c3e98f_1089x1060.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1060,&quot;width&quot;:1089,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:27329,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://singour.substack.com/i/186824415?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ee25c3c-8a1f-479b-9485-b04315c3e98f_1089x1060.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!7L-1!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ee25c3c-8a1f-479b-9485-b04315c3e98f_1089x1060.png 424w, /__u/substackcdn.com/image/fetch/$s_!7L-1!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ee25c3c-8a1f-479b-9485-b04315c3e98f_1089x1060.png 848w, /__u/substackcdn.com/image/fetch/$s_!7L-1!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ee25c3c-8a1f-479b-9485-b04315c3e98f_1089x1060.png 1272w, /__u/substackcdn.com/image/fetch/$s_!7L-1!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ee25c3c-8a1f-479b-9485-b04315c3e98f_1089x1060.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>It usually starts with a feeling, not a number.</p><p>Someone opens the app and says,<br>&#8220;Why does this feel slow?&#8221;</p><p>Not broken. Not failing.<br>Just&#8230; slow.</p><p>A few milliseconds of hesitation. A tiny pause. Enough to break the illusion.</p><p>So the requirement gets written:</p><p><strong>Every user, everywhere, should get a response in under 50 milliseconds.</strong></p><p>It sounds ambitious. It sounds premium.<br>It sounds like something great products should have.</p><p>What it really is&#8230; is a declaration of war against reality.</p><div><hr></div><h3>The World Is Bigger Than Your Backend</h3><p>Most software begins life in one place.</p><p>One cloud region.<br>One database.<br>One comforting sense of control.</p><p>From that setup, everything looks fast&#8212;until the first real users arrive.</p><p>A tap in New York feels instant.<br>A tap in London feels okay.<br>A tap in India feels&#8230; delayed.<br>A tap in Australia feels broken.</p><p>Nothing changed in the code.</p><p>Distance did.</p><p>Data doesn&#8217;t move instantly. It travels through cables, routers, oceans, and continents. Every kilometer adds a little delay. Stack enough kilometers together, and suddenly your &#8220;fast&#8221; system feels old.</p><p>That&#8217;s the moment you understand something no performance chart can teach:</p><p><strong>Latency is geography.</strong></p><div><hr></div><h3>You Can&#8217;t Pull the World In, So You Push the System Out</h3><p>At first, teams try the usual tricks.</p><p>Optimize queries.<br>Tune caches.<br>Upgrade servers.</p><p>It helps. A little.</p><p>But no amount of optimization can beat physics.</p><p>So the architecture shifts.</p><p>Instead of one powerful center, the system becomes many small outposts scattered across the globe. Parts of the application move closer to users&#8212;not just images and files, but logic, decisions, and sometimes even data.</p><p>Now when someone opens the app, the response doesn&#8217;t come from &#8220;the backend.&#8221;</p><p>It comes from <em>nearby</em>.</p><p>The app stops feeling like it&#8217;s on the internet and starts feeling like it&#8217;s on the device.</p><p>That&#8217;s when people say, &#8220;<strong>Wow, this feels fast.</strong>&#8221;</p><div><hr></div><h3>The Subtle Trade Nobody Notices</h3><p>But something quietly changes when data lives everywhere.</p><p>Perfect agreement disappears.</p><p>Two users in different countries might see slightly different versions of the same thingfor a moment. A count updates later. A feed rearranges itself. A status changes after a second.</p><p>And here&#8217;s the surprising truth:</p><p><strong>This is acceptable.</strong></p><p>Most humans don&#8217;t experience software as databases.<br>They experience it as moments.</p><p>If the moment feels smooth, they trust the system.<br>If the moment feels delayed, they don&#8217;t.</p><p>So systems stop chasing perfection and start chasing <em>perception</em>.</p><p>Correct eventually.<br>Fast immediately.</p><div><hr></div><h3>Time Becomes&#8230; Fuzzy</h3><p>When everything is global, time itself stops being clean.</p><blockquote><p>Which update happened first?<br>Which server is ahead?<br>Which region is &#8220;right&#8221;?</p></blockquote><p>Clocks drift. Networks lag. Messages arrive out of order.</p><p>So systems stop relying on exact time and start relying on ordering, versioning, and conflict resolution.</p><p>Instead of asking, &#8220;What time did this happen?&#8221;<br>They ask, &#8220;<strong>Which change should win?</strong>&#8221;</p><p>The system becomes less about storing facts<br>and more about negotiating reality.</p><div><hr></div><h3>When Speed Still Isn&#8217;t Enough</h3><p>Even after spreading across the world, 50ms is still hard.</p><p>So modern systems do something bold.</p><p>They assume.</p><blockquote><p>They preload data before you ask.<br>They render screens before confirmation.<br>They show optimistic results and fix mistakes later.</p></blockquote><p>You click &#8220;like,&#8221; and the heart fills instantly<br>even if the server hasn&#8217;t replied yet.</p><p>If everything works, you feel joy.<br>If something fails, the system quietly adjusts.</p><p>You never see the machinery.<br>You only feel the smoothness.</p><p>At this point, the system isn&#8217;t responding to users anymore.</p><p>It&#8217;s <strong>running ahead of them</strong>.</p><div><hr></div><h3>The Invisible Complexity</h3><p>From the outside, the app feels simple. Effortless. Clean.</p><p>Inside, it&#8217;s anything but.</p><blockquote><p>Logs are scattered across continents.<br>Errors happen only in certain regions.<br>Bugs can&#8217;t be reproduced easily.<br>Fixes must be rolled out carefully, slowly, globally.</p></blockquote><p>Every improvement risks breaking something far away.</p><p>But that&#8217;s the price of instant experiences.</p><div><hr></div><h3>What This Requirement Really Means</h3><p>&#8220;<em><strong>Latency under 50ms worldwide</strong></em>&#8221; isn&#8217;t a performance goal.</p><p>It&#8217;s a philosophy.</p><p>It means:</p><ul><li><p>You prioritize feeling over precision</p></li><li><p>You design for humans, not machines</p></li><li><p>You accept uncertainty to gain speed</p></li></ul><p>Most importantly, it means you understand this truth:</p><p><strong>Users don&#8217;t remember correctness.<br>They remember how it felt.</strong></p><p>Fast feels smart.<br>Fast feels reliable.<br>Fast feels modern.</p><p>And that&#8217;s why teams chase 50ms not because it&#8217;s easy, but because it changes how people experience the product.</p><div><hr></div><h3>The Final Shift</h3><p>In the end, systems like this stop asking:</p><p>&#8220;Is the data perfect right now?&#8221;</p><p>They ask:</p><p>&#8220;Does this feel instant, alive, and trustworthy?&#8221;</p><p>When the answer is yes, users stay.</p><p>And that&#8217;s the real reason latency matters.</p>]]></content:encoded></item><item><title><![CDATA[What If Reads Suddenly Become Write-Heavy?]]></title><description><![CDATA[What production teaches you when traffic patterns flip]]></description><link>https://singour.substack.com/p/what-if-reads-suddenly-become-write</link><guid isPermaLink="false">https://singour.substack.com/p/what-if-reads-suddenly-become-write</guid><dc:creator><![CDATA[Himanshu Singour]]></dc:creator><pubDate>Tue, 03 Feb 2026 06:20:22 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!L69x!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47e3a4d0-ac44-4fed-b4af-7b8e345f3ffa_1620x888.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!L69x!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47e3a4d0-ac44-4fed-b4af-7b8e345f3ffa_1620x888.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!L69x!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47e3a4d0-ac44-4fed-b4af-7b8e345f3ffa_1620x888.png 424w, /__u/substackcdn.com/image/fetch/$s_!L69x!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47e3a4d0-ac44-4fed-b4af-7b8e345f3ffa_1620x888.png 848w, /__u/substackcdn.com/image/fetch/$s_!L69x!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47e3a4d0-ac44-4fed-b4af-7b8e345f3ffa_1620x888.png 1272w, /__u/substackcdn.com/image/fetch/$s_!L69x!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47e3a4d0-ac44-4fed-b4af-7b8e345f3ffa_1620x888.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!L69x!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47e3a4d0-ac44-4fed-b4af-7b8e345f3ffa_1620x888.png" width="728" height="399" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/47e3a4d0-ac44-4fed-b4af-7b8e345f3ffa_1620x888.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:798,&quot;width&quot;:1456,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:23819,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://singour.substack.com/i/186704274?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47e3a4d0-ac44-4fed-b4af-7b8e345f3ffa_1620x888.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!L69x!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47e3a4d0-ac44-4fed-b4af-7b8e345f3ffa_1620x888.png 424w, /__u/substackcdn.com/image/fetch/$s_!L69x!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47e3a4d0-ac44-4fed-b4af-7b8e345f3ffa_1620x888.png 848w, /__u/substackcdn.com/image/fetch/$s_!L69x!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47e3a4d0-ac44-4fed-b4af-7b8e345f3ffa_1620x888.png 1272w, /__u/substackcdn.com/image/fetch/$s_!L69x!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47e3a4d0-ac44-4fed-b4af-7b8e345f3ffa_1620x888.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>When the system was built, it was quiet.</p><p>Most requests just read data.<br>Writes happened, but only when something actually changed.</p><p>Because of that, nobody worried too much about writes. Every request was allowed to touch the database. Counters were updated directly. Logs were stored immediately. It all felt safe.</p><p>And for a long time, it was.</p><p>Slowly, without anyone noticing, the nature of traffic changed.</p><p>A page view was no longer just a read.<br>It updated a counter.<br>It stored &#8220;last seen&#8221;.<br>It recorded activity.</p><p>Nothing dramatic. Just a few extra lines of code.</p><div><hr></div><p>At first, nothing broke.</p><p>Latency increased a little, but it was within limits.<br>CPU stayed high, but not alarming.<br>Replication lag appeared, then disappeared.</p><p>The system didn&#8217;t fail.<br>It just felt heavier.</p><p>That&#8217;s usually how write-heavy problems start.</p><div><hr></div><p>The uncomfortable part was that traffic hadn&#8217;t grown much.</p><p>Same users.<br>Same requests.</p><p>But now every request did more work.<br>Work that had to be written, locked, replicated, and persisted.</p><p>The database was no longer storing state.<br>It was reacting to behavior.</p><div><hr></div><p>Scaling helped, but only briefly.</p><p>A bigger machine bought time.<br>More IOPS reduced pressure.</p><p>But the feeling came back.</p><p>Because the system wasn&#8217;t slow due to lack of resources.<br>It was slow because it was doing too many writes that didn&#8217;t really matter.</p><div><hr></div><p>The turning point wasn&#8217;t a new tool or a new database.</p><p>It was a simple question asked during a quiet debugging session:</p><h4>&#8220;Why do we need to write this right now?&#8221;</h4><p>Not later.<br>Not eventually.<br>Right now.</p><p>That question exposed a lot.</p><p>Many writes existed only because they were easy to add.<br>Some data was useful, but not urgent.<br>Some data was nice to have, but not essential.</p><p>Yet all of it was treated as critical.</p><div><hr></div><p>Once that became clear, the system slowly changed.</p><blockquote><p>Some data stayed in memory longer.<br>Some updates became async.<br>Some counters stopped being exact.<br>Some things stopped being written at all.</p></blockquote><p>Nothing fancy.<br>Just honest decisions.</p><p>And gradually, the system became calm again.</p><div><hr></div><p>The biggest lesson wasn&#8217;t about databases or performance.</p><p>It was about mindset.</p><p>Read-heavy systems allow you to be careless.<br>Write-heavy systems don&#8217;t.</p><p>They force you to respect every write, because every write has a cost.</p><div><hr></div><p>The truth is, systems rarely stay read-heavy forever.</p><p>Products evolve.<br>Features grow.<br>Observability increases.</p><p>And one day, reads quietly turn into writes.</p><p>If your system isn&#8217;t ready for that, it won&#8217;t crash immediately.</p><p>It will just become fragile.</p><div><hr></div><h3>Final thought</h3><p>A system that works only when writes are rare is not strong it&#8217;s lucky.</p><p>Design assuming one day, reads will want to write.</p><p>Because production always finds a way to make that happen.</p>]]></content:encoded></item><item><title><![CDATA[What If Duplicate Events Are Unavoidable?]]></title><description><![CDATA[#4 Why Idempotency Matters More Than Event Guarantees]]></description><link>https://singour.substack.com/p/what-if-duplicate-events-are-unavoidable</link><guid isPermaLink="false">https://singour.substack.com/p/what-if-duplicate-events-are-unavoidable</guid><dc:creator><![CDATA[Himanshu Singour]]></dc:creator><pubDate>Mon, 02 Feb 2026 06:15:44 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!h-lF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefeedc3a-e1d7-419f-9afb-bbfcf7134114_1357x629.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!h-lF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefeedc3a-e1d7-419f-9afb-bbfcf7134114_1357x629.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!h-lF!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefeedc3a-e1d7-419f-9afb-bbfcf7134114_1357x629.png 424w, /__u/substackcdn.com/image/fetch/$s_!h-lF!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefeedc3a-e1d7-419f-9afb-bbfcf7134114_1357x629.png 848w, /__u/substackcdn.com/image/fetch/$s_!h-lF!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefeedc3a-e1d7-419f-9afb-bbfcf7134114_1357x629.png 1272w, /__u/substackcdn.com/image/fetch/$s_!h-lF!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefeedc3a-e1d7-419f-9afb-bbfcf7134114_1357x629.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!h-lF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefeedc3a-e1d7-419f-9afb-bbfcf7134114_1357x629.png" width="1357" height="629" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/efeedc3a-e1d7-419f-9afb-bbfcf7134114_1357x629.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:629,&quot;width&quot;:1357,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:67866,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://singour.substack.com/i/186581853?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefeedc3a-e1d7-419f-9afb-bbfcf7134114_1357x629.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!h-lF!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefeedc3a-e1d7-419f-9afb-bbfcf7134114_1357x629.png 424w, /__u/substackcdn.com/image/fetch/$s_!h-lF!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefeedc3a-e1d7-419f-9afb-bbfcf7134114_1357x629.png 848w, /__u/substackcdn.com/image/fetch/$s_!h-lF!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefeedc3a-e1d7-419f-9afb-bbfcf7134114_1357x629.png 1272w, /__u/substackcdn.com/image/fetch/$s_!h-lF!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefeedc3a-e1d7-419f-9afb-bbfcf7134114_1357x629.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>Every experienced backend engineer eventually learns this the hard way.</p><p>Not from a blog.<br>Not from a system design interview.<br>But from a real incident, usually late at night, when everything <em>looks</em> healthy and customers are still getting hurt.</p><div><hr></div><p>Duplicate events don&#8217;t come from bad code.<br>They come from reality.</p><p>Networks retry.<br>Brokers redeliver.<br>Services crash between two lines of code.<br>Timeouts fire even when work succeeded.</p><p>None of this is exceptional.<br>This is the normal operating mode of distributed systems.</p><div><hr></div><h3>When We Were Wrong</h3><p>The system was simple on paper.</p><p>An event comes in.<br>We process it.<br>We update the database.<br>We move on.</p><p>There was even a comment in the code:</p><blockquote><p>&#8220;This event will only be received once.&#8221;</p></blockquote><p>It wasn&#8217;t arrogance.<br>It was just an assumption no one had questioned yet.</p><p>Then one deployment later, a consumer restarted mid-flow.<br>The message broker retried.<br>The same event came back.</p><p>Nothing crashed.<br>Nothing alerted.</p><p>But a refund was issued twice.</p><div><hr></div><h3>Why Preventing Duplicates Doesn&#8217;t Work</h3><p>The first instinct is always the same:</p><ul><li><p>&#8220;Let&#8217;s dedupe at the producer&#8221;</p></li><li><p>&#8220;Let&#8217;s add retries with care&#8221;</p></li><li><p>&#8220;Let&#8217;s ensure exactly-once delivery&#8221;</p></li></ul><p>And all of that helps.</p><p>But none of it <em>guarantees</em> uniqueness.</p><p>Because once your system crosses machines, processes, or networks, <strong>you no longer control delivery</strong>.</p><p>You only control <strong>how you react</strong>.</p><div><hr></div><h3>Better Systems Ask Better Questions</h3><p>Junior systems ask:</p><blockquote><p>&#8220;How do we make sure this event happens once?&#8221;</p></blockquote><p>Senior systems ask:</p><blockquote><p><strong>&#8220;What happens if this runs twice?&#8221;</strong></p></blockquote><p>That single shift changes everything.</p><p>Instead of trusting the world, the system becomes defensive.<br>Instead of hoping, it becomes resilient.</p><div><hr></div><h3>Idempotency Is Just Common Sense</h3><p>The fix is rarely complex.</p><p>Before doing any irreversible work:</p><ul><li><p>charging money</p></li><li><p>sending emails</p></li><li><p>updating state</p></li></ul><p>The system checks:</p><blockquote><p>&#8220;Have I already handled this?&#8221;</p></blockquote><p>If yes, it exits quietly.<br>If no, it proceeds and records that fact.</p><p>No locks.<br>No distributed transactions.<br>No magic.</p><p>Just discipline.</p><p>This is why payment systems, notification systems, and order pipelines all talk about <strong>idempotency keys</strong>.</p><p>Not because duplicates are rare.<br>Because they are inevitable.</p><div><hr></div><h3>Why This Feels Boring (and That&#8217;s a Good Thing)</h3><p>There&#8217;s no dopamine hit in idempotency.</p><p>It doesn&#8217;t show up in dashboards.<br>It doesn&#8217;t improve latency.<br>It doesn&#8217;t impress in demos.</p><p>But it saves you at 2 AM.<br>It saves customer trust.<br>It saves your on call sanity.</p><p>Most great system design decisions feel boring in the moment.<br>They only feel brilliant in hindsight.</p><div><hr></div><h3>The Real Lesson</h3><p>Duplicate events are not a failure.<br>They are a signal.</p><p>A signal that your system is operating in the real world.</p><p>If processing the same event twice breaks your system,<br>then the system isn&#8217;t robust yet <br>it&#8217;s just lucky.</p><p>And luck doesn&#8217;t scale.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://medium.com/@himanshusingour7&quot;,&quot;text&quot;:&quot;System design oriented article&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://medium.com/@himanshusingour7"><span>System design oriented article</span></a></p>]]></content:encoded></item><item><title><![CDATA[What if database size grows 100×?]]></title><description><![CDATA[When Your Database Grows 100&#215;: The Problems You Don&#8217;t See Coming and How to Handle Them]]></description><link>https://singour.substack.com/p/what-if-database-size-grows-100</link><guid isPermaLink="false">https://singour.substack.com/p/what-if-database-size-grows-100</guid><dc:creator><![CDATA[Himanshu Singour]]></dc:creator><pubDate>Fri, 30 Jan 2026 13:29:18 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!_8O_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26cd6bbe-09f5-4cb0-89b6-6e2a5710b54c_1516x912.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!_8O_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26cd6bbe-09f5-4cb0-89b6-6e2a5710b54c_1516x912.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!_8O_!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26cd6bbe-09f5-4cb0-89b6-6e2a5710b54c_1516x912.png 424w, /__u/substackcdn.com/image/fetch/$s_!_8O_!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26cd6bbe-09f5-4cb0-89b6-6e2a5710b54c_1516x912.png 848w, /__u/substackcdn.com/image/fetch/$s_!_8O_!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26cd6bbe-09f5-4cb0-89b6-6e2a5710b54c_1516x912.png 1272w, /__u/substackcdn.com/image/fetch/$s_!_8O_!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26cd6bbe-09f5-4cb0-89b6-6e2a5710b54c_1516x912.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!_8O_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26cd6bbe-09f5-4cb0-89b6-6e2a5710b54c_1516x912.png" width="1456" height="876" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/26cd6bbe-09f5-4cb0-89b6-6e2a5710b54c_1516x912.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:876,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:118361,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://singour.substack.com/i/186301729?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26cd6bbe-09f5-4cb0-89b6-6e2a5710b54c_1516x912.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!_8O_!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26cd6bbe-09f5-4cb0-89b6-6e2a5710b54c_1516x912.png 424w, /__u/substackcdn.com/image/fetch/$s_!_8O_!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26cd6bbe-09f5-4cb0-89b6-6e2a5710b54c_1516x912.png 848w, /__u/substackcdn.com/image/fetch/$s_!_8O_!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26cd6bbe-09f5-4cb0-89b6-6e2a5710b54c_1516x912.png 1272w, /__u/substackcdn.com/image/fetch/$s_!_8O_!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26cd6bbe-09f5-4cb0-89b6-6e2a5710b54c_1516x912.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>When a database is small, it quietly supports you.</p><blockquote><p>Everything feels smooth. Pages load fast, APIs respond instantly, and nobody really thinks about what is happening underneath. </p></blockquote><p>You write queries quickly, ship features, and move on. Even if the design is not great, nothing complains. Small data is kind. It hides mistakes and makes you feel confident.</p><p>As time goes on, the product grows.<br>More users arrive, more actions are recorded, more history is stored. Orders, messages, logs, and events keep piling up. </p><p>The database grows slowly in the background, without making noise. Since nothing is broken, nobody pays attention to it.</p><div><hr></div><h4>Then one day, the database is <strong>100&#215; bigger</strong>, and the mood changes.</h4><p>Things don&#8217;t crash, but they don&#8217;t feel right either.</p><p><br>Pages hesitate before loading. APIs feel unpredictable. Sometimes everything is fast, sometimes it is slow, and no one can clearly explain why.</p><p>Users start saying the app feels &#8220;<strong>heavy</strong>.&#8221; Engineers start checking dashboards more often. The system still works, but it no longer feels comfortable.</p><p>The team slowly understands what is happening.<br>The database is not slow by accident. </p><p>It is slow because it is doing too much unnecessary work.</p><p>Queries that once touched a few rows now touch millions. </p><p>Decisions that felt harmless earlier are now expensive. </p><p>The database has not changed the truth has.</p><p>Fear enters the workflow.</p><p><br><em><strong>Migrations feel risky. Large updates are delayed. </strong></em></p><p>Even simple changes are discussed twice. The database becomes critical and fragile at the same time. Everyone depends on it, but no one wants to touch it casually anymore.</p><p><em><strong>Costs rise quietly in the background.</strong></em></p><p>Storage grows. Replicas increase. Memory usage climbs. Bills go up every month. What hurts most is realizing that this money is being spent to support inefficiency, not innovation.</p><p>At this point, the team has a choice.<br>Either keep reacting to problems, or stop and fix the foundation.</p><div><hr></div><h3>How Teams Actually Handle a Database That Grows 100&#215;</h3><blockquote><p>The first thing that changes is thinking.<br><code>Instead of asking why something is slow today, the team starts asking how it will behave next year. </code></p></blockquote><p>Data growth becomes part of design, not an afterthought. This mindset shift alone prevents many future problems.</p><p><em><strong>Then the team looks closely at how data is accessed.</strong></em><br>Not all data is equal. Most features touch only a small part of the database. </p><p>Once indexes are built around real usage instead of guesses, queries stop scanning everything and start behaving efficiently. Performance improves without adding more machines.</p><p><em><strong>Next comes separation of data.</strong></em><br>Old records, logs, and history are moved away from active data. Frequently used tables become smaller and faster. </p><p>The database feels lighter, not because data was deleted, but because important data is no longer buried under noise.</p><p><em><strong>Caching becomes an obvious step.</strong></em><br>The team notices users repeat the same actions again and again. Instead of asking the database every time, results are reused for short periods. </p><p>Load drops. Stability improves. The database finally gets room to breathe.</p><p><em><strong>As growth continues, structure increases.</strong></em><br>Reads and writes are separated. Replicas handle traffic. </p><p>Data is split by users, regions, or time. The system stops being one big room and becomes an organized building. Complexity increases, but chaos decreases.</p><p><em><strong>Most importantly, habits change permanently.</strong></em><br>Queries are reviewed. Slow operations are tracked. </p><p>New features are built with future data size in mind. &#8220;It works now&#8221; is no longer acceptable. The question becomes, &#8220;Will this still work when data grows again?&#8221;</p><div class="pullquote"><p><strong>Handling a database that grows 100&#215; is not about one big fix.</strong><br>It is about maturity. Teams that respect data build systems that age well. </p><p>Teams that ignore it keep fighting the same problems, just at a bigger and more painful scale.</p></div><p>In the end, growth becomes less scary.<br>Not because data stopped growing, but because the system and the team finally grew up with it.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://substack.com/@himanshusingour03&quot;,&quot;text&quot;:&quot;Follow for a daily system design series.&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="/__u/substack.com/@himanshusingour03"><span>Follow for a daily system design series.</span></a></p>]]></content:encoded></item><item><title><![CDATA[What if latency must stay <100ms globally?]]></title><description><![CDATA[#2 How We Keep Global Latency Under 100ms]]></description><link>https://singour.substack.com/p/what-if-latency-must-stay-100ms-globally</link><guid isPermaLink="false">https://singour.substack.com/p/what-if-latency-must-stay-100ms-globally</guid><dc:creator><![CDATA[Himanshu Singour]]></dc:creator><pubDate>Thu, 29 Jan 2026 14:42:58 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!-Uxl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb2810ec-c8e8-4537-a7e2-816466cfd005_1834x720.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!-Uxl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb2810ec-c8e8-4537-a7e2-816466cfd005_1834x720.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!-Uxl!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb2810ec-c8e8-4537-a7e2-816466cfd005_1834x720.png 424w, /__u/substackcdn.com/image/fetch/$s_!-Uxl!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb2810ec-c8e8-4537-a7e2-816466cfd005_1834x720.png 848w, /__u/substackcdn.com/image/fetch/$s_!-Uxl!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb2810ec-c8e8-4537-a7e2-816466cfd005_1834x720.png 1272w, /__u/substackcdn.com/image/fetch/$s_!-Uxl!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb2810ec-c8e8-4537-a7e2-816466cfd005_1834x720.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!-Uxl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb2810ec-c8e8-4537-a7e2-816466cfd005_1834x720.png" width="1456" height="572" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bb2810ec-c8e8-4537-a7e2-816466cfd005_1834x720.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:572,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:73838,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://singour.substack.com/i/186197463?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb2810ec-c8e8-4537-a7e2-816466cfd005_1834x720.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!-Uxl!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb2810ec-c8e8-4537-a7e2-816466cfd005_1834x720.png 424w, /__u/substackcdn.com/image/fetch/$s_!-Uxl!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb2810ec-c8e8-4537-a7e2-816466cfd005_1834x720.png 848w, /__u/substackcdn.com/image/fetch/$s_!-Uxl!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb2810ec-c8e8-4537-a7e2-816466cfd005_1834x720.png 1272w, /__u/substackcdn.com/image/fetch/$s_!-Uxl!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb2810ec-c8e8-4537-a7e2-816466cfd005_1834x720.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>It&#8217;s evening. </p><p>You&#8217;re standing at a small grocery store. </p><p>You scan the QR code, enter the amount, and tap <strong>Pay</strong>.</p><p>For that moment, nothing else matters. You&#8217;re staring at the screen, waiting.</p><p>If the app responds instantly, you relax.<br>If it pauses for even a second, your heart skips.<br>&#8220;<em><strong>Did the money go? Should I pay again?</strong></em>&#8221;</p><p>This is why payment apps must feel <strong>instant</strong>, no matter where the user is in the world.</p><div><hr></div><p>Behind the scenes, the biggest enemy isn&#8217;t hacking or bugs.<br>It&#8217;s <strong>distance</strong>.</p><p>If your payment request travels from India to a server in another country, it physically takes time. The data crosses oceans. </p><p>Even with perfect software, that delay can&#8217;t be avoided. And for payments, delay feels like danger.</p><p>So real payment systems don&#8217;t use one far-away brain.</p><div><hr></div><p>Instead, they quietly work close to you.</p><p>When you tap <strong>Pay</strong>, your request goes to a server in your own region. </p><p>If you&#8217;re in India, it stays in India. The system checks your balance, blocks the amount, and gives you a result almost immediately. </p><p>That&#8217;s why you see &#8220;<em><strong>Payment Successful</strong></em>&#8221; so fast usually within a blink.</p><p>At that moment, your money is safe. The system has already made a local decision.</p><div><hr></div><p>What happens next is calmer and slower.</p><p>After you&#8217;ve walked out of the shop, the system starts sharing that payment record with other parts of the world. </p><p>This syncing is important for reports, backups, and fraud checks but it doesn&#8217;t rush. The user doesn&#8217;t wait for it. </p><p>Life moves on.</p><p>This separation <strong>fast local action, slow global syncing</strong> is what keeps payments feeling smooth.</p><div><hr></div><p>There&#8217;s also a quiet understanding in the system.</p><p>Some things must be perfect instantly, like deducting money.</p><p><br>Other things, like updating transaction history everywhere, can take a little time. Real payment systems know the difference and don&#8217;t treat everything with the same urgency.</p><p>That&#8217;s how they stay fast without being careless.</p><div><hr></div><p>And when something goes wrong maybe a regional server is slow the system doesn&#8217;t panic. Traffic gently moves to the next nearest place. </p><p>The user may notice a tiny delay, but the payment still completes. </p><p>Trust is protected.</p><div><hr></div><p>So keeping payment latency under 100ms globally isn&#8217;t about magic speed.</p><p>It&#8217;s about <strong>staying close to the user</strong>, </p><p><strong>giving answers quickly</strong>, and <strong>doing heavy work quietly in the background</strong>.</p><p>When the user feels calm, the system has done its job.</p>]]></content:encoded></item><item><title><![CDATA[When Rollback Is Not Possible in Your System]]></title><description><![CDATA[The Night Everything Broke (And Rollback Wasn&#8217;t Going to Fix It)]]></description><link>https://singour.substack.com/p/when-rollback-is-not-possible-in</link><guid isPermaLink="false">https://singour.substack.com/p/when-rollback-is-not-possible-in</guid><dc:creator><![CDATA[Himanshu Singour]]></dc:creator><pubDate>Sun, 25 Jan 2026 14:02:51 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!QRtu!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4ec79f2-1f18-4fc1-ae67-3581aaceb587_1280x1280.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>It was 11:47 PM on a Thursday.</p><p>I remember the exact time because I&#8217;d just convinced myself it was safe to grab dinner. My instant ramen was exactly three minutes from being ready when my phone lit up like a Christmas tree. </p><p>Slack notifications. </p><p>PagerDuty alerts. </p><p>A text from Sarah, our ops lead, that just said: &#8220;We have a situation.&#8221;</p><p>The ramen stayed in the pot, forgotten, while I grabbed my laptop.</p><h2>When Your Safety Net Has Holes In It</h2><p>Five minutes later, I was on a call with half the team, still in their pajamas, staring at dashboards that told a story none of us wanted to read.</p><p>Payments were completing successfully. The payment gateway was happy. Money was moving exactly as it should. But somehow, our order service had decided to take an unscheduled nap. Orders were stuck in eternal &#8220;processing&#8221; limbo.</p><p>Marcus from DevOps said what we were all thinking: &#8220;<strong>Let&#8217;s just roll it back.</strong>&#8221;</p><p>It sounded so simple. So clean. Roll back the deployment. Revert the database. Pretend the last twenty minutes never happened. We&#8217;d done it before. Standard playbook, right?</p><p>Then Priya from payments spoke up, her voice quieter than usual. </p><p>&#8220;<em><strong>Guys... we can&#8217;t. There&#8217;s already $47,000 in processed transactions</strong></em>.&#8221;</p><p>The call went silent.</p><p>That number wasn&#8217;t theoretical. It wasn&#8217;t sitting in some pending state. It was <em>real money</em> that had left <em>real bank accounts</em>. </p><p>Confirmation emails had already hit inboxes. SMS notifications had already pinged phones. Some people were probably already asleep, trusting that their order was on the way.</p><p>You can&#8217;t rollback reality. </p><p>You can&#8217;t unsend a text message. </p><p>You can&#8217;t make money jump back across the internet into the right accounts.</p><p>We were past the point of no return, and we hadn&#8217;t even realized we&#8217;d crossed it.</p><h2>The Problem With Perfect Solutions</h2><p>Here&#8217;s what they don&#8217;t tell you in architecture reviews and system design interviews: rollback is a lie we tell ourselves to sleep better at night.</p><p>It works great on slides. Draw a nice arrow pointing backward. Label it &#8220;<em><strong>rollback</strong></em>.&#8221; Everyone nods. Problem solved.</p><p>But real systems don&#8217;t have clean arrows. They have tentacles reaching into payment processors, email services, SMS gateways, inventory systems, third party APIs, and God knows what else. The moment your code touches any of those things, you&#8217;ve started a chain reaction you can&#8217;t just... undo.</p><p>We <em>could</em> roll back our database. Technically, we had the commands ready. But here&#8217;s what that would actually do:</p><ul><li><p>Our system would suddenly claim these orders never existed</p></li><li><p>The payment provider would still show successful charges</p></li><li><p>Users would see money missing from their accounts with <em>nothing</em> to show for it</p></li><li><p>Our customer support team would wake up to hundreds of angry tickets</p></li><li><p>We&#8217;d have no paper trail of what actually happened</p></li></ul><p>That&#8217;s not a rollback. That&#8217;s setting your own house on fire and calling it &#8220;cleaning.&#8221;</p><h2>The Uncomfortable Middle Ground</h2><p>For about ninety minutes, our system was in what I can only describe as an &#8220;honestly broken&#8221; state.</p><p>There was no elegant way to describe what was happening. Users had paid money. Those orders existed <em>somewhere</em> in our system, but not <em>everywhere</em> they needed to be. The state machine had gotten wedged halfway through its process, like a drawer that&#8217;s neither open nor closed.</p><p>I watched Jen from customer support start her shift early, already drafting responses to confused users. </p><p>&#8220;<strong>We&#8217;re aware of the issue and working on it</strong>&#8221; </p><p>the most honest thing you can say when you&#8217;re currently debugging why thousands of dollars are in limbo.</p><p>Mike, our senior engineer who&#8217;d been with us for four years, looked physically uncomfortable. </p><p>&#8220;<strong>This feels so messy,</strong>&#8221; </p><p>he said. &#8220;<strong>The data&#8217;s just... wrong right now.</strong>&#8221;</p><p>He was right. It was messy. The system looked like someone had dropped their spaghetti code all over production. But here&#8217;s what I realized in that moment: <em>messy doesn&#8217;t mean dishonest</em>.</p><p>Our system was telling the truth. It was saying:</p><p> &#8220;<strong>Yes, payments happened. No, orders aren&#8217;t complete. This is the actual state of reality right now.</strong>&#8221;</p><p>A rollback would&#8217;ve been <em>clean</em>, sure. But it would&#8217;ve been a lie.</p><h2>Fixing Forward (The Scary Way)</h2><p>Around 1:30 AM, we made a decision that felt completely wrong at the time but was the only thing that made sense.</p><p>We weren&#8217;t going to undo anything. We were going to fix <em>forward</em>.</p><p>Sarah pulled up a spreadsheet (yes, a literal spreadsheet &#8211; sometimes the simplest tools are the best ones) and started categorizing every affected transaction:</p><blockquote><p><strong>Category A:</strong> Payment succeeded, order can still be fulfilled safely &#8594; Let it complete<br><strong>Category B:</strong> Payment succeeded, but something&#8217;s wrong with the inventory/shipping &#8594; Issue immediate refund<br><strong>Category C:</strong> Payment succeeded, user already contacted support and canceled &#8594; Refund with apology credit</p></blockquote><p>Every single transaction got logged. Every action we took got recorded with a timestamp and a reason. </p><p>We didn&#8217;t delete a single row of &#8220;bad&#8221; data. Instead, we added <em>more</em> data corrections, refunds, manual overrides, support notes.</p><p>The database got <em>bigger</em> and <em>messier</em>, not cleaner.</p><p>Priya wrote a script that sent personalized emails to every affected user. Not a template. </p><p>Real explanations: </p><p>&#8220;<em><strong>Your payment went through, but our system had a hiccup. Here&#8217;s what we&#8217;re doing about YOUR specific order</strong></em>.&#8221;</p><p>By 4 AM, we had processed every single transaction. By 6 AM, most users had either received their order confirmation or their refund. </p><p>By 9 AM, when the East Coast woke up, the only evidence of the disaster was a stack of detailed logs and a few support tickets from people checking on refund timing.</p><h2>What We Learned From Looking Stupid</h2><p>Here&#8217;s the thing nobody tells you about production incidents: your system is going to look <em>really stupid</em> sometimes.</p><p>For a solid two hours, if you&#8217;d looked at our order dashboard, you would&#8217;ve seen chaos. Inconsistent states. Weird statuses. </p><p>Orders that were both &#8220;completed&#8221; and &#8220;refunded&#8221; depending on which table you looked at.</p><p>It looked like amateur hour. Like we didn&#8217;t know what we were doing.</p><p>But we <em>did</em> know what we were doing. We were choosing truth over cleanliness. </p><p>We were choosing to preserve the actual history of what happened rather than trying to create a fiction where nothing went wrong.</p><p>Three weeks later, a user emailed asking about a charge from &#8220;that night things broke.&#8221; </p><p>We could tell them <em>exactly</em> what happened to their specific transaction, down to the second. We could show them the refund, the reason code, the support note, everything.</p><p>If we&#8217;d rolled back? We&#8217;d have had to guess. Or worse, we&#8217;d have to tell them their payment never existed even though their bank statement clearly showed otherwise.</p><h2>The Part Where I Sound Like I&#8217;m In Therapy</h2><p>That night fundamentally changed how I, <strong>Himanshu, think about building systems.</strong></p><p>I used to design for the happy path and treat failures as exceptional cases to be eliminated. </p><p>Now I design for failure as <em>the default state</em>. Success is the exception we&#8217;re grateful for.</p><p>I used to think good systems were systems that never broke. </p><p>Now I think good systems are systems that break <em>gracefully</em>, leave clear trails, and can explain themselves when someone asks &#8220;<em><strong>what the hell happened?</strong></em>&#8221;</p><p>I used to obsess over consistency making sure every part of the system agreed on the current state. </p><p>Now I obsess over <em>convergence</em> making sure that even if parts of the system disagree temporarily, they eventually reach a truthful state.</p><p>The messy middle isn&#8217;t a bug. It&#8217;s a feature. It&#8217;s reality teaching your system to be honest.</p><h2>What Changed After That Night</h2><p>We didn&#8217;t just patch the bug and move on. We rebuilt our entire approach to failures:</p><ul><li><p><strong>We added &#8220;compensation transactions&#8221; everywhere.</strong> For every action that touches the outside world, we now have a documented way to undo its <em>effects</em>, not the action itself. Can&#8217;t unsend an email? Fine send a correction. Can&#8217;t uncharge a card? Fine issue a refund.</p></li><li><p><strong>We stopped deleting data. Ever.</strong> Now we only mark things as &#8220;superseded&#8221; or &#8220;corrected.&#8221; Every mistake stays in the database with a paper trail of how it was fixed. Our database is uglier, sure, but it&#8217;s honest.</p></li><li><p><strong>We made &#8220;reconciliation&#8221; a first class feature.</strong> Every night, a job runs to compare what our system thinks happened with what actually happened in payment gateways, email services, and shipping systems. Discrepancies get flagged <em>before</em>users notice.</p></li><li><p><strong>We wrote runbooks for &#8220;unfixable&#8221; scenarios.</strong> What do you do when you literally cannot rollback? Not theoretical ones actual step-by-step guides for the panicking engineer at 2 AM.</p></li><li><p><strong>We got comfortable with temporary inconsistency.</strong> Not all inconsistency we still care about correctness. But we stopped treating brief moments of weirdness as catastrophic failures. Sometimes the system needs a minute to figure itself out.</p></li></ul><h2>The Truth About Production Systems</h2><p>You know what the real difference between a junior engineer and a senior engineer is?</p><p>Junior engineers believe rollback will save them.<br>Senior engineers know that rollback is just another name for &#8220;<strong>I hope we didn&#8217;t affect anything yet.</strong>&#8221;</p><p>Real production systems are messy, sprawling things with tentacles in places you didn&#8217;t even know existed. </p><p>They send emails. </p><p>They charge credit cards. </p><p>They update inventory in warehouses. </p><p>They trigger workflows in other people&#8217;s systems. </p><p>They make promises to users in push notifications.</p><p>Once any of that happens, you&#8217;re not in control anymore. You can&#8217;t rewind. You can only move forward and try to do the right thing with the mess you&#8217;ve created.</p><p>That&#8217;s not a failure of engineering. That&#8217;s just reality.</p><p>The best systems aren&#8217;t the ones that never break. </p><p>They&#8217;re the ones that break in ways you can recover from. That leave trails you can follow. That admit when they&#8217;re wrong and correct themselves transparently.</p><h2>What I&#8217;d Tell My Past Self</h2><p>If I could go back to that <strong>Thursday</strong> evening, to the moment right before I started cooking my ramen, I wouldn&#8217;t tell myself to prevent the incident. I couldn&#8217;t. Bugs happen. Systems fail. That&#8217;s life.</p><p>But I would tell myself this:</p><p>Don&#8217;t panic when rollback isn&#8217;t an option. It&#8217;s not the only option. It was never the only option.</p><p>Trust your logs. Trust your data. Trust that you can fix things forward even when you can&#8217;t undo them backward.</p><p>And most importantly: a system that honestly reflects its broken state is infinitely better than a system that lies about being fine.</p><p>That night, our system looked stupid. But it survived. And it earned the trust of every user we managed to make whole again.</p><p>That&#8217;s what matters.</p><div><hr></div><p><em>by the way, was completely inedible by the time I remembered it. Overcooked noodles, cold broth. I ate it anyway, at 5 AM, tasting like cardboard and small victories. Best meal I&#8217;d had all week.</em></p>]]></content:encoded></item><item><title><![CDATA[How I Revise DSA Every Saturday (Even When I Wake Up at 12)]]></title><description><![CDATA[DSA Every Saturday]]></description><link>https://singour.substack.com/p/how-i-revise-dsa-every-saturday-even</link><guid isPermaLink="false">https://singour.substack.com/p/how-i-revise-dsa-every-saturday-even</guid><dc:creator><![CDATA[Himanshu Singour]]></dc:creator><pubDate>Sat, 17 Jan 2026 11:06:08 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!gACl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8ff7cf1-ed46-448b-bfcb-73a21721dbaa_1400x933.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!gACl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8ff7cf1-ed46-448b-bfcb-73a21721dbaa_1400x933.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!gACl!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8ff7cf1-ed46-448b-bfcb-73a21721dbaa_1400x933.png 424w, /__u/substackcdn.com/image/fetch/$s_!gACl!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8ff7cf1-ed46-448b-bfcb-73a21721dbaa_1400x933.png 848w, /__u/substackcdn.com/image/fetch/$s_!gACl!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8ff7cf1-ed46-448b-bfcb-73a21721dbaa_1400x933.png 1272w, /__u/substackcdn.com/image/fetch/$s_!gACl!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8ff7cf1-ed46-448b-bfcb-73a21721dbaa_1400x933.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!gACl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8ff7cf1-ed46-448b-bfcb-73a21721dbaa_1400x933.png" width="1400" height="933" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c8ff7cf1-ed46-448b-bfcb-73a21721dbaa_1400x933.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:933,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="/__u/substackcdn.com/image/fetch/$s_!gACl!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8ff7cf1-ed46-448b-bfcb-73a21721dbaa_1400x933.png 424w, /__u/substackcdn.com/image/fetch/$s_!gACl!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8ff7cf1-ed46-448b-bfcb-73a21721dbaa_1400x933.png 848w, /__u/substackcdn.com/image/fetch/$s_!gACl!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8ff7cf1-ed46-448b-bfcb-73a21721dbaa_1400x933.png 1272w, /__u/substackcdn.com/image/fetch/$s_!gACl!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8ff7cf1-ed46-448b-bfcb-73a21721dbaa_1400x933.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>I don&#8217;t wake up early. I don&#8217;t have a study timetable. I don&#8217;t drink green tea and meditate before coding.<strong>I wake up around 12PM. Sometimes 1.</strong><br>I scroll through Instagram, eat leftover food, and chill.</p><p>But you know what?<br>Every Saturday, I still revise DSA.</p><p>No LeetCode. No Codeforces.<br>Just me, my laptop, and all the messy code I&#8217;ve written over the past year stored in random folders with names like <code>final_dp</code>, <code>graph_done</code>, <code>dp_final_latest_final</code>.</p><p>That&#8217;s my system. And weirdly&#8230; it works.</p><h2><strong>The Start: Lazy, Slow, But Intentional</strong></h2><p>It&#8217;s never a &#8220;productive morning.&#8221; There is no such thing.<br>I usually roll out of bed, brush, scroll memes, maybe watch some cricket or random YouTube junk.</p><p>At some point usually after 2PM I tell myself:</p><p><em>Bas 1&#8211;2 ghante. Open the laptop. Just check old code. That&#8217;s it.</em></p><p>I don&#8217;t think about solving new questions or doing anything big. I just want to <strong>revisit what I&#8217;ve already done</strong>.</p><p>That small mental trick changes everything. I&#8217;m not grinding. I&#8217;m just&#8230; catching up with myself.</p><h2><strong>The Setup: My Laptop Is My Only Source</strong></h2><p>No platforms. No bookmarks. No paid courses.</p><p>Everything I need is already sitting inside my laptop.</p><p>Folders like:</p><ul><li><p><code>BinarySearch</code></p></li><li><p><code>Tree Problems</code></p></li><li><p><code>Recursion_Important</code></p></li><li><p><code>Heap</code></p></li><li><p><code>Sliding Window</code><br>(also let&#8217;s not forget: <code>Misc</code>, <code>Unsorted</code>, and <code>Temp</code>, which have the best gems &#128517;)</p></li></ul><p>Some code files are clean. Some are garbage. Some have TODOs I never finished.<br>But I love this mess it&#8217;s mine. It&#8217;s my journey. My struggle. My growth.</p><h2><strong>The Routine: Re-Solve Without Looking</strong></h2><p>I randomly pick 3&#8211;4 files. Let&#8217;s say:</p><ul><li><p><code>isValidBST.java</code></p></li><li><p><code>minWindowSubstring.java</code></p></li><li><p><code>countIslands.java</code></p></li></ul><p>I open a new file beside it, and try to solve from scratch. No looking at the old one.</p><p>I struggle sometimes. Blank out. Forget what I did last time.</p><p>But slowly&#8230; it comes back.</p><p>And when it doesn&#8217;t I open my old code, line by line, and laugh:</p><blockquote><p><em>&#8220;Aree yaar, I used a visited matrix here!&#8221;<br>&#8220;WTH is this variable name I used? </em><code>temp_ans_final2</code><em>??&#8221;<br>&#8220;Ohhh I used stack here. Smart past-me.&#8221;</em></p></blockquote><p>It feels like I&#8217;m having a chat with my old self.<br><strong>That&#8217;s my revision. That&#8217;s how I learn.</strong></p><h2><strong>I Talk to Myself While Coding</strong></h2><p>Sounds mad, I know. But I do this all the time.</p><blockquote><p><em>&#8220;Okay, so I&#8217;ll start with a base case&#8230;&#8221;<br>&#8220;Yeh toh recursion lag raha hai&#8230;&#8221;<br>&#8220;Wait&#8230; should I sort first or use HashMap?&#8221;</em></p></blockquote><p>I just say whatever comes to mind like I&#8217;m explaining it to someone sitting next to me.</p><p>And somehow, that habit makes things stick more.</p><p>You don&#8217;t need notes if you talk to yourself.</p><h2><strong>Sometimes I Clean Up Old Code</strong></h2><p>This is optional, but fun.</p><p>Sometimes I open an old brute-force file and rewrite it better:</p><ul><li><p>Rename the ugly variables</p></li><li><p>Add comments</p></li><li><p>Remove unnecessary loops</p></li><li><p>Add a few test cases</p></li></ul><p>It feels good. It&#8217;s like refactoring your past.</p><p>You read your old self&#8217;s code, and silently whisper:</p><blockquote><p><em>&#8220;Nice try, bro. But let me fix this now.&#8221;</em></p></blockquote><h2><strong>I Stop After 2 Hours. Always.</strong></h2><p>By 4 or 5PM, I shut the laptop.</p><p>Not because I&#8217;m tired. But because I don&#8217;t want to hate DSA.<br>I want to look forward to it every Saturday. So I stop before it drains me.</p><p>Sometimes I revise 5 problems. Sometimes just 1.<br>Sometimes I get nothing right and that&#8217;s fine too.</p><p><strong>The win is: I showed up. I reconnected with my old self.</strong></p><p>That&#8217;s more valuable than solving 20 new questions blindly.</p><h2><strong>What I Don&#8217;t Do (And Never Will)</strong></h2><ul><li><p>I don&#8217;t wake up early</p></li><li><p>I don&#8217;t maintain notes or sheets</p></li><li><p>I don&#8217;t use LeetCode for revision</p></li><li><p>I don&#8217;t do topic-wise grinding</p></li><li><p>I don&#8217;t have a study plan</p></li></ul><p>I just open my laptop every Saturday&#8230;<br>&#8230;go through my own messy code&#8230;<br>&#8230;and try to understand myself better.</p><p>That&#8217;s my DSA revision.</p><h2><strong>Final Thoughts (From One Lazy Coder to Another)</strong></h2><p>If you&#8217;re someone who wakes up late, feels guilty, avoids DSA during the week but still wants to improve</p><p>I see you.<br>You&#8217;re not alone.<br>You&#8217;re not behind.</p><p><strong>Just start with your own code.</strong><br>Forget fancy platforms.<br>Forget online streaks.<br>Forget perfect productivity.</p><p>Your past code is the best teacher you&#8217;ll ever have.</p><p>And if you revise it even once a week you&#8217;re doing way more than you think.</p><p>Saturday doesn&#8217;t have to be perfect.<br>It just needs to be yours.</p>]]></content:encoded></item><item><title><![CDATA[I Gave 2 Hours Daily to DSA & System Design, Best Decision Ever]]></title><description><![CDATA[DSA & System Design, Your Career]]></description><link>https://singour.substack.com/p/i-gave-2-hours-daily-to-dsa-and-system</link><guid isPermaLink="false">https://singour.substack.com/p/i-gave-2-hours-daily-to-dsa-and-system</guid><dc:creator><![CDATA[Himanshu Singour]]></dc:creator><pubDate>Sat, 17 Jan 2026 11:04:15 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Rg2l!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F741b74a2-1ef4-4e55-9778-b64ce11a58b4_1024x1024.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!Rg2l!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F741b74a2-1ef4-4e55-9778-b64ce11a58b4_1024x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!Rg2l!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F741b74a2-1ef4-4e55-9778-b64ce11a58b4_1024x1024.png 424w, /__u/substackcdn.com/image/fetch/$s_!Rg2l!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F741b74a2-1ef4-4e55-9778-b64ce11a58b4_1024x1024.png 848w, /__u/substackcdn.com/image/fetch/$s_!Rg2l!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F741b74a2-1ef4-4e55-9778-b64ce11a58b4_1024x1024.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Rg2l!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F741b74a2-1ef4-4e55-9778-b64ce11a58b4_1024x1024.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!Rg2l!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F741b74a2-1ef4-4e55-9778-b64ce11a58b4_1024x1024.png" width="1024" height="1024" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/741b74a2-1ef4-4e55-9778-b64ce11a58b4_1024x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1024,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="/__u/substackcdn.com/image/fetch/$s_!Rg2l!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F741b74a2-1ef4-4e55-9778-b64ce11a58b4_1024x1024.png 424w, /__u/substackcdn.com/image/fetch/$s_!Rg2l!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F741b74a2-1ef4-4e55-9778-b64ce11a58b4_1024x1024.png 848w, /__u/substackcdn.com/image/fetch/$s_!Rg2l!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F741b74a2-1ef4-4e55-9778-b64ce11a58b4_1024x1024.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Rg2l!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F741b74a2-1ef4-4e55-9778-b64ce11a58b4_1024x1024.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>Master Software Engineering Interiews:  </p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://algorithmxlr8.io/&quot;,&quot;text&quot;:&quot;Master Software Engineer Interview&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://algorithmxlr8.io/"><span>Master Software Engineer Interview</span></a></p><p><em>I had 1.5 years of experience and still felt lost during interviews, confused in meetings, and unsure about my skills.<br>I didn&#8217;t need a course. I didn&#8217;t need luck.<br>I just needed consistency.<br>So I gave myself 2 hours a day. For 31 days.<br>And that small decision changed everything.</em></p><h2><strong>Why I Started This Challenge</strong></h2><p>Let&#8217;s be honest most of us know <em>what</em> to do.</p><p>We know DSA is important.We know System Design matters.We know interviews test these.But we don&#8217;t do it.</p><p>Why?Because we&#8217;re &#8220;too busy&#8221;, or &#8220;we&#8217;ll start next week&#8221;, or &#8220;I&#8217;m not ready yet.&#8221;</p><p>In January 2024, I had 1.5+ years of experience as a backend developer.<br>And I realized something painful:</p><p><em>I can build APIs, but I can&#8217;t <strong>explain</strong> them.<br>I can write code, but I don&#8217;t <strong>understand</strong> the deeper design.<br>And every time someone said &#8220;Let&#8217;s make this scalable&#8221; I&#8217;d nod&#8230; and secretly Google later.</em></p><p>I was tired of faking confidence.<br>So I said: <em>Enough.</em><br>Let&#8217;s get real.</p><h2><strong>The Simple Rule:</strong></h2><p>For the next 31 days<strong>2 hours every day. No excuses.</strong></p><ul><li><p>1 hour of DSA</p></li><li><p>1 hour of System Design</p></li></ul><blockquote><p><em>No targets. No pressure. Just show up. Daily.</em></p></blockquote><h2><strong>Week 1: The Start Is Always the Hardest</strong></h2><p>I still remember Day 1.</p><p>I opened LeetCode. Picked an Easy problem.It took me 40 minutes.</p><p>Then I moved to System Design and tried to learn <strong>Rate Limiting</strong>.<br>Heard terms like Token Bucket, LRU, TTL&#8230;<br>I was lost within 15 minutes.</p><p>But you know what? I didn&#8217;t stop.<br>I told myself:</p><blockquote><p><em>You&#8217;re not here to prove anything. You&#8217;re here to grow.</em></p></blockquote><p>So I wrote down what I learned.Even if I understood only 20%, I noted it in <em>my</em> words.</p><p>The goal wasn&#8217;t perfection it was to build the habit.</p><h2><strong>Week 2: Small Wins That Felt Big</strong></h2><p>By Day 10, I started seeing patterns.</p><p>I solved a prefix sum problem in under 20 minutes.<br>I looked at another and said &#8220;Ah, this is sliding window!&#8221;</p><p>Not because I became smart overnight,<br>but because I was showing up daily.</p><p>In System Design, I understood how <strong>message queues</strong> help us go async.<br>I drew diagrams of how a payment system works using Kafka and Retry Queues.</p><p>I stopped saying &#8220;I&#8217;ve seen this&#8221;<br>and started saying &#8220;I understand this&#8221;.</p><p>And trust me <strong>that shift feels amazing.</strong></p><h2><strong>Week 3: The Challenge Became a Ritual</strong></h2><p>By Week 3, I didn&#8217;t need motivation.</p><p>This wasn&#8217;t a &#8220;challenge&#8221; anymore.It became my <strong>favorite 2 hours of the day</strong>.</p><p>Just me, my laptop, a notebook and focus.</p><p>I didn&#8217;t scroll Instagram. I didn&#8217;t switch tabs.<br>I just solved problems, watched videos, drew systems.</p><p>Some days, I studied gRPC vs REST.<br>Other days, I designed small parts of WhatsApp or Swiggy.</p><p>I wasn&#8217;t doing this for an interview.I was doing it because I was finally enjoying learning again.</p><h2><strong>Week 4: I Felt Like a Real Engineer</strong></h2><p>Something shifted in my thinking.</p><p>Earlier, I&#8217;d panic in meetings.</p><p>Now? I spoke up.<br>I gave suggestions. I explained retries, DLQs, idempotency.</p><p>I wasn&#8217;t bluffing anymore.<br>I actually <strong>understood</strong> what I was saying.</p><p>At work, my teammates noticed.<br>In my code reviews, I was writing cleaner logic.<br>Even in casual chats, I could explain why we need a load balancer or cache.</p><p>It wasn&#8217;t magic.<br>It was 31 days of focused effort.</p><h2><strong>What Actually Changed After 31 Days</strong></h2><p>My improved:</p><blockquote><p><em><strong>DSA Thinking:</strong><br>I now recognize patterns binary search, prefix sum, sliding window faster and cleaner.</em></p></blockquote><p><strong>System Design Clarity:</strong><br>I can now explain things like Kafka, caching, queues, idempotency, retries without googling or fumbling.</p><blockquote><p><em><strong>Communication:</strong><br>I stopped being afraid of technical discussions. I started contributing with confidence.</em></p></blockquote><p><strong>Confidence:</strong><br>Not just in interviews but in everyday work. Because now I <em>know</em> I&#8217;ve put in the work.</p><blockquote><p><em><strong>Consistency &gt; Motivation:</strong><br>The biggest learning?Motivation fades. Discipline builds careers.</em></p></blockquote><h2><strong>My Simple Daily Routine</strong></h2><p>Want to try it yourself? Here&#8217;s what I did:</p><h2><strong>Hour 1 DSA</strong></h2><ul><li><p>Picked 1&#8211;2 LeetCode problems (mostly Medium)</p></li><li><p>Solved at my own pace</p></li><li><p>Wrote clean code, tested edge cases</p></li><li><p>Took notes: what worked, what didn&#8217;t</p></li></ul><h2><strong>Hour 2 System Design</strong></h2><ul><li><p>Picked 1 concept each day (Cache, gRPC, DB sharding, Kafka, etc.)</p></li><li><p>Watched 1&#8211;2 short videos</p></li><li><p>Drew diagrams, wrote 2&#8211;3 line summaries</p></li><li><p>Spoke the explanation out loud (yes, I literally talked to myself )</p></li></ul><p>That&#8217;s it. Nothing fancy.<br>Just <strong>deep, slow, honest learning.</strong></p><h2><strong>Final Words (From One Developer to Another)</strong></h2><p>If you&#8217;re reading this and you:</p><ul><li><p>Feel stuck at 1&#8211;2 years of experience</p></li><li><p>Keep failing interviews despite &#8220;knowing stuff&#8221;</p></li><li><p>Feel lost in real system design conversations</p></li><li><p>Want to grow, but don&#8217;t know where to start&#8230;</p></li></ul><h3><strong>Let me tell you this:</strong></h3><p>You don&#8217;t need 10 hours a day.<br>You don&#8217;t need another fancy course.<br>You don&#8217;t need to wait for the &#8220;perfect time&#8221;.</p><p>You need 2 hours.<br>Every day.<br>For 31 days.</p><p>Do this for <em>yourself</em>.Quietly.Consistently.And see the difference.</p><blockquote><p>It worked for me. In 2024.<br>With just 1.5 years of experience.<br>And no magic at all.</p></blockquote><p>It can work for you too. </p>]]></content:encoded></item><item><title><![CDATA[How We Built a Payment Module Supporting 6+ Payment Gateways per Tenant for 8 Lakh Users]]></title><description><![CDATA[A tenant is one organization (or business) using the same application, but with its own data, configuration, and settings, isolated from others.]]></description><link>https://singour.substack.com/p/how-we-built-a-payment-module-supporting</link><guid isPermaLink="false">https://singour.substack.com/p/how-we-built-a-payment-module-supporting</guid><dc:creator><![CDATA[Himanshu Singour]]></dc:creator><pubDate>Sat, 17 Jan 2026 11:02:58 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!nBq5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F396e34c8-1067-4088-8942-f00eb94b8474_1400x933.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!nBq5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F396e34c8-1067-4088-8942-f00eb94b8474_1400x933.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!nBq5!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F396e34c8-1067-4088-8942-f00eb94b8474_1400x933.png 424w, /__u/substackcdn.com/image/fetch/$s_!nBq5!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F396e34c8-1067-4088-8942-f00eb94b8474_1400x933.png 848w, /__u/substackcdn.com/image/fetch/$s_!nBq5!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F396e34c8-1067-4088-8942-f00eb94b8474_1400x933.png 1272w, /__u/substackcdn.com/image/fetch/$s_!nBq5!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F396e34c8-1067-4088-8942-f00eb94b8474_1400x933.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!nBq5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F396e34c8-1067-4088-8942-f00eb94b8474_1400x933.png" width="1400" height="933" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/396e34c8-1067-4088-8942-f00eb94b8474_1400x933.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:933,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="/__u/substackcdn.com/image/fetch/$s_!nBq5!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F396e34c8-1067-4088-8942-f00eb94b8474_1400x933.png 424w, /__u/substackcdn.com/image/fetch/$s_!nBq5!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F396e34c8-1067-4088-8942-f00eb94b8474_1400x933.png 848w, /__u/substackcdn.com/image/fetch/$s_!nBq5!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F396e34c8-1067-4088-8942-f00eb94b8474_1400x933.png 1272w, /__u/substackcdn.com/image/fetch/$s_!nBq5!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F396e34c8-1067-4088-8942-f00eb94b8474_1400x933.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><blockquote><p><em>NOTE: A <strong>tenant</strong> is one organization (or business) using the same application, but with <strong>its own data, configuration, and settings</strong>, isolated from others.</em></p></blockquote><p>When we started, our payment system had one gateway.</p><p>That wasn&#8217;t a shortcut.<br>It was a reasonable decision for the scale we were at.</p><p>Payments worked. Users paid. Finance reconciled. Everyone moved on.</p><p>Then we onboarded Citi Bank.</p><p>Around <strong>8 lakh users</strong>, real banking traffic, real pressure.</p><p>And suddenly, that one gateway stopped feeling &#8220;simple&#8221; and started feeling dangerous.</p><h2><strong>The System Was Holding But Only Just</strong></h2><p>During the first few weeks of Citi testing, nothing outright failed.</p><p>That worried me more than an outage would have.</p><p>Payment success rates dipped during peak hours.<br>Latency crept up slowly.<br>Retries increased, but quietly.</p><p>The gateway wasn&#8217;t down.</p><p>It was tired.</p><p>And tired systems fail when you least expect them to.</p><h2><strong>The Meeting Where Everything Changed</strong></h2><p>We scheduled a meeting.</p><p>It was supposed to be short.</p><p>Just me, my team, my manager, the architect, and the tech lead.<br>The agenda said: <em>&#8220;Citi payment scaling discussion.&#8221;</em></p><p>No one walked in with a solution.</p><p>We talked about:</p><ul><li><p>Adding more servers</p></li><li><p>Increasing gateway limits</p></li><li><p>Optimizing retries</p></li><li><p>Better monitoring</p></li></ul><p>All good ideas. None of them felt enough.</p><p>At some point, the room went quiet.</p><p>And I said something without fully knowing how it would land.</p><blockquote><p>Why Can&#8217;t One Tenant Have Multiple Active Gateways?&#8221;</p></blockquote><p>I remember hesitating before saying it.</p><p>Then I said:</p><blockquote><p><em>&#8220;What if one tenant doesn&#8217;t depend on one gateway at all?<br>What if a tenant can have multiple gateways, and the system decides which one to use?&#8221;</em></p></blockquote><p>The room paused.</p><p>The architect leaned back.<br>The tech lead stopped typing.<br>My manager asked, &#8220;Go on.&#8221;</p><p>That was the moment I knew this wasn&#8217;t just a random thought.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!t4JJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a02d589-9d69-4bed-a13e-a58e2543d634_1400x933.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!t4JJ!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a02d589-9d69-4bed-a13e-a58e2543d634_1400x933.png 424w, /__u/substackcdn.com/image/fetch/$s_!t4JJ!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a02d589-9d69-4bed-a13e-a58e2543d634_1400x933.png 848w, /__u/substackcdn.com/image/fetch/$s_!t4JJ!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a02d589-9d69-4bed-a13e-a58e2543d634_1400x933.png 1272w, /__u/substackcdn.com/image/fetch/$s_!t4JJ!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a02d589-9d69-4bed-a13e-a58e2543d634_1400x933.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!t4JJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a02d589-9d69-4bed-a13e-a58e2543d634_1400x933.png" width="1400" height="933" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6a02d589-9d69-4bed-a13e-a58e2543d634_1400x933.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:933,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="/__u/substackcdn.com/image/fetch/$s_!t4JJ!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a02d589-9d69-4bed-a13e-a58e2543d634_1400x933.png 424w, /__u/substackcdn.com/image/fetch/$s_!t4JJ!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a02d589-9d69-4bed-a13e-a58e2543d634_1400x933.png 848w, /__u/substackcdn.com/image/fetch/$s_!t4JJ!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a02d589-9d69-4bed-a13e-a58e2543d634_1400x933.png 1272w, /__u/substackcdn.com/image/fetch/$s_!t4JJ!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a02d589-9d69-4bed-a13e-a58e2543d634_1400x933.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>Why That Idea Made Sense to Me</strong></h2><p>I wasn&#8217;t thinking about architecture patterns.</p><p>I was thinking about reality.</p><p>Gateways don&#8217;t fail cleanly.<br>They slow down.<br>They partially fail.<br>They struggle under load.</p><p>So I explained my thinking:</p><ul><li><p>Citi&#8217;s traffic is too large for one gateway</p></li><li><p>Even two gateways aren&#8217;t enough if routing is static</p></li><li><p>Load matters as much as availability</p></li><li><p>Failover is reactive; load-based routing is proactive</p></li></ul><p>What we needed wasn&#8217;t a backup.</p><p>We needed <strong>choice at runtime</strong>.</p><h2><strong>How the Architecture Team Reacted And What Each Question Really Meant</strong></h2><p>The architect didn&#8217;t push back on the idea itself. Instead, they did what good architects always do they started pulling on the weak threads.</p><p>Each question they asked wasn&#8217;t meant to reject the idea. It was meant to test whether it could survive reality.</p><h2><strong>How would routing work?</strong></h2><blockquote><p><em>This was the first and most important question, because routing is the heart of the idea. If routing failed, everything else would collapse with it.</em></p></blockquote><p><strong>Himanshu</strong>: I explained that the biggest mistake we were making was routing based on configuration instead of conditions. Until now, we treated routing as something static: a primary gateway, then a fallback. That works only when traffic is low and gateways behave perfectly.</p><p>At Citi&#8217;s scale, that assumption was no longer true. Gateways didn&#8217;t fail cleanly. They slowed down, partially failed, or throttled requests. So instead of routing once at deploy time, we needed routing to happen at request time.</p><p>I told them that every payment request should be evaluated against the current state of all allowed gateways for that tenant. The system should look at which gateway was under the least load, which one was responding consistently, and which one wasn&#8217;t showing signs of stress. The goal wasn&#8217;t to be smart it was to avoid obviously bad choices.</p><p>That&#8217;s when routing stopped being a configuration problem and became a runtime decision problem.</p><h2><strong>What metrics would we trust?</strong></h2><blockquote><p><em>This question went deeper than it sounded. Metrics can lie if you don&#8217;t understand their context, and the architect was right to be cautious.</em></p></blockquote><p><strong>Himanshu</strong>: I explained that trusting a single metric like success rate or latency was dangerous. A gateway could show a high success rate but still be struggling under increasing load. Another might have slightly higher latency but be far more stable.</p><p>So instead of trusting one number, we needed to trust patterns.</p><p>I suggested combining short-term success trends with latency movement and retry behavior. Not over hours or days, but over recent windows just enough to reflect current stress. If retries started increasing or timeouts clustered together, that was a stronger signal than any dashboard metric.</p><p>I made it clear that we weren&#8217;t trying to predict the future. We were just reacting faster than users could notice problems.</p><p>That&#8217;s when metrics stopped being reporting tools and started becoming decision inputs.</p><h2><strong>How do we avoid double charges?</strong></h2><blockquote><p><em>This question changed the tone of the room, because this is where payment systems usually fail.</em></p></blockquote><p>I didn&#8217;t jump to an answer right away, because double charges aren&#8217;t caused by one mistake they&#8217;re caused by ambiguity.</p><p>I explained that the core problem wasn&#8217;t retries themselves. It was unclear ownership of transaction state. When multiple gateways are involved, the system must be absolutely certain about what has already happened and what hasn&#8217;t.</p><p>The solution was strict idempotency. Every payment attempt needed a unique, globally consistent transaction ID that followed the request across retries and gateways. A retry wasn&#8217;t a new payment it was the same payment continuing its journey.</p><p>I also explained that the orchestration layer had to own the state machine. Gateways should be treated as execution engines, not sources of truth. The system decides when to retry, when to switch gateways, and when to stop.</p><p>Once that was clear, the fear around double charges didn&#8217;t disappear but it became manageable.</p><h2><strong>How do we keep this tenant-specific?</strong></h2><p>This question grounded the discussion back in reality. Not all tenants behave like Citi, and we couldn&#8217;t design a system that forced everyone into the same rules.</p><p>I explained that tenants shouldn&#8217;t just configure gateways they should configure intent.</p><p>Each tenant should be able to define:</p><ul><li><p>Which gateways are allowed</p></li><li><p>How aggressive retries can be</p></li><li><p>Whether reliability or cost matters more</p></li><li><p>Any regional or compliance constraints</p></li></ul><p>The routing logic would operate only within those boundaries. The system could make intelligent decisions, but it could never violate tenant rules.</p><p>That separation was critical. It meant we weren&#8217;t building a one-size-fits-all payment engine. We were building a flexible system that respected each tenant&#8217;s reality.</p><h2><strong>One Real Problem We Had to Solve</strong></h2><p>Once we agreed on supporting multiple gateways for a single tenant, a practical problem surfaced very quickly.</p><p>Not all payment gateways behave the same way.</p><p>Some gateways, like Razorpay or Stripe, expect you to <strong>create an order first</strong>and then initiate the payment. Others, like <strong>PayU</strong>, work differently. They don&#8217;t have a clear &#8220;order creation&#8221; step at all they directly initiate the payment.</p><p>This inconsistency became a real issue.</p><p>If the system itself was choosing gateways dynamically, we couldn&#8217;t depend on gateway-specific order concepts. We needed a <strong>single, consistent source of truth</strong>, regardless of which gateway handled the payment.</p><h2><strong>Why We Created Our Own Order Table</strong></h2><p>So we made a simple but important decision.</p><p>Instead of relying on gateway orders, we created <strong>our own internal order table</strong>.</p><p>Every payment request first created an internal order in our system. That order:</p><ul><li><p>Had a unique ID</p></li><li><p>Tracked payment state end to end</p></li><li><p>Stayed consistent across retries and gateway switches</p></li></ul><p>Gateways became execution layers, not owners of state.</p><p>Whether the payment went through Razorpay, Stripe, or PayU, the system always knew exactly <strong>which order it belonged to and what stage it was in</strong>.</p><p>That one decision removed a lot of ambiguity and made multi-gateway routing actually safe to run in production.</p><h2><strong>How We Identified the Gateway for Each Payment</strong></h2><p>Along with creating our own internal order, we also introduced a <strong>payment gateway ID</strong> into the flow.</p><p>Every time the orchestration layer selected a gateway, that decision was stored against the order using a gateway ID. This sounds small, but it mattered a lot. It meant we always knew <strong>which gateway was chosen</strong>, <strong>why it was chosen</strong>, and <strong>where the payment was actually processed</strong>.</p><p>When callbacks came back from gateways, we didn&#8217;t have to guess or infer anything. We simply used the gateway ID to route the response to the correct handler and update the same internal order. This made retries safer, debugging easier, and reconciliation much cleaner.</p><p>It also helped us later when we needed reports, audits, or tenant-level analysis because the system never lost track of which gateway handled which payment.</p><p>Sometimes, clarity comes from something as simple as writing the decision down and never letting it get lost.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!L2WR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F211ac858-93ac-4230-8e8e-e785ac85a1ab_1400x933.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!L2WR!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F211ac858-93ac-4230-8e8e-e785ac85a1ab_1400x933.png 424w, /__u/substackcdn.com/image/fetch/$s_!L2WR!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F211ac858-93ac-4230-8e8e-e785ac85a1ab_1400x933.png 848w, /__u/substackcdn.com/image/fetch/$s_!L2WR!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F211ac858-93ac-4230-8e8e-e785ac85a1ab_1400x933.png 1272w, /__u/substackcdn.com/image/fetch/$s_!L2WR!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F211ac858-93ac-4230-8e8e-e785ac85a1ab_1400x933.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!L2WR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F211ac858-93ac-4230-8e8e-e785ac85a1ab_1400x933.png" width="1400" height="933" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/211ac858-93ac-4230-8e8e-e785ac85a1ab_1400x933.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:933,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="/__u/substackcdn.com/image/fetch/$s_!L2WR!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F211ac858-93ac-4230-8e8e-e785ac85a1ab_1400x933.png 424w, /__u/substackcdn.com/image/fetch/$s_!L2WR!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F211ac858-93ac-4230-8e8e-e785ac85a1ab_1400x933.png 848w, /__u/substackcdn.com/image/fetch/$s_!L2WR!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F211ac858-93ac-4230-8e8e-e785ac85a1ab_1400x933.png 1272w, /__u/substackcdn.com/image/fetch/$s_!L2WR!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F211ac858-93ac-4230-8e8e-e785ac85a1ab_1400x933.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This is a <strong>simplified payment data model</strong> created only for <strong>easy understanding</strong>. In real production systems, there are many more tables and attributes such as fees, dues, refunds, settlements, reconciliation, and ledgers, which are intentionally omitted here.</p><p>An <strong>Order</strong> represents the business request to collect money. One order can have <strong>multiple payment attempts</strong>. Each <strong>Payment</strong> is an attempt to pay an order using a selected <strong>Gateway</strong>. A payment can create <strong>multiple Transactions</strong>, which store the actual gateway responses like success, failure, or retries.</p><p>The <strong>Gateway</strong> table defines available payment providers per tenant. The <strong>Mandate</strong> table supports recurring or auto-debit payments by linking a user to a gateway for a valid time period. Overall flow is: <strong>Order &#8594; Payment &#8594; Transaction</strong>, with <strong>Gateway and Mandate</strong> supporting how payments are processed.</p><h2><strong>When the Questions Changed the Direction of the Conversation</strong></h2><p>At some point, the architect said something that stuck with me:</p><blockquote><p><em>&#8220;So this isn&#8217;t really about adding more gateways.<br>It&#8217;s about moving decision-making into the system.&#8221;</em></p></blockquote><p>That&#8217;s when the discussion shifted completely.</p><p>We stopped debating whether the idea was risky.<br>We started discussing how to make it reliable.</p><p>That&#8217;s the moment I knew the idea had landed.</p><h2><strong>What That Moment Taught Me</strong></h2><p>That meeting wasn&#8217;t about convincing anyone.</p><p>It was about explaining reality clearly enough that the architecture spoke for itself.</p><p>Each question wasn&#8217;t a blocker it was a filter. And once the idea passed those filters, it became stronger.</p><p>That&#8217;s how real systems are built.</p><h2><strong>From Idea to Design: One Tenant, Multiple Gateways</strong></h2><p>We agreed on a direction:</p><ul><li><p><strong>A tenant could configure up to six payment gateways</strong> <em>(Razorpay, Stripe, PayU, Paytm, Cashfree, and Adyen)</em></p></li><li><p>All gateways could be active</p></li><li><p>Selection would be dynamic, not static</p></li><li><p>Decisions would be made by the system, not hardcoded rules</p></li></ul><p>This wasn&#8217;t over-engineering.</p><p>It was designing for Citi&#8217;s reality.</p><h2><strong>Why We Built an Orchestration Layer</strong></h2><p>Instead of spreading gateway logic everywhere, we introduced a single decision point.</p><p>An orchestration layer that:</p><ul><li><p>Knew nothing about UI</p></li><li><p>Knew nothing about loans</p></li><li><p>Knew nothing about business flows</p></li></ul><p>It only answered one question:</p><p><strong>&#8220;Which gateway should handle this payment right now?&#8221;</strong></p><p>To answer that, it looked at:</p><ul><li><p>Current load</p></li><li><p>Recent success rates</p></li><li><p>Timeout patterns</p></li><li><p>Tenant-level preferences</p></li></ul><p>Simple signals. Real signals.</p><h2><strong>Microservices Happened Naturally After That</strong></h2><p>Once payment decisions were centralized, it became clear that payments didn&#8217;t really belong inside the rest of the system anymore.</p><p>They had their own traffic spikes, their own failure patterns, and their own operational risks. When payments slowed down or retried, it shouldn&#8217;t affect checkout, loans, or anything else.</p><p>Separating payments into their own service just felt like the right move. It allowed us to scale payments without scaling everything else, monitor them without noise, and contain failures instead of letting them spread.</p><p><strong>It wasn&#8217;t about following trends or &#8220;doing microservices right.&#8221;<br>It was simply the safest way to handle something as sensitive as payments.</strong></p><h2><strong>What Changed After We Implemented This</strong></h2><p>When Citi traffic ramped up:</p><ul><li><p>Load spread naturally across gateways</p></li><li><p>No single gateway became a bottleneck</p></li><li><p>Failures were contained and expected</p></li></ul><p>Most importantly, the system behaved calmly under stress.</p><p>That&#8217;s when I knew the idea was right.</p><h2><strong>What That Meeting Meant to Me Personally</strong></h2><p>That meeting taught me something important.</p><p>Architecture isn&#8217;t about big diagrams.</p><p>It&#8217;s about:</p><ul><li><p>Listening to the system</p></li><li><p>Understanding real-world behavior</p></li><li><p>Speaking up when something doesn&#8217;t feel right</p></li></ul><p>That one sentence <em>&#8220;Why can&#8217;t one tenant have multiple gateways?&#8221;</em> changed how our payments worked.</p><p>And it changed how I saw ownership.</p><h2><strong>Final Thought</strong></h2><p>We didn&#8217;t start with six gateways.</p><p>We earned them.</p><p>Citi forced us to think bigger.<br>That meeting gave the idea a voice.<br>The architecture made it real.</p><p>And once the system could handle Citi&#8217;s scale, everything else became easier.</p><p><em>If you understand this, you will be able to build any payment system whether for an interview or for your product easily. Soon, I will share the complete flow of this system.</em></p>]]></content:encoded></item><item><title><![CDATA[How UPI Handles ₹15 Chai Payments at Massive Scale]]></title><description><![CDATA[So how does NPCI handle 600 million users daily? How do 100K real requests come every second without a break?]]></description><link>https://singour.substack.com/p/how-upi-handles-15-chai-payments</link><guid isPermaLink="false">https://singour.substack.com/p/how-upi-handles-15-chai-payments</guid><dc:creator><![CDATA[Himanshu Singour]]></dc:creator><pubDate>Sat, 17 Jan 2026 11:01:02 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!sv1q!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e3a9e1d-56f4-41df-9783-ef115901bfbe_1024x1024.heic" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!sv1q!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e3a9e1d-56f4-41df-9783-ef115901bfbe_1024x1024.heic" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!sv1q!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e3a9e1d-56f4-41df-9783-ef115901bfbe_1024x1024.heic 424w, /__u/substackcdn.com/image/fetch/$s_!sv1q!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e3a9e1d-56f4-41df-9783-ef115901bfbe_1024x1024.heic 848w, /__u/substackcdn.com/image/fetch/$s_!sv1q!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e3a9e1d-56f4-41df-9783-ef115901bfbe_1024x1024.heic 1272w, /__u/substackcdn.com/image/fetch/$s_!sv1q!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e3a9e1d-56f4-41df-9783-ef115901bfbe_1024x1024.heic 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!sv1q!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e3a9e1d-56f4-41df-9783-ef115901bfbe_1024x1024.heic" width="1024" height="1024" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1e3a9e1d-56f4-41df-9783-ef115901bfbe_1024x1024.heic&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1024,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:40577,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/heic&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://singour.substack.com/i/184856416?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e3a9e1d-56f4-41df-9783-ef115901bfbe_1024x1024.heic&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="/__u/substackcdn.com/image/fetch/$s_!sv1q!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e3a9e1d-56f4-41df-9783-ef115901bfbe_1024x1024.heic 424w, /__u/substackcdn.com/image/fetch/$s_!sv1q!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e3a9e1d-56f4-41df-9783-ef115901bfbe_1024x1024.heic 848w, /__u/substackcdn.com/image/fetch/$s_!sv1q!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e3a9e1d-56f4-41df-9783-ef115901bfbe_1024x1024.heic 1272w, /__u/substackcdn.com/image/fetch/$s_!sv1q!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e3a9e1d-56f4-41df-9783-ef115901bfbe_1024x1024.heic 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Just amazing, right? Think about it &#8230;&#8217;</p><blockquote><p><em>&#8216;<strong>Kya system hoga Yrr!</strong>&#8217;</em></p></blockquote><p><em>Handling such massive scale, real-time processing, and near-zero downtime is only possible with world class architecture, deep engineering, and relentless optimization.</em></p><blockquote><p><em>To truly understand how this works, you need to read this entire article first.&#8221;</em></p></blockquote><p><em>A real-life story, with the full high-level design hidden inside it</em></p><p>My name is Himanshu. I write code for a living, but like most people in India, I don&#8217;t <em>think</em> about code when I pay for chai. I think about warmth, taste, and whether I&#8217;m late.</p><p>That night, the chai was &#8377;15. I scanned the QR, entered my PIN, heard the familiar sound, and stepped aside. The chaiwala didn&#8217;t look at the phone. He didn&#8217;t ask me to wait. He trusted the system more than he trusted cash.</p><blockquote><p><em><strong>Beep</strong>: &#8220;Paytm par 15 rupaye prapt hue, Davy aur Sajno&#8221;</em></p></blockquote><p>That silence after the beep is not accidental.</p><p>It is the sound of a system that has already answered a thousand hard questions before I ever touched my phone.</p><h2><strong>What Really Started When I Tapped &#8220;Pay&#8221;</strong></h2><p>When I pressed &#8220;Pay&#8221;, my phone did not try to move money. Phones are unreliable. Networks disappear. Batteries die. Humans make mistakes.</p><p>Instead, my phone created a <em>request</em>. A carefully structured message that says who I am, who I&#8217;m paying, how much, and under what rules.</p><p>That request went to my bank through the app I was using. The app is not the system. It is just a door.</p><p>My bank checked that this request was real, that it was signed correctly, that it came from me, and that it deserved to enter the national payment highway.</p><blockquote><p><em>From there, the request reached the system operated by <strong>National Payments Corporation of India</strong>, a system designed not like a startup product, but like electricity or roads something that must always work and must never surprise people.</em></p></blockquote><h2><strong>The High Level Design ( NPCI x UPI )</strong></h2><p>UPI&#8217;s design starts with one quiet decision: <em>no single party should own the whole flow</em>.</p><p>That is why the system is broken into clear components, each with a limited responsibility, each distrustful of the others, each designed to fail safely.</p><p>At the top are the <strong>client apps</strong>. These are replaceable by design. They are allowed to innovate, experiment, and even fail. The core system does not depend on them emotionally or technically.</p><p>Behind the apps are <strong>PSP banks</strong>. These banks act as the first gatekeepers. They validate requests, enforce basic limits, and ensure that only clean, authenticated traffic reaches the core.</p><p>This protects the rest of the system from chaos at the edges.</p><p>At the center is the <strong>UPI Switch</strong> operated by NPCI. This is the heart, but not the brain. It does not store money.</p><p>It does not remember users. It only routes, validates, times, and enforces rules.</p><p>On the other side are the <strong>receiver banks</strong>, where money actually moves. These banks own accounts, balances, and final truth.</p><p>Around all of this exist invisible but critical systems: fraud detection, monitoring, logging, reconciliation, and settlement.</p><p>Each part knows its job. Nothing tries to do everything.</p><h2><strong>Why the Payment System(NPCI) Doesn&#8217;t Store User Data</strong></h2><p>One of the most important architectural choices in UPI is that the core switch is <strong>stateless</strong>.</p><p>This means when my &#8377;15 request arrived, the system did not care who I was yesterday. It did not check my previous transaction. It did not store context.</p><p>Everything it needed was already inside the request.</p><p>This single idea allows the system to scale horizontally. When traffic increases, more identical servers are added. Any server can process any request. No server is special. No server is irreplaceable.</p><p><em>That is how the system survives <strong>100,000 or more requests every second</strong> without panic.</em></p><p>State is the enemy of scale. UPI keeps state at the edges, not at the core.</p><h2><strong>How a UPI Payment Works Step by Step</strong></h2><p>My request enters the UPI switch. The switch immediately validates its structure and identity. It reads the UPI ID and understands which bank should receive it. It starts a timer, because time matters more than completeness.</p><p>The request is forwarded to the receiver&#8217;s bank. That bank checks the account, applies fraud rules, ensures balance is sufficient, and performs an atomic operation where money is debited and credited as one indivisible step.</p><p>If anything goes wrong or takes too long, the bank responds clearly. No guessing. No waiting.</p><p>That response flows back through NPCI to my bank and finally to my phone.</p><p>The entire system agrees on one thing: <strong>there must be exactly one outcome</strong>.</p><h2><strong>Why You Rarely See &#8220;Processing&#8221;</strong></h2><p>UPI does not like uncertainty. It is designed to avoid &#8220;maybe&#8221;.</p><p>Every component operates under strict timeouts. If a response does not come back fast enough, the transaction is treated as failed. This is not cruelty. This is safety.</p><p>If my app retries because my network drops, the system recognizes the transaction by its unique ID. It knows this is not a new request. It does not move money again. It simply repeats the answer.</p><p>This property, called idempotency, is not a feature. It is a moral requirement in payment systems.</p><h2><strong>What Continues Working After You Pay</strong></h2><p>Once my phone shows success and I walk away with chai in hand, the system keeps working.</p><p>Audit logs are written so every step can be replayed. Metrics are updated so engineers can see health in real time. Fraud models observe behavior patterns quietly. Reconciliation records are prepared for the night.</p><p>All of this happens asynchronously, separated from the user path. My experience is protected from the weight of the system.</p><p>This separation is why UPI feels light even though it carries the financial weight of a nation.</p><h2><strong>Why Night Time Checks Matter</strong></h2><p>At night, when the city sleeps, systems compare notes.</p><p>Banks and NPCI reconcile millions of transactions. Every rupee must be accounted for. Every mismatch must be investigated. There is no hiding, no rounding, no excuses.</p><p>This is slow, careful, human work supported by machines. This is where trust is renewed daily.</p><h2><strong>What I Learned from This System</strong></h2><p>UPI changed how I understand good engineering.</p><p>Good systems are not loud. They are calm.<br>They do not show off. They remove fear.<br>They do not demand understanding. They earn trust.</p><p>The chaiwala doesn&#8217;t know about stateless services, distributed switches, or reconciliation engines.</p><p>He only knows the sound.</p><p>And that sound is enough.</p><h2><strong>Why NPCI Scales to 600 Million Daily Transactions</strong></h2><p>So how does NPCI handle <strong>600 million users </strong>daily?<br>How do <strong>100K real requests come every second</strong> without a break?</p><p>NPCI is able to handle around <strong>600 million users daily</strong> because it does <strong>not remember users at all</strong>. It does not store who paid earlier, who will pay later, or what someone paid a second ago.</p><p>For NPCI, there is no &#8220;Himanshu&#8221; or &#8220;chai payment history&#8221;. There is only a <strong>payment request that exists right now</strong>.</p><p>When a UPI payment comes, NPCI only checks a few things: is the request valid, which bank should get it, and did the bank respond in time.</p><p>Once the payment succeeds or fails, NPCI <strong>forgets the user immediately</strong>. Nothing personal is stored at the core system.</p><p>Because of this, every payment request is <strong>independent</strong>. One request does not depend on another.</p><p>That means any server can handle any request. If traffic increases, NPCI simply adds more servers.</p><p>This is why the system scales <strong>horizontally</strong> without slowing down.</p><p>That is how <strong>100,000 real requests can come every second</strong> without a break.</p><p>NPCI is not loading past data, not opening user sessions, and not holding memory. Requests just come in, get processed, and go out like a flowing river.</p><p>NPCI only remembers one thing carefully: the <strong>transaction ID</strong>. This is to avoid double payment. It forgets the user, but it never confuses the transaction.</p><p><strong>In one line:</strong><br>NPCI scales because it processes the present and forgets the rest.</p><h2><strong>Final Thought</strong></h2><p>That &#8377;15 chai was not small.</p><p>It passed through apps, banks, switches, networks, servers, logs, and humans and returned certainty in less than a second.</p><p>UPI did not just solve payments.</p><p>It solved confidence, at population scale.</p><p>And when engineering reaches that level, it disappears into life.</p><p>Just like the steam from that cup of chai.</p>]]></content:encoded></item><item><title><![CDATA[Big Billion Sale 2025: System Design]]></title><description><![CDATA[11:57 PM in Bengaluru.]]></description><link>https://singour.substack.com/p/big-billion-sale-2025-system-design</link><guid isPermaLink="false">https://singour.substack.com/p/big-billion-sale-2025-system-design</guid><dc:creator><![CDATA[Himanshu Singour]]></dc:creator><pubDate>Mon, 29 Sep 2025 19:15:29 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!bmhM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c2bd3d7-4ab6-4459-8036-e908a11a6f37_1024x1536.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!bmhM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c2bd3d7-4ab6-4459-8036-e908a11a6f37_1024x1536.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!bmhM!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c2bd3d7-4ab6-4459-8036-e908a11a6f37_1024x1536.webp 424w, /__u/substackcdn.com/image/fetch/$s_!bmhM!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c2bd3d7-4ab6-4459-8036-e908a11a6f37_1024x1536.webp 848w, /__u/substackcdn.com/image/fetch/$s_!bmhM!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c2bd3d7-4ab6-4459-8036-e908a11a6f37_1024x1536.webp 1272w, /__u/substackcdn.com/image/fetch/$s_!bmhM!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_webp, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c2bd3d7-4ab6-4459-8036-e908a11a6f37_1024x1536.webp 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!bmhM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c2bd3d7-4ab6-4459-8036-e908a11a6f37_1024x1536.webp" width="1024" height="1536" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6c2bd3d7-4ab6-4459-8036-e908a11a6f37_1024x1536.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1536,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="/__u/substackcdn.com/image/fetch/$s_!bmhM!, /__u/singour.substack.com/w_424, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c2bd3d7-4ab6-4459-8036-e908a11a6f37_1024x1536.webp 424w, /__u/substackcdn.com/image/fetch/$s_!bmhM!, /__u/singour.substack.com/w_848, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c2bd3d7-4ab6-4459-8036-e908a11a6f37_1024x1536.webp 848w, /__u/substackcdn.com/image/fetch/$s_!bmhM!, /__u/singour.substack.com/w_1272, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c2bd3d7-4ab6-4459-8036-e908a11a6f37_1024x1536.webp 1272w, /__u/substackcdn.com/image/fetch/$s_!bmhM!, /__u/singour.substack.com/w_1456, /__u/singour.substack.com/c_limit, /__u/singour.substack.com/f_auto, /__u/singour.substack.com/q_auto:good, /__u/singour.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c2bd3d7-4ab6-4459-8036-e908a11a6f37_1024x1536.webp 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>11:57 PM in Bengaluru</strong>.<br>The Flipkart war room feels like a launchpad. Dashboards glow in the dim light traffic per second, inventory count</p><p>ers, Kafka lags, CPU &amp; memory graphs. Some lines are green, a few turn amber, one or two flirt with red.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://singour.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Himanshu&#8217;s Substack! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>Coffee cups clutter the table. Engineers sit quietly, not coding anymore. Code freeze happened days ago. Tonight is not about writing code, it&#8217;s about watching systems <em>perform</em>.</p><p>Someone whispers: <em>&#8220;T-minus 3 minutes.&#8221;</em></p><p>At exactly <strong>12:00:00</strong>, the Flipkart banner flips to <strong>Big Billion Sale</strong>. Push notifications blast across India. <strong>Crores of taps per second</strong> slam into the system.</p><p>And somewhere in Pune, <strong>Himanshu taps &#8220;Buy Now.&#8221;</strong><br>This is the story of what happens next.</p><h2><strong>The Mall in the Cloud</strong></h2><p>&#8220;Imagine Flipkart as a giant mall, but it exists in the cloud.&#8221;</p><ul><li><p><strong>CDN (Content Delivery Network)</strong> &#8594; Like billboards all over India. Instead of fetching banners and scripts from Bengaluru, you read them from a server near your house. That&#8217;s why the homepage loads instantly.</p></li><li><p><strong>WAF (Web Application Firewall) + API Gateway</strong> &#8594; Like the mall&#8217;s main gate and security guards. They filter bots, block abusive traffic, and decide if Himanshu&#8217;s request is legitimate.</p></li><li><p><strong>Load Balancers</strong> &#8594; The traffic cops. A global LB sends Himanshu to the nearest regional data center (Mumbai, Chennai, Delhi). Then a regional LB routes him to a healthy server pod.</p></li><li><p><strong>Microservices</strong> &#8594; Inside the mall, each shop does one job: catalog, cart, payments, inventory, orders, notifications. They run inside Kubernetes, wrapped in a service mesh so they can talk securely.</p></li><li><p><strong>Kafka</strong> &#8594; The conveyor belt between shops. Instead of yelling, services drop messages on Kafka and others pick them up at their own pace.</p></li><li><p><strong>Databases</strong> &#8594; Stockrooms. Strict vaults (MySQL/Postgres) for money; wide bins (Cassandra/ElasticSearch) for catalog and search; fast drawers (Redis) for ultra-hot data like carts and stock.</p></li><li><p><strong>Observability</strong> &#8594; CCTV everywhere: Prometheus for metrics, Grafana dashboards, ELK logs, tracing. If one corridor jams, alerts ring instantly.</p></li></ul><h2><strong>Himanshu&#8217;s Midnight Order, The Flow</strong></h2><p>Let&#8217;s trace Himanshu&#8217;s iPhone order in real-time.</p><h2><strong>1. Homepage</strong></h2><p>When Himanshu opens the app:</p><ul><li><p><strong>80% of the load</strong> is served by <strong>CDNs</strong>: banners, images, JS.</p></li><li><p>Dynamic API calls go through the <strong>API Gateway</strong>, where a <strong>rate limiter</strong>ensures one user/device/IP doesn&#8217;t flood the system. Suspicious ones get challenged.</p></li><li><p><strong>Feature flags</strong> (simple config switches) decide if Himanshu sees an experimental banner or a bank-specific promo.</p></li></ul><p>The secret: by handling most stuff at the <strong>edge</strong>, core servers are shielded.</p><h2><strong>2. Search</strong></h2><p>Himanshu types <strong>&#8220;iPhone 15 Pro.&#8221;</strong></p><ul><li><p>The query hits the <strong>Search microservice</strong>, backed by <strong>ElasticSearch</strong>. Optimized indexes return results in ~50 ms.</p></li><li><p>Each result needs prices/promos. Instead of hitting MySQL every time, the <strong>Pricing service</strong> pulls from <strong>Redis</strong>(periodically synced with MySQL).</p></li></ul><p>Why not just MySQL? Because at this scale, even reading 10 million rows/sec would melt it. Redis handles micro-updates and insane read volume.</p><h2><strong>3. Product Page</strong></h2><p>Himanshu taps the iPhone listing.</p><ul><li><p><strong>Catalog service</strong> fetches structured product details from <strong>Cassandra + ElasticSearch</strong>.</p></li><li><p><strong>Inventory service</strong> checks <strong>Redis</strong> for stock count.</p></li><li><p>That little line <em>&#8220;Only 3 left in stock&#8221; </em>is not fake. It&#8217;s updated in near real-time by <strong>Kafka events</strong> flowing from warehouse DBs.</p></li></ul><p>This separation (catalog vs. inventory) avoids bottlenecks. Catalog = descriptive data (read-heavy). Inventory = small, hot, transactional counters.</p><h2><strong>4. Add to Cart</strong></h2><p>Himanshu adds the iPhone to his cart.</p><ul><li><p><strong>Redis</strong> is updated immediately (primary source for speed).</p></li><li><p>An <strong>async background write</strong> persists the cart in <strong>Cassandra</strong> for durability.</p></li></ul><p>Why this hybrid? Redis alone is too risky (data lost if memory crashes). Cassandra ensures persistence without slowing the hot path.</p><h2><strong>5. Checkout</strong></h2><p>The <strong>Order Orchestrator</strong> takes charge. Think of it as a conductor ensuring the orchestra plays in sync:</p><ol><li><p>Calls <strong>Inventory</strong> to reserve the item.</p></li><li><p>Confirms <strong>address &amp; delivery slot</strong>.</p></li><li><p>Passes to <strong>Payment Orchestrator</strong>.</p></li></ol><p>Every microservice call is logged with a correlation ID. If something goes wrong, engineers can trace Himanshu&#8217;s journey across dozens of services.</p><h2><strong>6. Reservation</strong></h2><p>This is the heart of the system. Here&#8217;s how Flipkart avoids overselling:</p><ul><li><p>Acquire a <strong>distributed lock</strong> (via Redis/ZooKeeper) on the iPhone SKU.</p></li><li><p>Check the <strong>stock counter</strong> in Redis.</p></li><li><p>If enough units exist &#8594; decrement atomically.</p></li><li><p>Create a <strong>reservation TTL (5 minutes)</strong> &#8594; Himanshu has this time to finish payment.</p></li><li><p>Kafka event informs other systems: &#8220;Item reserved.&#8221;</p></li><li><p>Release the lock.</p></li></ul><p>If Himanshu fails to pay, stock auto-releases when TTL expires. That&#8217;s why 1000 iPhones don&#8217;t become 2000 oversold orders.</p><h2><strong>7. Payments</strong></h2><p>Payments are unpredictable. Banks can be slow. Gateways can timeout.</p><p>The <strong>Payment Orchestrator</strong> is built for this:</p><ul><li><p>Generates an <strong>idempotency key</strong> so retries don&#8217;t double-charge.</p></li><li><p>Chooses the best route (UPI/Card/Wallet) based on live success scores.</p></li><li><p>Sets <strong>hard timeouts</strong> (e.g., UPI = 15 sec). If slow, retries on another gateway.</p></li><li><p>Every transaction is logged in an <strong>append-only ledger DB</strong> &#8594; audit-proof, tamper-proof.</p></li></ul><p>To Himanshu, this feels like: <em>&#8220;Processing your payment&#8230;&#8221;</em> even though in the backend, multiple retries and failovers may be happening.</p><h2><strong>8. Order Commit</strong></h2><p>If payment succeeds:</p><ul><li><p><strong>Order service</strong> writes the final record into <strong>MySQL/Postgres (ACID-safe)</strong>.</p></li><li><p>Kafka events trigger:</p></li><li><p>Notifications (SMS, email, push).</p></li><li><p>Ekart logistics (nearest warehouse starts packing).</p></li></ul><p>If payment fails? Himanshu sees a clear message not silence:</p><ul><li><p><em>&#8220;Processing&#8230;&#8221;</em> if bank callback is late.</p></li><li><p><em>&#8220;Payment failed, stock restored.&#8221;</em> if reservation expires.</p></li></ul><p>Predictable, honest UX &gt; Silent failure.</p><h2><strong>Flash Sale Mechanics</strong></h2><p>n a flash sale, lakhs of people hit <em>&#8220;Buy Now&#8221;</em> at the <strong>same second</strong>. Without guardrails, servers crash, stock oversells, and nobody is happy.</p><p>To stop this chaos, Flipkart uses five key tricks that work together.</p><p>First comes the <strong>token bucket at the gateway</strong>. Think of it like giving every user a handful of tokens maybe 10 per second.</p><p>Every time you send a request (like add to cart or check stock), you spend a token. If you run out, you wait.</p><p>This stops a single user or bot from hammering the system with thousands of requests while still letting normal customers through smoothly.</p><p>Next is the <strong>waiting room (pre-queue)</strong>. Imagine a stadium with only a few gates. If everyone pushes in at once, it&#8217;s chaos. Instead, the crowd waits outside, and security lets people in small waves.</p><p>That&#8217;s what happens here. You may see a &#8220;You&#8217;re in line&#8221; message for a few seconds, while the backend processes earlier requests. This way the system doesn&#8217;t collapse under sudden spikes, and users feel things are fair.</p><p>Now, the <strong>hot key problem</strong>. In Redis (or any cache), each product has a counter. During a flash sale, one product say the iPhone is requested millions of times.</p><p>That counter becomes a &#8220;hotspot&#8221; and one Redis server can melt under the load. The fix is <strong>sharding</strong>: split that iPhone counter into multiple smaller counters (like sku:iphone:a, sku:iphone:b&#8230;).</p><p>Updates spread across servers, and the system aggregates them when showing stock. This spreads the heat.</p><p>Another big issue is the <strong>cache stampede</strong>. Suppose a cache key (like the stock count) expires. Suddenly, thousands of requests rush to refresh it from the database at the same time, and the DB collapses.</p><p>The trick is <strong>single-flight refresh</strong>: the first request refreshes the data, and others just wait for that result instead of all hitting the DB.</p><p>Add in randomized expiries (jitter) so not everything expires together, and the system stays safe.</p><p>Finally, <strong>reservation TTLs</strong> keep things fair.</p><p>When Himanshu clicks <em>Buy Now</em>, the system reserves the item for him but only for a limited time (say 5 minutes). If payment succeeds, the item is his.</p><p>If he quits or fails to pay, the timer expires and the stock goes back into the pool. This prevents people from hoarding stock forever without completing the purchase.</p><h2><strong>Observability: Seeing Problems First</strong></h2><p>During a flash sale, millions of people are buying at once. If something breaks, you can&#8217;t wait for users to complain you need to <strong>spot problems instantly</strong>.</p><p>That&#8217;s why engineers watch a few <strong>golden signals</strong> on dashboards all night.</p><h2><strong>Golden Signals (What They Watch)</strong></h2><ol><li><p><strong>Checkout speed</strong> &#8594; Every checkout should finish fast. Target: under 300 ms for almost all users.</p></li><li><p><strong>Payment success</strong> &#8594; At least 95% of payments should go through. If it drops, something&#8217;s wrong with a bank or gateway.</p></li><li><p><strong>Inventory locks</strong> &#8594; Reserving stock should take less than 50 ms. If it&#8217;s slow, Redis or ZooKeeper is overloaded.</p></li><li><p><strong>Kafka lag</strong> &#8594; Events (orders, stock updates, payments) should be processed within 2 seconds. If delayed, stock counts and notifications may be wrong.</p></li></ol><h2><strong>What They Do When Things Break</strong></h2><ul><li><p>If <strong>Bank A fails</strong> &#8594; router quickly sends less traffic to it and more to other banks.</p></li><li><p>If <strong>Redis shard is overloaded</strong> &#8594; hot product counters (like iPhone) are split across multiple Redis keys to spread the load.</p></li><li><p>If <strong>Kafka is lagging</strong> &#8594; new consumers are started, or non-critical traffic is paused, so important events catch up.</p></li><li><p>Failures don&#8217;t shock the team. They <em>expect them</em>.</p></li></ul><h2><strong>Midnight Failures</strong></h2><ul><li><p><strong>12:12 AM</strong> &#8594; UPI-X latency spikes. Router cuts share 30% &#8594; 2%. Wallets take over. Pending orders settle later.</p></li><li><p><strong>Hot iPhone SKU overloads Redis</strong> &#8594; counter is split across 8 shards. TTL jitter avoids synchronized expiries.</p></li><li><p><strong>Kafka consumer lag</strong> &#8594; engineers scale up consumers, backlog clears in minutes.</p></li><li><p><strong>Cache stampede</strong> &#8594; single-flight prevents collapse.</p></li></ul><p>The system <em>bends but never breaks</em>.</p><blockquote><p><em>In the weeks before Big Billion Day, engineers practice at <strong>3 AM</strong> when traffic is low. These are called <strong>chaos drills</strong>. They break things on purpose:</em></p></blockquote><ul><li><p>Kill a database server.</p></li><li><p>Cut off a data center link.</p></li><li><p>Pretend a bank goes down.</p></li></ul><p>Every time, they practice how to recover. They write down what worked, update playbooks, and fine-tune alarms. So by the time the real sale night comes, <strong>failures don&#8217;t surprise anyone</strong> they&#8217;ve already seen them in practice.</p><p>That&#8217;s why during BBD night, there&#8217;s no panic and no &#8220;hero&#8221; trying to code last-minute fixes. Instead, it&#8217;s calm and methodical. Engineers sit with dashboards open, radios on, and checklists ready.</p><p>You&#8217;ll hear quiet voices say things like:</p><ul><li><p><em>&#8220;Cut Bank-X traffic.&#8221;</em></p></li><li><p><em>&#8220;Add more Kafka consumers.&#8221;</em></p></li><li><p><em>&#8220;Turn off recommendations, keep checkout fast.&#8221;</em></p></li></ul><p>And it works. By sunrise, <strong>crores of orders are confirmed</strong>, warehouses are buzzing, and the war room finally relaxes. Another Big Billion Sale survived.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://singour.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Himanshu&#8217;s Substack! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item></channel></rss>