<?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[Grind Engineer]]></title><description><![CDATA[5 Min Read to Master Software Engineering, One Concept at a Time!

From coding basics to advanced system design, this newsletter brings you well-researched articles every week. No fluff, just valuable.]]></description><link>https://grindengineer.substack.com</link><image><url>https://substackcdn.com/image/fetch/$s_!uewu!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d367be8-b221-478d-aee2-c4a431c9c556_297x297.png</url><title>Grind Engineer</title><link>https://grindengineer.substack.com</link></image><generator>Substack</generator><lastBuildDate>Mon, 10 Aug 2026 03:00:59 GMT</lastBuildDate><atom:link href="https://grindengineer.substack.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Aditya Singh Sisodiya]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[grindengineer@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[grindengineer@substack.com]]></itunes:email><itunes:name><![CDATA[Scortier]]></itunes:name></itunes:owner><itunes:author><![CDATA[Scortier]]></itunes:author><googleplay:owner><![CDATA[grindengineer@substack.com]]></googleplay:owner><googleplay:email><![CDATA[grindengineer@substack.com]]></googleplay:email><googleplay:author><![CDATA[Scortier]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[System Design was HARD Until I Learned These 20 Patterns]]></title><description><![CDATA[Every system design answer uses the same 20 building blocks. Learn all 5 layers with a cheat sheet diagram you can bookmark for your next FAANG interview.]]></description><link>https://grindengineer.substack.com/p/system-design-was-hard-until-i-learned</link><guid isPermaLink="false">https://grindengineer.substack.com/p/system-design-was-hard-until-i-learned</guid><dc:creator><![CDATA[Scortier]]></dc:creator><pubDate>Tue, 02 Jun 2026 12:10:43 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/56c0916c-b84d-434b-87b7-9090d5eb38b0_1280x720.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p style="text-align: center;"><em><strong>In Partnership with Tripo AI</strong></em> </p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!B6Sx!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F339168f3-3484-4254-94dd-a74df86ecdd7_348x348.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!B6Sx!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F339168f3-3484-4254-94dd-a74df86ecdd7_348x348.jpeg 424w, https://substackcdn.com/image/fetch/$s_!B6Sx!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F339168f3-3484-4254-94dd-a74df86ecdd7_348x348.jpeg 848w, https://substackcdn.com/image/fetch/$s_!B6Sx!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F339168f3-3484-4254-94dd-a74df86ecdd7_348x348.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!B6Sx!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F339168f3-3484-4254-94dd-a74df86ecdd7_348x348.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!B6Sx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F339168f3-3484-4254-94dd-a74df86ecdd7_348x348.jpeg" width="62" height="62" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/339168f3-3484-4254-94dd-a74df86ecdd7_348x348.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:348,&quot;width&quot;:348,&quot;resizeWidth&quot;:62,&quot;bytes&quot;:10357,&quot;alt&quot;:&quot;Image&quot;,&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="Image" title="Image" srcset="https://substackcdn.com/image/fetch/$s_!B6Sx!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F339168f3-3484-4254-94dd-a74df86ecdd7_348x348.jpeg 424w, https://substackcdn.com/image/fetch/$s_!B6Sx!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F339168f3-3484-4254-94dd-a74df86ecdd7_348x348.jpeg 848w, https://substackcdn.com/image/fetch/$s_!B6Sx!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F339168f3-3484-4254-94dd-a74df86ecdd7_348x348.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!B6Sx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F339168f3-3484-4254-94dd-a74df86ecdd7_348x348.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><blockquote><p>Welcome to <em><strong>Grind Engineer</strong></em>, your guide to becoming a better software engineer! No fluff. Pure engineering insights.</p><p><strong>TL;DR:</strong> There are only 20 building blocks that appear in virtually every system design interview and every production system. This article organizes them into 5 layers, explains what each block does, when to use it, and maps each one to the interview questions where it shows up. Bookmark this. You will come back to it.</p></blockquote><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!FVaN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed6ed1e0-6b18-4cd2-af83-b665566b95e7_1920x1080.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!FVaN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed6ed1e0-6b18-4cd2-af83-b665566b95e7_1920x1080.jpeg 424w, https://substackcdn.com/image/fetch/$s_!FVaN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed6ed1e0-6b18-4cd2-af83-b665566b95e7_1920x1080.jpeg 848w, https://substackcdn.com/image/fetch/$s_!FVaN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed6ed1e0-6b18-4cd2-af83-b665566b95e7_1920x1080.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!FVaN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed6ed1e0-6b18-4cd2-af83-b665566b95e7_1920x1080.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!FVaN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed6ed1e0-6b18-4cd2-af83-b665566b95e7_1920x1080.jpeg" width="609" height="342.5625" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ed6ed1e0-6b18-4cd2-af83-b665566b95e7_1920x1080.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;:609,&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;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!FVaN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed6ed1e0-6b18-4cd2-af83-b665566b95e7_1920x1080.jpeg 424w, https://substackcdn.com/image/fetch/$s_!FVaN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed6ed1e0-6b18-4cd2-af83-b665566b95e7_1920x1080.jpeg 848w, https://substackcdn.com/image/fetch/$s_!FVaN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed6ed1e0-6b18-4cd2-af83-b665566b95e7_1920x1080.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!FVaN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed6ed1e0-6b18-4cd2-af83-b665566b95e7_1920x1080.jpeg 1456w" sizes="100vw"></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>Tripo AI Raises Nearly $200M to Advance AI 3D and World Models</strong></p><p>Tripo AI builds AI 3D foundation models and world models for high demand 3D workflows across interior design, e commerce, gaming, film, VR/AR, digital twins, robotics, and interactive entertainment.</p><p>Used by more than 20 million users worldwide, Tripo AI helps creators, developers, and studios turn ideas into high quality 3D assets faster. With its new world model research initiative, <strong>Project Eden</strong>, Tripo AI is moving AI 3D beyond single asset generation toward persistent, editable, and interactive worlds.</p><p>What you can explore with Tripo AI:</p><ul><li><p>AI-generated 3D assets and production-ready meshes</p></li><li><p>Native 8K AI textures for sharper visual quality</p></li><li><p>Intelligent part segmentation for editable 3D workflows</p></li><li><p>Project Eden, Tripo AI&#8217;s world model research initiative</p></li></ul><p><strong><a href="https://www.tripo3d.ai/?utm_source=newsletter&amp;utm_medium=sponsorship&amp;utm_campaign=grind">Start creating with Tripo AI &#8594; here</a></strong></p><div><hr></div><p>I spent the first six months of my system design prep memorizing full architectures. &#8220;Design Twitter.&#8221; &#8220;Design Uber.&#8221; &#8220;Design YouTube.&#8221; I could recite solutions, but when the interviewer changed a single constraint, I was lost.</p><p>Then I realized I was studying wrong. Every system design answer is assembled from the same <strong>20 building blocks</strong>. Learn the blocks, and you can design anything.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!vyXt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52410c5b-55dc-460e-ac3c-b7748bc25e38_878x644.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!vyXt!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52410c5b-55dc-460e-ac3c-b7748bc25e38_878x644.png 424w, https://substackcdn.com/image/fetch/$s_!vyXt!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52410c5b-55dc-460e-ac3c-b7748bc25e38_878x644.png 848w, https://substackcdn.com/image/fetch/$s_!vyXt!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52410c5b-55dc-460e-ac3c-b7748bc25e38_878x644.png 1272w, https://substackcdn.com/image/fetch/$s_!vyXt!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52410c5b-55dc-460e-ac3c-b7748bc25e38_878x644.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!vyXt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52410c5b-55dc-460e-ac3c-b7748bc25e38_878x644.png" width="878" height="644" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/52410c5b-55dc-460e-ac3c-b7748bc25e38_878x644.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:644,&quot;width&quot;:878,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:121317,&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://scortier.substack.com/i/200134676?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52410c5b-55dc-460e-ac3c-b7748bc25e38_878x644.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!vyXt!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52410c5b-55dc-460e-ac3c-b7748bc25e38_878x644.png 424w, https://substackcdn.com/image/fetch/$s_!vyXt!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52410c5b-55dc-460e-ac3c-b7748bc25e38_878x644.png 848w, https://substackcdn.com/image/fetch/$s_!vyXt!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52410c5b-55dc-460e-ac3c-b7748bc25e38_878x644.png 1272w, https://substackcdn.com/image/fetch/$s_!vyXt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52410c5b-55dc-460e-ac3c-b7748bc25e38_878x644.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><h3>Layer 1: Traffic Management (how requests get in)</h3><h3>1. DNS (Domain Name System)</h3><p>Translates human readable domain names (google.com) into IP addresses (142.250.185.78). Every single request on the internet starts with a DNS lookup. In interviews, DNS matters for global load balancing: you can use DNS to route users to the nearest data center.</p><p><strong>Shows up in:</strong> Every system design question. Always mention DNS when discussing how users reach your system.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://grindengineer.substack.com/subscribe?"><span>Subscribe now</span></a></p><h3>2. CDN (Content Delivery Network)</h3><p>A network of servers distributed globally that caches and serves static content (images, CSS, JS, videos) from locations close to the user. Instead of fetching an image from your server in Virginia, a user in Mumbai gets it from a CDN node in Mumbai. Latency drops from 200ms to 20ms.</p><p><strong>Shows up in:</strong> Design YouTube, Design Instagram, Design Netflix, any system serving media.</p><h3>3. Load Balancer</h3><p>Distributes incoming traffic across multiple servers. Three algorithms cover 90% of cases: <strong>Round Robin</strong> (rotate evenly), <strong>Least Connections</strong> (send to the least busy server), and <strong>IP Hash</strong> (same user always hits the same server).</p><p><strong>Shows up in:</strong> Every question once you scale beyond one server. The moment you say &#8220;horizontal scaling,&#8221; a load balancer appears.</p><h3>4. API Gateway</h3><p>A single entry point that sits in front of all your backend services. Handles authentication, rate limiting, request routing, and protocol translation. Think of it as a smart receptionist that checks your badge, finds the right department, and enforces the rules.</p><p><strong>Shows up in:</strong> Design Uber, any microservices architecture, any system with a public API.</p><h3>5. Rate Limiter</h3><p>Controls how many requests a user or service can make in a given time window. Protects your system from abuse, DDoS attacks, and runaway clients. Common algorithms: token bucket, sliding window, fixed window.</p><p><strong>Shows up in:</strong> Design API Rate Limiter (a standalone question), and as a component in almost every other question.</p><h3>Layer 2: Compute (where logic runs)</h3><h3>6. Web/App Servers</h3><p>Stateless servers that handle business logic. The key word is <strong>stateless</strong>: any server can handle any request. Session data lives in a shared cache (Redis), not on the server. This makes horizontal scaling trivial: add more servers behind the load balancer.</p><p><strong>Shows up in:</strong> Every question. The foundation of any scalable backend.</p><h3>7. Microservices</h3><p>Breaking a monolith into independent services, each owning its own data and deploying independently. User Service, Order Service, Payment Service. Each team owns one service. The trade off: simpler deployments per service, but network calls replace function calls and debugging becomes distributed.</p><blockquote><p>&#128161; <strong>Key Insight:</strong> Every system design interview answer uses the same 20 building blocks. The skill is not memorizing architectures. It is knowing which blocks to pick, where to place them, and what trade offs each one introduces. Learn the blocks, and you can design anything you have never seen before.</p></blockquote><p><strong>Shows up in:</strong> Design Uber, Design Amazon, any system with multiple teams or domains.</p><h3>8. Serverless Functions</h3><p>Short lived functions that run on demand. No server management. You pay per execution. Perfect for event driven tasks: &#8220;When a user uploads an image, resize it.&#8221; Not suitable for long running processes or anything requiring persistent connections.</p><p><strong>Shows up in:</strong> Design image processing pipelines, webhook handlers, event driven architectures.</p><h3>Layer 3: Data Storage (where data lives)</h3><h3>9. SQL Database (Relational)</h3><p>Tables with rows and columns. Strict schema. ACID transactions. <strong>PostgreSQL</strong> and <strong>MySQL</strong> are the standards. Use SQL when your data has relationships (users have orders, orders have items) and you need strong consistency.</p><p><strong>Shows up in:</strong> Design Twitter (users, tweets, follows), Design E Commerce (products, orders, payments), most CRUD systems.</p><h3>10. NoSQL Database</h3><p>Flexible schema. Scales horizontally with ease. Multiple types exist: <strong>Document stores</strong> (MongoDB: JSON documents), <strong>Key value stores</strong> (DynamoDB, Redis: simple lookups), <strong>Wide column stores</strong> (Cassandra: time series, high write throughput), <strong>Graph databases</strong> (Neo4j: relationships between entities).</p><p>NoSQL TypeBest forExampleDocumentFlexible schemas, nested dataMongoDBKey ValueSimple lookups, sessions, cachingDynamoDB, RedisWide ColumnTime series, high write volumeCassandraGraphComplex relationships, social networksNeo4j</p><p><strong>Shows up in:</strong> Design Chat System (Cassandra), Design Social Graph (Neo4j), Design Config Store (DynamoDB).</p><h3>11. Object Storage (Blob Storage)</h3><p>Stores unstructured data: images, videos, PDFs, backups. <strong>Amazon S3</strong> is the standard. Virtually unlimited capacity, extremely durable (99.999999999% durability), and cheap. Never store large files in a database. Always use object storage.</p><p><strong>Shows up in:</strong> Design Instagram (photos), Design YouTube (videos), Design Dropbox (files).</p><h3>12. Cache</h3><p>Fast, in memory storage (Redis, Memcached) that holds frequently accessed data. A cache hit returns data in under 1ms. A database query takes 10 to 50ms. Cache aside is the default pattern: check cache first, fall back to DB on miss, populate cache for next time.</p><p><strong>Shows up in:</strong> Every single question. If your design does not mention caching, you are leaving performance on the table.</p><h3>13. Search Index</h3><p>A specialized data structure optimized for full text search. <strong>Elasticsearch</strong> is the standard. When a user types &#8220;blue running shoes&#8221; in a search bar, you cannot <code>SELECT * FROM products WHERE name LIKE '%blue%'</code>. That is too slow. A search index pre processes and inverts the data so queries return in milliseconds.</p><p><strong>Shows up in:</strong> Design Search Autocomplete, Design E Commerce (product search), Design Logging System (log search).</p><h3>Layer 4: Communication (how components talk)</h3><h3>14. Message Queue</h3><p>A buffer between producers and consumers. The producer drops a message into the queue and moves on. The consumer picks it up when ready. Decouples services, absorbs traffic spikes, and enables retry logic. <strong>Kafka</strong>, <strong>RabbitMQ</strong>, and <strong>SQS</strong> are the standards.</p><p>QueueBest forKafkaHigh throughput event streaming, log aggregationRabbitMQTask queues, complex routing, request/replySQSSimple cloud native queues, serverless integration</p><p><strong>Shows up in:</strong> Design Notification System, Design Order Processing, Design Email Service, any async workflow.</p><h3>15. Pub/Sub (Publish/Subscribe)</h3><p>A messaging pattern where publishers broadcast events to multiple subscribers without knowing who they are. Different from a queue: a queue delivers a message to ONE consumer. Pub/Sub delivers to ALL subscribers. <strong>Google Pub/Sub</strong>, <strong>Kafka topics</strong>, and <strong>Redis Pub/Sub</strong> are common choices.</p><p><strong>Shows up in:</strong> Design Real Time Feed, Design Notification System, Design Live Sports Score Updates.</p><h3>16. WebSockets</h3><p>A persistent, bidirectional connection between client and server. Unlike HTTP (request &#8594; response &#8594; close), WebSockets keep the connection open so the server can push data to the client at any time. Essential for real time features.</p><p><strong>Shows up in:</strong> Design Chat Application (WhatsApp), Design Live Collaboration (Google Docs), Design Live Dashboard.</p><h3>17. REST / GraphQL / gRPC</h3><p>Three API communication styles. REST for public APIs (universal, cacheable). GraphQL for complex frontends (client picks the data shape). gRPC for internal service to service calls (binary, fast, streaming). Most modern architectures use all three at different layers.</p><p><strong>Shows up in:</strong> Every question. Choose the right API style for each communication boundary.</p><h3>Layer 5: Reliability &amp; Observability (keeping it running)</h3><h3>18. Database Replication</h3><p>Copying data from a primary database to one or more replicas. The primary handles writes. Replicas handle reads. Since most apps are 90%+ reads, this multiplies your read throughput without touching the write path. If the primary dies, a replica gets promoted.</p><p><strong>Shows up in:</strong> Any question requiring high availability or read heavy workloads.</p><h3>19. Database Sharding</h3><p>Splitting data across multiple database servers. Each shard holds a subset of the data (e.g., users A through M on Shard 1, N through Z on Shard 2). Sharding is the last resort after replication, caching, and query optimization have been exhausted. Choosing the right shard key is critical: a bad key creates hot shards.</p><p><strong>Shows up in:</strong> Design Twitter (shard by user_id), Design URL Shortener (shard by hash), any system with billions of rows.</p><h3>20. Monitoring and Observability</h3><p>Three pillars: <strong>Metrics</strong> (quantitative measurements like latency, error rate, throughput), <strong>Logs</strong> (event records for debugging), and <strong>Traces</strong> (tracking a request across multiple services). Without observability, you are flying blind. Tools: Prometheus + Grafana for metrics, ELK stack for logs, Jaeger or Datadog for traces.</p><p><strong>Shows up in:</strong> Rarely asked directly, but mentioning it in any answer shows maturity. &#8220;I would add distributed tracing to track requests across services&#8221; is a staff level signal.</p><h3>The Building Blocks Cheat Sheet</h3><p>LayerBuilding BlocksInterview SignalTrafficDNS, CDN, Load Balancer, API Gateway, Rate Limiter&#8221;I understand how traffic reaches my system&#8221;ComputeApp Servers, Microservices, Serverless&#8221;I can structure backend logic appropriately&#8221;StorageSQL, NoSQL, Blob Storage, Cache, Search Index&#8221;I pick the right storage for the right data&#8221;CommunicationQueue, Pub/Sub, WebSockets, REST/GraphQL/gRPC&#8221;I know how components talk to each other&#8221;ReliabilityReplication, Sharding, Monitoring&#8221;I build systems that survive failures&#8221;</p><h3>When to Use What</h3><ol><li><p><strong>Every answer starts with 3 blocks: DNS + Load Balancer + App Servers.</strong> This is the skeleton. No exceptions. Build outward from here.</p></li><li><p><strong>Add blocks only when a constraint demands it.</strong> &#8220;High read throughput&#8221; &#8594; add Cache + Replicas. &#8220;User uploads media&#8221; &#8594; add Blob Storage + CDN. &#8220;Real time updates&#8221; &#8594; add WebSockets + Pub/Sub. Do not add blocks just to impress. Add them because the problem requires them.</p></li><li><p><strong>The interview is about trade offs, not components.</strong> Anyone can draw 20 boxes on a whiteboard. What separates strong candidates is saying &#8220;I chose Kafka over RabbitMQ because we need ordered, replayable event streams, and I accept the operational complexity that comes with it.&#8221;</p></li></ol><div><hr></div><p>For more visual explanations of system design, DSA patterns, AI in engineering and tech productivity, Subscribe To Grind Engineer! &#128640;</p><p>Follow me on <a href="https://www.youtube.com/@scortier">Youtube</a> &#183; <a href="https://www.linkedin.com/in/scortier/">LinkedIn</a> &#183; <a href="https://x.com/scortierHQ">X</a> &#183; <a href="https://www.instagram.com/_scortier_/">Instagram</a> to stay updated.</p><p>See you in the next one!<br>Signing Off, <strong>Scortier</strong></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.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 Grind Engineer! 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></p>]]></content:encoded></item><item><title><![CDATA[CLAUDE.md: The Complete Guide to Claude Code's Most Important File]]></title><description><![CDATA[Most engineers either skip it or overload it. Here is what the 13KB power users actually put in theirs.]]></description><link>https://grindengineer.substack.com/p/claudemd-the-complete-guide-to-claude</link><guid isPermaLink="false">https://grindengineer.substack.com/p/claudemd-the-complete-guide-to-claude</guid><dc:creator><![CDATA[Scortier]]></dc:creator><pubDate>Fri, 08 May 2026 12:31:33 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!MjTu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ac1ceb1-cbe1-447f-9d83-29842f773ea9_1250x920.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="https://substackcdn.com/image/fetch/$s_!MjTu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ac1ceb1-cbe1-447f-9d83-29842f773ea9_1250x920.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!MjTu!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ac1ceb1-cbe1-447f-9d83-29842f773ea9_1250x920.png 424w, https://substackcdn.com/image/fetch/$s_!MjTu!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ac1ceb1-cbe1-447f-9d83-29842f773ea9_1250x920.png 848w, https://substackcdn.com/image/fetch/$s_!MjTu!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ac1ceb1-cbe1-447f-9d83-29842f773ea9_1250x920.png 1272w, https://substackcdn.com/image/fetch/$s_!MjTu!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ac1ceb1-cbe1-447f-9d83-29842f773ea9_1250x920.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!MjTu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ac1ceb1-cbe1-447f-9d83-29842f773ea9_1250x920.png" width="1250" height="920" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5ac1ceb1-cbe1-447f-9d83-29842f773ea9_1250x920.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:920,&quot;width&quot;:1250,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:169061,&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://scortier.substack.com/i/196873929?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ac1ceb1-cbe1-447f-9d83-29842f773ea9_1250x920.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!MjTu!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ac1ceb1-cbe1-447f-9d83-29842f773ea9_1250x920.png 424w, https://substackcdn.com/image/fetch/$s_!MjTu!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ac1ceb1-cbe1-447f-9d83-29842f773ea9_1250x920.png 848w, https://substackcdn.com/image/fetch/$s_!MjTu!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ac1ceb1-cbe1-447f-9d83-29842f773ea9_1250x920.png 1272w, https://substackcdn.com/image/fetch/$s_!MjTu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ac1ceb1-cbe1-447f-9d83-29842f773ea9_1250x920.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><strong>73% of engineering teams now use AI coding tools daily.</strong> Yet most Claude Code users skip the one file that turns every session from a cold start into an informed conversation. That file is CLAUDE.md. And if you are not maintaining it, you are onboarding your AI pair programmer from scratch every single time.</p><blockquote><p>Welcome to <em><strong>Hello Engineer</strong></em>, your weekly guide to becoming a better software engineer! No fluff. Pure engineering insights. You can also check out: <strong><a href="https://scortier.substack.com/p/most-engineers-use-2-of-these-10">10 Claude Code Features Every Engineer Should Know</a></strong></p></blockquote><h4>What CLAUDE.md Actually Is</h4><p>CLAUDE.md is a markdown file that Claude Code reads at the start of every conversation. It lives in the root of your repository and acts as persistent memory for your project. Your architecture decisions, naming conventions, build commands, testing preferences, and workflow constraints all go here.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://grindengineer.substack.com/subscribe?"><span>Subscribe now</span></a></p><p>Without it, Claude has zero knowledge of your codebase when a session begins. It does not know your stack. It does not know your conventions. It does not know which branch strategy your team follows. Every session is a blank slate.</p><p>With it, every session starts informed.</p><blockquote><p>If you correct Claude twice about the same thing, add it to CLAUDE.md so it never happens again.</p></blockquote><p>The <code>/init</code> command was upgraded in <strong>March 2026</strong> to do more than scan files. It now asks questions about your workflow, suggests skills that could become slash commands, and recommends hooks for operations that should be blocked. Run <code>/init</code> once and you get a solid starting point. Then refine it by hand over the next few sessions.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!z9xw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F945fbed7-295a-491c-bce2-e77c8e87385a_1250x920.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!z9xw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F945fbed7-295a-491c-bce2-e77c8e87385a_1250x920.png 424w, https://substackcdn.com/image/fetch/$s_!z9xw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F945fbed7-295a-491c-bce2-e77c8e87385a_1250x920.png 848w, https://substackcdn.com/image/fetch/$s_!z9xw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F945fbed7-295a-491c-bce2-e77c8e87385a_1250x920.png 1272w, https://substackcdn.com/image/fetch/$s_!z9xw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F945fbed7-295a-491c-bce2-e77c8e87385a_1250x920.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!z9xw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F945fbed7-295a-491c-bce2-e77c8e87385a_1250x920.png" width="1250" height="920" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/945fbed7-295a-491c-bce2-e77c8e87385a_1250x920.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:920,&quot;width&quot;:1250,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:169061,&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://scortier.substack.com/i/196873929?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F945fbed7-295a-491c-bce2-e77c8e87385a_1250x920.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!z9xw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F945fbed7-295a-491c-bce2-e77c8e87385a_1250x920.png 424w, https://substackcdn.com/image/fetch/$s_!z9xw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F945fbed7-295a-491c-bce2-e77c8e87385a_1250x920.png 848w, https://substackcdn.com/image/fetch/$s_!z9xw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F945fbed7-295a-491c-bce2-e77c8e87385a_1250x920.png 1272w, https://substackcdn.com/image/fetch/$s_!z9xw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F945fbed7-295a-491c-bce2-e77c8e87385a_1250x920.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><h4>The Three Levels of CLAUDE.md</h4><p>Most engineers drop one file in the project root and stop there. But CLAUDE.md supports three scopes, and understanding them changes how you configure everything.</p><p>ScopeLocationShared via Git?Use CaseUser~/.claude/CLAUDE.mdNoPersonal preferences across all projectsProject./CLAUDE.mdYesTeam standards and project contextDirectory./src/api/CLAUDE.mdYesModule specific conventions (monorepos)</p><p>The load order is Global, then Project, then Directory. More specific files take priority. This means your team can set project defaults while individual developers override them locally without affecting anyone else.</p><p>For monorepos, directory scoping is a game changer. Your frontend folder gets React conventions. Your API folder gets Express conventions. Your infra folder gets Terraform conventions. None of them leak into each other.</p><h4>What Goes In (And What Stays Out)</h4><p>The biggest mistake engineers make with CLAUDE.md is writing too much. Research from <strong>HumanLayer</strong> found that frontier models can reliably follow about <strong>150 to 200 instructions</strong>. Claude Code&#8217;s own system prompt already consumes roughly <strong>50</strong> of those. That leaves you with around 100 to 150 instructions before quality starts dropping.</p><p>The golden rule: keep your CLAUDE.md under <strong>200 lines</strong>.</p><p>Here is what earns its place in the file:</p><p>Build, test, and lint commands are the single most valuable content. Claude needs to know how to verify its own work. Things like <code>npm run test</code>, <code>make build</code>, and <code>npx eslint .</code> should be right at the top.</p><p>Architecture decisions that Claude cannot infer from code alone come next. &#8220;We use a monorepo with Turborepo.&#8221; &#8220;All API endpoints must have rate limiting.&#8221; &#8220;TypeScript strict mode is on.&#8221;</p><p>Non obvious gotchas and naming conventions round it out. Import paths, error handling patterns, environment variable sources, and anything where Claude would otherwise guess wrong.</p><p>Here is what does NOT belong:</p><p>Code style rules that a linter can enforce. Never send an LLM to do a linter&#8217;s job. LLMs are expensive and slow compared to Prettier or ESLint. Instead, set up a PostToolUse hook that runs your formatter every time Claude writes a file.</p><blockquote><p>CLAUDE.md is advisory. Claude follows it about 80% of the time. Hooks are deterministic, 100%. If something must happen every single time, make it a hook.</p></blockquote><h4>A Real CLAUDE.md Template</h4><p>Here is a template that works for a typical TypeScript project. Adapt it to your stack.</p><pre><code><code># Project
Task management API built with Node.js, TypeScript, and PostgreSQL.

# Commands
- npm run dev: Start development server
- npm run build: Production build
- npm test: Run Jest test suite (use single tests, not the full suite)
- npm run lint: ESLint + Prettier check

# Architecture
- src/routes: Express route handlers
- src/services: Business logic (no direct DB calls from routes)
- src/db: Prisma schema and migrations
- src/types: Shared TypeScript interfaces

# Conventions
- Named exports only, no default exports
- Error handling: use Result types, not try/catch
- All environment variables come from .env (never hardcode)
- Tests colocated with source as *.test.ts

# When Compacting
Preserve the full list of modified files and current test status.</code></code></pre><p>That is <strong>25 lines</strong>. It covers everything Claude needs. No fluff.</p><h4>The Compaction Secret</h4><p>Long sessions accumulate context fast. When your context window fills up, Claude auto compacts and critical details can get lost. Here is the trick: add compaction instructions directly inside CLAUDE.md.</p><p>A line like &#8220;When compacting, always preserve the full list of modified files and any test commands&#8221; tells Claude what to prioritize during summarization. This one sentence can save you from losing track of 30 minutes of work.</p><p>The senior engineers running <strong>13KB+ CLAUDE.md files</strong> in production monorepos are not writing prose. They are writing targeted instructions that survive compaction and inform every session. Version control the file alongside your code. Review changes in PRs just like you would review architecture decisions.</p><h4>What This Means For Engineers</h4><ol><li><p>CLAUDE.md is not a nice to have. It is the difference between an AI pair programmer that knows your project and one that starts fresh every session. Run <code>/init</code> today, then spend 10 minutes refining the output. The return on that investment compounds across every future session.</p></li><li><p>Think in scopes. User level for your personal coding style. Project level for team standards. Directory level for monorepo modules. Getting the hierarchy right means no one on your team has to re explain conventions that should already be shared.</p></li><li><p>Less is more. Keep it under 200 lines. If Claude already does something correctly without being told, delete that instruction. If something must happen every time without exception, move it to a hook. CLAUDE.md is for guidance. Hooks are for guarantees.</p></li></ol><div><hr></div><p>Found this useful? A like goes a long way. </p><p>For more simple explanations, useful insights on coding, system design and tech trends, Subscribe To My Newsletter! &#128640;</p><p>Follow me on <a href="https://www.youtube.com/@scortier">Youtube</a> &#183; <a href="https://www.linkedin.com/in/scortier/">LinkedIn</a> &#183; <a href="https://x.com/scortierHQ">X</a> &#183; <a href="https://www.instagram.com/_scortier_/">Instagram</a> to stay updated.</p><p>See you next week with more exciting content!</p><p>Signing Off, <strong>Scortier</strong></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.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 Hello Engineer! 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><item><title><![CDATA[Claude Code Drama: 6,852 Sessions Prove Performance Collapse]]></title><description><![CDATA[6,852 sessions. 234,760 tool calls. A 73% collapse in reasoning depth. An AMD AI Director just dropped forensic evidence that Claude Opus 4.6 got quietly downgraded in March 2026. Anthropic says it's]]></description><link>https://grindengineer.substack.com/p/claude-code-drama-6852-sessions-prove</link><guid isPermaLink="false">https://grindengineer.substack.com/p/claude-code-drama-6852-sessions-prove</guid><dc:creator><![CDATA[Scortier]]></dc:creator><pubDate>Wed, 15 Apr 2026 15:13:04 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!kF3C!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F031809bc-9f24-4d5d-aab4-2826ef047179_825x463.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="https://substackcdn.com/image/fetch/$s_!kF3C!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F031809bc-9f24-4d5d-aab4-2826ef047179_825x463.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!kF3C!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F031809bc-9f24-4d5d-aab4-2826ef047179_825x463.png 424w, https://substackcdn.com/image/fetch/$s_!kF3C!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F031809bc-9f24-4d5d-aab4-2826ef047179_825x463.png 848w, https://substackcdn.com/image/fetch/$s_!kF3C!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F031809bc-9f24-4d5d-aab4-2826ef047179_825x463.png 1272w, https://substackcdn.com/image/fetch/$s_!kF3C!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F031809bc-9f24-4d5d-aab4-2826ef047179_825x463.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!kF3C!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F031809bc-9f24-4d5d-aab4-2826ef047179_825x463.png" width="825" height="463" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/031809bc-9f24-4d5d-aab4-2826ef047179_825x463.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:463,&quot;width&quot;:825,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:91845,&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://scortier.substack.com/i/194306794?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F031809bc-9f24-4d5d-aab4-2826ef047179_825x463.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!kF3C!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F031809bc-9f24-4d5d-aab4-2826ef047179_825x463.png 424w, https://substackcdn.com/image/fetch/$s_!kF3C!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F031809bc-9f24-4d5d-aab4-2826ef047179_825x463.png 848w, https://substackcdn.com/image/fetch/$s_!kF3C!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F031809bc-9f24-4d5d-aab4-2826ef047179_825x463.png 1272w, https://substackcdn.com/image/fetch/$s_!kF3C!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F031809bc-9f24-4d5d-aab4-2826ef047179_825x463.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>Welcome to <em><strong>Hello Engineer</strong></em>, your weekly guide to becoming a better software engineer! No fluff. Pure engineering insights.</p></blockquote><h3>The Smoking Gun: A Senior Engineer&#8217;s Data Autopsy</h3><p><strong>Stella Laurenzo</strong> knows how to file a bug report. The AMD Senior Director of AI dropped a <a href="https://www.reddit.com/r/singularity/comments/1sinatl/amds_senior_director_of_ai_thinks_claude_has/">GitHub issue</a> on April 2, 2026 that read less like a complaint and more like a criminal investigation. She brought telemetry from <strong>6,852 Claude Code sessions</strong>, tracked <strong>17,871 thinking blocks</strong>, and analyzed <strong>234,760 tool calls</strong> across three months of stable internal engineering work.</p><p>Her conclusion? Claude Code systematically degraded between January and March 2026.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://grindengineer.substack.com/subscribe?"><span>Subscribe now</span></a></p><p>The numbers are brutal:</p><ul><li><p>Median visible thinking length: <strong>2,200 characters in January &#8594; 600 characters in March</strong> (73% collapse)</p></li><li><p>API calls per task: <strong>Up to 80x more retries from February to March</strong></p></li><li><p>Files read before editing: <strong>6.6 files &#8594; 2.0 files</strong> (not enough to understand dependencies)</p></li><li><p>Early stopping patterns: <strong>Near zero &#8594; 10 per day</strong> after March 8</p></li></ul><blockquote><p><strong>Key insight:</strong> 600 characters is barely enough to articulate a file reading strategy, let alone plan a multi file refactor across a 50,000 line codebase.</p></blockquote><p>This is not &#8220;the model feels slower.&#8221; This is structural workflow breakdown.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!vVUz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccfeaa54-e1ea-4c55-8e24-9d6426c9c3a1_976x477.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!vVUz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccfeaa54-e1ea-4c55-8e24-9d6426c9c3a1_976x477.png 424w, https://substackcdn.com/image/fetch/$s_!vVUz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccfeaa54-e1ea-4c55-8e24-9d6426c9c3a1_976x477.png 848w, https://substackcdn.com/image/fetch/$s_!vVUz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccfeaa54-e1ea-4c55-8e24-9d6426c9c3a1_976x477.png 1272w, https://substackcdn.com/image/fetch/$s_!vVUz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccfeaa54-e1ea-4c55-8e24-9d6426c9c3a1_976x477.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!vVUz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccfeaa54-e1ea-4c55-8e24-9d6426c9c3a1_976x477.png" width="976" height="477" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ccfeaa54-e1ea-4c55-8e24-9d6426c9c3a1_976x477.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:477,&quot;width&quot;:976,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:117625,&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://scortier.substack.com/i/194306794?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccfeaa54-e1ea-4c55-8e24-9d6426c9c3a1_976x477.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!vVUz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccfeaa54-e1ea-4c55-8e24-9d6426c9c3a1_976x477.png 424w, https://substackcdn.com/image/fetch/$s_!vVUz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccfeaa54-e1ea-4c55-8e24-9d6426c9c3a1_976x477.png 848w, https://substackcdn.com/image/fetch/$s_!vVUz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccfeaa54-e1ea-4c55-8e24-9d6426c9c3a1_976x477.png 1272w, https://substackcdn.com/image/fetch/$s_!vVUz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccfeaa54-e1ea-4c55-8e24-9d6426c9c3a1_976x477.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><h3>The Viral Benchmark That Got Debunked</h3><p>While Laurenzo&#8217;s data was mounting on GitHub, a different claim went viral on X. <strong>BridgeMind</strong>, the team behind BridgeBench, posted on April 12 that Claude Opus 4.6 fell from <strong>83.3% accuracy (ranked #2)</strong> to <strong>68.3% accuracy (ranked #10)</strong> in a hallucination benchmark retest.</p><p>The post exploded. </p><p>Then <strong>Paul Calcraft</strong>, an independent AI researcher, tore it apart. The original high score? <strong>Only 6 benchmark tasks</strong>. The new retest? <strong>30 tasks</strong>. On the 6 overlapping tasks, performance barely moved: <strong>87.6% &#8594; 85.4%</strong>. The entire &#8220;67% drop&#8221; narrative collapsed under scrutiny.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!vfwJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00b1018b-7530-47cc-9484-edcd9f241067_976x583.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!vfwJ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00b1018b-7530-47cc-9484-edcd9f241067_976x583.png 424w, https://substackcdn.com/image/fetch/$s_!vfwJ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00b1018b-7530-47cc-9484-edcd9f241067_976x583.png 848w, https://substackcdn.com/image/fetch/$s_!vfwJ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00b1018b-7530-47cc-9484-edcd9f241067_976x583.png 1272w, https://substackcdn.com/image/fetch/$s_!vfwJ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00b1018b-7530-47cc-9484-edcd9f241067_976x583.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!vfwJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00b1018b-7530-47cc-9484-edcd9f241067_976x583.png" width="976" height="583" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/00b1018b-7530-47cc-9484-edcd9f241067_976x583.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:583,&quot;width&quot;:976,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:122968,&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://scortier.substack.com/i/194306794?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00b1018b-7530-47cc-9484-edcd9f241067_976x583.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!vfwJ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00b1018b-7530-47cc-9484-edcd9f241067_976x583.png 424w, https://substackcdn.com/image/fetch/$s_!vfwJ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00b1018b-7530-47cc-9484-edcd9f241067_976x583.png 848w, https://substackcdn.com/image/fetch/$s_!vfwJ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00b1018b-7530-47cc-9484-edcd9f241067_976x583.png 1272w, https://substackcdn.com/image/fetch/$s_!vfwJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00b1018b-7530-47cc-9484-edcd9f241067_976x583.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><p>The debunk did not stop the controversy. It made it worse. If the most viral benchmark claim was bad science, what else was real?</p><h3>What Anthropic Actually Changed (And Why Users Are Furious)</h3><p><strong>Boris Cherny</strong>, Claude Code lead, responded to Laurenzo&#8217;s GitHub issue with specifics. Anthropic made three deliberate product changes between February and March 2026:</p><ol><li><p><strong>Adaptive thinking by default</strong> (February 9): Claude decides reasoning depth per task instead of fixed budget</p></li><li><p><strong>Effort level dropped to &#8220;medium&#8221;</strong> (March 3): Default changed from high to effort level 85</p></li><li><p><strong>UI-only thinking redaction</strong> (February 12): Intermediate thinking hidden to reduce latency, but &#8220;does not impact thinking itself&#8221;</p></li></ol><p>The official line: these changes were meant to balance intelligence, latency, and cost.</p><p>The developer experience: broken workflows, wasted tokens, and a model that felt &#8220;dumber than Sonnet 3.5.&#8221;</p><p>Here is the gap. Cherny says you can manually type <code>/effort high</code> in Claude Code terminal to restore extended reasoning. But Pro users on Cowork and Claude Desktop <strong>cannot change the default</strong>. They are locked into medium effort with no escape hatch.</p><blockquote><p><strong>The trust issue:</strong> Anthropic knows when it changes serving parameters. Users do not. When the model suddenly starts hitting early stopping patterns and burning 80x more API calls, users have no official changelog to reference. They are left running their own benchmarks and filing GitHub issues.</p></blockquote><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!aHiE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9115b1a1-5127-4e97-a6b0-cec5c26cdc28_897x583.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!aHiE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9115b1a1-5127-4e97-a6b0-cec5c26cdc28_897x583.png 424w, https://substackcdn.com/image/fetch/$s_!aHiE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9115b1a1-5127-4e97-a6b0-cec5c26cdc28_897x583.png 848w, https://substackcdn.com/image/fetch/$s_!aHiE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9115b1a1-5127-4e97-a6b0-cec5c26cdc28_897x583.png 1272w, https://substackcdn.com/image/fetch/$s_!aHiE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9115b1a1-5127-4e97-a6b0-cec5c26cdc28_897x583.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!aHiE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9115b1a1-5127-4e97-a6b0-cec5c26cdc28_897x583.png" width="897" height="583" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9115b1a1-5127-4e97-a6b0-cec5c26cdc28_897x583.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:583,&quot;width&quot;:897,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:117758,&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://scortier.substack.com/i/194306794?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9115b1a1-5127-4e97-a6b0-cec5c26cdc28_897x583.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!aHiE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9115b1a1-5127-4e97-a6b0-cec5c26cdc28_897x583.png 424w, https://substackcdn.com/image/fetch/$s_!aHiE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9115b1a1-5127-4e97-a6b0-cec5c26cdc28_897x583.png 848w, https://substackcdn.com/image/fetch/$s_!aHiE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9115b1a1-5127-4e97-a6b0-cec5c26cdc28_897x583.png 1272w, https://substackcdn.com/image/fetch/$s_!aHiE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9115b1a1-5127-4e97-a6b0-cec5c26cdc28_897x583.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><h3>The Prompt Caching Bug That Inflated Costs 10x to 20x</h3><p>While the reasoning depth drama unfolded, a different group of developers discovered something worse. A community member reverse engineered the Claude Code binary using <strong>Ghidra and a MITM proxy</strong> and found two independent bugs that broke prompt caching.</p><p>Users reported costs inflating <strong>10x to 20x</strong> without warning. Some confirmed that downgrading to Claude Code version <strong>2.1.34</strong> made the issue disappear.</p><p><strong>Thariq Shihipar</strong>, an Anthropic engineer, responded on X: &#8220;Actively looking into this in particular.&#8221;</p><p>The timing was catastrophic. The prompt caching bug hit simultaneously with:</p><ul><li><p>Session limit cuts during peak hours (announced March 27)</p></li><li><p>End of a promotional period that had doubled usage limits</p></li><li><p>Multiple Opus 4.6 service incidents logged on the status page</p></li></ul><p>From a user perspective, it looked like Anthropic was throttling the model to save compute. From Anthropic&#8217;s perspective, they were tuning defaults and fixing infrastructure bugs.</p><p>Neither narrative is wrong. Both are happening at the same time.</p><h3>The OpenAI Memo That Added Fuel to the Fire</h3><p>On April 10, <strong>CNBC reported</strong> an internal OpenAI memo where their revenue chief claimed Anthropic made a &#8220;strategic misstep&#8221; by not securing enough compute capacity. The memo alleged Anthropic was &#8220;operating on a meaningfully smaller curve&#8221; than competitors.</p><p>Anthropic declined to comment on the claims.</p><p>The memo landed in the middle of the degradation controversy. Developers who were already suspicious about throttling now had an external data point suggesting Anthropic might be compute constrained.</p><p><strong>Shihipar</strong> publicly denied on X that Anthropic degrades models to manage demand. But the company had already announced stricter session limits during peak hours, affecting around <strong>7% of users</strong>. That established two facts:</p><ol><li><p>Anthropic faces surging demand</p></li><li><p>Anthropic is actively rationing usage during busy periods</p></li></ol><p>For many developers, that context made it easier to believe other, less visible tradeoffs might also be in play.</p><h3>What the Independent Benchmarks Actually Show</h3><p><strong>Marginlab</strong>, an independent third party organization, has been running daily <strong>SWE-Bench-Pro</strong> evaluations of Claude Code with Opus 4.6 since the degradation complaints began.</p><p>Their findings as of April 10, 2026:</p><ul><li><p>Historical baseline: <strong>56% pass rate</strong></p></li><li><p>Current daily evaluation: <strong>50% pass rate</strong> (6 percentage point drop)</p></li><li><p>Sample size: 50 test cases per day</p></li><li><p>Statistical significance: Not yet reached, but the trend is concerning</p></li></ul><p>Marginlab transparently notes their methodology: &#8220;We benchmark in Claude Code CLI with the SOTA model (currently Opus 4.6) directly, no custom harnesses.&#8221;</p><p><strong>Artificial Analysis</strong> reported that Opus 4.6 used <strong>30% to 60% more tokens</strong> than Opus 4.5 on their GDPval AA benchmark, making it the most costly model they had tested.</p><p><strong>LiveBench</strong> slightly favors Opus 4.6 over Opus 4.5 overall, which argues against a simple &#8220;the model got worse everywhere&#8221; narrative.</p><p>The pattern: Opus 4.6 is not universally degraded, but it is burning more tokens and showing degraded performance on sustained, multi step coding workflows.</p><h3>The Context Window Illusion</h3><p>One of the quieter complaints involves Opus 4.6&#8217;s advertised <strong>1 million token context window</strong>, which went generally available on March 13, 2026.</p><p>A detailed GitHub bug report found that during heavy Claude Code sessions, the model&#8217;s performance degraded well before hitting 50% of that window:</p><ul><li><p>At <strong>20% usage</strong>: Circular reasoning and forgotten decisions appeared</p></li><li><p>At <strong>40% usage</strong>: Context compression kicked in, wiping scrollback history</p></li><li><p>At <strong>48% usage</strong>: The model itself told the user it was not being effective and recommended starting a fresh session</p></li></ul><p>If the effective high quality context is roughly <strong>400,000 tokens</strong>, advertising 1 million feels misleading.</p><p>The user asked: &#8220;Should this be communicated rather than marketing the full figure?&#8221;</p><p>Anthropic has not publicly answered that question.</p><h3>What This Means For Engineers</h3><p>The Claude Code degradation saga is not just a bug report. It is a <strong>consumer rights crisis hiding in plain sight</strong>. When you pay a subscription fee for a specific AI model, do you have any right to actually receive that model&#8217;s advertised capabilities?</p><p>Here are the takeaways for engineers working with AI coding agents:</p><ol><li><p><strong>Trust the logs, not the marketing.</strong> Laurenzo&#8217;s forensic approach shows the right way to document degradation. Track session metrics, reasoning depth, API retry counts, and file read patterns over time. When something feels wrong, the data will prove it.</p></li><li><p><strong>Demand transparency on serving parameters.</strong> Adaptive thinking, effort levels, prompt caching TTLs, and context compression thresholds directly impact your workflows. These should be documented in release notes, not discovered through reverse engineering.</p></li><li><p><strong>Build escape hatches into your tooling.</strong> If your entire dev workflow depends on one AI provider, you are exposed to silent downgrades. Keep fallback models ready. Test them regularly. Know your migration path.</p></li></ol><div><hr></div><p>Found this breakdown valuable? Show some love with a like &#10084;&#65039;</p><p>For more no nonsense insights on coding, system design, and tech trends, <strong>Subscribe To My Newsletter!</strong> &#128640;</p><p>Follow me on <a href="https://www.youtube.com/@scortier">Youtube</a> &#183; <a href="https://www.linkedin.com/in/scortier/">LinkedIn</a> &#183; <a href="https://x.com/scortierHQ">X</a> &#183; <a href="https://www.instagram.com/_scortier_/">Instagram</a> to stay updated.</p><p>See you next week with more exciting content!</p><p>Signing Off, <strong>Scortier</strong></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.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 Hello Engineer! 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></p>]]></content:encoded></item><item><title><![CDATA[Claude Code Source Leak: What 512,000 Lines Revealed]]></title><description><![CDATA[One missing line in .npmignore exposed 512,000 lines of Anthropic&#8217;s most guarded codebase to the entire internet.]]></description><link>https://grindengineer.substack.com/p/anthropic-forgot-one-line-we-got</link><guid isPermaLink="false">https://grindengineer.substack.com/p/anthropic-forgot-one-line-we-got</guid><dc:creator><![CDATA[Scortier]]></dc:creator><pubDate>Wed, 08 Apr 2026 11:35:31 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Pb4n!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb9c6a8c-70b6-490d-b0e6-d79bf2c3442a_818x582.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="https://substackcdn.com/image/fetch/$s_!Pb4n!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb9c6a8c-70b6-490d-b0e6-d79bf2c3442a_818x582.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Pb4n!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb9c6a8c-70b6-490d-b0e6-d79bf2c3442a_818x582.png 424w, https://substackcdn.com/image/fetch/$s_!Pb4n!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb9c6a8c-70b6-490d-b0e6-d79bf2c3442a_818x582.png 848w, https://substackcdn.com/image/fetch/$s_!Pb4n!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb9c6a8c-70b6-490d-b0e6-d79bf2c3442a_818x582.png 1272w, https://substackcdn.com/image/fetch/$s_!Pb4n!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb9c6a8c-70b6-490d-b0e6-d79bf2c3442a_818x582.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Pb4n!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb9c6a8c-70b6-490d-b0e6-d79bf2c3442a_818x582.png" width="818" height="582" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fb9c6a8c-70b6-490d-b0e6-d79bf2c3442a_818x582.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:582,&quot;width&quot;:818,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:79514,&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://scortier.substack.com/i/193563861?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb9c6a8c-70b6-490d-b0e6-d79bf2c3442a_818x582.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Pb4n!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb9c6a8c-70b6-490d-b0e6-d79bf2c3442a_818x582.png 424w, https://substackcdn.com/image/fetch/$s_!Pb4n!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb9c6a8c-70b6-490d-b0e6-d79bf2c3442a_818x582.png 848w, https://substackcdn.com/image/fetch/$s_!Pb4n!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb9c6a8c-70b6-490d-b0e6-d79bf2c3442a_818x582.png 1272w, https://substackcdn.com/image/fetch/$s_!Pb4n!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb9c6a8c-70b6-490d-b0e6-d79bf2c3442a_818x582.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>Welcome to <em><strong>Hello Engineer</strong></em>, your weekly guide to becoming a better software engineer! No fluff. Pure engineering insights. You can also check out: <strong><a href="https://helloengineer.substack.com">Claude Code: 10 Features Every Engineer Should Know</a></strong></p></blockquote><h3>One File, One Mistake, Everything Gone</h3><p>On <strong>March 31, 2026</strong>, Anthropic shipped version <strong>2.1.88</strong> of Claude Code via npm. Tucked inside was a <code>cli.js.map</code> file, <strong>59.8 MB</strong>, that any browser could fetch directly from a public S3 bucket. A source map is a debugging artifact that translates minified production code back into readable TypeScript. Bun, the JavaScript runtime Anthropic acquired in late 2025, generates them by default. Nobody added <code>*.map</code> to <code>.npmignore</code>.</p><blockquote><p>The root cause: Bun had a known open bug (filed March 11) where source maps are served in production mode even when disabled in config. Anthropic was building on their own toolchain. The toolchain bit them.</p></blockquote><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://grindengineer.substack.com/subscribe?"><span>Subscribe now</span></a></p><p><strong>Chaofan Shou</strong> spotted it first. Within minutes the code was mirrored to GitHub. Within hours, <code>claw-code</code> hit <strong>75,000 stars</strong> and was being called the fastest-growing repo in GitHub history. Anthropic filed DMCA takedowns against direct clones. The rewrite forks stayed up.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!uBju!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2700f4b5-a976-4ba7-aa1d-b2b5208f5377_818x582.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!uBju!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2700f4b5-a976-4ba7-aa1d-b2b5208f5377_818x582.png 424w, https://substackcdn.com/image/fetch/$s_!uBju!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2700f4b5-a976-4ba7-aa1d-b2b5208f5377_818x582.png 848w, https://substackcdn.com/image/fetch/$s_!uBju!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2700f4b5-a976-4ba7-aa1d-b2b5208f5377_818x582.png 1272w, https://substackcdn.com/image/fetch/$s_!uBju!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2700f4b5-a976-4ba7-aa1d-b2b5208f5377_818x582.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!uBju!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2700f4b5-a976-4ba7-aa1d-b2b5208f5377_818x582.png" width="818" height="582" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2700f4b5-a976-4ba7-aa1d-b2b5208f5377_818x582.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:582,&quot;width&quot;:818,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:79514,&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;:false,&quot;internalRedirect&quot;:&quot;https://scortier.substack.com/i/193563861?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2700f4b5-a976-4ba7-aa1d-b2b5208f5377_818x582.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!uBju!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2700f4b5-a976-4ba7-aa1d-b2b5208f5377_818x582.png 424w, https://substackcdn.com/image/fetch/$s_!uBju!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2700f4b5-a976-4ba7-aa1d-b2b5208f5377_818x582.png 848w, https://substackcdn.com/image/fetch/$s_!uBju!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2700f4b5-a976-4ba7-aa1d-b2b5208f5377_818x582.png 1272w, https://substackcdn.com/image/fetch/$s_!uBju!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2700f4b5-a976-4ba7-aa1d-b2b5208f5377_818x582.png 1456w" sizes="100vw"></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><h3>KAIROS: The Agent That Never Sleeps</h3><p>The most significant find in the source is a fully built, unreleased autonomous agent mode hidden behind feature flags called <code>PROACTIVE</code> and <code>KAIROS</code>.</p><p>KAIROS is not reactive. Every few seconds it receives a heartbeat: &#8220;anything worth doing right now?&#8221; It decides on its own. If it acts, it can fix errors, push files, respond to messages, all without you typing a thing. It has three tools that normal Claude Code sessions never see: <strong>push notifications</strong> to your phone when the terminal is closed, <strong>file delivery</strong> for things it created unprompted, and <strong>GitHub PR subscriptions</strong> so it watches your repo for changes around the clock.</p><p>At night it runs a process the source literally calls <code>autoDream</code>. It forks a subagent with limited tool access, consolidates memory, removes contradictions, and compresses daily observations down to under <strong>200 lines and 25KB</strong>. Close your laptop Friday. Open it Monday. KAIROS has been running the whole time.</p><blockquote><p>The key architectural shift here is not capability, it is initiative. A reactive agent needs good execution. A proactive agent needs good judgment. Those are very different engineering problems.</p></blockquote><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.youtube.com/@scortierHQ&quot;,&quot;text&quot;:&quot;Youtube Channel&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://www.youtube.com/@scortierHQ"><span>Youtube Channel</span></a></p><h3>Anti-Distillation: Poisoning Competitors at Collection Time</h3><p>Distillation is how smaller AI companies build fast, cheap models: point an agent at a bigger model&#8217;s API traffic and train on what you capture. Anthropic knew this was happening to Claude Code. Their defense is genuinely clever.</p><p>The <code>ANTI_DISTILLATION_CC</code> flag makes Claude Code send <code>anti_distillation: ['fake_tools']</code> in every API request. The server silently injects <strong>decoy tool definitions</strong> into the system prompt. Any competitor training on that captured data gets poisoned schemas baked into every example.</p><p>There is a second layer via <code>CONNECTOR_TEXT</code>: the server buffers the assistant&#8217;s full reasoning between tool calls, summarizes it, signs the summary cryptographically, and returns only the summary to API traffic recorders. Even a perfect man-in-the-middle attack yields digests, not chain-of-thought.</p><p>The author of the most detailed technical breakdown estimated both mechanisms can be bypassed in about an hour with a MITM proxy. The actual protection is legal, not technical. But the design decision is worth understanding: <strong>Anthropic targeted the distillation attack surface at data collection time, not at inference time.</strong> That is the right place to intervene.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Oofh!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffde244ec-c73a-499a-b654-6447d97409cc_818x582.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Oofh!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffde244ec-c73a-499a-b654-6447d97409cc_818x582.png 424w, https://substackcdn.com/image/fetch/$s_!Oofh!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffde244ec-c73a-499a-b654-6447d97409cc_818x582.png 848w, https://substackcdn.com/image/fetch/$s_!Oofh!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffde244ec-c73a-499a-b654-6447d97409cc_818x582.png 1272w, https://substackcdn.com/image/fetch/$s_!Oofh!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffde244ec-c73a-499a-b654-6447d97409cc_818x582.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Oofh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffde244ec-c73a-499a-b654-6447d97409cc_818x582.png" width="818" height="582" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fde244ec-c73a-499a-b654-6447d97409cc_818x582.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:582,&quot;width&quot;:818,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:82823,&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://scortier.substack.com/i/193563861?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffde244ec-c73a-499a-b654-6447d97409cc_818x582.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Oofh!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffde244ec-c73a-499a-b654-6447d97409cc_818x582.png 424w, https://substackcdn.com/image/fetch/$s_!Oofh!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffde244ec-c73a-499a-b654-6447d97409cc_818x582.png 848w, https://substackcdn.com/image/fetch/$s_!Oofh!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffde244ec-c73a-499a-b654-6447d97409cc_818x582.png 1272w, https://substackcdn.com/image/fetch/$s_!Oofh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffde244ec-c73a-499a-b654-6447d97409cc_818x582.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><h3>The Memory Architecture Engineers Should Copy</h3><p>Claude Code&#8217;s memory system is not a <code>CLAUDE.md</code> file. It is a <strong>3-layer index</strong> built around a single insight: the context window is a scarce resource, so treat it like one.</p><p>Layer 1 is the <strong>Index</strong>: always loaded, just pointers, roughly 150 characters per line. Layer 2 is <strong>Topic files</strong>: loaded on demand when the index pointer says they are relevant. Layer 3 is <strong>Transcripts</strong>: never loaded into context directly, only searched with grep when needed.</p><p>The write discipline is strict: write to a topic file first, update the index second. Never dump content into the index. If a fact can be re-derived from the codebase in the time it takes to look it up, it is not stored at all.</p><p><code>autoDream</code> runs as a forked subagent with limited tool access so it cannot corrupt the main context while reorganizing. Memory is treated as a hint, never as truth. The agent verifies before acting on it.</p><p>Most open source agent frameworks load all memory into context every turn. That is expensive and noisy. Claude Code treats retrieval like a database query: cheap pointers always present, expensive content fetched only when needed.</p><h3>DRM Below JavaScript: The Bun/Zig Attestation Layer</h3><p>Here is something competitors probably discovered the hard way. API requests from Claude Code contain placeholder values that Bun&#8217;s native HTTP stack, written in <strong>Zig</strong>, overwrites with computed cryptographic hashes before transmission. These hashes prove a request came from a genuine Claude Code binary.</p><p>The reason this lives in Zig rather than JavaScript is deliberate. JavaScript can be patched, monkey-patched, or proxied at runtime. Zig compiled into the Bun binary cannot be inspected or overridden without recompiling from source. This is why tools like OpenCode faced friction beyond just legal notices: they were being blocked at the API layer too.</p><h3>Undercover Mode and the Irony Nobody Missed</h3><p><code>undercover.ts</code>, 90 lines, instructs Claude Code to strip all Anthropic internals from commit messages and PR descriptions when working on external repositories. No <code>Co-Authored-By</code> attribution. No mention of internal codenames. No reference to &#8220;Claude Code&#8221; itself. You can force it ON with an environment variable. There is no way to force it OFF.</p><p>The community noticed the irony immediately: Anthropic built a system specifically designed to prevent internal information from leaking through code contributions. Then they leaked the entire source code through a file they forgot to exclude from their npm package.</p><p></p><h3>What This Means For Engineers</h3><ol><li><p>The <code>SYSTEM_PROMPT_DYNAMIC_BOUNDARY</code> pattern from the source is something you can use today. Split your system prompt into a stable front half and a dynamic back half. Static instructions that never change between sessions should never be rebuilt from scratch on every API call. Getting this right means <a href="https://x.com/trq212/status/2024574133011673516">prompt caching actually works</a> and you stop paying to recompute the same tokens on every turn.</p></li><li><p>The 3-layer memory architecture is the most directly transferable pattern here. Context windows are not free. Designing memory as an index of pointers rather than a dump of content is a real architectural decision that affects cost and signal quality at every turn of a long-running agent.</p></li><li><p>The strategic damage from this leak exceeded the code damage. Feature flags are roadmap. <code>KAIROS</code>, <code>ULTRAPLAN</code>, model codenames like <strong>Capybara</strong>, <strong>Fennec</strong>, <strong>Numbat</strong>: these are product decisions competitors can now plan around. You can refactor code in a week. You cannot un-leak a roadmap.</p></li><li><p>Spinner Verbs for your vocabulary :)</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!89DV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F466fac8d-dc1d-4bc5-9fe0-fc0d13c3c382_1988x1170.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!89DV!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F466fac8d-dc1d-4bc5-9fe0-fc0d13c3c382_1988x1170.jpeg 424w, https://substackcdn.com/image/fetch/$s_!89DV!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F466fac8d-dc1d-4bc5-9fe0-fc0d13c3c382_1988x1170.jpeg 848w, https://substackcdn.com/image/fetch/$s_!89DV!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F466fac8d-dc1d-4bc5-9fe0-fc0d13c3c382_1988x1170.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!89DV!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F466fac8d-dc1d-4bc5-9fe0-fc0d13c3c382_1988x1170.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!89DV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F466fac8d-dc1d-4bc5-9fe0-fc0d13c3c382_1988x1170.jpeg" width="1456" height="857" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/466fac8d-dc1d-4bc5-9fe0-fc0d13c3c382_1988x1170.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:857,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Image&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="Image" title="Image" srcset="https://substackcdn.com/image/fetch/$s_!89DV!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F466fac8d-dc1d-4bc5-9fe0-fc0d13c3c382_1988x1170.jpeg 424w, https://substackcdn.com/image/fetch/$s_!89DV!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F466fac8d-dc1d-4bc5-9fe0-fc0d13c3c382_1988x1170.jpeg 848w, https://substackcdn.com/image/fetch/$s_!89DV!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F466fac8d-dc1d-4bc5-9fe0-fc0d13c3c382_1988x1170.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!89DV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F466fac8d-dc1d-4bc5-9fe0-fc0d13c3c382_1988x1170.jpeg 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></li></ol><div><hr></div><p>Loved this breakdown?</p><p>Hit a like!<br>For more simple explanations, useful insights on coding, system design and tech trends, <strong>Subscribe To My Newsletter!</strong> &#128640;</p><p>Follow me on <a href="https://www.youtube.com/@scortierHQ">Youtube</a>, <a href="https://www.linkedin.com/in/scortier/">LinkedIn</a>, <a href="https://x.com/scortierHQ">X</a> and <a href="https://www.instagram.com/its.scortier">Instagram</a> to stay updated.</p><p>See you next week with more exciting content!</p><p>Signing Off, <strong>Scortier</strong></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.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">Subscribe to Hello Engineer! No fluff. Pure engineering insights.</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></p>]]></content:encoded></item><item><title><![CDATA[10 Claude Code Features Every Engineer Should Know]]></title><description><![CDATA[From CLAUDE.md to Subagents &#8212; the features that separate 10x engineers from everyone else]]></description><link>https://grindengineer.substack.com/p/most-engineers-use-2-of-these-10</link><guid isPermaLink="false">https://grindengineer.substack.com/p/most-engineers-use-2-of-these-10</guid><dc:creator><![CDATA[Scortier]]></dc:creator><pubDate>Mon, 06 Apr 2026 13:08:37 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!YdRl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28f2128b-b65b-42d1-b398-e4f0a002f792_818x582.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="https://substackcdn.com/image/fetch/$s_!YdRl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28f2128b-b65b-42d1-b398-e4f0a002f792_818x582.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!YdRl!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28f2128b-b65b-42d1-b398-e4f0a002f792_818x582.png 424w, https://substackcdn.com/image/fetch/$s_!YdRl!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28f2128b-b65b-42d1-b398-e4f0a002f792_818x582.png 848w, https://substackcdn.com/image/fetch/$s_!YdRl!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28f2128b-b65b-42d1-b398-e4f0a002f792_818x582.png 1272w, https://substackcdn.com/image/fetch/$s_!YdRl!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28f2128b-b65b-42d1-b398-e4f0a002f792_818x582.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!YdRl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28f2128b-b65b-42d1-b398-e4f0a002f792_818x582.png" width="818" height="582" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/28f2128b-b65b-42d1-b398-e4f0a002f792_818x582.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:582,&quot;width&quot;:818,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:78948,&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://scortier.substack.com/i/193347948?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28f2128b-b65b-42d1-b398-e4f0a002f792_818x582.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!YdRl!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28f2128b-b65b-42d1-b398-e4f0a002f792_818x582.png 424w, https://substackcdn.com/image/fetch/$s_!YdRl!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28f2128b-b65b-42d1-b398-e4f0a002f792_818x582.png 848w, https://substackcdn.com/image/fetch/$s_!YdRl!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28f2128b-b65b-42d1-b398-e4f0a002f792_818x582.png 1272w, https://substackcdn.com/image/fetch/$s_!YdRl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28f2128b-b65b-42d1-b398-e4f0a002f792_818x582.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><strong>41% of all code written in 2026 is now AI-generated or AI-assisted.</strong></p><p>And if you are not using Claude Code, you are not just slower. You are playing a completely different game.</p><blockquote><p>Welcome to <em><strong>Hello Engineer</strong></em>, your weekly guide to becoming a better software engineer! No fluff. Pure engineering insights. You can also check out: <strong><a href="https://scortier.substack.com">Hello Engineer Archive on Substack</a></strong></p></blockquote><h3>Why Claude Code Is Different</h3><p>Most AI coding tools are glorified autocomplete. Claude Code is something else. It is a terminal-native agent that reads your codebase, edits files, runs commands, manages git, and coordinates other AI agents. All from your terminal. All through natural language.</p><p>It started as an internal tool at Anthropic. A command-line experiment that showed what music an engineer was listening to. Then someone gave it filesystem access. Within days it had spread across the company. Today it generates over <strong>$1 billion</strong> in annualized run-rate and powers the workflows of engineers at Google, Stripe, and Anthropic itself.</p><p>By mid-2025, Claude Code was processing <strong>195 million lines of code weekly</strong> across <strong>115,000 developers</strong>.</p><p>Here are the <strong>10 features</strong> that separate engineers who get 10x leverage from those who just scratch the surface.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://grindengineer.substack.com/subscribe?"><span>Subscribe now</span></a></p><h3>Feature 1: CLAUDE.md &#8212; The Project Brain</h3><p>This is the single most important file in your entire Claude Code setup. It is Claude&#8217;s &#8220;constitution&#8221; for your project. Drop it in the root of your repo and Claude reads it on every session. No re-explaining. No context re-loading.</p><p>The most senior Claude Code users maintain their CLAUDE.md with near-religious discipline. One staff engineer&#8217;s monorepo CLAUDE.md sits at <strong>13KB</strong> and is strictly version-controlled alongside the codebase itself.</p><p>Put your architecture decisions, naming conventions, testing commands, and environment constraints in here. The ROI is immediate. Every session starts informed.</p><blockquote><p>Think of CLAUDE.md as onboarding documentation that never gets stale because the AI reads it every single time.</p></blockquote><div><hr></div><h3>Feature 2: Slash Commands &#8212; Repeatable Workflows</h3><p>Slash commands are stored as markdown files in <code>.claude/commands/</code> for project-specific use or in <code>~/.claude/commands/</code> for personal commands across all your projects. </p><p>Type <code>/optimize</code> and Claude knows exactly what to do. No re-prompting. No re-explaining your preferences. You can build commands that run git diffs before commits, trigger security audits, generate API docs, or scaffold components. All deterministic. All yours.</p><p>A compound slash command looks like this:</p><pre><code><code>--- allowed-tools: Read, Grep, Bash(git diff:*)
description: Comprehensive code review ---
Review for: code quality, security, performance, test coverage</code></code></pre><p>Slash commands can also orchestrate subagents and skills into pipelines. Research, then codebase scan, then doc generation. All from a single <code>/</code> trigger. </p><div><hr></div><h3>Feature 3: Skills &#8212; Autonomous Task Agents</h3><p>Skills go further than slash commands. They are directory-based bundles with a <code>SKILL.md</code> descriptor plus any supporting scripts and templates. The key difference: Claude decides when to invoke them.</p><p>Claude reviews your available skill descriptions when you assign any task. If a skill&#8217;s description matches the task context, Claude loads the full instructions and applies them automatically. </p><p>You can build skills for onboarding new services, writing database migrations, generating test plans, or producing architecture docs. Package them once. Reuse them across every project. Share them with your team.</p><div><hr></div><h3>Feature 4: Subagents &#8212; Isolated Context Windows</h3><p>This is where serious context management begins. Every token your main session accumulates eats into your reasoning budget. Subagents solve this.</p><p>Subagents are specialized AI assistants that run in their own context window with a custom system prompt, specific tool access, and independent permissions. When Claude encounters a matching task, it delegates there and gets back only the results. </p><p>You can define a security reviewer agent, a database expert agent, a content QA agent. Each gets focused context. Your main session stays clean. Build a custom subagent like this:</p><pre><code><code># .claude/agents/security-reviewer.md
---
name: security-reviewer
description: "Reviews code for security vulnerabilities"
tools: Read, Grep, Glob, Bash
---
You are a senior security engineer. Review for injection, auth flaws, secrets in code.</code></code></pre><div><hr></div><h3>Feature 5: Hooks &#8212; Lifecycle Automation</h3><p>Hooks are shell commands that fire at specific Claude Code lifecycle events. <code>PreToolUse</code>. <code>PostToolUse</code>. <code>SessionStart</code>. <code>SessionEnd</code>. They are your deterministic guardrails around an otherwise probabilistic system.</p><p>You configure hooks directly in <code>~/.claude/settings.json</code>. A desktop notification hook fires when Claude needs your attention. A formatter hook runs <code>black</code> on every Python file Claude writes. A cleanup hook deletes temp files when you <code>/clear</code>. </p><p>One pattern that pays off immediately: run your linter and type checker as a <code>PostToolUse</code> hook on every file write. Every file Claude generates is automatically validated before it enters your review queue.</p><blockquote><p>Hooks make sure AI-generated code follows your team&#8217;s quality bar every single time, not just when you remember to check.</p></blockquote><div><hr></div><h3>Feature 6: MCP Servers &#8212; Connecting the Outside World</h3><p>The Model Context Protocol is the integration layer that turns Claude Code from a local tool into a platform. Connect an MCP server and its tools appear inside your Claude session as first-class capabilities.</p><p>Connect an MCP server and its tools appear as slash commands in the terminal. GitHub. Databases. APIs. Playwright for browser automation. The architecture is universal: one protocol, any tool. </p><p>The GitHub MCP integration is the one to set up first. Comment <code>@claude review this PR</code> on a pull request and Claude scans the diff for bugs, style violations, and security issues. No context switching. No copy-paste.</p><div><hr></div><h3>Feature 7: Headless Mode &#8212; Scriptable AI</h3><p>The <code>-p</code> flag transforms Claude Code from a conversational tool into a scriptable automation engine. Pass a prompt. Get output. Wire it into anything.</p><p>Headless mode enables entire workflows without a human in the loop. Fix all linting errors across a directory. Generate API documentation for every endpoint file. Review the latest commit for security issues. All as one-liners.</p><pre><code><code>cat build-error.txt | claude -p 'explain the root cause' &gt; output.txt
claude -p "Fix all ESLint errors in utils/" --output-format json</code></code></pre><p>Pipe data in. Get structured JSON out. Wire it into build scripts, pre-commit hooks, or your deployment pipeline.</p><div><hr></div><h3>Feature 8: GitHub Actions Integration &#8212; AI in Your CI</h3><p>Claude Code reached general availability with GitHub Actions integration in May 2025. You can now trigger Claude directly inside CI jobs, generate tests for every commit, and automate PR-level code review.</p><p>The setup involves one GitHub Action, one secret, and a CLAUDE.md that gives Claude the context of your project. After that, Claude runs as a team member in every pull request.</p><pre><code><code>- name: Generate tests
  run: claude -p "Create Jest tests for last commit's changes"</code></code></pre><p>When you combine headless mode, hooks, and GitHub Actions, teams automate first-pass code review on every pull request without a senior engineer manually checking every line. </p><div><hr></div><h3>Feature 9: Extended Thinking &#8212; Deep Reasoning Mode</h3><p>Extended thinking lets Claude reason through hard problems before generating code. It is not about typing &#8220;think harder.&#8221; It is a mode toggle that allocates additional reasoning tokens before any response.</p><p>Extended thinking is enabled by default in Claude Code. It lets Claude reason through complex problems before writing code. Phrases like &#8220;think harder&#8221; in your prompt do not allocate additional tokens. Use the toggle instead. </p><p>Use it before tackling algorithm design, complex refactoring, or anything where getting it right the first time saves more time than iterating. Reserve it for high-stakes decisions. The token cost is real. The quality jump is also real.</p><div><hr></div><h3>Feature 10: Session Memory and /compact &#8212; Preserving Your Context</h3><p>Long sessions accumulate context fast. When your context window fills up, Claude starts compacting and important details get lost. The <code>/compact</code> command forces a structured summarization before that happens.</p><p>Experienced engineers use <code>claude --resume</code> frequently, not just to restart sessions but to revisit historical decisions. They run meta-analysis scripts over <code>~/.claude/projects/</code> to find common error patterns and feed them back into CLAUDE.md improvements. </p><p>Think of <code>/compact</code> as committing your work before your scratch space runs out. Do it proactively after each major task, not reactively when things break.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!hh9Q!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a09a062-2420-4f54-bd6b-b01b84d4cd41_818x582.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!hh9Q!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a09a062-2420-4f54-bd6b-b01b84d4cd41_818x582.png 424w, https://substackcdn.com/image/fetch/$s_!hh9Q!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a09a062-2420-4f54-bd6b-b01b84d4cd41_818x582.png 848w, https://substackcdn.com/image/fetch/$s_!hh9Q!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a09a062-2420-4f54-bd6b-b01b84d4cd41_818x582.png 1272w, https://substackcdn.com/image/fetch/$s_!hh9Q!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a09a062-2420-4f54-bd6b-b01b84d4cd41_818x582.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!hh9Q!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a09a062-2420-4f54-bd6b-b01b84d4cd41_818x582.png" width="818" height="582" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0a09a062-2420-4f54-bd6b-b01b84d4cd41_818x582.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:582,&quot;width&quot;:818,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:78948,&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://scortier.substack.com/i/193347948?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a09a062-2420-4f54-bd6b-b01b84d4cd41_818x582.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!hh9Q!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a09a062-2420-4f54-bd6b-b01b84d4cd41_818x582.png 424w, https://substackcdn.com/image/fetch/$s_!hh9Q!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a09a062-2420-4f54-bd6b-b01b84d4cd41_818x582.png 848w, https://substackcdn.com/image/fetch/$s_!hh9Q!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a09a062-2420-4f54-bd6b-b01b84d4cd41_818x582.png 1272w, https://substackcdn.com/image/fetch/$s_!hh9Q!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a09a062-2420-4f54-bd6b-b01b84d4cd41_818x582.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><h3>What This Means For Engineers</h3><ol><li><p>The engineers getting the most out of Claude Code are not the ones using the most features. They are the ones who built a coherent system. CLAUDE.md gives Claude memory. Hooks give it discipline. Subagents give it scale. Each feature compounds on the others.</p></li><li><p>The gap between basic Claude Code usage and optimized usage is not incremental. At Effloow, a fully AI-powered content company running <strong>14 agents</strong> through Claude Code, the difference between basic and optimized usage &#8220;changes what is possible.&#8221;. That is not marketing language. It is the engineering reality.</p></li><li><p>Context management is the real skill. Every advanced technique in Claude Code exists to keep your context clean, focused, and efficient. Subagents isolate exploration. Commands encode workflows. Hooks enforce quality. Get your context strategy right and everything else accelerates.</p></li></ol><div><hr></div><p>Loved this breakdown?</p><p>Hit a like &#10084;&#65039;<br>For more simple explanations, useful insights on coding, system design and tech trends, <strong>Subscribe To My Newsletter!</strong> &#128640;</p><p>Follow me on <a href="https://www.youtube.com/@scortierHQ">Youtube</a>, <a href="https://www.linkedin.com/in/scortier/">LinkedIn</a>, <a href="https://x.com/scortierHQ">X</a> and <a href="https://www.instagram.com/its.scortier">Instagram</a> to stay updated.</p><p>See you next week with more exciting content!</p><p>Signing Off, <strong>Scortier</strong></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.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 Hello Engineer! 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></p>]]></content:encoded></item><item><title><![CDATA[He Built a $1.8 Billion Company Alone with AI.]]></title><description><![CDATA[A breakdown of the AI stack behind Medvi and what it means for how we build things.]]></description><link>https://grindengineer.substack.com/p/how-one-man-built-a-18-billion-company</link><guid isPermaLink="false">https://grindengineer.substack.com/p/how-one-man-built-a-18-billion-company</guid><dc:creator><![CDATA[Scortier]]></dc:creator><pubDate>Fri, 03 Apr 2026 12:24:04 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!g70b!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec54d26d-3b07-4eac-bae4-20e35d180f06_916x736.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote><p>Welcome to <em><strong>Hello Engineer</strong></em>, your weekly guide to becoming a better software engineer! No fluff. Pure engineering insights.</p></blockquote><p>Matthew Gallagher is not a startup founder in the traditional sense.</p><p>No VC money. No 50 person team. No office. Just a house in Los Angeles, a dozen AI tools, $20,000 and two months of relentless building.</p><p>The result? <strong>Medvi</strong>, a telehealth company that did <strong>$401 million in revenue in its first full year</strong> and is on track for <strong>$1.8 billion</strong> this year. With two employees: Matthew, and his younger brother Elliot.</p><p>This is not a fluke. This is the blueprint for a new class of company. As engineers, we need to understand exactly how it was built.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://grindengineer.substack.com/subscribe?"><span>Subscribe now</span></a></p><h3>The Stack: What He Actually Used</h3><p>Here is the part most articles gloss over. Let us go layer by layer.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!g70b!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec54d26d-3b07-4eac-bae4-20e35d180f06_916x736.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!g70b!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec54d26d-3b07-4eac-bae4-20e35d180f06_916x736.png 424w, https://substackcdn.com/image/fetch/$s_!g70b!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec54d26d-3b07-4eac-bae4-20e35d180f06_916x736.png 848w, https://substackcdn.com/image/fetch/$s_!g70b!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec54d26d-3b07-4eac-bae4-20e35d180f06_916x736.png 1272w, https://substackcdn.com/image/fetch/$s_!g70b!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec54d26d-3b07-4eac-bae4-20e35d180f06_916x736.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!g70b!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec54d26d-3b07-4eac-bae4-20e35d180f06_916x736.png" width="916" height="736" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ec54d26d-3b07-4eac-bae4-20e35d180f06_916x736.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:736,&quot;width&quot;:916,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:107550,&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://scortier.substack.com/i/193063301?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec54d26d-3b07-4eac-bae4-20e35d180f06_916x736.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!g70b!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec54d26d-3b07-4eac-bae4-20e35d180f06_916x736.png 424w, https://substackcdn.com/image/fetch/$s_!g70b!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec54d26d-3b07-4eac-bae4-20e35d180f06_916x736.png 848w, https://substackcdn.com/image/fetch/$s_!g70b!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec54d26d-3b07-4eac-bae4-20e35d180f06_916x736.png 1272w, https://substackcdn.com/image/fetch/$s_!g70b!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec54d26d-3b07-4eac-bae4-20e35d180f06_916x736.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><h4>Layer 1: AI Tools (~$20,000 total spend)</h4><p>Matthew did not hire a team. He assembled a toolset.</p><p><strong>ChatGPT, Claude and Grok</strong> handled writing the code, website copy and building AI agents that glued his software systems together. <strong>Midjourney and Runway</strong> generated images and videos for ads and the website. <strong>ElevenLabs</strong> powered AI voice tools to communicate with customers.</p><p>That is it. Code, content, visuals, voice &#8212; all AI generated.</p><h4>Layer 2: Telehealth Platforms (the outsourced backend)</h4><p>Matthew did not build the hard stuff. He plugged into two platforms that already existed.</p><p><strong>CareValidate</strong> provided the doctor network, prescription compliance and a telehealth in a box infrastructure. <strong>OpenLoop Health</strong> handled pharmacy fulfillment, shipping and patient management.</p><p>His insight was simple: do not build what has already been built. Use it as an API.</p><h4>Layer 3: The Product (Medvi)</h4><p>On top of this stack, he built a clean consumer brand selling GLP1 weight loss drugs at <strong>$179 per month</strong>, cheaper than competitors, smoother checkout and no doctor&#8217;s office visit required.</p><p>The market was ready. He just got there faster.</p><div><hr></div><h3>The Engineering Decisions That Mattered</h3><p>A few things stand out from a pure systems thinking perspective.</p><blockquote><p><strong>He treated every dependency as a service, not a hire.</strong></p></blockquote><p>Doctors? A service via CareValidate. Shipping? A service via OpenLoop. Legal? LegalZoom first, then a law firm. Accounting? AI tools first, then an accounting firm. Marketing? Media agencies on contract.</p><p>His mental model was essentially microservices applied to a whole business. Every function was a composable, replaceable module.</p><blockquote><p><strong>He built AI agents before it was widely adopted.</strong></p></blockquote><p>When his disparate software systems could not talk to each other, he did not hire an integration engineer. He built custom AI agents to bridge the gaps. In 2024, that was still niche thinking.</p><blockquote><p><strong>He felt the cost of over hiring viscerally.</strong></p></blockquote><p>At his previous startup Watch Gang, he had 60 employees and never turned a profit. He described it clearly: more people meant higher costs and slower decisions. With Medvi, every hire had to justify itself against that experience.</p><div><hr></div><h3>The One Failure That Explains Everything</h3><p>In March 2025, Matthew made a minor website change and went hiking. His media agency called. Zero orders for the last hour. He had broken something in production with no one to fix it.</p><p>He sprinted home.</p><p>That single incident, losing around 200 customers in one hour, is a forcing function most founders never face so cleanly. No on call rotation. No SRE team. No incident management runbook. Just him, running.</p><p>His fix? <strong>He hired two engineers on contract.</strong> Not full time. Contract. Still avoiding headcount.</p><div><hr></div><h3>What This Means for Engineers</h3><p>This story is not about replacing engineers. It is about what one determined engineer can do when they stop waiting for permission, budget or a team.</p><p>Three takeaways worth sitting with.</p><p><strong>1. The leverage point has shifted.</strong> The bottleneck used to be execution capacity. You needed people to build things. Now the bottleneck is judgment &#8212; knowing what to build, which tools to assemble and when to stop. That is a very different skill set from what most CS curriculums prepare you for.</p><p><strong>2. Outsource the solved problems. It is a real architecture principle.</strong> Matthew did not reinvent prescription fulfillment. He plugged into CareValidate. As engineers, we spend a lot of time building infrastructure that already exists. The better question is always: what layer is actually novel here?</p><p><strong>3. A one person company worth $1 billion was Sam Altman&#8217;s 2024 prediction. It happened in 9 months.</strong> The compression of time between prediction and reality in AI is accelerating. Whatever you think is 3 years away is probably 6 months away.</p><div><hr></div><h3>The Lonely Part Nobody Talks About</h3><p>Matthew admitted he is considering hiring more people mostly because <strong>he is lonely</strong>.</p><p>There is something very human in that. Maximum efficiency and isolation often come bundled together. He created an AI clone of his own voice to handle personal scheduling calls. He works basically every waking hour.</p><p>He also donated $1 million to a foundation, supports LA cat rescue organisations and is emotionally moved by the financial security he now has, given a childhood spent in motels and cars.</p><p>The technology made the company possible. The rest of it is still just a person trying to figure out what to do with what they have built.</p><div><hr></div><p>Loved this breakdown? </p><p>Hit a like &#10084;&#65039; <br>For more simple explanations, useful insights on coding, system design and tech trends, <strong>Subscribe To My Newsletter!</strong> &#128640;</p><p>Follow me on <a href="https://www.youtube.com/@scortierHQ">Youtube</a>, <a href="https://www.linkedin.com/in/scortier/">LinkedIn</a>, <a href="https://x.com/scortierHQ">X</a> and <a href="https://www.instagram.com/its.scortier">Instagram</a> to stay updated.</p><p>See you next week with more exciting content!</p><p>Signing Off, <strong>Scortier</strong></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.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 Hello Engineer! 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></p>]]></content:encoded></item><item><title><![CDATA[How OpenClaw Works Behind the Scenes]]></title><description><![CDATA[A simple mental model of the Gateway, plugins, tools, and memory]]></description><link>https://grindengineer.substack.com/p/how-openclaw-works-behind-the-scenes</link><guid isPermaLink="false">https://grindengineer.substack.com/p/how-openclaw-works-behind-the-scenes</guid><dc:creator><![CDATA[Scortier]]></dc:creator><pubDate>Fri, 06 Mar 2026 06:01:45 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!4LgG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd160e82-404c-4876-87cc-7321b29c01c4_545x307.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="https://substackcdn.com/image/fetch/$s_!4LgG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd160e82-404c-4876-87cc-7321b29c01c4_545x307.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4LgG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd160e82-404c-4876-87cc-7321b29c01c4_545x307.webp 424w, https://substackcdn.com/image/fetch/$s_!4LgG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd160e82-404c-4876-87cc-7321b29c01c4_545x307.webp 848w, https://substackcdn.com/image/fetch/$s_!4LgG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd160e82-404c-4876-87cc-7321b29c01c4_545x307.webp 1272w, https://substackcdn.com/image/fetch/$s_!4LgG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd160e82-404c-4876-87cc-7321b29c01c4_545x307.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4LgG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd160e82-404c-4876-87cc-7321b29c01c4_545x307.webp" width="545" height="307" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dd160e82-404c-4876-87cc-7321b29c01c4_545x307.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:307,&quot;width&quot;:545,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:6520,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/webp&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://scortier.substack.com/i/188815347?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd160e82-404c-4876-87cc-7321b29c01c4_545x307.webp&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!4LgG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd160e82-404c-4876-87cc-7321b29c01c4_545x307.webp 424w, https://substackcdn.com/image/fetch/$s_!4LgG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd160e82-404c-4876-87cc-7321b29c01c4_545x307.webp 848w, https://substackcdn.com/image/fetch/$s_!4LgG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd160e82-404c-4876-87cc-7321b29c01c4_545x307.webp 1272w, https://substackcdn.com/image/fetch/$s_!4LgG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd160e82-404c-4876-87cc-7321b29c01c4_545x307.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><h3>TLDR;</h3><p>OpenClaw is a local Node.js service that stays running on your machine. Messages from Telegram or Slack go through a channel plugin into the Gateway, which routes them to an AI agent. The agent can call tools like GitHub, files, and shell commands, and the Gateway can pause risky actions for your approval in the Control UI. Conversations are saved on disk and compacted when they get long, while older context is recalled using a local memory index with semantic search. That is why it can both automate tasks and continue work from days ago without you repeating everything.</p><div><hr></div><p>If you have used AI tools that feel helpful in the moment but forget everything the next day, OpenClaw feels like a different category. It runs locally as a server, stays on, connects to your chat apps, and can resume work even after a gap of a few days. Once you know what parts are doing what, it becomes much easier to decide what to enable and what permissions to allow.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://grindengineer.substack.com/subscribe?"><span>Subscribe now</span></a></p><h2>What OpenClaw ?</h2><p>OpenClaw is a Node.js service that keeps running on your machine. When you start the gateway command, you are launching an HTTP and WebSocket server that listens on port 18789 by default. This gateway is basically the hub. Messages come in from Telegram or Slack, the agent processes them with tool access, and the gateway sends replies back out. The main difference from using an AI in a browser is that this thing does not disappear when you close a tab. It can keep conversations, run scheduled tasks, and even notify you when something needs attention.</p><p>Put diagram here Request flow from chat app to gateway to agent to tools and back</p><h2>How it knows to check GitHub</h2><p>It is not guessing. GitHub access is provided through a plugin and a skill. When you ask to check pull requests, the agent sees that GitHub is an available tool, calls it, and then turns the results into a readable summary. The reason it feels fast is because the gateway is already running and the integrations are already connected, so it is not starting from zero each time.</p><p>A simple way to think about the flow is this</p><ol><li><p>A message arrives from Telegram or Slack</p></li><li><p>The channel plugin translates it into OpenClaw&#8217;s internal format</p></li><li><p>The gateway routes it to the agent</p></li><li><p>The agent calls tools if needed such as GitHub or shell</p></li><li><p>The gateway sends the final response back to the channel</p></li></ol><h2>The Memory Part.</h2><p>When people hear persistent conversations, they assume the entire chat lives inside the model forever. That is not what is happening.</p><p>OpenClaw stores conversations on disk as JSONL files under a transcripts folder. For each new reply, it loads only the recent relevant part of the thread into the model context. If the thread becomes too large, it compacts it by summarizing older parts so the model does not have to carry a massive history every time.</p><p>Long term recall works differently. Old transcripts get indexed into a local database that supports vector search. Before answering, the agent can search that index and pull back the most relevant bits from previous sessions. That is how it can resume a bug investigation from five days ago without you re explaining the whole story.</p><p>Put diagram here Short term context versus long term recall with search</p><h2>What starts up when you run the gateway</h2><p>When the gateway boots, it reads your config file, loads plugins, and starts listening for connections. It also brings up the control UI so you can watch what the agent is doing and approve sensitive actions. In the background, it can start schedulers for timed automations, heartbeat style check ins, and a memory indexer that keeps new information searchable.</p><h2>The Architecture.</h2><p>You can understand OpenClaw as five layers working together</p><ul><li><p><strong>Channel layer</strong> connects Telegram Slack WhatsApp and friends</p></li><li><p><strong>Gateway layer</strong> routes messages and controls approvals</p></li><li><p><strong>Plugin layer</strong> adds integrations tools and background services</p></li><li><p><strong>Agent layer</strong> calls the model and decides when to use tools</p></li><li><p><strong>Memory layer</strong> stores conversations and retrieves older context when needed</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!JUbS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa708204a-940b-47f9-b6cc-b60ffb1b3551_2600x2377.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JUbS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa708204a-940b-47f9-b6cc-b60ffb1b3551_2600x2377.png 424w, https://substackcdn.com/image/fetch/$s_!JUbS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa708204a-940b-47f9-b6cc-b60ffb1b3551_2600x2377.png 848w, https://substackcdn.com/image/fetch/$s_!JUbS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa708204a-940b-47f9-b6cc-b60ffb1b3551_2600x2377.png 1272w, https://substackcdn.com/image/fetch/$s_!JUbS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa708204a-940b-47f9-b6cc-b60ffb1b3551_2600x2377.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JUbS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa708204a-940b-47f9-b6cc-b60ffb1b3551_2600x2377.png" width="1456" height="1331" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a708204a-940b-47f9-b6cc-b60ffb1b3551_2600x2377.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1331,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:250104,&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://scortier.substack.com/i/188815347?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa708204a-940b-47f9-b6cc-b60ffb1b3551_2600x2377.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!JUbS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa708204a-940b-47f9-b6cc-b60ffb1b3551_2600x2377.png 424w, https://substackcdn.com/image/fetch/$s_!JUbS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa708204a-940b-47f9-b6cc-b60ffb1b3551_2600x2377.png 848w, https://substackcdn.com/image/fetch/$s_!JUbS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa708204a-940b-47f9-b6cc-b60ffb1b3551_2600x2377.png 1272w, https://substackcdn.com/image/fetch/$s_!JUbS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa708204a-940b-47f9-b6cc-b60ffb1b3551_2600x2377.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>Why this matters for real use</h2><p>Once you see that OpenClaw is basically a local automation server with an AI agent in the middle, the security questions become clearer. You can choose what plugins to enable, what tools should require approval, and what information should be stored long term. That is the difference between a toy assistant and something you can actually trust on your own machine.</p><div><hr></div><p>Loved this deep dive? Hit a like &#10084;&#65039;<br>For more simple explanations, useful insights on coding, system design, and tech trends, <strong>Subscribe To My Newsletter! </strong>&#128640;</p><p>If you have any questions or suggestions, leave a comment.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.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 Hello Engineer! 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></p><p>Follow me on <a href="https://www.linkedin.com/in/scortier/">LinkedIn</a>, <a href="https://x.com/scortierHQ">X</a> and <a href="https://www.instagram.com/_scortier_/">Instagram</a> to stay updated.</p><p>I hope you have a lovely day!</p><p>See you next week with more exciting content!</p><p>Signing Off,<br>Scortier</p>]]></content:encoded></item><item><title><![CDATA[10K Subscribers in 6 Months - A Personal Win]]></title><description><![CDATA[We crossed 10,000 subscribers on YouTube in just six months &#128640;]]></description><link>https://grindengineer.substack.com/p/10k-subscribers-in-6-months-a-personal</link><guid isPermaLink="false">https://grindengineer.substack.com/p/10k-subscribers-in-6-months-a-personal</guid><dc:creator><![CDATA[Scortier]]></dc:creator><pubDate>Mon, 29 Dec 2025 15:56:21 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!9dC5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4844945a-1961-4471-b701-466836bcf4a4_1170x1535.jpeg" 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="https://substackcdn.com/image/fetch/$s_!9dC5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4844945a-1961-4471-b701-466836bcf4a4_1170x1535.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9dC5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4844945a-1961-4471-b701-466836bcf4a4_1170x1535.jpeg 424w, https://substackcdn.com/image/fetch/$s_!9dC5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4844945a-1961-4471-b701-466836bcf4a4_1170x1535.jpeg 848w, https://substackcdn.com/image/fetch/$s_!9dC5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4844945a-1961-4471-b701-466836bcf4a4_1170x1535.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!9dC5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4844945a-1961-4471-b701-466836bcf4a4_1170x1535.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9dC5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4844945a-1961-4471-b701-466836bcf4a4_1170x1535.jpeg" width="1170" height="1535" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4844945a-1961-4471-b701-466836bcf4a4_1170x1535.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1535,&quot;width&quot;:1170,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:612770,&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;:&quot;https://scortier.substack.com/i/182869463?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4844945a-1961-4471-b701-466836bcf4a4_1170x1535.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!9dC5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4844945a-1961-4471-b701-466836bcf4a4_1170x1535.jpeg 424w, https://substackcdn.com/image/fetch/$s_!9dC5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4844945a-1961-4471-b701-466836bcf4a4_1170x1535.jpeg 848w, https://substackcdn.com/image/fetch/$s_!9dC5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4844945a-1961-4471-b701-466836bcf4a4_1170x1535.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!9dC5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4844945a-1961-4471-b701-466836bcf4a4_1170x1535.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></p><p>For some, this number might feel small.<br>For me, it&#8217;s deeply <strong>personal</strong>.</p><p>Not because of money.<br>Not to prove anything to anyone.</p><p>This is something I wanted to do for years, but kept holding myself back because of procrastination, overthinking, fear of judgment, and that constant voice asking, <em>&#8220;What will people think?&#8221;</em></p><p>The idea of starting a YouTube channel first came to me in <strong>2021</strong>, when I cracked my internship at Gojek.<br>Then time passed.<br>I cracked multiple companies, joined Microsoft, and still&#8230; I didn&#8217;t start.</p><p>I remember the first time I posted content on LinkedIn.<br>Someone criticized me on day one.</p><p>It hit harder than I expected.</p><p>From there, the doubts grew louder:<br>What will people think?<br>What will my friends say?<br>Will people judge me?</p><p>Another fear quietly followed me. I never wanted anyone to say my content worked <em>because of where I work</em>. I wanted it to stand on its own.</p><p>Because of all this overthinking, I wasted <strong>four years</strong> without posting anything.</p><p>After my recent switch, something finally clicked.</p><p>I had already wasted enough time.</p><p>So I decided to stop caring about opinions and start doing what I genuinely enjoy. I made a conscious decision not to leverage my company name. Whatever happens should be because of the <strong>content</strong>, not a tag.</p><p>I started posting:</p><ul><li><p>Raw interview experiences</p></li><li><p>A system design series</p></li><li><p>And soon podcasts and more</p></li></ul><p>And to my surprise, people really loved it.</p><p>I could see it in the data, average watch time, CTR, likes vs dislikes. But more importantly, I could feel it.</p><p>I received countless personal messages from people saying the videos helped them. A few even stopped me randomly on the street to share kind words.</p><p>That feeling of doing something meaningful - is hard to describe.</p><p>This is just the beginning, but the journey has already taught me a lot:</p><ul><li><p>You need thick skin. Negative opinions will come anytime, anywhere.</p></li><li><p>Confidence grows in ways you don&#8217;t expect.</p></li><li><p>Data never lies.</p></li><li><p>And most importantly, <strong>I loved every part of the process, from scripting to shooting to editing. It never felt like a burden.</strong></p></li></ul><p>If you&#8217;re holding back because you&#8217;re worried about what others will say, remember this:</p><p><strong>People who are ahead of you will never pull you down.<br>Those who want to do it but haven&#8217;t started often will.</strong></p><p>This <strong>10K milestone</strong> is a huge win for me this year.</p><p>Thank you to everyone who supported &#10084;&#65039;<br>And if you haven&#8217;t subscribed yet, you know what to do &#128521; : <a href="https://www.youtube.com/@scortierHQ">https://www.youtube.com/@scortierHQ</a></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.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 Hello Engineer! 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><div><hr></div><blockquote><p><em>Want to crack your next interview?<br>Get extra 10% OFF (+77% Off) on Educative.io System Design courses here : </em></p><p>https://www.educative.io/</p></blockquote><p>Follow me on <a href="https://www.linkedin.com/in/scortier/">LinkedIn</a>, <a href="https://x.com/scortierHQ">X</a> and <a href="https://www.instagram.com/_scortier_/">Instagram</a> to stay updated.</p><p>See you next week with more exciting content!</p><p>Signing Off,<br>Scortier</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.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 Hello Engineer! 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><item><title><![CDATA[Cloudflare Outage on November'25 : What Actually Happened?]]></title><description><![CDATA[How a tiny configuration mistake rippled into a global Internet slowdown.]]></description><link>https://grindengineer.substack.com/p/cloudflare-outage-on-november25-what</link><guid isPermaLink="false">https://grindengineer.substack.com/p/cloudflare-outage-on-november25-what</guid><dc:creator><![CDATA[Scortier]]></dc:creator><pubDate>Thu, 20 Nov 2025 12:31:08 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!_SOw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86644e02-aaa3-44fa-867e-1bdaac696887_1258x854.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="https://substackcdn.com/image/fetch/$s_!_SOw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86644e02-aaa3-44fa-867e-1bdaac696887_1258x854.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_SOw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86644e02-aaa3-44fa-867e-1bdaac696887_1258x854.png 424w, https://substackcdn.com/image/fetch/$s_!_SOw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86644e02-aaa3-44fa-867e-1bdaac696887_1258x854.png 848w, https://substackcdn.com/image/fetch/$s_!_SOw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86644e02-aaa3-44fa-867e-1bdaac696887_1258x854.png 1272w, https://substackcdn.com/image/fetch/$s_!_SOw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86644e02-aaa3-44fa-867e-1bdaac696887_1258x854.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_SOw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86644e02-aaa3-44fa-867e-1bdaac696887_1258x854.png" width="1258" height="854" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/86644e02-aaa3-44fa-867e-1bdaac696887_1258x854.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:854,&quot;width&quot;:1258,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;HTTP error page displayed during the incident&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="HTTP error page displayed during the incident" title="HTTP error page displayed during the incident" srcset="https://substackcdn.com/image/fetch/$s_!_SOw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86644e02-aaa3-44fa-867e-1bdaac696887_1258x854.png 424w, https://substackcdn.com/image/fetch/$s_!_SOw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86644e02-aaa3-44fa-867e-1bdaac696887_1258x854.png 848w, https://substackcdn.com/image/fetch/$s_!_SOw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86644e02-aaa3-44fa-867e-1bdaac696887_1258x854.png 1272w, https://substackcdn.com/image/fetch/$s_!_SOw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86644e02-aaa3-44fa-867e-1bdaac696887_1258x854.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>Welcome to <em><strong><a href="https://scortier.substack.com/">Hello Engineer</a></strong></em>, your weekly guide to becoming a better software engineer! No fluff - pure engineering insights.</p></blockquote><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://grindengineer.substack.com/subscribe?"><span>Subscribe now</span></a></p><p>On November 18, 2025, a huge portion of the Internet suddenly felt &#8220;down.&#8221; The reason? Cloudflare, the service that sits between millions of websites and their visitors experienced a major multi-hour outage that triggered widespread 5xx errors across the web.</p><h2>TL;DR</h2><p>Cloudflare went down because a database permission change accidentally doubled the size of a machine-learning &#8220;feature file&#8221; used by its Bot Management system. The proxy that loads this file has a hard limit, and the oversized file caused it to crash, returning 5xx errors across the network. Once Cloudflare figured this out, they stopped generating the bad file, pushed a known-good one, restarted the proxy, and services gradually recovered.</p><h2>How Cloudflare Fits Into the Internet ?</h2><p>Most websites don&#8217;t directly communicate with your browser. Your request hits Cloudflare first. It acts as a reverse proxy, handling TLS, caching, performance tuning, DDoS protection, bot filtering, and routing traffic to the origin server.</p><p>In short, Cloudflare sits in front of a huge chunk of the world&#8217;s websites. When Cloudflare breaks, the impact is global.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Kn_y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcfda9a23-fb19-472e-a09a-46c98584658e_1999x846.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Kn_y!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcfda9a23-fb19-472e-a09a-46c98584658e_1999x846.png 424w, https://substackcdn.com/image/fetch/$s_!Kn_y!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcfda9a23-fb19-472e-a09a-46c98584658e_1999x846.png 848w, https://substackcdn.com/image/fetch/$s_!Kn_y!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcfda9a23-fb19-472e-a09a-46c98584658e_1999x846.png 1272w, https://substackcdn.com/image/fetch/$s_!Kn_y!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcfda9a23-fb19-472e-a09a-46c98584658e_1999x846.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Kn_y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcfda9a23-fb19-472e-a09a-46c98584658e_1999x846.png" width="1456" height="616" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cfda9a23-fb19-472e-a09a-46c98584658e_1999x846.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:616,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Diagram of our reverse proxy architecture&quot;,&quot;title&quot;:&quot;Diagram of our reverse proxy architecture&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="Diagram of our reverse proxy architecture" title="Diagram of our reverse proxy architecture" srcset="https://substackcdn.com/image/fetch/$s_!Kn_y!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcfda9a23-fb19-472e-a09a-46c98584658e_1999x846.png 424w, https://substackcdn.com/image/fetch/$s_!Kn_y!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcfda9a23-fb19-472e-a09a-46c98584658e_1999x846.png 848w, https://substackcdn.com/image/fetch/$s_!Kn_y!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcfda9a23-fb19-472e-a09a-46c98584658e_1999x846.png 1272w, https://substackcdn.com/image/fetch/$s_!Kn_y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcfda9a23-fb19-472e-a09a-46c98584658e_1999x846.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><figcaption class="image-caption">Source: Cloudflare.</figcaption></figure></div><h2>Why the Outage Happened : The Root Cause ?</h2><p>This wasn&#8217;t a cyberattack. It began with a small internal permission change in Cloudflare&#8217;s ClickHouse database cluster.</p><p>Cloudflare&#8217;s Bot Management system relies on a &#8220;feature file&#8221; that is regenerated every few minutes. This file contains a list of ML features used to score requests. After the permission update, the query that builds this file started returning duplicate rows, which doubled the number of features.</p><p>Cloudflare&#8217;s proxy (FL and the newer FL2) has a limit of 200 features for memory preallocation. The duplicated file exceeded that limit, causing the module loading it to panic. Once that happened, the proxy began returning 5xx errors for traffic that needed the Bot Management module, eventually affecting most requests.</p><p>Because the file regenerated every five minutes, the network briefly recovered whenever a &#8220;good&#8221; file was generated, then failed again when a &#8220;bad&#8221; one appeared. That led teams to initially suspect a large-scale attack.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!SVCs!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff482e472-a974-408f-828d-7495128a732b_1507x733.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!SVCs!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff482e472-a974-408f-828d-7495128a732b_1507x733.png 424w, https://substackcdn.com/image/fetch/$s_!SVCs!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff482e472-a974-408f-828d-7495128a732b_1507x733.png 848w, https://substackcdn.com/image/fetch/$s_!SVCs!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff482e472-a974-408f-828d-7495128a732b_1507x733.png 1272w, https://substackcdn.com/image/fetch/$s_!SVCs!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff482e472-a974-408f-828d-7495128a732b_1507x733.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!SVCs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff482e472-a974-408f-828d-7495128a732b_1507x733.png" width="1456" height="708" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f482e472-a974-408f-828d-7495128a732b_1507x733.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:708,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Volume of HTTP 5xx requests served by the Cloudflare network&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="Volume of HTTP 5xx requests served by the Cloudflare network" title="Volume of HTTP 5xx requests served by the Cloudflare network" srcset="https://substackcdn.com/image/fetch/$s_!SVCs!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff482e472-a974-408f-828d-7495128a732b_1507x733.png 424w, https://substackcdn.com/image/fetch/$s_!SVCs!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff482e472-a974-408f-828d-7495128a732b_1507x733.png 848w, https://substackcdn.com/image/fetch/$s_!SVCs!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff482e472-a974-408f-828d-7495128a732b_1507x733.png 1272w, https://substackcdn.com/image/fetch/$s_!SVCs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff482e472-a974-408f-828d-7495128a732b_1507x733.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><figcaption class="image-caption">Source: Cloudflare</figcaption></figure></div><h2>What the Investigation Looked Like</h2><p>Internally, Cloudflare engineers first saw:</p><p>&#8226; spikes in 5xx errors<br>&#8226; Workers KV failures<br>&#8226; Access authentication issues<br>&#8226; unusual CPU load due to error reporting<br>&#8226; even their off-platform status page breaking (coincidentally unrelated)</p><p>The intermittent nature confused things, sometimes everything looked fine, sometimes it crashed again. Early thinking leaned toward a <a href="https://blog.cloudflare.com/defending-the-internet-how-cloudflare-blocked-a-monumental-7-3-tbps-ddos/">massive DDoS</a>, especially given recent <a href="https://techcommunity.microsoft.com/blog/azureinfrastructureblog/defending-the-cloud-azure-neutralized-a-record-breaking-15-tbps-ddos-attack/4470422">Aisuru</a> attacks.</p><p>As the investigation deepened, a clearer picture emerged. KV wasn&#8217;t the root cause; it was a downstream victim of proxy failures. The proxy was crashing when loading the Bot Management feature file. That file was malformed because the database query started producing duplicates. And that duplication was caused by the permission change. Once that chain connected, the real cause became obvious.</p><p>When the bad file with more than 200 features was propagated to our servers, this limit was hit &#8212; resulting in the system panicking. The FL2 Rust code that makes the check and was the source of the unhandled error is shown below:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Xl3l!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95bf804f-0dd3-47f8-9f93-97cb61128199_1472x456.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Xl3l!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95bf804f-0dd3-47f8-9f93-97cb61128199_1472x456.png 424w, https://substackcdn.com/image/fetch/$s_!Xl3l!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95bf804f-0dd3-47f8-9f93-97cb61128199_1472x456.png 848w, https://substackcdn.com/image/fetch/$s_!Xl3l!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95bf804f-0dd3-47f8-9f93-97cb61128199_1472x456.png 1272w, https://substackcdn.com/image/fetch/$s_!Xl3l!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95bf804f-0dd3-47f8-9f93-97cb61128199_1472x456.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Xl3l!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95bf804f-0dd3-47f8-9f93-97cb61128199_1472x456.png" width="1456" height="451" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/95bf804f-0dd3-47f8-9f93-97cb61128199_1472x456.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:451,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;code that generated the error&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="code that generated the error" title="code that generated the error" srcset="https://substackcdn.com/image/fetch/$s_!Xl3l!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95bf804f-0dd3-47f8-9f93-97cb61128199_1472x456.png 424w, https://substackcdn.com/image/fetch/$s_!Xl3l!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95bf804f-0dd3-47f8-9f93-97cb61128199_1472x456.png 848w, https://substackcdn.com/image/fetch/$s_!Xl3l!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95bf804f-0dd3-47f8-9f93-97cb61128199_1472x456.png 1272w, https://substackcdn.com/image/fetch/$s_!Xl3l!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95bf804f-0dd3-47f8-9f93-97cb61128199_1472x456.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 resulted in the following panic which in turn resulted in a 5xx error.</p><h2>How Cloudflare Resolved It</h2><p>Once they understood the issue, the response happened in several steps:</p><p>&#8226; They stopped generating and distributing the bad feature file.<br>&#8226; They injected a known-good version of the file into the distribution pipeline.<br>&#8226; They restarted the proxy so it would load the good file.<br>&#8226; Workers KV and Access were temporarily shifted to fallback paths to avoid relying on the failing proxy.</p><p>By 14:30 UTC, core traffic started recovering.<br>By 17:06 UTC, all downstream services were stable again.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8Gau!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd65fb414-0591-4228-9db6-1a7353d79125_1999x674.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8Gau!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd65fb414-0591-4228-9db6-1a7353d79125_1999x674.png 424w, https://substackcdn.com/image/fetch/$s_!8Gau!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd65fb414-0591-4228-9db6-1a7353d79125_1999x674.png 848w, https://substackcdn.com/image/fetch/$s_!8Gau!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd65fb414-0591-4228-9db6-1a7353d79125_1999x674.png 1272w, https://substackcdn.com/image/fetch/$s_!8Gau!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd65fb414-0591-4228-9db6-1a7353d79125_1999x674.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8Gau!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd65fb414-0591-4228-9db6-1a7353d79125_1999x674.png" width="1456" height="491" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d65fb414-0591-4228-9db6-1a7353d79125_1999x674.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:491,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;availability of Cloudflare internal APIs during the incident&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="availability of Cloudflare internal APIs during the incident" title="availability of Cloudflare internal APIs during the incident" srcset="https://substackcdn.com/image/fetch/$s_!8Gau!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd65fb414-0591-4228-9db6-1a7353d79125_1999x674.png 424w, https://substackcdn.com/image/fetch/$s_!8Gau!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd65fb414-0591-4228-9db6-1a7353d79125_1999x674.png 848w, https://substackcdn.com/image/fetch/$s_!8Gau!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd65fb414-0591-4228-9db6-1a7353d79125_1999x674.png 1272w, https://substackcdn.com/image/fetch/$s_!8Gau!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd65fb414-0591-4228-9db6-1a7353d79125_1999x674.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><h2>Final Thoughts</h2><p>Cloudflare described this as their worst outage since 2019. A small internal permissions change led to an oversized config file, which caused a core part of their proxy to crash, a classic example of how tiny changes in distributed systems can ripple into massive failures.</p><p>Incidents like this are painful, but they lead to stronger, more resilient infrastructure for the entire Internet.</p><p>Source : <a href="https://blog.cloudflare.com/18-november-2025-outage/">https://blog.cloudflare.com/18-november-2025-outage/</a></p><div><hr></div><blockquote><p><em>Want to crack your next interview? <br>Get 10% OFF on Educative.io System Design courses here : <a href="https://www.educative.io/explore?aff=BbWr">https://www.educative.io/</a></em></p></blockquote><p>Subscribe to my Youtube Channel : <a href="https://www.youtube.com/@scortierHQ">https://www.youtube.com/@scortierHQ</a></p><p>Follow me on <a href="https://www.linkedin.com/in/scortier/">LinkedIn</a>, <a href="https://x.com/scortierHQ">X</a> and <a href="https://www.instagram.com/_scortier_/">Instagram</a> to stay updated.</p><p>See you next week with more exciting content!</p><p>Signing Off,<br>Scortier</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.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 Hello Engineer! 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></p>]]></content:encoded></item><item><title><![CDATA[MCP Explained: A Universal Protocol for AI Integrations]]></title><description><![CDATA[How the Model Context Protocol Drives Real-World Agent Behavior.]]></description><link>https://grindengineer.substack.com/p/mcp-explained-a-universal-protocol</link><guid isPermaLink="false">https://grindengineer.substack.com/p/mcp-explained-a-universal-protocol</guid><dc:creator><![CDATA[Scortier]]></dc:creator><pubDate>Thu, 19 Jun 2025 05:04:18 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!0LyI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93357e29-5441-4388-b354-ee4356876f48_1552x1126.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="https://substackcdn.com/image/fetch/$s_!0LyI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93357e29-5441-4388-b354-ee4356876f48_1552x1126.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0LyI!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93357e29-5441-4388-b354-ee4356876f48_1552x1126.png 424w, https://substackcdn.com/image/fetch/$s_!0LyI!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93357e29-5441-4388-b354-ee4356876f48_1552x1126.png 848w, https://substackcdn.com/image/fetch/$s_!0LyI!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93357e29-5441-4388-b354-ee4356876f48_1552x1126.png 1272w, https://substackcdn.com/image/fetch/$s_!0LyI!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93357e29-5441-4388-b354-ee4356876f48_1552x1126.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!0LyI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93357e29-5441-4388-b354-ee4356876f48_1552x1126.png" width="1456" height="1056" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/93357e29-5441-4388-b354-ee4356876f48_1552x1126.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1056,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:170990,&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://scortier.substack.com/i/165992497?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93357e29-5441-4388-b354-ee4356876f48_1552x1126.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!0LyI!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93357e29-5441-4388-b354-ee4356876f48_1552x1126.png 424w, https://substackcdn.com/image/fetch/$s_!0LyI!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93357e29-5441-4388-b354-ee4356876f48_1552x1126.png 848w, https://substackcdn.com/image/fetch/$s_!0LyI!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93357e29-5441-4388-b354-ee4356876f48_1552x1126.png 1272w, https://substackcdn.com/image/fetch/$s_!0LyI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93357e29-5441-4388-b354-ee4356876f48_1552x1126.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>Generative AI tools are impressive, but I've long argued that they aren't very useful in the real world unless they have access to more information than just their training data and can actually do something with it. It's this ability that allows AI tools to create usable content, offer useful insights, and perform actions that actually move work forward.</p><p><strong>MCP (Model Context Protocol)</strong> changes that. It gives AI agents a simple, standardized way to plug into tools, data, and services, no hacks, no hand-coding.</p><p>With MCP, AI goes from <em>smart&#8230; to actually useful.</em></p><h2><strong>What is MCP, Really ?</strong> </h2><p>MCP is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI applications. Just as USB-C provides a standardized way to connect your devices to various peripherals and accessories, MCP provides a standardized way to connect AI models to different data sources and tools.</p><p>While it may sound technical, but the core idea is simple: give AI agents a consistent way to connect with tools, services, and data, no matter where they live or how they&#8217;re built.</p><p>MCP helps you build agents and complex workflows on top of LLMs. LLMs frequently need to integrate with data and tools, and MCP provides:</p><ul><li><p>A growing list of pre-built integrations that your LLM can directly plug into</p></li><li><p>The flexibility to switch between LLM providers and vendors</p></li><li><p>Best practices for securing your data within your infrastructure</p></li></ul><p>Before MCP, each of those actions required a unique API, custom logic, and developer time to glue it all together.</p><blockquote><p><em>In short: <strong>Instead of ad-hoc workarounds, MCP provides a single, real-time protocol designed for autonomous agents.</strong></em></p></blockquote><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://grindengineer.substack.com/subscribe?"><span>Subscribe now</span></a></p><h2>How does MCP work ?</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!0LyI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93357e29-5441-4388-b354-ee4356876f48_1552x1126.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0LyI!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93357e29-5441-4388-b354-ee4356876f48_1552x1126.png 424w, https://substackcdn.com/image/fetch/$s_!0LyI!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93357e29-5441-4388-b354-ee4356876f48_1552x1126.png 848w, https://substackcdn.com/image/fetch/$s_!0LyI!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93357e29-5441-4388-b354-ee4356876f48_1552x1126.png 1272w, https://substackcdn.com/image/fetch/$s_!0LyI!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93357e29-5441-4388-b354-ee4356876f48_1552x1126.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!0LyI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93357e29-5441-4388-b354-ee4356876f48_1552x1126.png" width="638" height="462.72527472527474" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/93357e29-5441-4388-b354-ee4356876f48_1552x1126.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1056,&quot;width&quot;:1456,&quot;resizeWidth&quot;:638,&quot;bytes&quot;:170990,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://scortier.substack.com/i/165992497?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93357e29-5441-4388-b354-ee4356876f48_1552x1126.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!0LyI!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93357e29-5441-4388-b354-ee4356876f48_1552x1126.png 424w, https://substackcdn.com/image/fetch/$s_!0LyI!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93357e29-5441-4388-b354-ee4356876f48_1552x1126.png 848w, https://substackcdn.com/image/fetch/$s_!0LyI!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93357e29-5441-4388-b354-ee4356876f48_1552x1126.png 1272w, https://substackcdn.com/image/fetch/$s_!0LyI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93357e29-5441-4388-b354-ee4356876f48_1552x1126.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>Now, let's look at more of the nitty-gritty. MCP operates using a client-host-server model:</p><ul><li><p><strong>The MCP host</strong>&#8212;typically, a chatbot, IDE, or other AI tool is the central coordinator within the application: it manages each client instance and controls permissions and security policies. Depending on how things are set up, the host may decide to call for something over MCP based on your request or based on an automated process.</p></li><li><p><strong>The MCP client</strong> is initiated by the host and connects to a single server; it handles communications <em>between</em> the host and the server.</p></li><li><p><strong>The MCP server</strong> connects to a data source or tool, either local or remote, and exposes specific capabilities. For example, an MCP server connected to a file storage app can provide capabilities like "search for a file" and "read a file," while an MCP server connected to your team chat app can provide capabilities like "get my latest mentions" and "update my status." Anthropic <a href="https://github.com/modelcontextprotocol/servers">maintains a list of available MCP servers</a>, or if you're a developer, you can write your own.</p></li></ul><p>MCP servers can provide data using <a href="https://spec.modelcontextprotocol.io/specification/2025-03-26/server/">three basic methods</a>:</p><ul><li><p><strong>Prompts</strong> are pre-defined templates for the <a href="https://zapier.com/blog/best-llm/">LLM</a> that can be selected by the user through slash commands, menu options, and the like.</p></li><li><p><strong>Resources</strong> are structured data, like files, data from a database, or a commit history that provide additional context to the LLM.</p></li><li><p><strong>Tools</strong> are functions that allow the model to take action, like interacting with an <a href="https://zapier.com/blog/how-to-use-api/">API</a> or writing something to a file.</p></li></ul><p>While MCP might sound superficially similar to how APIs operate, the two differ significantly in design, intent, and flexibility. An <a href="https://zapier.com/resources/guides/apis">API</a> offers a direct, service-specific interface, while MCP is designed to be a unified framework. Many MCP servers use APIs when they're triggered over MCP, so the two often work in tandem, but they're not the same thing.</p><h2>MCP vs. AI agents</h2><p>AI agents are AI-powered tools that are able to act autonomously. As a basic example, <a href="https://zapier.com/blog/chatgpt-deep-research/">ChatGPT Deep Research</a> is able to decide what web searches to perform and websites to visit based on your query. You tell it what you want, but it decides how it's going to give it to you.</p><p>MCP has the capacity to <em>enable</em> agentic behavior. By allowing developers to connect apps and data sources to AI assistants, they can build AI tools capable of making autonomous decisions and taking action in other apps. But MCP isn't the only way to build AI agents nor does using MCP automatically make any AI-powered tool an AI agent. It's simply a way of connecting an AI to another tool.</p><p>MCP is designed primarily for developers building custom integrations and AI applications, it's ideal for teams with technical resources who need to build specialized AI capabilities into their own applications or workflows.</p><p>Both approaches have their place in the ecosystem: MCP gives developers deeper control and flexibility for custom implementations, while no-code tools offer accessibility and speed for business users or teams without extensive development resources.</p><h2>Marketplaces Are Here</h2><p>Here are the ones to watch:</p><ul><li><p><a href="https://mcpmarket.com/">mcpmarket.com </a>- A plug-and-play directory of MCP servers for tools like GitHub, Figma, Notion, Databricks, and more.</p></li><li><p><a href="https://mcp.so/">mcp.so </a>- A growing open repo of community-built MCP servers. Discover one. Fork it. Build your own.</p></li><li><p><a href="https://github.com/cline/mcp-marketplace">Cline&#8217;s MCP Marketplace </a>- A GitHub-powered hub for open-source MCP connectors anyone can use.</p></li></ul><h2>How to get started with MCP</h2><p>If you're a developer building an AI app and want it to be able to initiate tasks in other apps not just access data then MCP is well worth a look. It gives your AI tools the ability to trigger actions in external systems, like sending messages, creating records, or kicking off workflows, all through a standardized protocol. And if you don't want to create your own server, you can <a href="https://github.com/modelcontextprotocol/servers">find a list of available MCP servers here</a>.</p><h2>For more Deep Dive</h2><p>Here are some great places to explore MCP further:</p><ul><li><p><a href="https://www.anthropic.com/news/model-context-protocol">Introducing the Model Context Protocol</a> by Anthropic</p></li><li><p><a href="https://github.com/modelcontextprotocol">Model Context Protocol</a> on GitHub</p></li></ul><div><hr></div><p>Hope you enjoyed this deep dive into &#8220;MCP Explained&#8221; and how it connects AI to your data and tools ? Hit a like &#10084;&#65039;<br>For more simple explanations, useful insights on coding, system design, and tech trends, <strong>Subscribe To My Newsletter! </strong>&#128640;</p><p>If you have any questions or suggestions, leave a comment.</p><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://scortier.substack.com/p/elasticsearch-101-part-2?utm_source=substack&amp;utm_medium=email&amp;utm_content=share&amp;action=share&amp;token=eyJ1c2VyX2lkIjo4ODczNDgwLCJwb3N0X2lkIjoxNjIyNDQyMDQsImlhdCI6MTc0OTk4OTY1OCwiZXhwIjoxNzUyNTgxNjU4LCJpc3MiOiJwdWItMzcxNjY1Iiwic3ViIjoicG9zdC1yZWFjdGlvbiJ9.Lcirt1yIimfSC0zzjT5AkUcLpQ0sxfDl1p2Eu6Wnmds&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="CaptionedButtonToDOM"><div class="preamble"><p class="cta-caption">This post is public so feel free to share it.</p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.substack.com/p/mcp-explained-a-universal-protocol?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://grindengineer.substack.com/p/mcp-explained-a-universal-protocol?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><p>Follow me on <a href="https://www.linkedin.com/in/scortier/">LinkedIn</a>, <a href="https://x.com/scortierHQ">X</a> and <a href="https://www.instagram.com/_scortier_/">Instagram</a> to stay updated.</p><p>I hope you have a lovely day!</p><p>See you next week with more exciting content!</p><p>Signing Off,<br>Scortier</p><div><hr></div>]]></content:encoded></item><item><title><![CDATA[My Amazon SDE-2 Interview Experience ]]></title><description><![CDATA[Welcome to Hello Engineer, your weekly guide to becoming a better software engineer!]]></description><link>https://grindengineer.substack.com/p/my-amazon-sde-2-interview-experience</link><guid isPermaLink="false">https://grindengineer.substack.com/p/my-amazon-sde-2-interview-experience</guid><dc:creator><![CDATA[Scortier]]></dc:creator><pubDate>Sat, 31 May 2025 07:50:47 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!4zv3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F924ef7a3-fd98-4788-a67b-4365a847a3d6_1920x848.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="https://substackcdn.com/image/fetch/$s_!4zv3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F924ef7a3-fd98-4788-a67b-4365a847a3d6_1920x848.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4zv3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F924ef7a3-fd98-4788-a67b-4365a847a3d6_1920x848.webp 424w, https://substackcdn.com/image/fetch/$s_!4zv3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F924ef7a3-fd98-4788-a67b-4365a847a3d6_1920x848.webp 848w, https://substackcdn.com/image/fetch/$s_!4zv3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F924ef7a3-fd98-4788-a67b-4365a847a3d6_1920x848.webp 1272w, https://substackcdn.com/image/fetch/$s_!4zv3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F924ef7a3-fd98-4788-a67b-4365a847a3d6_1920x848.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4zv3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F924ef7a3-fd98-4788-a67b-4365a847a3d6_1920x848.webp" width="1456" height="643" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/924ef7a3-fd98-4788-a67b-4365a847a3d6_1920x848.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:643,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Revolutionize Your Listings with Amazon PIM Integration&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="Revolutionize Your Listings with Amazon PIM Integration" title="Revolutionize Your Listings with Amazon PIM Integration" srcset="https://substackcdn.com/image/fetch/$s_!4zv3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F924ef7a3-fd98-4788-a67b-4365a847a3d6_1920x848.webp 424w, https://substackcdn.com/image/fetch/$s_!4zv3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F924ef7a3-fd98-4788-a67b-4365a847a3d6_1920x848.webp 848w, https://substackcdn.com/image/fetch/$s_!4zv3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F924ef7a3-fd98-4788-a67b-4365a847a3d6_1920x848.webp 1272w, https://substackcdn.com/image/fetch/$s_!4zv3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F924ef7a3-fd98-4788-a67b-4365a847a3d6_1920x848.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><blockquote><p>Welcome to <em><strong><a href="https://scortier.substack.com/">Hello Engineer</a></strong></em>, your weekly guide to becoming a better software engineer! No fluff - pure engineering insights.</p><p>You can also checkout : <strong><a href="https://scortier.substack.com/p/why-redis-is-everywhere">Why Redis is Everywhere ? </a></strong></p></blockquote><p></p><p>Over the past few months, I went through the interview processes at several top tech companies - <strong>DoorDash, Databricks, Amazon, Uber, Stripe, Rippling</strong>, and more. I thought it would be helpful to share what the experience was like, especially for anyone preparing for similar roles.</p><p>Let&#8217;s kick things off with my <strong>Amazon SDE-2 interview experience</strong>.</p><blockquote><p>&#128176; <strong>Quick note:</strong> The SDE-2 role at Amazon starts with a package of <strong>&#8377;65 LPA+</strong>, depending on location and stock grants.</p></blockquote><h4>Application &amp; Online Assessment</h4><p>I applied through the Amazon job portal for multiple roles. On a Sunday, I received a link to the Online Assessment (OA).</p><p>The OA included two parts:</p><ul><li><p><strong>DSA (Data Structures &amp; Algorithms)</strong></p></li><li><p><strong>SDE Simulation</strong></p></li></ul><p>I solved all the questions and soon after, received a mail that my interviews were lined up.</p><h3>Interview Process Overview</h3><ul><li><p>DSA Round 1</p></li><li><p>DSA Round 2</p></li><li><p>System Design</p></li><li><p>Bar Raiser</p></li></ul><blockquote><p><em>Note: There&#8217;s no separate Hiring Manager (HM) round because Amazon integrates leadership principle questions at the end of every interview.</em></p></blockquote><h3>DSA Rounds (1 Hour Each)</h3><p>Each round involved <strong>2 coding questions</strong>, ranging from <strong>medium to hard</strong> difficulty (LeetCode level). The interviews were conducted via an internal portal (similar to HackerRank), where questions were pasted and we were asked to proceed step by step.</p><h4>Structure I followed:</h4><ul><li><p>Clarify the problem</p></li><li><p>Propose a brute-force solution verbally</p></li><li><p>Optimize the solution and explain the approach</p></li><li><p>Write code for the optimal solution (no need to run it)</p></li><li><p>Dry run with test cases</p></li></ul><p>&#9201;&#65039; If you finish the first question within 30&#8211;35 minutes, they may give you a second one. I received a second question in both rounds.</p><p>At the end of each round, I was asked <strong>two leadership principle questions</strong>, which had to be answered using the <strong>STAR format</strong>.</p><h4>What is STAR?</h4><p><strong>S</strong>ituation &#8211; Describe the context<br><strong>T</strong>ask &#8211; What was the goal?<br><strong>A</strong>ction &#8211; What steps did <em>you</em> take?<br><strong>R</strong>esult &#8211; What was the outcome?</p><p>This format is crucial, prepare stories beforehand that map to Amazon's leadership principles.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://grindengineer.substack.com/subscribe?"><span>Subscribe now</span></a></p><h3>System Design Round (1 Hour)</h3><p>A manager conducted this round. It began with a high-level prompt like:</p><blockquote><p>&#8220;Design Twitter.&#8221;</p></blockquote><p>Then it's on you to figure out everything from scratch.</p><h4>My approach:</h4><ul><li><p>Identify functional &amp; non-functional requirements by discussing with the interviewer.</p></li><li><p>Start with a <strong>basic design</strong> for ~100 users.</p></li><li><p>Gradually scale it up to <strong>1M users</strong>, explaining the reasoning and components along the way.</p></li></ul><p>&#127919; <em>Key Insight:</em><br>Sometimes interviewers are not looking for broad coverage&#8212;they prefer deep dives into specific areas. If they steer the conversation toward one component, follow their lead. Going too broad when they expect depth may hurt your chances.</p><h3>Bar Raiser Round</h3><p>This is the <strong>most critical round</strong>. The outcome of the debrief is heavily influenced by the Bar Raiser.</p><p>The interviewer is usually from <strong>outside the hiring team</strong> to reduce bias. Mine was a very senior and calm individual.</p><p>We started with brief introductions, then jumped into a system design problem. I followed the same approach as in the earlier system design round, but this time the interviewer <strong>deep-dived</strong> into a specific part of the system.</p><p>They asked:</p><ul><li><p>Multiple solution approaches</p></li><li><p>Pros &amp; cons of each</p></li><li><p>Which one I'd choose and why</p></li></ul><p>&#128204; <em>Important:</em> There's no single &#8220;right&#8221; answer. What's evaluated is your <strong>understanding of trade-offs</strong> and your ability to <strong>communicate decisions clearly</strong>. If your logic doesn&#8217;t align with the interviewer&#8217;s and you don&#8217;t justify it well, it's game over.</p><p>The round ended with leadership questions.</p><h3>Resources I Followed</h3><ul><li><p><a href="https://leetcode.com/problem-list/5urgxrst/">LeetCode (Mid-Hard problems)</a></p></li><li><p><a href="https://github.com/donnemartin/system-design-primer">System Design Primer</a></p></li><li><p><a href="https://github.com/mukul96/System-Design-AlexXu/blob/master/System%20Design%20Interview%20An%20Insider%E2%80%99s%20Guide%20by%20Alex%20Xu%20(z-lib.org).pdf">System Design Interview Book by Alex Xu</a></p></li><li><p><a href="https://github.com/letthedataconfess/Data-Engineering-Books/blob/main/Book-2Designing-data-intensive-applications.pdf">Designing Data Intensive Application</a> </p></li><li><p><a href="https://interviewing.io/guides/amazon-leadership-principles">Amazon Leadership Principles</a> </p></li></ul><div><hr></div><p><strong>Final Thoughts</strong></p><p>Amazon interviews are tough, structured, and fair. Be prepared to code, communicate, and tell your story. Don&#8217;t underestimate leadership questions, they matter as much as technical skills.</p><p>Hope this helps those preparing!</p><p>Loved this interview experience ? Hit a like &#10084;&#65039;<br>For more simple explanations, useful insights on coding, system design, and tech trends, <strong>Subscribe To My Newsletter! </strong>&#128640;</p><p>If you have any questions or suggestions, leave a comment.</p><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://scortier.substack.com/p/elasticsearch-101-part-2?utm_source=substack&amp;utm_medium=email&amp;utm_content=share&amp;action=share&amp;token=eyJ1c2VyX2lkIjo4ODczNDgwLCJwb3N0X2lkIjoxNjIyNDQyMDQsImlhdCI6MTc0ODY3NzQ2NCwiZXhwIjoxNzUxMjY5NDY0LCJpc3MiOiJwdWItMzcxNjY1Iiwic3ViIjoicG9zdC1yZWFjdGlvbiJ9.hB6ZhkuYBKzu4hzb4u81rl8ZD3jN3ixYVMmX4xK-6IU&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="CaptionedButtonToDOM"><div class="preamble"><p class="cta-caption">This post is public so feel free to share it.</p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.substack.com/p/my-amazon-sde-2-interview-experience?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://grindengineer.substack.com/p/my-amazon-sde-2-interview-experience?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><p>Follow me on <a href="https://www.linkedin.com/in/scortier/">LinkedIn</a>, <a href="https://x.com/scortierHQ">X</a> and <a href="https://www.instagram.com/_scortier_/">Instagram</a> to stay updated.</p><p>I hope you have a lovely day!</p><p>See you next week with more exciting content!</p><p>Signing Off,<br>Scortier</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.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 Hello Engineer! 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><item><title><![CDATA[How does CDN works ?]]></title><description><![CDATA[A CDN delivers cached content from the nearest server to the user, cutting down load times and boosting performance.]]></description><link>https://grindengineer.substack.com/p/how-does-cdn-works</link><guid isPermaLink="false">https://grindengineer.substack.com/p/how-does-cdn-works</guid><dc:creator><![CDATA[Scortier]]></dc:creator><pubDate>Sat, 24 May 2025 07:24:22 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!ocIP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf18b090-d178-43c8-95ea-268d83dc3427_1920x1080.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="https://substackcdn.com/image/fetch/$s_!ocIP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf18b090-d178-43c8-95ea-268d83dc3427_1920x1080.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ocIP!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf18b090-d178-43c8-95ea-268d83dc3427_1920x1080.png 424w, https://substackcdn.com/image/fetch/$s_!ocIP!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf18b090-d178-43c8-95ea-268d83dc3427_1920x1080.png 848w, https://substackcdn.com/image/fetch/$s_!ocIP!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf18b090-d178-43c8-95ea-268d83dc3427_1920x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!ocIP!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf18b090-d178-43c8-95ea-268d83dc3427_1920x1080.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ocIP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf18b090-d178-43c8-95ea-268d83dc3427_1920x1080.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/df18b090-d178-43c8-95ea-268d83dc3427_1920x1080.png&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;:&quot;What is CDN (Content Delivery Network)? - ClouDNS Blog&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="What is CDN (Content Delivery Network)? - ClouDNS Blog" title="What is CDN (Content Delivery Network)? - ClouDNS Blog" srcset="https://substackcdn.com/image/fetch/$s_!ocIP!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf18b090-d178-43c8-95ea-268d83dc3427_1920x1080.png 424w, https://substackcdn.com/image/fetch/$s_!ocIP!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf18b090-d178-43c8-95ea-268d83dc3427_1920x1080.png 848w, https://substackcdn.com/image/fetch/$s_!ocIP!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf18b090-d178-43c8-95ea-268d83dc3427_1920x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!ocIP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf18b090-d178-43c8-95ea-268d83dc3427_1920x1080.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><blockquote><p>Welcome to <em><strong><a href="https://scortier.substack.com/">Hello Engineer</a></strong></em>, your weekly guide to becoming a better software engineer! No fluff - pure engineering insights.</p><p>You can also checkout : <strong><a href="https://scortier.substack.com/p/elasticsearch-101-part-1">Elasticsearch 101: Part 1</a></strong></p></blockquote><p></p><h3>What is a CDN ?</h3><p>When your app has users around the world, delivering content quickly becomes a challenge. No one likes slow load times, especially users (and interviewers in a system design round).</p><p>A <strong>Content Delivery Network (CDN)</strong> helps by storing content on servers across different locations. When someone requests a file, like an image or video, the CDN serves it from the nearest server. If it's not cached yet, the CDN fetches it from your origin server, stores it locally, and delivers it. Next time, it&#8217;s ready to go fast.</p><p>CDNs are great for static content (images, videos, HTML, CSS), and with the right setup, they can even handle some dynamic content.</p><p>A common use case? Think of a social media app like Instagram. You&#8217;d use a CDN to serve profile pictures instantly, no matter where the user is.</p><p>In short: if you care about speed, scale, and user experience, a CDN is often worth it.</p><h3>Why Do We Need CDNs?</h3><p>Modern websites and applications serve users across the globe, but often host content in just one or a few regions. This geographic gap causes latency, especially for users far from the origin server.</p><p>&#128205; <strong>Example</strong>:<br>Imagine your website is hosted in Mumbai. Users from Chennai, Delhi, or Kolkata would need to wait for their requests to travel all the way to Mumbai and back. Not ideal for performance or user experience.</p><p>Now, introduce a CDN: content gets cached on edge servers in nearby cities. So a user in Chennai can fetch content from a local CDN node much faster, less load on the main server.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://grindengineer.substack.com/subscribe?"><span>Subscribe now</span></a></p><h3>How a CDN Works</h3><p>A CDN caches and serves content (like images, HTML, JS, CSS, or even API responses) from strategically located <strong>Points of Presence (PoPs)</strong>. These PoPs contain <strong>edge servers</strong> that act as mini versions of your origin infrastructure.</p><p>When a user requests content:</p><ol><li><p>The CDN checks if the content is cached on a nearby edge server.</p></li><li><p>If yes, it serves it directly fast.</p></li><li><p>If not, it fetches the content from the origin, stores it at the edge, and serves it.</p></li><li><p>Next time, it's already there, ready to go.</p></li></ol><h3>Routing Requests to the Right Server</h3><p>To direct user traffic efficiently, CDNs use different routing techniques:</p><ul><li><p><strong>DNS-based routing</strong>: Each PoP has a unique IP address. DNS returns the IP of the closest PoP.</p></li><li><p><strong>Anycast</strong>: All PoPs share the same IP. The network automatically routes requests to the nearest server based on location and availability.</p></li></ul><h3>Common CDN Use Cases (Especially in Interviews)</h3><p>In system design interviews, CDNs often come up when discussing how to serve static media&#8212;like images or videos efficiently. A classic example is a social media app (like Instagram) using a CDN to cache and deliver user profile pictures quickly, no matter where the user is.</p><p><strong>1. Not Just for Static Files</strong><br>While CDNs are typically used for static assets&#8212;images, videos, JavaScript, etc.&#8212;they can also handle dynamic content that doesn&#8217;t change often. For instance, a blog post updated once a day can be cached to improve load times without serving stale content.</p><p><strong>2. Caching API Responses</strong><br>If your API endpoints return the same data to many users (e.g., trending posts or product listings), you can cache those responses using a CDN. This reduces backend load and speeds up response times.</p><p><strong>3. Cache Eviction &amp; Invalidation</strong><br>Like any cache, CDNs don&#8217;t hold onto data forever. You can control how long content stays cached using TTL (Time To Live), or explicitly invalidate the cache when the underlying data changes. This helps keep content fresh without sacrificing performance.</p><h3>Modern CDN Capabilities</h3><p>CDNs have evolved far beyond just caching static files. Here's what they can do today:</p><ul><li><p><strong>Dynamic Content Caching</strong>: Content that doesn't change frequently (like blog posts or product pages) can still be cached.</p></li><li><p><strong>API Caching</strong>: Repeated API responses can be cached to reduce backend load and improve response times.</p></li><li><p><strong>Edge Optimizations</strong>: CDNs can minify JavaScript or convert images (e.g., to WebP or AVIF) on the fly.</p></li><li><p><strong>TLS Termination at the Edge</strong>: CDNs handle secure HTTPS connections at the nearest edge server. This reduces the time it takes to establish a secure connection (especially with TLS 1.2 or 1.3).</p></li><li><p><strong>DDoS Protection</strong>: With globally distributed infrastructure, CDNs can absorb and deflect massive traffic spikes caused by denial-of-service attacks.</p></li><li><p><strong>Improved Availability</strong>: If one PoP goes down, others can continue to serve traffic, keeping your site up and running.</p></li></ul><h3></h3><p>By now, you should have a clear understanding of what a CDN is, why it exists, and how it helps developers build better, faster, and more secure applications.</p><p>To sum it up:</p><blockquote><p>A <strong>CDN</strong> is a geographically distributed network of servers that cache and deliver content from the location nearest to the user&#8212;making websites load faster, reducing latency, improving security, and keeping things running smoothly at scale.</p></blockquote><p>In a world where user experience and performance are non-negotiable, <strong>CDNs are no longer optional, they&#8217;re essential</strong>.</p><div><hr></div><p>Loved this deep dive? Hit a like &#10084;&#65039;<br>For more simple explanations, useful insights on coding, system design, and tech trends, <strong>Subscribe To My Newsletter! </strong>&#128640;</p><p>If you have any questions or suggestions, leave a comment.</p><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://scortier.substack.com/p/elasticsearch-101-part-2?utm_source=substack&amp;utm_medium=email&amp;utm_content=share&amp;action=share&amp;token=eyJ1c2VyX2lkIjo4ODczNDgwLCJwb3N0X2lkIjoxNjIyNDQyMDQsImlhdCI6MTc0ODA3MDc5MiwiZXhwIjoxNzUwNjYyNzkyLCJpc3MiOiJwdWItMzcxNjY1Iiwic3ViIjoicG9zdC1yZWFjdGlvbiJ9.tJ5SzxeDGrypEg5bmNXWKBubA07aPAGU5hbDIODCaxg&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="CaptionedButtonToDOM"><div class="preamble"><p class="cta-caption">This post is public so feel free to share it.</p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.substack.com/p/how-does-cdn-works?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://grindengineer.substack.com/p/how-does-cdn-works?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><p>Follow me on <a href="https://www.linkedin.com/in/scortier/">LinkedIn</a>, <a href="https://x.com/scortierHQ">X</a> and <a href="https://www.instagram.com/_scortier_/">Instagram</a> to stay updated.</p><p>I hope you have a lovely day!</p><p>See you next week with more exciting content!</p><p>Signing Off,<br>Scortier</p>]]></content:encoded></item><item><title><![CDATA[How WebSockets Work ?]]></title><description><![CDATA[Two-way real-time communication between client-server over a single connection.]]></description><link>https://grindengineer.substack.com/p/how-websockets-work</link><guid isPermaLink="false">https://grindengineer.substack.com/p/how-websockets-work</guid><dc:creator><![CDATA[Scortier]]></dc:creator><pubDate>Sun, 11 May 2025 12:28:54 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!J_lR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd80adf0f-51cc-49de-bc3f-71111b40fcb4_1416x512.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="https://substackcdn.com/image/fetch/$s_!J_lR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd80adf0f-51cc-49de-bc3f-71111b40fcb4_1416x512.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!J_lR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd80adf0f-51cc-49de-bc3f-71111b40fcb4_1416x512.png 424w, https://substackcdn.com/image/fetch/$s_!J_lR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd80adf0f-51cc-49de-bc3f-71111b40fcb4_1416x512.png 848w, https://substackcdn.com/image/fetch/$s_!J_lR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd80adf0f-51cc-49de-bc3f-71111b40fcb4_1416x512.png 1272w, https://substackcdn.com/image/fetch/$s_!J_lR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd80adf0f-51cc-49de-bc3f-71111b40fcb4_1416x512.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!J_lR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd80adf0f-51cc-49de-bc3f-71111b40fcb4_1416x512.png" width="1416" height="512" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d80adf0f-51cc-49de-bc3f-71111b40fcb4_1416x512.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:512,&quot;width&quot;:1416,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:68795,&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://scortier.substack.com/i/163323544?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd80adf0f-51cc-49de-bc3f-71111b40fcb4_1416x512.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!J_lR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd80adf0f-51cc-49de-bc3f-71111b40fcb4_1416x512.png 424w, https://substackcdn.com/image/fetch/$s_!J_lR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd80adf0f-51cc-49de-bc3f-71111b40fcb4_1416x512.png 848w, https://substackcdn.com/image/fetch/$s_!J_lR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd80adf0f-51cc-49de-bc3f-71111b40fcb4_1416x512.png 1272w, https://substackcdn.com/image/fetch/$s_!J_lR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd80adf0f-51cc-49de-bc3f-71111b40fcb4_1416x512.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>Welcome to <em><strong><a href="https://scortier.substack.com/">Hello Engineer</a></strong></em>, your weekly guide to becoming a better software engineer! No fluff - pure engineering insights.</p><p>You can also checkout : <strong><a href="https://scortier.substack.com/p/elasticsearch-101-part-1">Elasticsearch 101: Part 1</a></strong></p></blockquote><p></p><p>Have you ever noticed how some websites update instantly like chat apps, stock tickers, or multiplayer games without needing to refresh the page? That magical real-time experience is powered by something called <strong>WebSockets</strong>. Let&#8217;s dive in and see how they work and why they matter!</p><p>Imagine you're playing an online game, and the leaderboard keeps changing on the server. How does your browser know when to update?</p><p>One way is to ask users to refresh the page every few seconds. Or maybe have your browser keep sending requests every minute to check if something&#8217;s changed. That&#8217;s called <strong>polling</strong> and yeah, it works, but it&#8217;s not really the best way.</p><p>Every time the client sends a request, it waits for the server to respond. If there&#8217;s no new data, the server still sends back something usually an empty response. It&#8217;s like constantly asking, &#8220;Anything new?&#8221; and hearing, &#8220;Nope&#8221; over and over again.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!miOS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9a9df1f-69e3-4da9-ac91-93ad6886e945_1238x1080.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!miOS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9a9df1f-69e3-4da9-ac91-93ad6886e945_1238x1080.png 424w, https://substackcdn.com/image/fetch/$s_!miOS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9a9df1f-69e3-4da9-ac91-93ad6886e945_1238x1080.png 848w, https://substackcdn.com/image/fetch/$s_!miOS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9a9df1f-69e3-4da9-ac91-93ad6886e945_1238x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!miOS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9a9df1f-69e3-4da9-ac91-93ad6886e945_1238x1080.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!miOS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9a9df1f-69e3-4da9-ac91-93ad6886e945_1238x1080.png" width="499" height="435.3150242326333" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f9a9df1f-69e3-4da9-ac91-93ad6886e945_1238x1080.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1080,&quot;width&quot;:1238,&quot;resizeWidth&quot;:499,&quot;bytes&quot;:69648,&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;:false,&quot;internalRedirect&quot;:&quot;https://scortier.substack.com/i/163323544?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9a9df1f-69e3-4da9-ac91-93ad6886e945_1238x1080.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!miOS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9a9df1f-69e3-4da9-ac91-93ad6886e945_1238x1080.png 424w, https://substackcdn.com/image/fetch/$s_!miOS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9a9df1f-69e3-4da9-ac91-93ad6886e945_1238x1080.png 848w, https://substackcdn.com/image/fetch/$s_!miOS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9a9df1f-69e3-4da9-ac91-93ad6886e945_1238x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!miOS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9a9df1f-69e3-4da9-ac91-93ad6886e945_1238x1080.png 1456w" sizes="100vw"></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 class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://grindengineer.substack.com/subscribe?"><span>Subscribe now</span></a></p><h3>What&#8217;s the issue?</h3><p>Polling creates a lot of traffic. Imagine thousands of users asking the server for updates every second &#8212; even when there&#8217;s nothing new to show. It wastes resources and can slow things down.</p><p>To make it a little better, there&#8217;s something called <strong>long polling</strong>. Here, the server doesn&#8217;t respond immediately. Instead, it waits until there&#8217;s something new to send back. If there&#8217;s still no update after a while, it times out and the client tries again.</p><p>It&#8217;s better than regular polling, but it still needs to open and close connections over and over. This takes up memory and network resources.</p><h3>Enter WebSockets </h3><p>WebSockets were designed to solve the limitations of polling and long polling. Instead of repeatedly opening and closing connections, WebSockets allow the client and server to establish a <strong>single, persistent connection</strong> that stays open. This enables real-time, two-way communication.</p><p>To begin, the client starts by sending a regular HTTP request to the server. But this request includes an <strong>"Upgrade" header</strong> that tells the server:<br>&#8220;I&#8217;d like to switch this to a WebSocket connection.&#8221;</p><p>If the server supports WebSockets, it responds with a confirmation. The HTTP connection is then <strong>upgraded to a WebSocket</strong>, and from that point on, both the client and server can freely send and receive data through this single TCP connection &#8212; without needing to reconnect each time.</p><p>Typically, a <strong>WebSocket Handler</strong> is used in the setup. It's a lightweight server-side component that maintains these open connections and manages active users. This handler ensures that real-time communication is possible across multiple users without needing to repeatedly create new connections.</p><p>To summarize the process:</p><ul><li><p>The client sends an HTTP request with an upgrade header.</p></li><li><p>The server acknowledges and upgrades the connection to WebSocket.</p></li><li><p>Once established, this connection remains open for ongoing two-way data exchange.</p></li><li><p>Either the client or server can close the connection at any time, ending the communication.</p></li></ul><p>This persistent connection model is what makes WebSockets highly efficient for real-time applications like chat systems, live notifications, online gaming, and more.tion at any time and the server won&#8217;t be able to send you anything now.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Lmoy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb83d947-9b80-4040-a80e-e0a5c4172e13_1238x646.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Lmoy!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb83d947-9b80-4040-a80e-e0a5c4172e13_1238x646.png 424w, https://substackcdn.com/image/fetch/$s_!Lmoy!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb83d947-9b80-4040-a80e-e0a5c4172e13_1238x646.png 848w, https://substackcdn.com/image/fetch/$s_!Lmoy!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb83d947-9b80-4040-a80e-e0a5c4172e13_1238x646.png 1272w, https://substackcdn.com/image/fetch/$s_!Lmoy!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb83d947-9b80-4040-a80e-e0a5c4172e13_1238x646.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Lmoy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb83d947-9b80-4040-a80e-e0a5c4172e13_1238x646.png" width="509" height="265.6009693053312" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fb83d947-9b80-4040-a80e-e0a5c4172e13_1238x646.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:646,&quot;width&quot;:1238,&quot;resizeWidth&quot;:509,&quot;bytes&quot;:54928,&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://scortier.substack.com/i/163323544?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb83d947-9b80-4040-a80e-e0a5c4172e13_1238x646.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Lmoy!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb83d947-9b80-4040-a80e-e0a5c4172e13_1238x646.png 424w, https://substackcdn.com/image/fetch/$s_!Lmoy!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb83d947-9b80-4040-a80e-e0a5c4172e13_1238x646.png 848w, https://substackcdn.com/image/fetch/$s_!Lmoy!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb83d947-9b80-4040-a80e-e0a5c4172e13_1238x646.png 1272w, https://substackcdn.com/image/fetch/$s_!Lmoy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb83d947-9b80-4040-a80e-e0a5c4172e13_1238x646.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><h3>Why WebSockets Matter</h3><p>With traditional methods like polling, the connection would close after every response, forcing the client to keep asking the server for updates. This wasn&#8217;t very efficient, especially when there was no new data to send &#8212; it just created unnecessary load.</p><p>With WebSockets, the communication channel remains open. Once the connection is established, both the client and the server can send data <strong>whenever they need to</strong>, without waiting for a request from the other side. This makes the whole process much faster and more efficient.</p><p>For example, in a real-time chat application:</p><ul><li><p>When <strong>User A</strong> sends a message, it goes to the server.</p></li><li><p>Instead of <strong>User B</strong> constantly checking the server for new messages, the server can immediately send the message to User B over the open WebSocket connection.</p></li><li><p>There&#8217;s no delay, no need to reconnect, and no extra overhead &#8212; just instant communication.</p></li></ul><p>This model not only reduces server load but also improves the user experience by delivering updates in real time.</p><p>If at any point the client or server no longer needs the connection for example, if the user leaves the chat either side can close it. Once closed, no further messages can be sent through that connection.</p><h2>Why Not Just Use HTTP?</h2><p>Here's how standard HTTP works:</p><ul><li><p>Client says: "Hey server, got anything for me?"</p></li><li><p>Server replies: "Here you go!" (or "Nope, nothing right now.")</p></li><li><p>Then... they hang up.</p></li></ul><p>It&#8217;s always <strong>request &#8594; response &#8594; disconnect</strong>.</p><p>If you want more data, you have to ask again. And again. And again. Not great for real-time updates.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tIHT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0dcdb64c-df79-47cd-b8df-fa59c20cd3d3_1238x1080.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tIHT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0dcdb64c-df79-47cd-b8df-fa59c20cd3d3_1238x1080.png 424w, https://substackcdn.com/image/fetch/$s_!tIHT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0dcdb64c-df79-47cd-b8df-fa59c20cd3d3_1238x1080.png 848w, https://substackcdn.com/image/fetch/$s_!tIHT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0dcdb64c-df79-47cd-b8df-fa59c20cd3d3_1238x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!tIHT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0dcdb64c-df79-47cd-b8df-fa59c20cd3d3_1238x1080.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tIHT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0dcdb64c-df79-47cd-b8df-fa59c20cd3d3_1238x1080.png" width="546" height="476.3166397415186" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0dcdb64c-df79-47cd-b8df-fa59c20cd3d3_1238x1080.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1080,&quot;width&quot;:1238,&quot;resizeWidth&quot;:546,&quot;bytes&quot;:86482,&quot;alt&quot;:&quot;&quot;,&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://scortier.substack.com/i/163323544?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0dcdb64c-df79-47cd-b8df-fa59c20cd3d3_1238x1080.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!tIHT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0dcdb64c-df79-47cd-b8df-fa59c20cd3d3_1238x1080.png 424w, https://substackcdn.com/image/fetch/$s_!tIHT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0dcdb64c-df79-47cd-b8df-fa59c20cd3d3_1238x1080.png 848w, https://substackcdn.com/image/fetch/$s_!tIHT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0dcdb64c-df79-47cd-b8df-fa59c20cd3d3_1238x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!tIHT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0dcdb64c-df79-47cd-b8df-fa59c20cd3d3_1238x1080.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>What makes WebSockets special?</h2><ul><li><p><strong>Real-time updates</strong>: Messages, prices, scores &#8212; all get pushed instantly.</p></li><li><p><strong>Less overhead</strong>: One open connection, not thousands of repeated ones.</p></li><li><p><strong>Two-way communication</strong>: Both sides can send data anytime.</p></li></ul><p>It works over a TCP connection and keeps everything fast and responsive.</p><h2>Where are WebSockets used?</h2><p>WebSockets are everywhere in modern apps that need to be real-time.</p><ul><li><p><strong>Chat apps</strong> like WhatsApp or Messenger use them to send and receive messages quickly.</p></li><li><p><strong>Stock apps</strong> use WebSockets to show live price updates.</p></li><li><p><strong>Online games</strong> rely on it for smooth, instant interactions.</p></li></ul><p>It&#8217;s not just for browsers either lots of backend systems use WebSocket-based tools to power things behind the scenes.</p><h2>When NOT to use WebSockets?</h2><p>WebSockets are great, but they&#8217;re not always the right tool. If you're just loading data once &#8212; like fetching a list of users or getting a product page, a regular HTTP request is easier and lighter. It shine when you need updates <strong>right away</strong> and <strong>all the time</strong>.</p><p></p><p>So that&#8217;s WebSockets in a nutshell. They let your browser and server keep an open line of communication, sending messages back and forth in real-time. No more asking, no more waiting.</p><p>They&#8217;re perfect for anything where speed and instant updates matter chats, games, live scores, stock updates, and more.</p><p>It&#8217;s one of those things that makes the web feel alive. And now you know how it works!</p><div><hr></div><p>I hope, by now you must have had a clear idea of <strong>WebSockets,</strong> from its meaning to working you know all of it now.</p><p>Loved this deep dive? Hit a like &#10084;&#65039;<br>For more simple explanations, useful insights on coding, system design, and tech trends, <strong>Subscribe To My Newsletter! </strong>&#128640;</p><p>If you have any questions or suggestions, leave a comment.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.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">Subscribe to receive new article every week! </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></p><p>Follow me on <a href="https://www.linkedin.com/in/scortier/">LinkedIn</a>, <a href="https://x.com/scortierHQ">X</a> and <a href="https://www.instagram.com/_scortier_/">Instagram</a> to stay updated.</p><p>I hope you have a lovely day!</p><p>See you next week with more exciting content!</p><p><em>- Scortier</em></p><div><hr></div><p></p>]]></content:encoded></item><item><title><![CDATA[ElasticSearch 101: Part 2]]></title><description><![CDATA[Under the Hood: How Elasticsearch Really Works]]></description><link>https://grindengineer.substack.com/p/elasticsearch-101-part-2</link><guid isPermaLink="false">https://grindengineer.substack.com/p/elasticsearch-101-part-2</guid><dc:creator><![CDATA[Scortier]]></dc:creator><pubDate>Thu, 01 May 2025 06:49:56 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!GYJU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ed6f9ba-bc71-47f7-a88a-b62bf8986700_1982x1274.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!odWf!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01cb637b-a9f8-4fd1-abdd-06fbd97331e3_311x162.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!odWf!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01cb637b-a9f8-4fd1-abdd-06fbd97331e3_311x162.png 424w, https://substackcdn.com/image/fetch/$s_!odWf!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01cb637b-a9f8-4fd1-abdd-06fbd97331e3_311x162.png 848w, https://substackcdn.com/image/fetch/$s_!odWf!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01cb637b-a9f8-4fd1-abdd-06fbd97331e3_311x162.png 1272w, https://substackcdn.com/image/fetch/$s_!odWf!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01cb637b-a9f8-4fd1-abdd-06fbd97331e3_311x162.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!odWf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01cb637b-a9f8-4fd1-abdd-06fbd97331e3_311x162.png" width="311" height="162" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/01cb637b-a9f8-4fd1-abdd-06fbd97331e3_311x162.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:162,&quot;width&quot;:311,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:3005,&quot;alt&quot;:&quot;&quot;,&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://scortier.substack.com/i/162045001?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01cb637b-a9f8-4fd1-abdd-06fbd97331e3_311x162.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!odWf!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01cb637b-a9f8-4fd1-abdd-06fbd97331e3_311x162.png 424w, https://substackcdn.com/image/fetch/$s_!odWf!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01cb637b-a9f8-4fd1-abdd-06fbd97331e3_311x162.png 848w, https://substackcdn.com/image/fetch/$s_!odWf!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01cb637b-a9f8-4fd1-abdd-06fbd97331e3_311x162.png 1272w, https://substackcdn.com/image/fetch/$s_!odWf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01cb637b-a9f8-4fd1-abdd-06fbd97331e3_311x162.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><blockquote><p>Welcome to <em><strong><a href="https://scortier.substack.com/">Hello Engineer</a></strong></em>, your weekly guide to becoming a better software engineer! No fluff - pure engineering insights.</p><p>You can also checkout : <strong><a href="https://scortier.substack.com/p/elasticsearch-101-part-1">Elasticsearch 101: Part 1</a></strong></p></blockquote><p></p><blockquote><p><em>Don&#8217;t forget to check out the <strong>latest job openings</strong> at the end of the article!</em></p></blockquote><p></p><p>In <a href="https://scortier.substack.com/p/elasticsearch-101-part-1">Part 1</a>, we explored the basics of Elasticsearch, what it is, how you use it, and how it fits into modern systems. Now, let&#8217;s take a peek under the hood.</p><p>Okay, so you know how searching through tons of stuff online is usually pretty quick? Elasticsearch is a big reason for that. Now, Elasticsearch is cool on its own, but it's built on top of something even cooler: Apache Lucene.</p><p>Think of Lucene as the real engine for searching &#8211; it's super-fast at the nitty-gritty stuff. Elasticsearch is like the person managing that engine, making sure it runs smoothly when you have lots of different parts working together. It handles all the behind-the-scenes stuff like keeping your search setup organized (that's the "cluster"), giving you easy ways to talk to it, doing calculations across all your data, and making sure you get results right away. Lucene does the actual searching, but Elasticsearch makes it work for big, complex setups.</p><p>There's a lot to talk about, but let's start with how an Elasticsearch setup (a "cluster") is organized. Then we can look at how it gets your information ready to be searched and how it actually finds what you're looking for.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://grindengineer.substack.com/subscribe?"><span>Subscribe now</span></a></p><h3>The Different Helpers: Node Types</h3><p>Elasticsearch likes to work as a team, so you usually have a bunch of servers running together &#8211; we call these "nodes." When you start Elasticsearch, you're basically starting up a few of these helpers. Each helper can have a specific job. Here are the main roles:</p><ul><li><p><strong>Master Node:</strong> This is like the team leader. It's in charge of the whole operation &#8211; adding or removing helpers, and creating or getting rid of your search collections (we call them "indices").</p></li><li><p><strong>Data Node:</strong> These are the ones who actually hold all your information. If you have a lot of stuff to search, you'll have a lot of these helpers.</p></li><li><p><strong>Coordinating Node:</strong> This is the friendly face that takes your search requests and then talks to the other helpers to get you the answers. It's like the person you first talk to.</p></li><li><p><strong>Ingest Node:</strong> This is the one who gets your information ready. It takes your raw data and prepares it so the Data nodes can store and search it easily.</p></li><li><p><strong>Machine Learning Node:</strong> This helper does any of the fancy computer learning stuff you might want to do with your data.</p></li></ul><p>All the different "helpers" in Elasticsearch - like the ones that prep data (Ingest), store it (Data), or handle queries (Coordinating) - work together like a well-organized team. Imagine the Ingest helpers cleaning up raw data and handing it off to the Data helpers, who carefully store it away.</p><p>The cool part? One server can wear multiple hats! A single server might act as the team leader, a friendly receptionist, and a storage unit all at once. But in larger setups, it's common to split the roles across multiple machines. For example, data prep might need a lot of CPU power, while storing tons of data requires disk space.</p><p>It gets even more organized&#8212;data can be split based on how often it&#8217;s needed:</p><ul><li><p><strong>Hot data</strong>: used all the time, super fast access.</p></li><li><p><strong>Warm data</strong>: accessed occasionally.</p></li><li><p><strong>Cold data</strong>: rarely touched.</p></li><li><p><strong>Frozen data</strong>: almost never used, but still there just in case.</p></li></ul><p>This structure helps Elasticsearch balance performance and cost really well.</p><h3>Data Nodes: Where the Searching Happens</h3><p>The Data helpers in Elasticsearch are the ones doing the heavy lifting - they safely store your documents and make them lightning-fast to search. How? By keeping two things:</p><ol><li><p>The <strong>original data</strong> (your full documents)</p></li><li><p>The <strong>Lucene-powered indexes</strong> (think: smart shortcuts for searching)</p></li></ol><p>Imagine you&#8217;re in a library. The actual books are your documents, and the index at the back of each book helps you jump right to the good stuff. That&#8217;s how search works in Elasticsearch.</p><p>When you run a search, two steps kick in:</p><ul><li><p><strong>Query phase</strong>: Elasticsearch uses those Lucene indexes to quickly find which documents match your search.</p></li><li><p><strong>Fetch phase</strong>: Then it pulls the actual document content from the Data helpers so you can read it.</p></li></ul><p>Now, inside these Data helpers live your <strong>indices</strong> - basically organized folders of documents. These indices are split into <strong>shards</strong> (smaller chunks), and each shard can have one or more <strong>replicas</strong> (backups). And each shard has its very own Lucene index inside, like mini search engines inside your main search engine.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!GYJU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ed6f9ba-bc71-47f7-a88a-b62bf8986700_1982x1274.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GYJU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ed6f9ba-bc71-47f7-a88a-b62bf8986700_1982x1274.png 424w, https://substackcdn.com/image/fetch/$s_!GYJU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ed6f9ba-bc71-47f7-a88a-b62bf8986700_1982x1274.png 848w, https://substackcdn.com/image/fetch/$s_!GYJU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ed6f9ba-bc71-47f7-a88a-b62bf8986700_1982x1274.png 1272w, https://substackcdn.com/image/fetch/$s_!GYJU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ed6f9ba-bc71-47f7-a88a-b62bf8986700_1982x1274.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GYJU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ed6f9ba-bc71-47f7-a88a-b62bf8986700_1982x1274.png" width="1456" height="936" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1ed6f9ba-bc71-47f7-a88a-b62bf8986700_1982x1274.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:936,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:197890,&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://scortier.substack.com/i/162244204?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ed6f9ba-bc71-47f7-a88a-b62bf8986700_1982x1274.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!GYJU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ed6f9ba-bc71-47f7-a88a-b62bf8986700_1982x1274.png 424w, https://substackcdn.com/image/fetch/$s_!GYJU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ed6f9ba-bc71-47f7-a88a-b62bf8986700_1982x1274.png 848w, https://substackcdn.com/image/fetch/$s_!GYJU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ed6f9ba-bc71-47f7-a88a-b62bf8986700_1982x1274.png 1272w, https://substackcdn.com/image/fetch/$s_!GYJU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ed6f9ba-bc71-47f7-a88a-b62bf8986700_1982x1274.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><p>"Sharding" is what lets Elasticsearch spread your information (and those search shortcuts) across multiple servers. This is what makes it really fast and able to handle tons of data. When you search, Elasticsearch can ask all the relevant parts at the same time, and then the friendly face helper puts all the answers together for you.</p><p>Now, about those "replicas." They're just exact copies of your shards. Why have copies? Two main reasons:</p><ol><li><p><strong>Keeping Things Running:</strong> If one of your servers has a problem, the copy can jump in and make sure you can still access your information. It's like having a spare tire.</p></li><li><p><strong>Handling More Searches:</strong> If one part can handle, say, 10 searches at once, then having a copy means you can probably handle 20 at once (roughly speaking). It's like having more checkout lanes at a store.</p></li></ol><p>Lastly, remember that each of those Elasticsearch parts (shards) has its own little Lucene search engine inside. So, a lot of what Elasticsearch does with these parts &#8211; like putting smaller pieces together, making them fresh, and of course, searching &#8211; is really just telling the Lucene engines inside what to do.</p><h3>Lucene's Building Blocks: Segments</h3><p>Think of a Lucene index as being made up of smaller chunks called "segments." These segments are the basic units our search engine works with. Now, here's a key thing to wrap your head around: <strong>once a segment is created, it can't be changed.</strong> Let that sink in for a sec. You might be thinking, "Wait a minute, don't we constantly add, update, and delete stuff in our Elasticsearch data?" Good question!</p><p>The way Lucene handles this is by being clever with how it writes. When you add a new document, it doesn't go straight into an existing segment. Instead, it gets bundled up with other new documents. Once there's a little batch of them, Lucene creates a brand new segment and writes all those documents into it. It's like collecting your dirty laundry and then doing a whole load at once, rather than washing each sock individually.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8btQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24e0a361-35c1-4663-be36-db05e6d280a7_1982x1272.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8btQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24e0a361-35c1-4663-be36-db05e6d280a7_1982x1272.png 424w, https://substackcdn.com/image/fetch/$s_!8btQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24e0a361-35c1-4663-be36-db05e6d280a7_1982x1272.png 848w, https://substackcdn.com/image/fetch/$s_!8btQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24e0a361-35c1-4663-be36-db05e6d280a7_1982x1272.png 1272w, https://substackcdn.com/image/fetch/$s_!8btQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24e0a361-35c1-4663-be36-db05e6d280a7_1982x1272.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8btQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24e0a361-35c1-4663-be36-db05e6d280a7_1982x1272.png" width="1456" height="934" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/24e0a361-35c1-4663-be36-db05e6d280a7_1982x1272.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:934,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:211782,&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://scortier.substack.com/i/162244204?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24e0a361-35c1-4663-be36-db05e6d280a7_1982x1272.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!8btQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24e0a361-35c1-4663-be36-db05e6d280a7_1982x1272.png 424w, https://substackcdn.com/image/fetch/$s_!8btQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24e0a361-35c1-4663-be36-db05e6d280a7_1982x1272.png 848w, https://substackcdn.com/image/fetch/$s_!8btQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24e0a361-35c1-4663-be36-db05e6d280a7_1982x1272.png 1272w, https://substackcdn.com/image/fetch/$s_!8btQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24e0a361-35c1-4663-be36-db05e6d280a7_1982x1272.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>Now, what happens when you have a ton of these segments? It can get a bit messy. So, Lucene has a process to merge them. It takes a few segments, combines them into a new, bigger segment, and then gets rid of the old smaller ones. It's like taking a bunch of small piles of papers and combining them into a few larger, more organized stacks.</p><p>When you <strong>delete</strong> a document, Lucene doesn&#8217;t erase it right away. Instead, it marks it as "invisible"&#8212;like sticking a Post-it note that says <em>"ignore this one."</em> The actual data is still there until Lucene later cleans it up during <strong>segment merges</strong>.</p><p><strong>Updating</strong> is even trickier! There&#8217;s no in-place update. Instead, Lucene marks the old version as deleted and adds the new version as a brand-new document. So technically, every update is a delete + insert behind the scenes.</p><p>This makes both deletes and updates <em>really fast</em>&#8212;at first. But over time, too many of them can slow things down until Lucene merges and tidies things up. So go easy on those frequent updates!</p><p>This "can't change once it's written" approach (we call it immutability) actually has some pretty cool benefits for Lucene:</p><ul><li><p><strong>Faster Writing:</strong> Adding new stuff is quick because it just goes into new segments without messing with the old ones.</p></li><li><p><strong>Efficient Caching:</strong> Since segments never change, the system can safely keep copies of them in memory (like a super-fast shortcut) without worrying that the data will become outdated.</p></li><li><p><strong>Simpler Coordination:</strong> When you're searching, the system doesn't have to worry about the data changing while it's in the middle of looking. This makes things much simpler when lots of people are searching at the same time.</p></li><li><p><strong>Easier Recovery:</strong> If something crashes, it's easier to get back up and running because the segments are in a consistent, known state.</p></li><li><p><strong>Better Compression:</strong> Data that doesn't change can be squeezed down more effectively to save disk space.</p></li><li><p><strong>Quicker Searches:</strong> The unchanging nature of segments allows for some really clever and fast ways to organize and search the data.</p></li></ul><h3>What's Inside These Segments?</h3><p>Segments aren't just dumb containers holding your documents. They also have some super smart data structures inside that make searching really fast. Two of the most important ones are the <strong>inverted index</strong> and <strong>doc values</strong>.</p><h4>The Inverted Index: The Heart of Fast Search</h4><p>If Lucene is the heart of Elasticsearch, then the inverted index is definitely the heart of Lucene. Basically, if you want to find things quickly, you have a couple of main strategies:</p><ol><li><p><strong>Organize your data based on how you want to find it.</strong> For example, if you want to quickly look up a specific book by its ID, a simple list where you have to check every book (O(n) &#8211; that's computer science speak for "slow for lots of books") would be bad. A sorted list (O(log(n)) &#8211; better) would be okay, but a hash table (O(1) &#8211; super fast!) would be ideal.</p></li><li><p><strong>Make a copy of your data and organize that copy in a smart way (like in point 1).</strong></p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!1JnU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a5c82bc-8a57-49b7-b002-f4a7f59278b3_1206x778.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!1JnU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a5c82bc-8a57-49b7-b002-f4a7f59278b3_1206x778.png 424w, https://substackcdn.com/image/fetch/$s_!1JnU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a5c82bc-8a57-49b7-b002-f4a7f59278b3_1206x778.png 848w, https://substackcdn.com/image/fetch/$s_!1JnU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a5c82bc-8a57-49b7-b002-f4a7f59278b3_1206x778.png 1272w, https://substackcdn.com/image/fetch/$s_!1JnU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a5c82bc-8a57-49b7-b002-f4a7f59278b3_1206x778.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!1JnU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a5c82bc-8a57-49b7-b002-f4a7f59278b3_1206x778.png" width="1206" height="778" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0a5c82bc-8a57-49b7-b002-f4a7f59278b3_1206x778.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:778,&quot;width&quot;:1206,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:97741,&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://scortier.substack.com/i/162244204?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a5c82bc-8a57-49b7-b002-f4a7f59278b3_1206x778.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!1JnU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a5c82bc-8a57-49b7-b002-f4a7f59278b3_1206x778.png 424w, https://substackcdn.com/image/fetch/$s_!1JnU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a5c82bc-8a57-49b7-b002-f4a7f59278b3_1206x778.png 848w, https://substackcdn.com/image/fetch/$s_!1JnU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a5c82bc-8a57-49b7-b002-f4a7f59278b3_1206x778.png 1272w, https://substackcdn.com/image/fetch/$s_!1JnU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a5c82bc-8a57-49b7-b002-f4a7f59278b3_1206x778.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>Let's say you have a billion books, and only a few of them have the word "great" in the title. How would you find those books as fast as possible?</p><p>An <strong>inverted index</strong> is like a special kind of index that maps words (or numbers, etc.) to where they appear in your data (in our case, which documents they're in). This is what makes keyword search with Elasticsearch so speedy. It lists every unique word that appears in any of your documents and then tells you exactly which documents contain that word. So, for our "great" example, the inverted index would have an entry like:</p><pre><code><code>"great" -&gt; [document #12, document #53, ...]</code></code></pre><p>Now, instead of having to look through every single book to see if the title contains "great," we can just look up "great" in our inverted index and BAM! We instantly know which documents have it.</p><h4>Doc Values: For Sorting and More</h4><p>When you want to sort search results, say by price - Elasticsearch uses something called <strong>doc values</strong> to keep things fast.</p><p>Instead of scanning every full document just to get one field (like traditional row-based databases), Elasticsearch stores field values like "price" in a <strong>columnar format</strong>. This means all the prices are stored together, all the authors together, and so on.</p><p>So when you search for books with "great" in the title and want to sort them by price, Elasticsearch can quickly grab just the price values from memory, sort them, and return the results&#8212;without touching the rest of the document. Efficient and speedy!</p><h3>Coordinating Nodes: The Traffic Cops</h3><p>Remember how Elasticsearch is like a team of servers? Well, <strong>coordinating nodes</strong> are the traffic cops of that team. When you send a search request, they&#8217;re the first to receive it. Their job is to figure out which servers (nodes) need to help answer the query, send out those requests, and then gather all the results and stitch them together for you.</p><p>One of their biggest responsibilities is <strong>query planning</strong>&#8212;basically, choosing the smartest, fastest way to get your answer. Think of it like them plotting the most efficient route on a GPS before you hit the road. After the coordinating node understands what you're asking for, the query planner figures out things like:</p><ul><li><p>Should we use the inverted index?</p></li><li><p>If our search has multiple parts, what's the best order to do them in?</p></li><li><p>How should we combine the results we get back from all the different servers?</p></li></ul><h4>Order Optimization: Being Smart About Searching</h4><p>Let's say you're searching for the phrase "bill nye" across millions of documents. In our inverted index, the word "bill" might appear in millions of documents, but the word "nye" might only appear in a few hundred. How should the system go about finding documents that contain both? There are a bunch of ways it could do it:</p><ul><li><p>Find all documents with "nye," then check each of those to see if they also contain "bill" and then do a more detailed check for "bill nye."</p></li><li><p>Find all documents with "bill," then check each of those for "nye" and then do a more detailed check for "bill nye."</p></li><li><p>...and many other possibilities!</p></li></ul><p>The difference in speed between these approaches can be huge!</p><p>By keeping track of information about the data (like which words are common, how long documents are, etc.), Elasticsearch's query planner can make smart choices about the best way to perform the search. It tries to minimize the amount of work needed to get you your results quickly. This optimization becomes really important as your data gets bigger and your searches get more complex.</p><div><hr></div><p>I hope you&#8217;ve got a good grasp of how Elasticsearch works under the hood, its inner workings, exploring the cluster architecture, and much more.</p><p>Loved this deep dive? Hit a like &#10084;&#65039;<br>For more simple explanations, useful insights on coding, system design, and tech trends, <strong>Subscribe To My Newsletter! </strong>&#128640;</p><p>If you have any questions or suggestions, leave a comment.</p><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.substack.com/p/elasticsearch-101-part-2?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="CaptionedButtonToDOM"><div class="preamble"><p class="cta-caption">This post is public so feel free to share it.</p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.substack.com/p/elasticsearch-101-part-2?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://grindengineer.substack.com/p/elasticsearch-101-part-2?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><p>Follow me on <a href="https://www.linkedin.com/in/scortier/">LinkedIn</a>, <a href="https://x.com/scortierHQ">X</a> and <a href="https://www.instagram.com/_scortier_/">Instagram</a> to stay updated.</p><p>I hope you have a lovely day!</p><p>See you next week with more exciting content!</p><p>Signing Off,<br>Scortier</p><div class="poll-embed" data-attrs="{&quot;id&quot;:309271}" data-component-name="PollToDOM"></div><div><hr></div><h3><strong>Exciting Job Opportunities &#128640;</strong></h3><ul><li><p>Software Engineer, Rippling : <a href="https://www.linkedin.com/jobs/collections/recommended/?currentJobId=4217144440">Link</a></p></li><li><p>Software Engineer, Atlassian: <a href="https://www.linkedin.com/jobs/collections/recommended/?currentJobId=4212978315">Link</a></p></li><li><p>Software Engineer, Backend, Coinbase : <a href="https://www.linkedin.com/jobs/collections/recommended/?currentJobId=4095195699">Link</a></p></li><li><p>Software Engineer, Amazon : <a href="https://www.linkedin.com/jobs/collections/recommended/?currentJobId=4211789290">Link</a></p></li><li><p>Software Engineer, Google : <a href="https://www.linkedin.com/jobs/collections/recommended/?currentJobId=4174742757">Link</a></p></li><li><p>Software Engineer, Uber : <a href="https://www.linkedin.com/jobs/view/4202746612/?eBP=CwEAAAGWcpT0Xg9nF5Ntxx9cZbhqcUBbWni1XgtYeGLtThO6ICdOrprSH50LI3Vz3JGyQnmd4URmLbs7KLIVkHpcPC3T6o_aNEH9ryBgT36xHwkZ-w3cNTVxdGunSvU-LjfLkKpneFP1HK5ycQVJQvUSKIHM9JdF3LB3_IXhcXO6KryaCu5Y-X-bpBjueN85ZvoERdC5nW2niu4MUUPFmtuB8bVIg4Xo7e89jVIR37k-xDdN6pZ1AHjSvzg5-nA0L1Sj3FPKCZnc21YuxuUjNwoz-o5SLv9NiL94jSmM5-0mFNsUHcjYG5KNDOJH259LEoUtCojK33IGYanKGt7OnMFHsXp0VO5C2-zGIT1fKIJfMzNJvHNVxe7saP5swplpCkXfun9-T9U7pIw3sH6P-17uD0DhvZSQgokNiGkM1j4dJYavCbAoqXuHtAcUDdzGI6jpYKX6dblYwCpnRlT5j3eHOtaXdrRuwc8ZYs-DhA&amp;refId=K3duFslzwUixH1nzc8arxg%3D%3D&amp;trackingId=VvajQooU0wReW8vteYE4Nw%3D%3D&amp;trk=flagship3_jobs_discovery_jymbii">Link</a></p></li><li><p>Software Engineer, Meta : <a href="https://www.linkedin.com/jobs/view/4140436568/?eBP=BUDGET_EXHAUSTED_JOB&amp;refId=K3duFslzwUixH1nzc8arxg%3D%3D&amp;trackingId=B9SMXe%2Bpd%2FShNk9ObT6mjg%3D%3D&amp;trk=flagship3_jobs_discovery_jymbii">Link</a></p></li></ul><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.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 Hello Engineer! Subscribe for free to receive new articles every week.</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><div><hr></div><p></p>]]></content:encoded></item><item><title><![CDATA[Elasticsearch 101: Part 1]]></title><description><![CDATA[An Introduction to the Basics of Search and Indexing with Elasticsearch]]></description><link>https://grindengineer.substack.com/p/elasticsearch-101-part-1</link><guid isPermaLink="false">https://grindengineer.substack.com/p/elasticsearch-101-part-1</guid><dc:creator><![CDATA[Scortier]]></dc:creator><pubDate>Sun, 27 Apr 2025 06:40:57 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/ac7cc4e7-935b-4e24-8e52-454249c8bbc1_319x158.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!odWf!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01cb637b-a9f8-4fd1-abdd-06fbd97331e3_311x162.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!odWf!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01cb637b-a9f8-4fd1-abdd-06fbd97331e3_311x162.png 424w, https://substackcdn.com/image/fetch/$s_!odWf!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01cb637b-a9f8-4fd1-abdd-06fbd97331e3_311x162.png 848w, https://substackcdn.com/image/fetch/$s_!odWf!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01cb637b-a9f8-4fd1-abdd-06fbd97331e3_311x162.png 1272w, https://substackcdn.com/image/fetch/$s_!odWf!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01cb637b-a9f8-4fd1-abdd-06fbd97331e3_311x162.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!odWf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01cb637b-a9f8-4fd1-abdd-06fbd97331e3_311x162.png" width="311" height="162" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/01cb637b-a9f8-4fd1-abdd-06fbd97331e3_311x162.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:162,&quot;width&quot;:311,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:3005,&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://scortier.substack.com/i/162045001?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01cb637b-a9f8-4fd1-abdd-06fbd97331e3_311x162.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!odWf!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01cb637b-a9f8-4fd1-abdd-06fbd97331e3_311x162.png 424w, https://substackcdn.com/image/fetch/$s_!odWf!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01cb637b-a9f8-4fd1-abdd-06fbd97331e3_311x162.png 848w, https://substackcdn.com/image/fetch/$s_!odWf!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01cb637b-a9f8-4fd1-abdd-06fbd97331e3_311x162.png 1272w, https://substackcdn.com/image/fetch/$s_!odWf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01cb637b-a9f8-4fd1-abdd-06fbd97331e3_311x162.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><p></p><blockquote><p>Welcome to <em><strong><a href="https://scortier.substack.com/">Hello Engineer</a></strong></em>, your weekly guide to becoming a better software engineer! No fluff - pure engineering insights.</p><p>You can also checkout : <strong><a href="https://scortier.substack.com/p/cap-theorem-explained">CAP Theorem Explained!</a></strong></p></blockquote><p></p><blockquote><p><em>Don&#8217;t forget to check out the <strong>latest job openings</strong> at the end of the article!</em></p></blockquote><h2>Intro</h2><p>A lot of system design problems boil down to one thing: finding stuff. You&#8217;ve got a huge pile of "things" and need a smart way to get the right one when you ask for it. Sure, databases like Postgres (with full-text search) can handle that up to a point. But when things get serious, think more scale, more features, you&#8217;ll want a tool built just for the job. That&#8217;s where Elasticsearch shines.</p><p>Elasticsearch is one of the most popular search engines out there. It's fast, it&#8217;s flexible, and it&#8217;s built to handle stuff like sorting, filtering, ranking, and all the other bells and whistles that make modern search actually useful.</p><h1>Basics</h1><p>Let&#8217;s start with the basics. If you're working with Elasticsearch, there are a few key terms you&#8217;ll hear all the time: <strong>documents</strong>, <strong>indices</strong>, <strong>mappings</strong>, and <strong>fields</strong>.</p><h2>Documents</h2><p>Think of <strong>documents</strong> as the core pieces of data you&#8217;re storing and searching. Don&#8217;t let the term throw you off, it doesn&#8217;t have to be a blog post or a PDF. In Elasticsearch, a document is just a JSON object.</p><p>Here&#8217;s a new example: imagine you&#8217;re building a recipe app. Each recipe can be a document, like this:</p><pre><code>{
  "id": "RECIPE001",
  "title": "Spaghetti Carbonara",
  "chef": "Mario Rossi",
  "ingredients": ["spaghetti", "eggs", "pancetta", "parmesan", "pepper"],
  "prepTimeMinutes": 25,
  "createdAt": "2025-03-12T10:00:00.000Z"
}
</code></pre><p>This is what Elasticsearch will index and allow you to search through, by title, chef, ingredients, or whatever else you include.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://grindengineer.substack.com/subscribe?"><span>Subscribe now</span></a></p><h2>Indices</h2><p>An <strong>index</strong> in Elasticsearch is basically a collection of documents. Think of it like a table in a traditional database, each document in that index has a unique ID and a bunch of fields (just key-value pairs) that hold the data you want to search.</p><p>For example, in our recipe app, we might have an index called recipes, where each document is a different recipe.</p><p>Just a quick note: the word <em>index</em> can be a bit confusing. In general tech terms, &#8220;index&#8221; often means a data structure that makes lookups faster (like in SQL). Here in Elasticsearch, we&#8217;re talking about the top-level container that holds documents.</p><p>You could have multiple indices, one for recipes, one for chefs, another for user reviews, and so on, whatever makes sense for your app. And when you search, you&#8217;re querying one or more of these indices to find what you need.</p><h2>Mappings and Fields</h2><p>Okay, so you&#8217;ve got your documents, and you&#8217;ve got your index. But how does Elasticsearch know what kind of data it&#8217;s dealing with? That&#8217;s where <strong>mappings</strong> come in.</p><p>A <strong>mapping</strong> is like a blueprint or schema for your index. It tells Elasticsearch, &#8220;Hey, this field is a number, that one&#8217;s a date, and this one over here? Yeah, treat it like plain ol&#8217; text.&#8221;</p><p>For example, let&#8217;s say we&#8217;re storing recipes. Here&#8217;s a simple mapping:</p><pre><code>{
  "properties": {
    "id":        { "type": "keyword" },
    "title":     { "type": "text" },
    "chef":      { "type": "text" },
    "rating":    { "type": "float" },
    "createdAt": { "type": "date" }
  }
}
</code></pre><p>Let&#8217;s break that down:</p><ul><li><p><code>id </code>is a <strong>keyword</strong>, which means it&#8217;s not broken up, Elasticsearch treats it as a single value, perfect for exact matches.</p></li><li><p><code>title</code> and <code>chef</code> are <strong>text</strong>, so they get analyzed and split up into terms. Useful for full-text search (like searching for "chocolate").</p></li><li><p><code>rating</code> is a <strong>float</strong>, so we can sort or filter by it.</p></li><li><p><code>createdAt</code> is a <strong>date</strong>, which means we can do date-range queries and sorting.</p></li></ul><p>Elasticsearch is super flexible, you can even use nested objects, arrays, geolocation fields, or fancy stuff like embeddings for AI-powered search. But don&#8217;t worry, you don&#8217;t need all of that to get started.</p><blockquote><p><strong>Tip</strong>: </p><p>Only include fields you actually need for searching or filtering. Adding extra fields &#8220;just in case&#8221; makes your index bigger and slower. If you&#8217;re only searching on 2 out of 10 fields, don&#8217;t waste memory on the other 8!</p></blockquote><p>Mapping is one of the best tools you have to control search behavior <em>and</em> performance, so get to know it well!</p><p>Let&#8217;s walk through a series of operations to create an index, store some data, and perform a search to get a feel for the essential functionality.</p><p></p><p>Elasticsearch offers a clean and friendly REST API to handle these operations. You can use tools like curl, Postman, or Kibana&#8217;s Dev Tools interface to interact with your cluster. While Elasticsearch also has many client libraries and GUI tools, the REST API is where everything starts.</p><p>This step-by-step flow gives you a taste of what working with Elasticsearch actually looks like.</p><h1>Use Cases</h1><h2>Creating an Index</h2><p>Imagine you're starting a library and need to set up shelves. A basic index is like setting up your shelves in a library. By default, Elasticsearch will automatically organize things for you, but you can add your own specific instructions, like how many shelves (shards) you want and how many backup shelves (replicas) there should be. Here's a quick example:</p><pre><code>PUT /library
{
  "settings": {
    "number_of_shards": 2,
    "number_of_replicas": 1
  }
}
</code></pre><h2>Setting a Mapping</h2><p>Now, you want to tell Elasticsearch exactly how to handle each book (field). Maybe you have a "title," an "author," and a "price" that need to be treated differently, right? Let&#8217;s be clear about the categories (types) before we start putting in books. Here's what that could look like:</p><pre><code>PUT /library/_mapping
{
  "properties": {
    "title": { "type": "text" },
    "author": { "type": "keyword" },
    "price": { "type": "float" },
    "publish_date": { "type": "date" }
  }
}
</code></pre><p>Now Elasticsearch knows that your books will have <strong>titles</strong>, <strong>authors</strong>, <strong>prices</strong>, and <strong>publish dates</strong>. You can add more complex stuff, like reviews, later if needed.</p><h2>Adding Documents</h2><p>Now, let&#8217;s fill up our shelves! To add books, you just make a quick POST request. For instance, let's add a book:</p><pre><code>POST /library/_doc
{
  "title": "The Alchemist",
  "author": "Paulo Coelho",
  "price": 15.99,
  "publish_date": "1988-05-01"
}
</code></pre><p>When Elasticsearch accepts this, it&#8217;ll give you a nice little ID for the book (like a library catalog number). So, you can always retrieve or update it later.</p><h2>Updating Documents</h2><p>Let's say you want to raise the price of "The Alchemist" because it's now a bestseller. You can do that with a PUT request. Just target the book by its unique catalog ID:</p><pre><code>PUT /library/_doc/1
{
  "title": "The Alchemist",
  "author": "Paulo Coelho",
  "price": 19.99,
  "publish_date": "1988-05-01"
}
</code></pre><p>But <strong>beware!</strong> If someone else is also updating the same book at the same time, you could accidentally overwrite their changes. Elasticsearch offers a little helper called the <strong>version number</strong> to avoid that.</p><h2>Search</h2><p>Now that we have books in the library, let&#8217;s search for them! If you&#8217;re looking for books by Paulo Coelho, just use a simple search like this:</p><pre><code>GET /library/_search
{
  "query": {
    "match": {
      "author": "Paulo Coelho"
    }
  }
}
</code></pre><p>Boom! You&#8217;ll get all the books by this author. What if you want to look for books that cost less than $20? No problem!</p><pre><code>GET /library/_search
{
  "query": {
    "bool": {
      "must": [
        { "match": { "author": "Paulo Coelho" } },
        { "range": { "price": { "lte": 20 } } }
      ]
    }
  }
}
</code></pre><p>Now you're getting books that are by Paulo Coelho and cost under $20.</p><h2>Sort</h2><p>But wait, we&#8217;re not done! Sometimes you want to see the books in a certain order. Maybe you want to see the cheapest books first or the newest ones last. Sorting is simple:</p><p><strong>Sort by price (ascending):</strong></p><pre><code>GET /library/_search
{
  "sort": [
    { "price": "asc" }
  ],
  "query": {
    "match_all": {}
  }
}
</code></pre><p>Sort by price and then by publish date (descending):</p><pre><code>GET /library/_search
{
  "sort": [
    { "price": "asc" },
    { "publish_date": "desc" }
  ],
  "query": {
    "match_all": {}
  }
}
</code></pre><p>This sorts first by price, and then if two books have the same price, it sorts them by publish date, starting from the most recent.</p><h2>Nested Searches</h2><p>Let&#8217;s add a little complexity! Imagine you have a list of reviews for each book. You can search through these reviews to find books with the best ratings. Check this out:</p><pre><code>GET /library/_search
{
  "query": {
    "nested": {
      "path": "reviews",
      "query": {
        "bool": {
          "must": [
            { "match": { "reviews.comment": "life-changing" } },
            { "range": { "reviews.rating": { "gte": 4 } } }
          ]
        }
      }
    }
  }
}
</code></pre><p>This searches for books with a review comment containing "life-changing" and a rating of 4 or more stars. Talk about precision!</p><h3><strong>How Elasticsearch Works ?</strong></h3><p>So, you&#8217;re already using Elasticsearch, but ever wonder what&#8217;s going on behind the scenes? How is it making everything so fast and smooth? Here&#8217;s the scoop:</p><p>At the core, Elasticsearch is powered by <strong>Lucene</strong>, a super-efficient search library. Think of <strong>Lucene</strong> as the engine that does all the heavy lifting, and <strong>Elasticsearch</strong> is the conductor making sure everything runs in sync.</p><h3><strong>What&#8217;s Happening in Elasticsearch?</strong></h3><ol><li><p><strong>Cluster</strong>: This is like a team of servers working together. It&#8217;s like a library, but bigger&#8212;think multiple libraries in different cities working as one.</p></li><li><p><strong>Node</strong>: Each server in the cluster is a node. So, every node is like a librarian with their own little section of the library.</p></li><li><p><strong>Index</strong>: This is where your data (like documents or books) is stored. It&#8217;s the bookshelf where Elasticsearch keeps everything organized.</p></li><li><p><strong>Shards and Replicas</strong>: To make sure everything is fast and safe, Elasticsearch breaks up each index into <strong>shards</strong>, tiny chunks of data. These chunks are spread across different servers (nodes). And just like having backup copies of your favorite book, <strong>replicas</strong> are extra copies of these chunks to keep your data safe and available.</p></li></ol><h3><strong>Indexing: How Elasticsearch Organizes Your Stuff</strong></h3><p>When you add data to Elasticsearch, it doesn&#8217;t just throw it into a random pile. It <strong>indexes</strong> it, which means it organizes everything neatly to make searching super quick. This is done with something called an <strong>inverted index</strong>.</p><p>Here&#8217;s an easy way to think about it: imagine a book index. You look up a word, and it tells you all the pages where that word appears. Elasticsearch does this for every single word in your data. So when you search for something, it doesn&#8217;t have to read everything, it just checks the <strong>inverted index</strong> to find exactly what you need, super fast.</p><h3><strong>Searching: How Elasticsearch Finds What You Want</strong></h3><p>When you search, Elasticsearch doesn&#8217;t go through every document one by one. Here&#8217;s how it works:</p><ol><li><p><strong>Your Search</strong>: You type something like, &#8220;Find books by Paulo Coelho,&#8221; and Elasticsearch figures out where that data is stored.</p></li><li><p><strong>Distributed Search</strong>: Since Elasticsearch is spread out over multiple servers (nodes), it sends the search request to all the right places.</p></li><li><p><strong>Lucene Does the Work</strong>: Each server uses <strong>Lucene</strong> to find the documents that match your search.</p></li><li><p><strong>Results</strong>: Elasticsearch collects the results from all the servers and sends them back to you.</p></li></ol><h2>Wrapping Up!</h2><p>I hope you&#8217;ve got a good grasp of how Elasticsearch works so far! In the next part, we'll dive even deeper into its inner workings, exploring the cluster architecture, and much more. </p><p>Loved this deep dive? Hit a like &#10084;&#65039;<br>For more simple explanations, useful insights on coding, system design, and tech trends, <strong>Subscribe To My Newsletter! </strong>&#128640;</p><p>If you have any questions or suggestions, leave a comment.</p><p>See you next week with more exciting content!</p><div><hr></div><h3><strong>Exciting Job Opportunities &#128640;</strong></h3><ul><li><p>Software Engineer, Core Infra, Stripe : <a href="https://www.linkedin.com/jobs/view/4159349417/?eBP=CwEAAAGWcpT0XmLi3r_gQMifezw3cipX49VGZLjgOKh2eV6TpNpeE74FTVat6mDcQZ2Ed664_Sz0SbOnSuZg7t7bkI_vgjtB-Yu7BtREvH4H7O8m_buwDOqQj7vgJfQ9riGvFrNMOmQVusRv6xosVVfQ3XDO0CVf48kF8yp4q3sq6_8dbp2UWjDJKRpb0dc3BgHq34dD_oltFhPH_jEn0h4ZPeAyI20nn6tZJA8qh95Ne3q651ctULkNAHsnOkdz3t1EI4LoCNWU_QsBU6Q9CcUINOtLU7KY9v_vhg0PVGjHnc243YqOGi6A2A2NP_GNPGrIEd03xEvarS5pwExcYZD9slRJUUvgC3RgM-mqehiaT6zTsX6GJan7aImcihEdP2hPpeaSmDKUmtbmZ3A8Hk3xQVeLTqmLWsMwK8YH9Ln6cazZTl4INoDPVBr4yzPDF4p5GfEidg&amp;refId=K3duFslzwUixH1nzc8arxg%3D%3D&amp;trackingId=iptwk6H2DCd5y8x2FOXStw%3D%3D&amp;trk=flagship3_jobs_discovery_jymbii">Link</a></p></li><li><p>Software Engineer, DE Shaw : <a href="https://www.linkedin.com/jobs/view/3889498506/?eBP=BUDGET_EXHAUSTED_JOB&amp;refId=K3duFslzwUixH1nzc8arxg%3D%3D&amp;trackingId=X69To12aO8xWsuk9fL937w%3D%3D&amp;trk=flagship3_jobs_discovery_jymbii">Link</a></p></li><li><p>Software Engineer, Backend, Coinbase : <a href="https://www.linkedin.com/jobs/collections/recommended/?currentJobId=4095195699">Link</a></p></li><li><p>Software Engineer, Google : <a href="https://www.linkedin.com/jobs/collections/recommended/?currentJobId=4174742757">Link</a></p></li><li><p>Software Engineer, Uber : <a href="https://www.linkedin.com/jobs/view/4202746612/?eBP=CwEAAAGWcpT0Xg9nF5Ntxx9cZbhqcUBbWni1XgtYeGLtThO6ICdOrprSH50LI3Vz3JGyQnmd4URmLbs7KLIVkHpcPC3T6o_aNEH9ryBgT36xHwkZ-w3cNTVxdGunSvU-LjfLkKpneFP1HK5ycQVJQvUSKIHM9JdF3LB3_IXhcXO6KryaCu5Y-X-bpBjueN85ZvoERdC5nW2niu4MUUPFmtuB8bVIg4Xo7e89jVIR37k-xDdN6pZ1AHjSvzg5-nA0L1Sj3FPKCZnc21YuxuUjNwoz-o5SLv9NiL94jSmM5-0mFNsUHcjYG5KNDOJH259LEoUtCojK33IGYanKGt7OnMFHsXp0VO5C2-zGIT1fKIJfMzNJvHNVxe7saP5swplpCkXfun9-T9U7pIw3sH6P-17uD0DhvZSQgokNiGkM1j4dJYavCbAoqXuHtAcUDdzGI6jpYKX6dblYwCpnRlT5j3eHOtaXdrRuwc8ZYs-DhA&amp;refId=K3duFslzwUixH1nzc8arxg%3D%3D&amp;trackingId=VvajQooU0wReW8vteYE4Nw%3D%3D&amp;trk=flagship3_jobs_discovery_jymbii">Link</a></p></li><li><p>Software Engineer, Meta : <a href="https://www.linkedin.com/jobs/view/4140436568/?eBP=BUDGET_EXHAUSTED_JOB&amp;refId=K3duFslzwUixH1nzc8arxg%3D%3D&amp;trackingId=B9SMXe%2Bpd%2FShNk9ObT6mjg%3D%3D&amp;trk=flagship3_jobs_discovery_jymbii">Link</a></p></li></ul><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.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 Hello Engineer! 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></p>]]></content:encoded></item><item><title><![CDATA[Why Redis Is Everywhere ?]]></title><description><![CDATA[From caching and queues to leaderboards and streams, Redis keeps things moving.]]></description><link>https://grindengineer.substack.com/p/why-redis-is-everywhere</link><guid isPermaLink="false">https://grindengineer.substack.com/p/why-redis-is-everywhere</guid><dc:creator><![CDATA[Scortier]]></dc:creator><pubDate>Mon, 14 Apr 2025 05:30:43 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Xm8f!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11f8ed66-95a0-48d9-8337-9a2d1979c7b9_928x750.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="https://substackcdn.com/image/fetch/$s_!Xm8f!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11f8ed66-95a0-48d9-8337-9a2d1979c7b9_928x750.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Xm8f!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11f8ed66-95a0-48d9-8337-9a2d1979c7b9_928x750.png 424w, https://substackcdn.com/image/fetch/$s_!Xm8f!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11f8ed66-95a0-48d9-8337-9a2d1979c7b9_928x750.png 848w, https://substackcdn.com/image/fetch/$s_!Xm8f!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11f8ed66-95a0-48d9-8337-9a2d1979c7b9_928x750.png 1272w, https://substackcdn.com/image/fetch/$s_!Xm8f!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11f8ed66-95a0-48d9-8337-9a2d1979c7b9_928x750.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Xm8f!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11f8ed66-95a0-48d9-8337-9a2d1979c7b9_928x750.png" width="516" height="417.0258620689655" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/11f8ed66-95a0-48d9-8337-9a2d1979c7b9_928x750.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:750,&quot;width&quot;:928,&quot;resizeWidth&quot;:516,&quot;bytes&quot;:82375,&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://scortier.substack.com/i/161100708?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11f8ed66-95a0-48d9-8337-9a2d1979c7b9_928x750.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Xm8f!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11f8ed66-95a0-48d9-8337-9a2d1979c7b9_928x750.png 424w, https://substackcdn.com/image/fetch/$s_!Xm8f!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11f8ed66-95a0-48d9-8337-9a2d1979c7b9_928x750.png 848w, https://substackcdn.com/image/fetch/$s_!Xm8f!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11f8ed66-95a0-48d9-8337-9a2d1979c7b9_928x750.png 1272w, https://substackcdn.com/image/fetch/$s_!Xm8f!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11f8ed66-95a0-48d9-8337-9a2d1979c7b9_928x750.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><blockquote><p>Welcome to <em><strong><a href="https://scortier.substack.com/">Hello Engineer</a></strong></em>, your weekly guide to becoming a better software engineer! No fluff - pure engineering insights.</p><p>You can also checkout : <strong><a href="https://scortier.substack.com/p/cap-theorem-explained">CAP Theorem Explained!</a></strong></p></blockquote><p></p><blockquote><p><em>Don&#8217;t forget to check out the <strong>latest job openings</strong> at the end of the article!</em></p></blockquote><h1>What is Redis ?</h1><p>Ever wondered how apps like Amazon or Twitter retrieve data so fast? &#9889;</p><p>Every time you scroll, search, or shop there&#8217;s a behind-the-scenes hero making sure things run <em>blazingly</em> fast.</p><p>That hero? <strong>Redis</strong>.</p><p><strong>Redis is a &#8220;data structure store&#8221; but not your typical one. </strong>It&#8217;s written in C, runs <strong>in-memory</strong> and is <strong>single-threaded</strong> &#128561; and that&#8217;s exactly what makes it <em>blazingly</em> fast.</p><p><strong>Redis Cache</strong> is like a super-speedy assistant that stores data in memory (RAM), so your apps don&#8217;t have to wait around querying a slower database.</p><p>It&#8217;s <strong>open-source</strong>, easy to work with, and runs quietly in the background but the impact it makes is massive.</p><p><em>The story behind Redis: Back in 2009, when platforms like Twitter were scaling like crazy, traditional databases just couldn&#8217;t keep up. Redis was built to solve this based on the bold idea that a cache can be more than just a temporary store. It can be fast and reliable.</em></p><blockquote><p><em><strong>NOTE:</strong></em></p><p><em><strong>Redis is fast but speed comes with trade-offs. &#9888;&#65039;</strong></em></p><p><em>One thing to keep in mind: <strong>Redis isn&#8217;t built for durability out of the box.</strong></em></p><p><em>Since it&#8217;s an in-memory store, if the server crashes, your data could vanish. Redis does offer ways to reduce this risk like the <strong>Append-Only File (AOF)</strong> but it's not the same level of durability you&#8217;d get from traditional databases that write every commit to disk.</em></p><p><em>This isn&#8217;t a bug it&#8217;s a design choice by the Redis team to prioritize blazing speed over guaranteed persistence.</em></p><p><em>But, if you do need stronger durability, options like <strong>AWS MemoryDB</strong> exist. They&#8217;re based on Redis but trade a bit of speed for more safety.</em></p><p><em>&#128204; So, ask yourself: Do I need ultra-low latency, or do I need data to survive a reboot?<br>Your answer will guide the tool you pick.</em></p></blockquote><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://grindengineer.substack.com/subscribe?"><span>Subscribe now</span></a></p><h2>Data Structure Support</h2><p><strong>Redis isn't just a cache it's a powerful playground of data structures. </strong>At its core, It is a <strong>key-value store</strong> but what you store in those keys can be surprisingly diverse.</p><p>Here are some of the <strong>fundamental data structures</strong> Redis supports:</p><ul><li><p><strong>Strings</strong> &#8211; The simplest type, great for basic caching.</p></li><li><p><strong>Hashes</strong> &#8211; Think of them like lightweight JSON objects.</p></li><li><p><strong>Lists</strong> &#8211; For pushing/popping elements, like a queue or stack.</p></li><li><p><strong>Sets</strong> &#8211; Unique unordered elements.</p></li><li><p><strong>Sorted Sets</strong> &#8211; Ordered with scores &#8212; great for things like leaderboards or priority queues.</p></li><li><p><strong>Bloom Filters</strong> &#8211; For fast probabilistic checks (e.g., has this been seen before?).</p></li><li><p><strong>Geospatial Indexes</strong> &#8211; Perfect for location-based queries.</p></li><li><p><strong>Time Series</strong> &#8211; Ideal for logging or tracking values over time.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!2Iue!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde2532be-5824-48ee-baad-ca3263d1bb85_1150x1182.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2Iue!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde2532be-5824-48ee-baad-ca3263d1bb85_1150x1182.png 424w, https://substackcdn.com/image/fetch/$s_!2Iue!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde2532be-5824-48ee-baad-ca3263d1bb85_1150x1182.png 848w, https://substackcdn.com/image/fetch/$s_!2Iue!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde2532be-5824-48ee-baad-ca3263d1bb85_1150x1182.png 1272w, https://substackcdn.com/image/fetch/$s_!2Iue!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde2532be-5824-48ee-baad-ca3263d1bb85_1150x1182.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2Iue!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde2532be-5824-48ee-baad-ca3263d1bb85_1150x1182.png" width="540" height="555.0260869565218" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/de2532be-5824-48ee-baad-ca3263d1bb85_1150x1182.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1182,&quot;width&quot;:1150,&quot;resizeWidth&quot;:540,&quot;bytes&quot;:163893,&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://scortier.substack.com/i/161100708?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde2532be-5824-48ee-baad-ca3263d1bb85_1150x1182.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!2Iue!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde2532be-5824-48ee-baad-ca3263d1bb85_1150x1182.png 424w, https://substackcdn.com/image/fetch/$s_!2Iue!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde2532be-5824-48ee-baad-ca3263d1bb85_1150x1182.png 848w, https://substackcdn.com/image/fetch/$s_!2Iue!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde2532be-5824-48ee-baad-ca3263d1bb85_1150x1182.png 1272w, https://substackcdn.com/image/fetch/$s_!2Iue!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde2532be-5824-48ee-baad-ca3263d1bb85_1150x1182.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>And Redis goes beyond just storing data. It also supports <strong>communication patterns</strong> like:</p><ul><li><p><strong>Pub/Sub</strong> &#8212; For real-time messaging.</p></li><li><p><strong>Streams</strong> &#8212; For ordered message processing, somewhat like Kafka-lite.</p></li></ul><p>Whether you're building a real-time leaderboard, a geolocation app, or a chat system, Redis has something built-in to help you out all while staying fast and easy to reason about.</p><h2>Commands</h2><p>One of the best things about Redis? You don&#8217;t need to learn a complex query language to use it. Redis uses a simple, custom string-based protocol that feels super natural &#8212; especially if you&#8217;ve used data structures in any programming language.</p><p>You can literally connect to a Redis instance and run commands like these straight from the CLI:</p><pre><code>SET foo 1 # Store key 'foo' with value 1 
GET foo # Returns 1 
INCR foo # Increments 'foo', returns 2 
XADD mystream * name Sara surname O
Connor # Adds an entry to a stream</code></pre><p>And the best part? Commands are grouped by data structure and they make sense.</p><p>For example, Redis <strong>Sets</strong> come with:</p><ul><li><p><strong>SADD</strong> &#8211; Add an element</p></li><li><p><strong>SCARD</strong> &#8211; Get total number of elements</p></li><li><p><strong>SMEMBERS</strong> &#8211; List all elements</p></li><li><p><strong>SISMEMBER</strong> &#8211; Check if an element exists</p></li></ul><p>It&#8217;s like working with a <strong>Set</strong> in your favorite language just faster and persistent across networked systems.</p><h2>Performance</h2><p>Redis is fast like really fast. It can handle over 100k writes per second, and read latency is usually in the microsecond range.</p><p>Because of this, you can get away with patterns that would usually be a bad idea in traditional databases. For example, running 100 separate SQL queries to build a list is something you'd avoid with a relational DB. But with Redis, that kind of overhead is much lower. It&#8217;s still better to keep things efficient, but if you do need to make a lot of small calls, Redis can handle it.</p><p>This is mainly because Redis keeps everything in memory. That makes it great for performance-heavy use cases. It&#8217;s not the right fit for everything, especially if you need strong durability, but in the right scenarios, it works really well.</p><h2>Infrastructure Configuration</h2><p>Redis can be deployed in different ways depending on your needs as a <strong>single node</strong>, with a <strong>high availability replica</strong>, or as a <strong>cluster</strong>.</p><p>When using Redis in cluster mode, each client caches a set of <strong>hash slots</strong>. These slots map keys to specific nodes, so the client knows exactly which node to contact for a given key. This direct mapping helps Redis maintain its performance edge.</p><p>Redis nodes also talk to each other using a <strong>gossip protocol</strong>. So if a client ends up asking the wrong node for a key, it can be redirected but ideally, you want to hit the correct node on the first try.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!sVPA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe60a53fe-2585-4b82-9280-cdd765ca89b1_1306x1172.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sVPA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe60a53fe-2585-4b82-9280-cdd765ca89b1_1306x1172.png 424w, https://substackcdn.com/image/fetch/$s_!sVPA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe60a53fe-2585-4b82-9280-cdd765ca89b1_1306x1172.png 848w, https://substackcdn.com/image/fetch/$s_!sVPA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe60a53fe-2585-4b82-9280-cdd765ca89b1_1306x1172.png 1272w, https://substackcdn.com/image/fetch/$s_!sVPA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe60a53fe-2585-4b82-9280-cdd765ca89b1_1306x1172.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sVPA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe60a53fe-2585-4b82-9280-cdd765ca89b1_1306x1172.png" width="527" height="472.9280245022971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e60a53fe-2585-4b82-9280-cdd765ca89b1_1306x1172.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1172,&quot;width&quot;:1306,&quot;resizeWidth&quot;:527,&quot;bytes&quot;:180755,&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://scortier.substack.com/i/161100708?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe60a53fe-2585-4b82-9280-cdd765ca89b1_1306x1172.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!sVPA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe60a53fe-2585-4b82-9280-cdd765ca89b1_1306x1172.png 424w, https://substackcdn.com/image/fetch/$s_!sVPA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe60a53fe-2585-4b82-9280-cdd765ca89b1_1306x1172.png 848w, https://substackcdn.com/image/fetch/$s_!sVPA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe60a53fe-2585-4b82-9280-cdd765ca89b1_1306x1172.png 1272w, https://substackcdn.com/image/fetch/$s_!sVPA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe60a53fe-2585-4b82-9280-cdd765ca89b1_1306x1172.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><p>Compared to most distributed databases, Redis clustering is quite minimal. It doesn&#8217;t abstract away scalability problems instead, it gives you just enough tools to build your own solutions.</p><p>For example, Redis assumes that all the data needed for a request lives on <strong>one node</strong>. So if your data is spread out or your keys are poorly designed, things can fall apart.</p><p>That&#8217;s why <strong>key structure and partitioning strategy</strong> play a huge role in scaling Redis effectively. It&#8217;s less about what Redis gives you out of the box, and more about how you build on top of it.</p><h2>Capabilities</h2><h3>Redis as a Cache</h3><p>One of the most common ways Redis is used is as a cache. In this case, the keys and values in Redis directly represent the keys and values we want to store in the cache.</p><p>Redis makes it easy to scale, it can distribute this key-value map across multiple nodes in a cluster. So if you need more capacity, you just add more nodes.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!251N!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fbd990f-248c-4496-887b-2757d52d4771_928x750.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!251N!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fbd990f-248c-4496-887b-2757d52d4771_928x750.png 424w, https://substackcdn.com/image/fetch/$s_!251N!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fbd990f-248c-4496-887b-2757d52d4771_928x750.png 848w, https://substackcdn.com/image/fetch/$s_!251N!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fbd990f-248c-4496-887b-2757d52d4771_928x750.png 1272w, https://substackcdn.com/image/fetch/$s_!251N!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fbd990f-248c-4496-887b-2757d52d4771_928x750.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!251N!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fbd990f-248c-4496-887b-2757d52d4771_928x750.png" width="514" height="415.4094827586207" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3fbd990f-248c-4496-887b-2757d52d4771_928x750.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:750,&quot;width&quot;:928,&quot;resizeWidth&quot;:514,&quot;bytes&quot;:82375,&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://scortier.substack.com/i/161100708?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fbd990f-248c-4496-887b-2757d52d4771_928x750.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!251N!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fbd990f-248c-4496-887b-2757d52d4771_928x750.png 424w, https://substackcdn.com/image/fetch/$s_!251N!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fbd990f-248c-4496-887b-2757d52d4771_928x750.png 848w, https://substackcdn.com/image/fetch/$s_!251N!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fbd990f-248c-4496-887b-2757d52d4771_928x750.png 1272w, https://substackcdn.com/image/fetch/$s_!251N!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fbd990f-248c-4496-887b-2757d52d4771_928x750.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><p>When caching with Redis, it's common to set a TTL (time to live) on each key. Once the TTL expires, Redis ensures that the key is no longer accessible. It also uses TTLs to decide which keys to evict, which helps keep memory usage under control &#8212; especially when you're trying to cache more data than your memory can hold.</p><p>That said, using Redis as a cache doesn&#8217;t solve everything. One common issue is the &#8220;hot key&#8221; problem where one key gets a lot more traffic than others. This isn&#8217;t unique to Redis though; tools like Memcached and even large-scale databases like DynamoDB face similar challenges.</p><p>Official Doc: <a href="https://redis.io/learn/howtos/solutions/microservices/caching">Redis as a Cache</a></p><h3><strong>Redis as a Distributed Lock</strong></h3><p>Sometimes, you&#8217;ll need to ensure consistency when multiple users are interacting with your system. For example, when designing a system like Ticketmaster, you need to make sure the same ticket isn&#8217;t sold twice. Or in something like Uber, you have to make sure two drivers aren&#8217;t assigned the same ride.</p><p>Most databases including Redis provide some level of consistency. If your main database already handles it well, it&#8217;s usually better to rely on that instead of introducing a distributed lock. Distributed locks can add complexity, and interviewers often dig into edge cases when you use them.</p><p>That said, Redis does support basic locking mechanisms. A simple distributed lock might use the <code>INCR</code> command with a TTL. You try to acquire the lock by calling <code>INCR</code>. If the result is 1, you own the lock and can proceed. If it&#8217;s more than 1, it means someone else already has it  so you wait and try again later. Once you're done, you <code>DEL</code> the key to release the lock.</p><p>For more advanced use cases, Redis also supports the Redlock algorithm a more robust way to handle distributed locking across multiple nodes.</p><p>Read more : <a href="https://redis.io/docs/latest/develop/use/patterns/distributed-locks/">Redis Official Doc for Distributed Lock</a></p><h3>Redis for Ranking </h3><p>Redis' sorted sets are great for keeping data in order which makes them a perfect fit for leaderboard-style use cases. Since inserts and reads are fast, even at scale, they can handle scenarios where a traditional SQL database might struggle.</p><p>Let&#8217;s say we&#8217;re building a feature where users search for cricket-related topics, and we want to show the most liked posts for that keyword.</p><p>For example, when someone searches for "kohli", we can maintain a sorted set of posts containing that keyword, ranked by the number of likes.</p><pre><code><code>ZADD kohli_posts 320 "PostId123" # A post about Kohli's century 

ZADD kohli_posts 75 "PostId456" # A post about Kohli's training session 

ZREMRANGEBYRANK kohli_posts 0 -6 # Keep only the top 5 posts</code></code></pre><p>This gives us a quick way to fetch the most engaging content related to a specific keyword, and we can periodically clean up the lower-ranked posts to keep things efficient.</p><h3><strong>Redis for Sliding Window Rate Limiting</strong></h3><p>Instead of traditional fixed window rate limiting, Redis can implement sliding window rate limiting using sorted sets. Each request adds a timestamp to the sorted set, and the system checks how many requests exist in the last N seconds. For example, if an API allows <strong>100 requests per 60 seconds</strong>, Redis can dynamically reject requests once that threshold is crossed. This approach ensures smooth limiting, avoids sudden spikes, and is much fairer to end users.</p><h3><strong>Redis for Proximity Search</strong></h3><p>Redis also supports geospatial indexes out of the box using commands like <code>GEOADD</code> and <code>GEORADIUS</code>. These are useful when you need to store locations and perform quick proximity searches.</p><p>Here&#8217;s how it works:</p><pre><code><code>GEOADD nearby_restaurants 77.5946 12.9716 "PizzaPlace" # Add a restaurant at a specific location 

GEORADIUS nearby_restaurants 77.5946 12.9716 5 km # Find restaurants within 5 km</code></code></pre><p>In this example, we&#8217;re storing the location of restaurants and then searching for places near a user&#8217;s location. This is useful for features like showing nearby food outlets in a food delivery app.</p><p>The <code>GEORADIUS</code> command runs in O(N + log(M)) time, where N is the number of elements within the radius and M is the total number of elements in the index.</p><h3><strong>Redis for Event Sourcing</strong></h3><p>Redis streams are append-only logs, somewhat like Kafka topics. They let you add data in a durable way and provide a built-in mechanism for distributing that data to multiple consumers.</p><p>Redis supports this with two key features:</p><ul><li><p><strong>XADD</strong> to push new items to the stream</p></li><li><p>Consumer groups (<strong>XREADGROUP</strong>, <strong>XCLAIM</strong>) to read and manage those items</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Y8F9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a6c2ebc-3379-4e01-9c6f-e96260f956c0_1344x694.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Y8F9!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a6c2ebc-3379-4e01-9c6f-e96260f956c0_1344x694.png 424w, https://substackcdn.com/image/fetch/$s_!Y8F9!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a6c2ebc-3379-4e01-9c6f-e96260f956c0_1344x694.png 848w, https://substackcdn.com/image/fetch/$s_!Y8F9!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a6c2ebc-3379-4e01-9c6f-e96260f956c0_1344x694.png 1272w, https://substackcdn.com/image/fetch/$s_!Y8F9!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a6c2ebc-3379-4e01-9c6f-e96260f956c0_1344x694.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Y8F9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a6c2ebc-3379-4e01-9c6f-e96260f956c0_1344x694.png" width="605" height="312.4032738095238" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7a6c2ebc-3379-4e01-9c6f-e96260f956c0_1344x694.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:694,&quot;width&quot;:1344,&quot;resizeWidth&quot;:605,&quot;bytes&quot;:86076,&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://scortier.substack.com/i/161100708?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a6c2ebc-3379-4e01-9c6f-e96260f956c0_1344x694.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Y8F9!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a6c2ebc-3379-4e01-9c6f-e96260f956c0_1344x694.png 424w, https://substackcdn.com/image/fetch/$s_!Y8F9!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a6c2ebc-3379-4e01-9c6f-e96260f956c0_1344x694.png 848w, https://substackcdn.com/image/fetch/$s_!Y8F9!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a6c2ebc-3379-4e01-9c6f-e96260f956c0_1344x694.png 1272w, https://substackcdn.com/image/fetch/$s_!Y8F9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a6c2ebc-3379-4e01-9c6f-e96260f956c0_1344x694.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>Let&#8217;s take a work queue as an example. Imagine you're queuing up background jobs like sending emails. You push each job into the stream using <strong>XADD</strong>. Now, you have a group of workers (in a consumer group) processing these jobs. Redis tracks what each worker has acknowledged and what&#8217;s still pending. If a worker crashes midway, Redis doesn&#8217;t lose track. Another worker can use <strong>XCLAIM</strong> to pick up the unacknowledged message and reprocess it. </p><p>This setup gives you reliability and fault tolerance without needing a separate queuing system.</p><h2><strong>Redis for Write Coalescing (Debouncing)</strong></h2><p>In high-frequency write scenarios, it&#8217;s inefficient to hit your database on every update. Redis can act as a buffer to hold temporary state and update the primary database periodically. For example, in a <strong>collaborative document editor</strong>, where users type rapidly, every keystroke doesn&#8217;t need to be stored in the DB. Instead, Redis can store the intermediate state and sync it every few seconds. This reduces backend load and improves responsiveness, without losing any data.</p><h2>Hot Key Issue</h2><p>One common problem you might run into when using Redis at scale is the <strong>"hot key" issue</strong>. This happens when traffic is heavily focused on just one or a few keys, causing uneven load across your Redis cluster.</p><p>Let&#8217;s say you're building a social media platform and using Redis to cache user profile data. You&#8217;ve distributed user keys evenly across a 50-node Redis cluster. Everything&#8217;s running smoothly.</p><p>Now imagine a celebrity joins the platform and millions of users start viewing their profile at the same time. Suddenly, the Redis node storing that celebrity&#8217;s profile data is handling way more traffic than any other node.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!JUBf!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b73e68c-0cb7-40c1-9089-2ca73340acc2_838x672.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JUBf!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b73e68c-0cb7-40c1-9089-2ca73340acc2_838x672.png 424w, https://substackcdn.com/image/fetch/$s_!JUBf!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b73e68c-0cb7-40c1-9089-2ca73340acc2_838x672.png 848w, https://substackcdn.com/image/fetch/$s_!JUBf!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b73e68c-0cb7-40c1-9089-2ca73340acc2_838x672.png 1272w, https://substackcdn.com/image/fetch/$s_!JUBf!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b73e68c-0cb7-40c1-9089-2ca73340acc2_838x672.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JUBf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b73e68c-0cb7-40c1-9089-2ca73340acc2_838x672.png" width="531" height="425.81384248210026" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7b73e68c-0cb7-40c1-9089-2ca73340acc2_838x672.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:672,&quot;width&quot;:838,&quot;resizeWidth&quot;:531,&quot;bytes&quot;:72855,&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://scortier.substack.com/i/161100708?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b73e68c-0cb7-40c1-9089-2ca73340acc2_838x672.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!JUBf!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b73e68c-0cb7-40c1-9089-2ca73340acc2_838x672.png 424w, https://substackcdn.com/image/fetch/$s_!JUBf!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b73e68c-0cb7-40c1-9089-2ca73340acc2_838x672.png 848w, https://substackcdn.com/image/fetch/$s_!JUBf!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b73e68c-0cb7-40c1-9089-2ca73340acc2_838x672.png 1272w, https://substackcdn.com/image/fetch/$s_!JUBf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b73e68c-0cb7-40c1-9089-2ca73340acc2_838x672.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><p>Unless your cluster is overprovisioned with lots of spare capacity, that node will likely become a bottleneck and start failing even though the rest of the cluster is underutilized.</p><p>Here are a few ways to handle this:</p><ul><li><p><strong>Client-side caching</strong>: Cache the celebrity&#8217;s profile data on the frontend or at the edge so you don&#8217;t hit Redis every time.</p></li><li><p><strong>Key duplication</strong>: Store the same profile under multiple keys and randomly pick one for reads, distributing load across multiple nodes.</p></li><li><p><strong>Read replicas</strong>: Add replicas for the hotspot node and load-balance requests across them dynamically.</p></li></ul><p>For system design interviews, what matters most is that you <strong>identify the hot key problem early</strong> and <strong>proactively suggest mitigation strategies</strong>. It shows you&#8217;re thinking beyond the happy path.</p><h2>Wrapping Up!</h2><p>By now, you should have a clear understanding of Redis, what it is, how it works, where it fits in, and why it&#8217;s used.</p><p>Its speed and flexibility make it a top choice for many large-scale systems. From caching and real-time analytics to queues and pub/sub. Redis quietly powers a lot of what makes your apps feel fast and responsive.</p><p>Loved this deep dive? Hit a like &#10084;&#65039;<br>For more simple explanations, useful insights on coding, system design, and tech trends, <strong>Subscribe To My Newsletter! </strong>&#128640;</p><p>If you have any questions or suggestions, leave a comment.</p><p>See you next week with more exciting content!</p><div><hr></div><h3><strong>Here's Something Extra for You: Exciting Job Openings &#128640;</strong></h3><ol><li><p>Member of Technical Staff - 3 Distributed systems, Nutanix : <a href="https://www.linkedin.com/jobs/view/4201002074">Link</a></p></li><li><p>Software Engineer (IC2), Oracle : <a href="https://www.linkedin.com/jobs/view/4190535641">Link</a></p></li><li><p>Software Engineer 3, Google: <a href="https://www.linkedin.com/jobs/view/4179804595">Link</a></p></li><li><p>Software Engineer, GenAI, Google: <a href="https://www.linkedin.com/jobs/view/4169559122">Link</a></p></li><li><p>Software Engineer 2, Amazon : <a href="https://www.linkedin.com/jobs/view/4199916650">Link</a></p></li><li><p>Software Engineer, Coinbase: <a href="https://www.linkedin.com/jobs/view/4095195699">Link</a></p></li><li><p>Software Engineer, Gojek : <a href="https://www.linkedin.com/jobs/view/4152727591">Link</a></p></li></ol><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.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 Hello Engineer! 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></p>]]></content:encoded></item><item><title><![CDATA[CAP Theorem Explained]]></title><description><![CDATA[Theorem that can make or break your system design interview!]]></description><link>https://grindengineer.substack.com/p/cap-theorem-explained</link><guid isPermaLink="false">https://grindengineer.substack.com/p/cap-theorem-explained</guid><dc:creator><![CDATA[Scortier]]></dc:creator><pubDate>Mon, 07 Apr 2025 05:20:54 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!K4me!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F218e37b0-27a0-4802-9a8c-08933a210a2d_1190x1082.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="https://substackcdn.com/image/fetch/$s_!K4me!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F218e37b0-27a0-4802-9a8c-08933a210a2d_1190x1082.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!K4me!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F218e37b0-27a0-4802-9a8c-08933a210a2d_1190x1082.png 424w, https://substackcdn.com/image/fetch/$s_!K4me!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F218e37b0-27a0-4802-9a8c-08933a210a2d_1190x1082.png 848w, https://substackcdn.com/image/fetch/$s_!K4me!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F218e37b0-27a0-4802-9a8c-08933a210a2d_1190x1082.png 1272w, https://substackcdn.com/image/fetch/$s_!K4me!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F218e37b0-27a0-4802-9a8c-08933a210a2d_1190x1082.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!K4me!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F218e37b0-27a0-4802-9a8c-08933a210a2d_1190x1082.png" width="586" height="532.8168067226891" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/218e37b0-27a0-4802-9a8c-08933a210a2d_1190x1082.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1082,&quot;width&quot;:1190,&quot;resizeWidth&quot;:586,&quot;bytes&quot;:85018,&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://scortier.substack.com/i/160424330?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F218e37b0-27a0-4802-9a8c-08933a210a2d_1190x1082.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!K4me!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F218e37b0-27a0-4802-9a8c-08933a210a2d_1190x1082.png 424w, https://substackcdn.com/image/fetch/$s_!K4me!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F218e37b0-27a0-4802-9a8c-08933a210a2d_1190x1082.png 848w, https://substackcdn.com/image/fetch/$s_!K4me!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F218e37b0-27a0-4802-9a8c-08933a210a2d_1190x1082.png 1272w, https://substackcdn.com/image/fetch/$s_!K4me!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F218e37b0-27a0-4802-9a8c-08933a210a2d_1190x1082.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><blockquote><p>Welcome to <em><strong><a href="https://scortier.substack.com/">Hello Engineer</a></strong></em>, your weekly guide to becoming a better software engineer! No fluff - pure engineering insights.</p><p>You can also checkout : <strong><a href="https://scortier.substack.com/p/what-is-http">What is HTTP ?</a></strong></p></blockquote><blockquote><p><em>Don&#8217;t forget to check out the <strong>latest job openings</strong> at the end of the article!</em></p></blockquote><blockquote><p><strong>I would like to know what type of content you want in the future.</strong> It will help me to create the right content for you. Please fill out this <strong><a href="https://forms.gle/NeW58UWVf7jzQjWm6">form</a></strong> to let us know</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://docs.google.com/forms/d/e/1FAIpQLSeUO82mYwgA1FdBRZiz1r2RmseOebQLzOQ-eSGmhw-vvIvaAA/viewform&quot;,&quot;text&quot;:&quot;Share your Ideas!&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://docs.google.com/forms/d/e/1FAIpQLSeUO82mYwgA1FdBRZiz1r2RmseOebQLzOQ-eSGmhw-vvIvaAA/viewform"><span>Share your Ideas!</span></a></p></blockquote><p></p><p><strong>CAP theorem</strong> is something that often confuses people in system design interviews, especially if they haven&#8217;t understood it clearly. But it&#8217;s an important concept that can really shape how you design your system.</p><p>In this post, we&#8217;ll explain what CAP theorem is, how it works, and the trade-offs involved &#8212; all in a simple way. This will help you understand it better and feel more confident in your next system design interview.</p><h1>What is CAP Theorem ?</h1><p>At a basic level, the <strong>CAP theorem</strong> says that in any distributed system, you can only get <strong>two out of these three things</strong>:</p><ol><li><p><strong>Consistency</strong> &#8211; Every node has the same data. So if you update something, all future reads from any node will give you that latest value.</p></li><li><p><strong>Availability</strong> &#8211; Every request gets a response, even if it&#8217;s not the most recent data. So the system stays responsive no matter what.</p></li><li><p><strong>Partition Tolerance</strong> &#8211; The system keeps running even if there&#8217;s a break in communication between parts of the system (like a network issue).</p></li></ol><p>Here&#8217;s the main idea that makes CAP theorem easier to understand in interviews: <strong>In real-world distributed systems, you always need partition tolerance.</strong> Network issues are bound to happen, and your system has to deal with them.</p><blockquote><p>So in most cases, CAP comes down to one simple decision: <strong>When there&#8217;s a network issue, do you want your system to stay consistent or stay available?</strong></p></blockquote><p>Let&#8217;s break this down with a simple example to understand it better.</p><h1>3 Pillars of CAP</h1><h2>1. Consistency</h2><p><strong>Consistency</strong> means that every time you read data, you either get the most recent update &#8212; or an error if that&#8217;s not possible. All healthy nodes in the system will return the same data at the same time.</p><p>For example, if you write something to <strong>Node A</strong>, and then read from <strong>Node B</strong>, you&#8217;ll see that latest update right away.</p><p>This is really important for systems where accuracy is critical like in <strong>banking apps</strong>, where checking your balance must always show the most recent amount.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!COdR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f0a0eb3-bbfb-496b-9811-9880459d2446_1318x992.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!COdR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f0a0eb3-bbfb-496b-9811-9880459d2446_1318x992.png 424w, https://substackcdn.com/image/fetch/$s_!COdR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f0a0eb3-bbfb-496b-9811-9880459d2446_1318x992.png 848w, https://substackcdn.com/image/fetch/$s_!COdR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f0a0eb3-bbfb-496b-9811-9880459d2446_1318x992.png 1272w, https://substackcdn.com/image/fetch/$s_!COdR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f0a0eb3-bbfb-496b-9811-9880459d2446_1318x992.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!COdR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f0a0eb3-bbfb-496b-9811-9880459d2446_1318x992.png" width="551" height="414.7132018209408" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5f0a0eb3-bbfb-496b-9811-9880459d2446_1318x992.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:992,&quot;width&quot;:1318,&quot;resizeWidth&quot;:551,&quot;bytes&quot;:112194,&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://scortier.substack.com/i/160424330?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f0a0eb3-bbfb-496b-9811-9880459d2446_1318x992.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!COdR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f0a0eb3-bbfb-496b-9811-9880459d2446_1318x992.png 424w, https://substackcdn.com/image/fetch/$s_!COdR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f0a0eb3-bbfb-496b-9811-9880459d2446_1318x992.png 848w, https://substackcdn.com/image/fetch/$s_!COdR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f0a0eb3-bbfb-496b-9811-9880459d2446_1318x992.png 1272w, https://substackcdn.com/image/fetch/$s_!COdR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f0a0eb3-bbfb-496b-9811-9880459d2446_1318x992.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><blockquote><p>Just a heads-up &#8212; <strong>consistency in CAP theorem</strong> is not the same as the <strong>consistency in ACID databases</strong>.</p><p>Yeah, it&#8217;s a bit confusing, but they mean different things in different contexts.</p></blockquote><h2>2. Availability</h2><p><strong>Availability</strong> means that every request, whether it&#8217;s a read or write, gets a response. But that response might not always have the latest data.</p><p>So even if some nodes are out of sync, the system still works and stays responsive.</p><p>This is super important for apps that need to be <strong>always up and running</strong>, like <strong>online shopping sites</strong>, where showing <em>something</em> is better than showing nothing.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!622f!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f4eeb3b-bb96-4f1c-b8af-3686055df8d6_1318x992.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!622f!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f4eeb3b-bb96-4f1c-b8af-3686055df8d6_1318x992.png 424w, https://substackcdn.com/image/fetch/$s_!622f!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f4eeb3b-bb96-4f1c-b8af-3686055df8d6_1318x992.png 848w, https://substackcdn.com/image/fetch/$s_!622f!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f4eeb3b-bb96-4f1c-b8af-3686055df8d6_1318x992.png 1272w, https://substackcdn.com/image/fetch/$s_!622f!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f4eeb3b-bb96-4f1c-b8af-3686055df8d6_1318x992.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!622f!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f4eeb3b-bb96-4f1c-b8af-3686055df8d6_1318x992.png" width="549" height="413.2078907435508" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2f4eeb3b-bb96-4f1c-b8af-3686055df8d6_1318x992.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:992,&quot;width&quot;:1318,&quot;resizeWidth&quot;:549,&quot;bytes&quot;:107920,&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://scortier.substack.com/i/160424330?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f4eeb3b-bb96-4f1c-b8af-3686055df8d6_1318x992.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!622f!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f4eeb3b-bb96-4f1c-b8af-3686055df8d6_1318x992.png 424w, https://substackcdn.com/image/fetch/$s_!622f!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f4eeb3b-bb96-4f1c-b8af-3686055df8d6_1318x992.png 848w, https://substackcdn.com/image/fetch/$s_!622f!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f4eeb3b-bb96-4f1c-b8af-3686055df8d6_1318x992.png 1272w, https://substackcdn.com/image/fetch/$s_!622f!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f4eeb3b-bb96-4f1c-b8af-3686055df8d6_1318x992.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>3. Partition Tolerance</h2><p><strong>Partition Tolerance</strong> means the system keeps working even if some parts of it can&#8217;t talk to each other because of a network issue.</p><p>A <strong>network partition</strong> happens when a failure splits the system into two or more groups of servers that can&#8217;t communicate.</p><p>When this happens, the system has to <strong>choose between staying consistent or staying available</strong>.</p><p>Partition tolerance is a must for distributed systems because network problems are pretty common. A partition-tolerant system can still run smoothly, even when the network isn&#8217;t perfect.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!N5Dm!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F325fed66-8977-4f3f-bb56-4578a6e15189_1128x1054.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!N5Dm!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F325fed66-8977-4f3f-bb56-4578a6e15189_1128x1054.png 424w, https://substackcdn.com/image/fetch/$s_!N5Dm!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F325fed66-8977-4f3f-bb56-4578a6e15189_1128x1054.png 848w, https://substackcdn.com/image/fetch/$s_!N5Dm!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F325fed66-8977-4f3f-bb56-4578a6e15189_1128x1054.png 1272w, https://substackcdn.com/image/fetch/$s_!N5Dm!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F325fed66-8977-4f3f-bb56-4578a6e15189_1128x1054.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!N5Dm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F325fed66-8977-4f3f-bb56-4578a6e15189_1128x1054.png" width="546" height="510.1808510638298" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/325fed66-8977-4f3f-bb56-4578a6e15189_1128x1054.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1054,&quot;width&quot;:1128,&quot;resizeWidth&quot;:546,&quot;bytes&quot;:108276,&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://scortier.substack.com/i/160424330?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F325fed66-8977-4f3f-bb56-4578a6e15189_1128x1054.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!N5Dm!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F325fed66-8977-4f3f-bb56-4578a6e15189_1128x1054.png 424w, https://substackcdn.com/image/fetch/$s_!N5Dm!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F325fed66-8977-4f3f-bb56-4578a6e15189_1128x1054.png 848w, https://substackcdn.com/image/fetch/$s_!N5Dm!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F325fed66-8977-4f3f-bb56-4578a6e15189_1128x1054.png 1272w, https://substackcdn.com/image/fetch/$s_!N5Dm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F325fed66-8977-4f3f-bb56-4578a6e15189_1128x1054.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>Understand Through an Example</h1><p>Let&#8217;s say you have a website with two servers, one in the India and one in Europe.</p><p>Now imagine this:</p><ul><li><p><strong>User A</strong> is in the India. They connect to the India server and update their display name on their profile.</p></li><li><p>That update is then sent to the Europe server so both servers stay in sync.</p></li><li><p>Later, <strong>User B</strong> (who&#8217;s in Europe) checks User A&#8217;s profile and sees the new, updated name.</p></li></ul><p>Everything works smoothly because the servers can talk to each other and keep the data consistent.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!J8TL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0397d143-624a-4584-b266-4765b3dc066a_1368x1018.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!J8TL!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0397d143-624a-4584-b266-4765b3dc066a_1368x1018.png 424w, https://substackcdn.com/image/fetch/$s_!J8TL!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0397d143-624a-4584-b266-4765b3dc066a_1368x1018.png 848w, https://substackcdn.com/image/fetch/$s_!J8TL!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0397d143-624a-4584-b266-4765b3dc066a_1368x1018.png 1272w, https://substackcdn.com/image/fetch/$s_!J8TL!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0397d143-624a-4584-b266-4765b3dc066a_1368x1018.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!J8TL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0397d143-624a-4584-b266-4765b3dc066a_1368x1018.png" width="589" height="438.30555555555554" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0397d143-624a-4584-b266-4765b3dc066a_1368x1018.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1018,&quot;width&quot;:1368,&quot;resizeWidth&quot;:589,&quot;bytes&quot;:111577,&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://scortier.substack.com/i/160424330?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0397d143-624a-4584-b266-4765b3dc066a_1368x1018.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!J8TL!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0397d143-624a-4584-b266-4765b3dc066a_1368x1018.png 424w, https://substackcdn.com/image/fetch/$s_!J8TL!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0397d143-624a-4584-b266-4765b3dc066a_1368x1018.png 848w, https://substackcdn.com/image/fetch/$s_!J8TL!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0397d143-624a-4584-b266-4765b3dc066a_1368x1018.png 1272w, https://substackcdn.com/image/fetch/$s_!J8TL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0397d143-624a-4584-b266-4765b3dc066a_1368x1018.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><p>But things change when there&#8217;s a <strong>network partition</strong> &#8212; the connection between the USA and Europe servers goes down. Now we face an important decision:</p><p>When <strong>User B</strong> (in Europe) tries to view <strong>User A&#8217;s</strong> profile, what should we do?</p><ul><li><p><strong>Option A:</strong> Return an error, because we can&#8217;t be sure the data is the latest (this means choosing <strong>consistency</strong>).</p></li><li><p><strong>Option B:</strong> Show the last known data, even if it might be a bit outdated (this means choosing <strong>availability</strong>).</p></li></ul><p>This is the heart of the CAP theorem &#8212; deciding between consistency and availability when something goes wrong in the network.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gT60!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a076337-4321-4fcf-8519-6c272fb7f64d_1366x918.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gT60!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a076337-4321-4fcf-8519-6c272fb7f64d_1366x918.png 424w, https://substackcdn.com/image/fetch/$s_!gT60!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a076337-4321-4fcf-8519-6c272fb7f64d_1366x918.png 848w, https://substackcdn.com/image/fetch/$s_!gT60!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a076337-4321-4fcf-8519-6c272fb7f64d_1366x918.png 1272w, https://substackcdn.com/image/fetch/$s_!gT60!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a076337-4321-4fcf-8519-6c272fb7f64d_1366x918.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gT60!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a076337-4321-4fcf-8519-6c272fb7f64d_1366x918.png" width="575" height="386.42020497803804" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9a076337-4321-4fcf-8519-6c272fb7f64d_1366x918.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:918,&quot;width&quot;:1366,&quot;resizeWidth&quot;:575,&quot;bytes&quot;:101600,&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://scortier.substack.com/i/160424330?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a076337-4321-4fcf-8519-6c272fb7f64d_1366x918.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!gT60!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a076337-4321-4fcf-8519-6c272fb7f64d_1366x918.png 424w, https://substackcdn.com/image/fetch/$s_!gT60!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a076337-4321-4fcf-8519-6c272fb7f64d_1366x918.png 848w, https://substackcdn.com/image/fetch/$s_!gT60!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a076337-4321-4fcf-8519-6c272fb7f64d_1366x918.png 1272w, https://substackcdn.com/image/fetch/$s_!gT60!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a076337-4321-4fcf-8519-6c272fb7f64d_1366x918.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><p>This is where the <strong>CAP theorem becomes real</strong> &#8212; we have to pick between consistency and availability.</p><p>In this case, the choice is pretty obvious: it&#8217;s better to show <strong>User B</strong> the old name than to show an error. A slightly outdated profile is still useful &#8212; an error page isn&#8217;t.</p><p>Let&#8217;s look at a few more real-world examples where systems make similar choices.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://grindengineer.substack.com/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><h1>Consistency Over Availability</h1><p>Some systems just <strong>can&#8217;t afford to show outdated data</strong>, they need to stay consistent, even if that means being less available during issues.</p><p>If you prioritize consistency, your design might include:</p><ul><li><p><strong>Distributed Transactions</strong>: You make sure different parts of your system (like the database and cache) stay in sync using methods like two-phase commit. This keeps data accurate, but it also adds complexity and can slow things down for users.</p></li><li><p><strong>Single-Node Setup</strong>: You can avoid consistency problems by using just one database. This limits how much your system can grow, but it keeps everything simple and reliable with one source of truth.</p></li><li><p><strong>Tech Choices that support strong consistency</strong>:</p><ul><li><p>Traditional databases like <strong>PostgreSQL</strong> or <strong>MySQL</strong></p></li><li><p><strong>Google Spanner</strong></p></li><li><p><strong>DynamoDB</strong> (when used in strong consistency mode)</p></li></ul></li></ul><p>Here are a few examples of systems require consistency over availability:</p><ul><li><p><strong>Ticket Booking Systems</strong>: Let&#8217;s say <strong>User A</strong> books seat 6A on a flight. But because of a network issue, <strong>User B</strong> still sees it as available and books it too. Now two people have the same seat &#8212; that&#8217;s a big problem.</p></li><li><p><strong>Online Shopping (Inventory)</strong>: Imagine Amazon has just <strong>one toothbrush</strong> left. If the system shows it as available to multiple users during a network issue, it could be sold to more people than they actually have in stock.</p></li><li><p><strong>Financial Systems</strong>: Stock trading platforms need to show <strong>real-time data</strong>. If you see stale prices, you might place trades that don&#8217;t reflect the actual market &#8212; and that can cost people a lot of money.</p></li></ul><div><hr></div><h1>Availability Over Consistency</h1><p>Most systems can handle a bit of inconsistency and should focus on <strong>availability</strong>. In these cases, <strong>eventual consistency</strong> is good enough &#8212; meaning the system will become consistent over time, maybe after a few seconds or minutes.</p><p>If you prioritize availability, your design might include:</p><ul><li><p><strong>Multiple Replicas</strong>: You can have extra read replicas with <strong>asynchronous replication</strong>, which means they may be slightly behind but can still serve requests. This improves performance and keeps the system available &#8212; even if some data is a bit outdated.</p></li><li><p><strong>Change Data Capture (CDC)</strong>: This tracks changes in the main database and pushes updates to replicas, caches, or other systems in the background. It helps the main system stay available while the updates reach everywhere eventually.</p></li><li><p><strong>Tech choices that support high availability</strong>:</p><ul><li><p><strong>Cassandra</strong></p></li><li><p><strong>DynamoDB</strong> (when used across multiple availability zones)</p></li><li><p><strong>Redis clusters</strong></p></li></ul></li></ul><p>Here are a few examples of systems require availability over consistency:</p><ul><li><p><strong>Social Media</strong>: If <strong>User A</strong> changes their profile picture, it's okay if <strong>User B</strong> still sees the old one for a little while.</p></li><li><p><strong>Streaming Platforms (like Netflix)</strong>: If someone updates a movie&#8217;s description, it's not a big deal if some users still see the old version for a short time.</p></li><li><p><strong>Review Sites (like Yelp)</strong>: If a restaurant changes its hours, showing the older timing briefly is still better than showing nothing.</p></li></ul><blockquote><p><em><strong>NOTE : </strong><br>The main question to ask is: <strong>&#8220;Would it really hurt if users saw slightly outdated data for a bit?&#8221;</strong><br>If the answer is <strong>yes</strong>, go with <strong>consistency</strong>. If the answer is <strong>no</strong>, <strong>availability</strong> is usually the better choice.</em></p></blockquote><div><hr></div><h1>Different Levels of Consistency</h1><p>When people talk about consistency in the CAP theorem, they usually mean <strong>strong consistency</strong> where every read shows the latest write. But there are other types of consistency too, and knowing them can help you design smarter systems depending on your needs.</p><ul><li><p><strong>Strong Consistency</strong>: Every read gives you the most recent write. This is the most reliable but also the slowest. It's needed for systems like <strong>bank accounts</strong>, where accuracy is critical. (This is the type we&#8217;ve focused on so far.)</p></li><li><p><strong>Causal Consistency</strong>: Events that are related always appear in the correct order. For example, <strong>comments on a post</strong> will always show up <em>after</em> the post itself, never before.</p></li><li><p><strong>Read-Your-Own-Writes</strong>: A user can immediately see their own updates, even if others can't yet. This is common in <strong>social media</strong>, where users expect to see their changes (like profile updates) right away.</p></li><li><p><strong>Eventual Consistency</strong>: The system will <strong>become consistent over time</strong>, but it may not be instant. This is fine for things like <strong>DNS</strong> or systems where a small delay in updates is okay. Most distributed systems use this when they prioritize <strong>availability</strong>.</p></li></ul><h1>Wrapping Up!</h1><p>The <strong>CAP theorem is super important</strong>, it helps shape the way you think about system design, especially in interviews. And it&#8217;s something you <strong>shouldn&#8217;t ignore</strong>.</p><p>But the good news is: <strong>it doesn&#8217;t have to be complicated</strong>.</p><p>Just ask yourself one simple question: <strong>&#8220;Does every read need to return the most recent write?&#8221;  </strong>If the answer is <strong>yes</strong>, go with <strong>consistency</strong>. If the answer is <strong>no</strong>, <strong>availability</strong> is usually the better choice.</p><p>Loved this deep dive? Hit a like &#10084;&#65039;  <br>For more simple explanations, useful insights on coding, system design, and tech trends, <strong>Subscribe To My Newsletter! </strong>&#128640;</p><p>If you have any questions or suggestions, leave a comment.</p><p>See you next week with more exciting content!</p><div><hr></div><h3><strong>Here's Something Extra for You: Exciting Job Openings &#128640;</strong></h3><ol><li><p>Member of Technical Staff - 3 Distributed systems, Nutanix : <a href="https://www.linkedin.com/jobs/view/4201002074">Link</a></p></li><li><p>Software Engineer (IC2), Oracle : <a href="https://www.linkedin.com/jobs/view/4190535641">Link</a></p></li><li><p>Software Engineer 3, Google: <a href="https://www.linkedin.com/jobs/view/4179804595">Link</a></p></li><li><p>Software Engineer, GenAI, Google: <a href="https://www.linkedin.com/jobs/view/4169559122">Link</a></p></li><li><p>Software Engineer 2, Amazon : <a href="https://www.linkedin.com/jobs/view/4199916650">Link</a></p></li><li><p>Software Engineer, Coinbase: <a href="https://www.linkedin.com/jobs/view/4095195699">Link</a></p></li><li><p>Software Engineer, Gojek : <a href="https://www.linkedin.com/jobs/view/4152727591">Link</a></p></li></ol><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.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 Hello Engineer! 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></p>]]></content:encoded></item><item><title><![CDATA[What is HTTP ?]]></title><description><![CDATA[HTTP is the foundation of data communication on the web.]]></description><link>https://grindengineer.substack.com/p/what-is-http</link><guid isPermaLink="false">https://grindengineer.substack.com/p/what-is-http</guid><dc:creator><![CDATA[Scortier]]></dc:creator><pubDate>Wed, 02 Apr 2025 10:52:17 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!lC03!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffab0f1bc-5387-4084-8715-e2c7dd09b7aa_1668x690.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="https://substackcdn.com/image/fetch/$s_!lC03!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffab0f1bc-5387-4084-8715-e2c7dd09b7aa_1668x690.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lC03!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffab0f1bc-5387-4084-8715-e2c7dd09b7aa_1668x690.png 424w, https://substackcdn.com/image/fetch/$s_!lC03!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffab0f1bc-5387-4084-8715-e2c7dd09b7aa_1668x690.png 848w, https://substackcdn.com/image/fetch/$s_!lC03!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffab0f1bc-5387-4084-8715-e2c7dd09b7aa_1668x690.png 1272w, https://substackcdn.com/image/fetch/$s_!lC03!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffab0f1bc-5387-4084-8715-e2c7dd09b7aa_1668x690.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!lC03!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffab0f1bc-5387-4084-8715-e2c7dd09b7aa_1668x690.png" width="1456" height="602" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fab0f1bc-5387-4084-8715-e2c7dd09b7aa_1668x690.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:602,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:116875,&quot;alt&quot;:&quot;&quot;,&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://scortier.substack.com/i/160344929?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffab0f1bc-5387-4084-8715-e2c7dd09b7aa_1668x690.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!lC03!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffab0f1bc-5387-4084-8715-e2c7dd09b7aa_1668x690.png 424w, https://substackcdn.com/image/fetch/$s_!lC03!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffab0f1bc-5387-4084-8715-e2c7dd09b7aa_1668x690.png 848w, https://substackcdn.com/image/fetch/$s_!lC03!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffab0f1bc-5387-4084-8715-e2c7dd09b7aa_1668x690.png 1272w, https://substackcdn.com/image/fetch/$s_!lC03!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffab0f1bc-5387-4084-8715-e2c7dd09b7aa_1668x690.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>Welcome to <em><strong><a href="https://scortier.substack.com/">Hello Engineer</a></strong></em>, your weekly guide to becoming a better software engineer! No fluff - pure engineering insights.</p><p>You can also checkout : <strong><a href="https://scortier.substack.com/p/what-are-microservices">What are Microservices ?</a></strong></p></blockquote><blockquote><p><strong>I would like to know what type of content you want in the future.</strong> It will help me to create the right content for you &#128071;</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://docs.google.com/forms/d/e/1FAIpQLSeUO82mYwgA1FdBRZiz1r2RmseOebQLzOQ-eSGmhw-vvIvaAA/viewform&quot;,&quot;text&quot;:&quot;Share your Ideas!&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://docs.google.com/forms/d/e/1FAIpQLSeUO82mYwgA1FdBRZiz1r2RmseOebQLzOQ-eSGmhw-vvIvaAA/viewform"><span>Share your Ideas!</span></a></p></blockquote><div><hr></div><h2>What is HTTP?</h2><p><strong>HTTP is a set of rules that allow computers to talk to each other over the internet.<br></strong>When you open a browser and visit a website, like <strong>www.google.com</strong>, your browser sends a message to Google&#8217;s servers saying:</p><blockquote><p>&#8220;Hey! Can you show me the homepage, please?&#8221;</p></blockquote><p>And Google replies with:</p><blockquote><p>&#8220;Sure! Here&#8217;s the content you asked for.&#8221;</p></blockquote><p>This whole conversation happens using <strong>HTTP</strong>.</p><p>Think of HTTP as the <strong>language</strong> your browser uses to request data, and your server uses to respond.</p><p>Two important traits make HTTP what it is:</p><ul><li><p><strong>Connectionless</strong></p></li><li><p><strong>Stateless</strong></p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://grindengineer.substack.com/subscribe?"><span>Subscribe now</span></a></p><h2>Real World Analogy: Ordering a burger&#8230;</h2><p>Imagine walking into a fast-food restaurant:</p><ul><li><p>You walk to the counter.</p></li><li><p>Place your order for a cheeseburger.</p></li><li><p>Get the burger.</p></li><li><p>Walk away.</p></li></ul><p>The cashier <strong>doesn't remember you</strong>, nor does she <strong>keep the connection open</strong> for future orders.</p><p>Every time you want something new, you go back and repeat the whole process.</p><p>That&#8217;s HTTP.</p><ul><li><p>&#127869; <strong>Connectionless</strong> &#8594; You don&#8217;t keep the line open after getting the burger.</p></li><li><p>&#129504; <strong>Stateless</strong> &#8594; The cashier doesn&#8217;t remember your last order.</p></li></ul><div><hr></div><h2>How HTTP Works (Step-by-step)</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!lC03!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffab0f1bc-5387-4084-8715-e2c7dd09b7aa_1668x690.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lC03!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffab0f1bc-5387-4084-8715-e2c7dd09b7aa_1668x690.png 424w, https://substackcdn.com/image/fetch/$s_!lC03!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffab0f1bc-5387-4084-8715-e2c7dd09b7aa_1668x690.png 848w, https://substackcdn.com/image/fetch/$s_!lC03!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffab0f1bc-5387-4084-8715-e2c7dd09b7aa_1668x690.png 1272w, https://substackcdn.com/image/fetch/$s_!lC03!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffab0f1bc-5387-4084-8715-e2c7dd09b7aa_1668x690.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!lC03!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffab0f1bc-5387-4084-8715-e2c7dd09b7aa_1668x690.png" width="1456" height="602" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fab0f1bc-5387-4084-8715-e2c7dd09b7aa_1668x690.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:602,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:116875,&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://scortier.substack.com/i/160344929?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffab0f1bc-5387-4084-8715-e2c7dd09b7aa_1668x690.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!lC03!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffab0f1bc-5387-4084-8715-e2c7dd09b7aa_1668x690.png 424w, https://substackcdn.com/image/fetch/$s_!lC03!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffab0f1bc-5387-4084-8715-e2c7dd09b7aa_1668x690.png 848w, https://substackcdn.com/image/fetch/$s_!lC03!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffab0f1bc-5387-4084-8715-e2c7dd09b7aa_1668x690.png 1272w, https://substackcdn.com/image/fetch/$s_!lC03!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffab0f1bc-5387-4084-8715-e2c7dd09b7aa_1668x690.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>Here&#8217;s how HTTP works when you open a website like <code>google.com</code>:</p><ol><li><p>You type the URL in your browser.</p></li><li><p>Browser contacts DNS to find the actual IP address.</p></li><li><p>Browser sends an <strong>HTTP request</strong> to the server at that IP.</p></li><li><p>Server sends back an <strong>HTTP response</strong> &#8212; containing the website content.</p></li><li><p>The connection closes.</p></li><li><p>Want to visit another page? &#8594; Repeat from step 3.</p></li></ol><p>It&#8217;s like sending a letter and getting a reply, no ongoing call, no memory.</p><div><hr></div><h2>HTTP is Stateless - But Why Does Google Remember Me?</h2><p>If HTTP is stateless, how does Google remember you're logged in?</p><p>&#128161; <em>Answer: Cookies</em></p><p>Cookies are small text files that your browser stores.</p><p>Here&#8217;s how they work:</p><ul><li><p>You log in to a site &#8594; Server sends back a cookie with your login info.</p></li><li><p>That cookie is saved in your browser.</p></li><li><p>Next time you visit the site, your browser sends that cookie back &#8594; Server recognizes you!</p></li></ul><p>So even though HTTP doesn&#8217;t remember you, <strong>cookies help websites remember who you are.</strong></p><div><hr></div><h2>HTTP Methods - How You Interact with the Server</h2><p>Think of HTTP Methods like the different actions you can perform in a conversation:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OEOl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F053f8f60-8c97-41e0-b1e5-edcf05bc587a_1222x484.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OEOl!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F053f8f60-8c97-41e0-b1e5-edcf05bc587a_1222x484.png 424w, https://substackcdn.com/image/fetch/$s_!OEOl!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F053f8f60-8c97-41e0-b1e5-edcf05bc587a_1222x484.png 848w, https://substackcdn.com/image/fetch/$s_!OEOl!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F053f8f60-8c97-41e0-b1e5-edcf05bc587a_1222x484.png 1272w, https://substackcdn.com/image/fetch/$s_!OEOl!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F053f8f60-8c97-41e0-b1e5-edcf05bc587a_1222x484.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OEOl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F053f8f60-8c97-41e0-b1e5-edcf05bc587a_1222x484.png" width="1222" height="484" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/053f8f60-8c97-41e0-b1e5-edcf05bc587a_1222x484.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:484,&quot;width&quot;:1222,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:98789,&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://scortier.substack.com/i/160344929?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F053f8f60-8c97-41e0-b1e5-edcf05bc587a_1222x484.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!OEOl!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F053f8f60-8c97-41e0-b1e5-edcf05bc587a_1222x484.png 424w, https://substackcdn.com/image/fetch/$s_!OEOl!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F053f8f60-8c97-41e0-b1e5-edcf05bc587a_1222x484.png 848w, https://substackcdn.com/image/fetch/$s_!OEOl!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F053f8f60-8c97-41e0-b1e5-edcf05bc587a_1222x484.png 1272w, https://substackcdn.com/image/fetch/$s_!OEOl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F053f8f60-8c97-41e0-b1e5-edcf05bc587a_1222x484.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>The browser uses these methods to talk to the server and get things done.</p><div><hr></div><h2>HTTP Status Codes - Messages From the Server</h2><p>When your browser makes a request, the server replies with a <strong>status code</strong> to indicate what happened:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!R0Z-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc378e663-786c-4089-9a28-b17491097e0c_1386x1700.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!R0Z-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc378e663-786c-4089-9a28-b17491097e0c_1386x1700.png 424w, https://substackcdn.com/image/fetch/$s_!R0Z-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc378e663-786c-4089-9a28-b17491097e0c_1386x1700.png 848w, https://substackcdn.com/image/fetch/$s_!R0Z-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc378e663-786c-4089-9a28-b17491097e0c_1386x1700.png 1272w, https://substackcdn.com/image/fetch/$s_!R0Z-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc378e663-786c-4089-9a28-b17491097e0c_1386x1700.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!R0Z-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc378e663-786c-4089-9a28-b17491097e0c_1386x1700.png" width="1386" height="1700" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c378e663-786c-4089-9a28-b17491097e0c_1386x1700.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1700,&quot;width&quot;:1386,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:363740,&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://scortier.substack.com/i/160344929?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc378e663-786c-4089-9a28-b17491097e0c_1386x1700.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!R0Z-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc378e663-786c-4089-9a28-b17491097e0c_1386x1700.png 424w, https://substackcdn.com/image/fetch/$s_!R0Z-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc378e663-786c-4089-9a28-b17491097e0c_1386x1700.png 848w, https://substackcdn.com/image/fetch/$s_!R0Z-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc378e663-786c-4089-9a28-b17491097e0c_1386x1700.png 1272w, https://substackcdn.com/image/fetch/$s_!R0Z-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc378e663-786c-4089-9a28-b17491097e0c_1386x1700.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>These codes help developers understand what&#8217;s going wrong when something doesn&#8217;t load properly.</p><div><hr></div><h2>Advantages of Using HTTP</h2><ul><li><p><strong>Fast and lightweight</strong> &#8211; It doesn&#8217;t use much memory or CPU.</p></li><li><p><strong>Simple to implement</strong> &#8211; Easy for both clients and servers to work with.</p></li><li><p><strong>Low network load</strong> &#8211; Fewer connections = less internet traffic.</p></li><li><p><strong>No session tracking</strong> &#8211; Great for quick, one-time requests.</p></li><li><p><strong>Supports pipelining</strong> &#8211; Can send multiple requests without waiting.</p></li></ul><div><hr></div><h2>Limitations of HTTP</h2><ul><li><p><strong>Not secure</strong> &#8211; Sends data in plain text (hello hackers &#128064;).</p></li><li><p><strong>Not mobile-friendly</strong> &#8211; Doesn&#8217;t handle mobile networks well.</p></li><li><p><strong>Poor for sensitive data</strong> &#8211; No encryption = risky for logins, payments, etc.</p></li><li><p><strong>Uses more power</strong> &#8211; Long data transfers can be resource-heavy.</p></li><li><p><strong>One request at a time</strong> &#8211; Server can get stuck waiting on slow clients.</p></li></ul><div><hr></div><h2>HTTP vs HTTPS - What&#8217;s the Real Difference?</h2><p>Imagine you're writing a postcard (&#128236;).<br>Anyone who handles it can read everything you wrote. That&#8217;s how <strong>HTTP</strong> works &#8212; your data travels openly, without any protection.</p><p>Now imagine locking that postcard in a box &#128274; before sending it.<br>Only the person with the key can open and read it. That&#8217;s <strong>HTTPS</strong> &#8212; it <strong>encrypts your data</strong>, so no one else can read it, even if they intercept it.</p><div><hr></div><h3>How HTTPS works ?</h3><ul><li><p><strong>HTTPS uses security tools called SSL and TLS</strong> to scramble (encrypt) your data before sending it.</p></li><li><p>Only the website you're talking to can unscramble (decrypt) it.</p></li><li><p>This ensures a <strong>private and secure connection</strong> between you and the website.</p></li></ul><p>The website also proves it&#8217;s trustworthy using something called an <strong>SSL certificate</strong> &#8212; like a digital ID card.</p><div><hr></div><h3>Why HTTPS is Better ?</h3><ul><li><p><strong>Secure Communication</strong> &#8211; Your data is locked while in transit.</p></li><li><p><strong>Data Integrity</strong> &#8211; It ensures your data isn&#8217;t changed or tampered with.</p></li><li><p><strong>Privacy</strong> &#8211; No one can snoop on your personal info.</p></li><li><p><strong>Performance</strong> &#8211; Modern HTTPS is fast and efficient.</p></li><li><p><strong>Trust</strong> &#8211; Browsers now mark non-HTTPS sites as &#8220;Not Secure.&#8221;</p><p></p></li></ul><blockquote><p><em><strong>Quick Dev Tip</strong></em></p><p><em>Open <strong>DevTools &#8594; Network Tab</strong> in your browser<br>&#128073; Load any site<br>&#128073; You&#8217;ll see every HTTP request, method, and status code</em></p><p><em>Explore it.</em> <em>You will learn a lot.</em></p></blockquote><h2>Wrapping Up!</h2><p>HTTP might seem like a technical detail, but it&#8217;s everywhere.<br>Every browser, API call, and website you interact with uses HTTP under the hood.</p><p>So the next time someone says &#8220;this API is broken&#8221;. Remember: it&#8217;s probably just an HTTP request gone wrong. &#128521;</p><p>Loved this deep dive? For more simple explanations, useful insights on coding, system design, and tech trends, <strong>Subscribe To My Newsletter! </strong>&#128640;</p><p>See you next Week with more exciting content!</p><div><hr></div><h3><strong>Here's Something Extra for You: Exciting Job Openings &#128640;</strong></h3><ul><li><p>System Performance Engineer @Google:<br><strong><a href="https://www.linkedin.com/jobs/view/4131721557?utm_source=hw.glich.co&amp;utm_medium=referral&amp;utm_campaign=ep-65-how-quora-improved-its-search-system-with-qdrant">https://www.linkedin.com/jobs/view/4131721557</a></strong></p></li><li><p>Software Engineer, Product @Meta:<br><strong><a href="https://www.linkedin.com/jobs/view/4142048795?utm_source=hw.glich.co&amp;utm_medium=referral&amp;utm_campaign=ep-65-how-quora-improved-its-search-system-with-qdrant">https://www.linkedin.com/jobs/view/4142048795</a></strong></p></li><li><p>Software Engineer 1 @Dell:<br><strong><a href="https://www.linkedin.com/jobs/view/4145776983?utm_source=hw.glich.co&amp;utm_medium=referral&amp;utm_campaign=ep-65-how-quora-improved-its-search-system-with-qdrant">https://www.linkedin.com/jobs/view/4145776983</a></strong></p></li><li><p>Software Engineer @LinkedIn:<br><strong><a href="https://www.linkedin.com/jobs/view/4135579811?utm_source=hw.glich.co&amp;utm_medium=referral&amp;utm_campaign=ep-65-how-quora-improved-its-search-system-with-qdrant">https://www.linkedin.com/jobs/view/4135579811</a></strong></p></li><li><p>Software Engineer @Microsoft:<br><strong><a href="https://www.linkedin.com/jobs/view/4099719491?utm_source=hw.glich.co&amp;utm_medium=referral&amp;utm_campaign=ep-65-how-quora-improved-its-search-system-with-qdrant">https://www.linkedin.com/jobs/view/4099719491</a></strong></p></li><li><p>Software Engineer - Frontend @HackerEarth:<br><strong><a href="https://www.linkedin.com/jobs/view/4143880403?utm_source=hw.glich.co&amp;utm_medium=referral&amp;utm_campaign=ep-65-how-quora-improved-its-search-system-with-qdrant">https://www.linkedin.com/jobs/view/4143880403</a></strong></p></li><li><p>Software Developer 3 @Oracle:<br><strong><a href="https://www.linkedin.com/jobs/view/4104207974?utm_source=hw.glich.co&amp;utm_medium=referral&amp;utm_campaign=ep-65-how-quora-improved-its-search-system-with-qdrant">https://www.linkedin.com/jobs/view/4104207974</a></strong></p></li><li><p>Software Development Engineer - II - Frontend @Meesho:<br><strong><a href="https://www.linkedin.com/jobs/view/4144401401?utm_source=hw.glich.co&amp;utm_medium=referral&amp;utm_campaign=ep-65-how-quora-improved-its-search-system-with-qdrant">https://www.linkedin.com/jobs/view/4144401401</a></strong></p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.substack.com/p/what-is-http/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://grindengineer.substack.com/p/what-is-http/comments"><span>Leave a comment</span></a></p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.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 Hello Engineer! 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></p>]]></content:encoded></item><item><title><![CDATA[What the hell is an API Gateway?]]></title><description><![CDATA[One Stop for All Your App&#8217;s Requests!]]></description><link>https://grindengineer.substack.com/p/what-the-hell-is-an-api-gateway</link><guid isPermaLink="false">https://grindengineer.substack.com/p/what-the-hell-is-an-api-gateway</guid><dc:creator><![CDATA[Scortier]]></dc:creator><pubDate>Sun, 23 Mar 2025 05:01:16 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!JoaT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffe9b93e-6c36-46b3-806f-adf7b46d2747_2308x826.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="https://substackcdn.com/image/fetch/$s_!JoaT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffe9b93e-6c36-46b3-806f-adf7b46d2747_2308x826.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JoaT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffe9b93e-6c36-46b3-806f-adf7b46d2747_2308x826.png 424w, https://substackcdn.com/image/fetch/$s_!JoaT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffe9b93e-6c36-46b3-806f-adf7b46d2747_2308x826.png 848w, https://substackcdn.com/image/fetch/$s_!JoaT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffe9b93e-6c36-46b3-806f-adf7b46d2747_2308x826.png 1272w, https://substackcdn.com/image/fetch/$s_!JoaT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffe9b93e-6c36-46b3-806f-adf7b46d2747_2308x826.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JoaT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffe9b93e-6c36-46b3-806f-adf7b46d2747_2308x826.png" width="1456" height="521" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ffe9b93e-6c36-46b3-806f-adf7b46d2747_2308x826.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:521,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:187137,&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://scortier.substack.com/i/159572470?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffe9b93e-6c36-46b3-806f-adf7b46d2747_2308x826.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!JoaT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffe9b93e-6c36-46b3-806f-adf7b46d2747_2308x826.png 424w, https://substackcdn.com/image/fetch/$s_!JoaT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffe9b93e-6c36-46b3-806f-adf7b46d2747_2308x826.png 848w, https://substackcdn.com/image/fetch/$s_!JoaT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffe9b93e-6c36-46b3-806f-adf7b46d2747_2308x826.png 1272w, https://substackcdn.com/image/fetch/$s_!JoaT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffe9b93e-6c36-46b3-806f-adf7b46d2747_2308x826.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><blockquote><p>Welcome to <em><strong><a href="https://scortier.substack.com/">Hello Engineer</a></strong></em>, your weekly guide to becoming a better software engineer! No fluff - pure engineering insights.</p><p>You can also checkout : <strong><a href="https://scortier.substack.com/p/what-are-microservices">What are Microservices ?</a></strong></p></blockquote><blockquote><p><strong>I would like to know what type of content you want in the future.</strong> It will help me to create the right content for you &#128071;</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://forms.gle/NeW58UWVf7jzQjWm6&quot;,&quot;text&quot;:&quot;Share your Ideas!&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://forms.gle/NeW58UWVf7jzQjWm6"><span>Share your Ideas!</span></a></p></blockquote><p></p><p>Imagine walking into a luxury hotel. You don&#8217;t need to know where housekeeping or maintenance is located, right? Instead, you check in at the front desk, and they handle everything from room assignments to special requests. In the world of microservices, the API Gateway plays that role for client requests.</p><p><strong>In simple terms:</strong></p><ul><li><p><strong>Single Entry Point:</strong> It&#8217;s the one door through which all your app&#8217;s requests come in.</p></li><li><p><strong>Traffic Controller:</strong> Just like the front desk directs guests, the API Gateway routes each request to the right backend service.</p></li><li><p><strong>Middleware Manager:</strong> It handles all the routine but crucial tasks like authentication, rate limiting, and logging, so your services can focus on what they do best.</p></li></ul><h2>Core Responsibilities</h2><p>Let&#8217;s walk through the key things an API Gateway does, step by step.</p><h3>1. Request Validation</h3><p>Before anything else, the API Gateway ensures that every incoming request is properly formatted and contains the necessary information. Think of it as checking that a guest has all the right documents before they even step into the hotel. If something's missing, say, a required API key or a well-formed request, the gateway can quickly send an error response, saving time and resources for your backend services.</p><pre><code>routes:
  - path: /clients/*
    service: client-management
    port: 8080
  - path: /purchases/*
    service: purchase-service
    port: 8081
  - path: /transactions/*
    service: transaction-service
    port: 8082</code></pre><h3>2. Middleware Magic</h3><p>After validation, the gateway jumps into action with its middleware features. <br>Here&#8217;s what it typically handles:</p><ul><li><p><strong>Authentication:</strong> Verifies that the requester is who they say they are (like checking an ID at the front desk).</p></li><li><p><strong>Rate Limiting:</strong> Prevents any one client from overwhelming your system&#8212;imagine limiting the number of items a guest can order from the minibar.</p></li><li><p><strong>Logging &amp; Monitoring:</strong> Keeps an eye on all the requests, which is super helpful for troubleshooting and performance insights.</p></li><li><p><strong>Other Tasks:</strong> It can also manage SSL termination, compress responses, handle CORS headers, and more.</p></li></ul><p>By centralizing these tasks, your individual services remain lean and focused.</p><pre><code>// Client sends an HTTP POST request to create a new order
POST /orders
Content-Type: application/json

{
  "userId": "123",
  "productId": "456",
  "quantity": 3
}

// API Gateway transforms this into an internal gRPC call
orderService.createOrder({ userId: "123", productId: "456", quantity: 3 })

// Gateway transforms the gRPC response into JSON and returns it to the client over HTTP
{
  "orderId": "789",
  "status": "confirmed",
  "deliveryDate": "2025-04-01"
}</code></pre><h3>3. Intelligent Routing</h3><p>The heart of the API Gateway is its routing capability. It looks at details like the URL path, HTTP method, and headers to decide which backend service should handle the request. For example, a request to <em>/users/profile</em> might be routed to your user service, while <em>/orders</em> might go to your order processing system. <br>This setup means your clients don&#8217;t have to deal with multiple endpoints, everything goes through one neat channel.</p><h3>4. Backend Communication &amp; Response Transformation</h3><p>Once a request is routed, your backend services do their magic and send back a response. The API Gateway then transforms this response into a client-friendly format. For instance, if your services communicate internally using a different protocol, the gateway can convert it back to standard HTTP/JSON before sending it out. It&#8217;s like having a translator at the front desk who ensures everyone understands each other perfectly.</p><h3>5. Caching for Speed</h3><p>To improve performance, the API Gateway can cache responses for frequently requested data. If a guest asks for the same hotel information repeatedly, the front desk can quickly hand out a brochure instead of re-preparing all the details from scratch. This caching mechanism helps reduce load and speed up response times.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://grindengineer.substack.com/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><h2>Scaling the API Gateway</h2><p>As your user base grows, so does the need for your gateway to handle increased traffic. Here&#8217;s how you can scale:</p><ul><li><p><strong>Horizontal Scaling:</strong> Since API Gateways are typically stateless, you can add more instances behind a load balancer to distribute incoming requests efficiently.</p></li><li><p><strong>Global Distribution:</strong> For apps with users around the world, deploying API Gateways in multiple regions can reduce latency by directing users to the nearest instance.</p></li></ul><div><hr></div><h2>Choosing the Right API Gateway</h2><p>When it comes to implementation, you have plenty of options:</p><ul><li><p><strong>Managed Services:</strong> AWS API Gateway, Azure API Management, and Google Cloud Endpoints offer fully managed solutions that integrate seamlessly with their ecosystems.</p></li><li><p><strong>Open Source:</strong> Tools like Kong, Tyk, and Express Gateway give you more control, especially if you're running services on-premises or prefer a customizable approach.</p></li></ul><div><hr></div><h2>When to Use an API Gateway</h2><p>Here&#8217;s a quick rule of thumb:</p><ul><li><p><strong>Microservices Architecture:</strong> If your system is composed of multiple microservices, an API Gateway is almost indispensable. It keeps your client interactions clean and your internal services decoupled.</p></li><li><p><strong>Simple Client-Server Architecture:</strong> If you&#8217;re working with a straightforward monolithic design, adding an API Gateway might complicate things unnecessarily.</p></li></ul><blockquote><p><em>In system design interviews, a good tip is to mention that you&#8217;d add an API Gateway to handle routing and basic middleware tasks and then confidently move on to the more interesting parts of your design.</em></p></blockquote><div><hr></div><h2>Wrapping Up!</h2><p>The API Gateway is more than just a routing tool, it&#8217;s the unsung hero that manages the chaos of modern distributed systems. By centralizing key functions like validation, authentication, routing, and caching, it allows your microservices to shine without getting bogged down by repetitive tasks.</p><p>Loved this deep dive? For more simple explanations, useful insights on coding, system design, and tech trends, <strong>Subscribe To My Newsletter! </strong>&#128640;</p><p>See you next Monday with more exciting content!</p><p><em><strong>Scortier, Signing Off!</strong></em></p><div><hr></div><h3><strong>Here's Something Extra for You: Exciting Job Openings &#128640;</strong></h3><ul><li><p><strong><a href="https://www.linkedin.com/jobs/view/4182726027">Software Engineer, Rubrik</a></strong></p></li><li><p><strong><a href="https://www.linkedin.com/jobs/view/4166506645">Software Engineer Fullstack, Linkedin </a></strong></p></li><li><p><strong><a href="https://www.linkedin.com/jobs/view/4150472779">Software Engineer 2, Amazon</a></strong></p></li><li><p><strong><a href="https://www.linkedin.com/jobs/view/4188335479">Software Engineer 2, Vimeo</a></strong></p></li><li><p><strong><a href="https://www.linkedin.com/jobs/view/4183831980">Software Engineer, Search, Postman</a></strong></p></li></ul><p></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.substack.com/p/what-the-hell-is-an-api-gateway/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://grindengineer.substack.com/p/what-the-hell-is-an-api-gateway/comments"><span>Leave a comment</span></a></p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.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 Hello Engineer! 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><div><hr></div><p></p>]]></content:encoded></item><item><title><![CDATA[What are Microservices ?]]></title><description><![CDATA[Netflix uses them, Google doesn&#8217;t. But why? And what even are they?]]></description><link>https://grindengineer.substack.com/p/what-are-microservices</link><guid isPermaLink="false">https://grindengineer.substack.com/p/what-are-microservices</guid><dc:creator><![CDATA[Scortier]]></dc:creator><pubDate>Tue, 18 Mar 2025 14:34:49 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!FgBq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98caeaf3-9ed3-48c0-b1e3-aba3f5aca256_1692x1214.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="https://substackcdn.com/image/fetch/$s_!FgBq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98caeaf3-9ed3-48c0-b1e3-aba3f5aca256_1692x1214.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!FgBq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98caeaf3-9ed3-48c0-b1e3-aba3f5aca256_1692x1214.png 424w, https://substackcdn.com/image/fetch/$s_!FgBq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98caeaf3-9ed3-48c0-b1e3-aba3f5aca256_1692x1214.png 848w, https://substackcdn.com/image/fetch/$s_!FgBq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98caeaf3-9ed3-48c0-b1e3-aba3f5aca256_1692x1214.png 1272w, https://substackcdn.com/image/fetch/$s_!FgBq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98caeaf3-9ed3-48c0-b1e3-aba3f5aca256_1692x1214.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!FgBq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98caeaf3-9ed3-48c0-b1e3-aba3f5aca256_1692x1214.png" width="1456" height="1045" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/98caeaf3-9ed3-48c0-b1e3-aba3f5aca256_1692x1214.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1045,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:176662,&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://scortier.substack.com/i/159171705?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98caeaf3-9ed3-48c0-b1e3-aba3f5aca256_1692x1214.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!FgBq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98caeaf3-9ed3-48c0-b1e3-aba3f5aca256_1692x1214.png 424w, https://substackcdn.com/image/fetch/$s_!FgBq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98caeaf3-9ed3-48c0-b1e3-aba3f5aca256_1692x1214.png 848w, https://substackcdn.com/image/fetch/$s_!FgBq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98caeaf3-9ed3-48c0-b1e3-aba3f5aca256_1692x1214.png 1272w, https://substackcdn.com/image/fetch/$s_!FgBq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98caeaf3-9ed3-48c0-b1e3-aba3f5aca256_1692x1214.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><blockquote><p>Welcome to <em><strong><a href="https://scortier.substack.com/">Hello Engineer</a></strong></em>, your weekly guide to becoming a better software engineer! No fluff - pure engineering insights.</p><p>You can also checkout : <strong><a href="https://scortier.substack.com/p/what-is-dns-the-simplest-explanation">What is DNS ? The Simplest Explanation</a></strong></p></blockquote><p></p><blockquote><p><strong>I would like to know what type of content you want in the future.</strong> It will help me to create the right content for you. Please fill out this <strong><a href="https://forms.gle/NeW58UWVf7jzQjWm6">form</a></strong> to let us know</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://forms.gle/NeW58UWVf7jzQjWm6&quot;,&quot;text&quot;:&quot;Fill Form&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://forms.gle/NeW58UWVf7jzQjWm6"><span>Fill Form</span></a></p></blockquote><p></p><h3><strong>Ever Wondered How Netflix Handles 200+ Million Users ?</strong></h3><p>Picture this: You&#8217;re binge-watching <em>Stranger Things</em> on Netflix. Suddenly, the &#8220;Recommended for You&#8221; section updates, your watch history syncs, and your payment for the next month processes seamlessly. All of this happens in the background, without a single glitch.</p><p>How?</p><p>The answer lies in <strong>microservices</strong>.</p><p>But what are microservices? And why do companies like Netflix swear by them, while others like Google stick to monolithic architectures? Let&#8217;s dive in.</p><div><hr></div><h3><strong>What are Microservices ?</strong></h3><p>Imagine you&#8217;re building a city. A bustling, thriving city with millions of residents. Now, think of your city&#8217;s services:</p><ul><li><p><strong>Water supply</strong></p></li><li><p><strong>Electricity grid</strong></p></li><li><p><strong>Public transportation</strong></p></li><li><p><strong>Healthcare</strong></p></li></ul><p>Each of these services operates independently. If the water supply goes down, the electricity grid keeps running. If public transportation halts, hospitals still function.</p><p><strong>Microservices work the same way.</strong></p><p>Instead of building one giant, monolithic application (where everything is interconnected and a single failure can bring down the entire system), microservices break your app into smaller, independent &#8220;services.&#8221; Each service handles a specific function, like:</p><ul><li><p>User authentication</p></li><li><p>Payment processing</p></li><li><p>Search functionality</p></li><li><p>Notifications</p></li></ul><p>These services communicate with each other but are developed, deployed, and scaled independently.</p><h3><strong>Why Microservices? Let&#8217;s Talk Monoliths First</strong></h3><p>Before microservices, there were <strong>monolithic architectures</strong>. Think of a monolith as a giant, all-in-one machine. Everything&#8212;your database, business logic, user interface&#8212;is bundled into a single codebase.</p><h4><strong>The Good:</strong></h4><ul><li><p><strong>Simple to develop:</strong> Everything is in one place.</p></li><li><p><strong>Easy to deploy:</strong> One build, one deployment.</p></li><li><p><strong>Fast performance:</strong> No network calls between services.</p></li></ul><h4><strong>The Bad:</strong></h4><ul><li><p><strong>Scalability issues:</strong> Want to scale just the search feature? Too bad, you have to scale the entire app.</p></li><li><p><strong>Team dependencies:</strong> Multiple teams working on the same codebase? Chaos ensues.</p></li><li><p><strong>Single point of failure:</strong> One bug can crash the entire system.</p></li></ul><h4><strong>The Ugly:</strong></h4><ul><li><p><strong>Tech lock-in:</strong> Stuck with the same programming language and framework forever.</p></li></ul><h3><strong>Enter Microservices: The Modular Approach</strong></h3><p>Microservices solve these problems by breaking the monolith into smaller, self-contained units.</p><p>Let&#8217;s take <strong>Amazon</strong> as an example.</p><p>Amazon isn&#8217;t one giant app. It&#8217;s a collection of microservices:</p><ul><li><p><strong>Search Service:</strong> Handles product searches.</p></li><li><p><strong>Cart Service:</strong> Manages your shopping cart.</p></li><li><p><strong>Payment Service:</strong> Processes payments.</p></li><li><p><strong>Recommendation Service:</strong> Suggests products you might like.</p></li></ul><p>Each service is developed by a separate team, using the best tech stack for the job. The Search Service might use Python for its machine learning algorithms, while the Payment Service uses Java for its robustness.</p><h4><strong>The Benefits:</strong></h4><ul><li><p><strong>Independent scaling:</strong> Only scale the services that need it.</p></li><li><p><strong>Faster development:</strong> Teams work in parallel without stepping on each other&#8217;s toes.</p></li><li><p><strong>Resilience:</strong> If one service fails, the rest keep running.</p></li><li><p><strong>Tech flexibility:</strong> Use the right tool for the job.</p></li></ul><h3><strong>Challenges with Microservices</strong></h3><p>Microservices come with their own set of challenges:</p><ol><li><p><strong>Complexity:</strong> Managing multiple services, databases, and deployments can get messy.</p></li><li><p><strong>Communication:</strong> Services need to talk to each other, often over a network. This introduces latency and potential failures.</p></li><li><p><strong>Debugging:</strong> Tracing an issue across multiple services is like finding a needle in a haystack.</p></li><li><p><strong>Infrastructure overhead:</strong> You&#8217;ll need tools for service discovery, load balancing, and monitoring.</p></li></ol><h3><strong>Monoliths vs. Microservices: Who Wins?</strong></h3><p>It&#8217;s not a one-size-fits-all answer.</p><ul><li><p><strong>Monoliths</strong> are great for small teams and simple apps. They&#8217;re fast, easy to build, and require less overhead.</p></li><li><p><strong>Microservices</strong> shine for large, complex systems with multiple teams. They offer flexibility, scalability, and resilience.</p></li></ul><p>Fun fact: <strong>Google</strong> still uses a monolithic architecture for its search engine. Why? Because it works for them. On the other hand, <strong>Netflix</strong> relies heavily on microservices to handle its massive scale and ever-evolving features.</p><p>Atlassian Blog on differences between monolith and microservice : <a href="https://www.atlassian.com/microservices/microservices-architecture/microservices-vs-monolith">https://www.atlassian.com/microservices/microservices-architecture/microservices-vs-monolith</a></p><div><hr></div><p>Now that you know what microservices are, here&#8217;s a question for you :</p><p><em>If you were building the next big social media app, would you go monolithic or microservices? Why?</em></p><p>Hit reply and let me know your thoughts!</p><p>Enjoyed this explanation? For more simple, useful insights on coding, system design, and tech trends, <strong>Subscribe To My Newsletter! </strong>&#128640;</p><p>See you next Monday with more exciting content!</p><p><em><strong>Scortier, Signing Off!</strong></em></p><div><hr></div><h3><strong>Bonus Section &#128640;: Top Books to Master System Design</strong></h3><ol><li><p>Designing Data-Intensive Applications by Martin Kleppmann</p></li><li><p>The System Design Primer by Donne Martin</p></li><li><p>System Design Interview Part 1 and 2 by Alex Xu</p></li><li><p>Distributed Systems: Principles and Paradigms by Andrew S. Tanenbaum</p></li></ol><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.substack.com/p/what-are-microservices/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://grindengineer.substack.com/p/what-are-microservices/comments"><span>Leave a comment</span></a></p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://grindengineer.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 Hello Engineer! 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><div><hr></div><p></p>]]></content:encoded></item></channel></rss>