<?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[Level Up Coding System Design Newsletter]]></title><description><![CDATA[System Design made simple. Get our System Design Handbook for FREE on newsletter signup.]]></description><link>https://blog.levelupcoding.com</link><image><url>https://substackcdn.com/image/fetch/$s_!MHoh!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fedf87a9f-2fe8-4b79-a8a7-25f89f0b0cad_500x500.png</url><title>Level Up Coding System Design Newsletter</title><link>https://blog.levelupcoding.com</link></image><generator>Substack</generator><lastBuildDate>Sat, 04 Jul 2026 21:36:07 GMT</lastBuildDate><atom:link href="https://blog.levelupcoding.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Level Up Coding]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[lucsystemdesign@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[lucsystemdesign@substack.com]]></itunes:email><itunes:name><![CDATA[Nikki Siapno]]></itunes:name></itunes:owner><itunes:author><![CDATA[Nikki Siapno]]></itunes:author><googleplay:owner><![CDATA[lucsystemdesign@substack.com]]></googleplay:owner><googleplay:email><![CDATA[lucsystemdesign@substack.com]]></googleplay:email><googleplay:author><![CDATA[Nikki Siapno]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[LLMs: The Essential Guide]]></title><description><![CDATA[Most engineers only see the API layer. Here's what's happening underneath.]]></description><link>https://blog.levelupcoding.com/p/llms-the-essential-guide</link><guid isPermaLink="false">https://blog.levelupcoding.com/p/llms-the-essential-guide</guid><dc:creator><![CDATA[Nikki Siapno]]></dc:creator><pubDate>Fri, 26 Jun 2026 14:44:38 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/934bae56-a966-4807-b241-b5eda2c87488_2400x1260.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_!yLV0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yLV0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" width="1292" height="266" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:266,&quot;width&quot;:1292,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:343451,&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://lvlupcoding.substack.com/i/171357839?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.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_!yLV0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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">Get our 142-page System Design Handbook for FREE on newsletter signup:</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><h2><a href="https://lucode.co/checkmarx-appsec-2027-outlook-report-z7nl">What Happens When 81% of Your Code Is AI-Generated?</a></h2><h5>Presented by Checkmarx</h5><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!2Iy1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0ffe4d8-9afb-456b-8a41-10da4f0b9c74_2094x1386.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2Iy1!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0ffe4d8-9afb-456b-8a41-10da4f0b9c74_2094x1386.png 424w, https://substackcdn.com/image/fetch/$s_!2Iy1!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0ffe4d8-9afb-456b-8a41-10da4f0b9c74_2094x1386.png 848w, https://substackcdn.com/image/fetch/$s_!2Iy1!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0ffe4d8-9afb-456b-8a41-10da4f0b9c74_2094x1386.png 1272w, https://substackcdn.com/image/fetch/$s_!2Iy1!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0ffe4d8-9afb-456b-8a41-10da4f0b9c74_2094x1386.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2Iy1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0ffe4d8-9afb-456b-8a41-10da4f0b9c74_2094x1386.png" width="1456" height="964" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d0ffe4d8-9afb-456b-8a41-10da4f0b9c74_2094x1386.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:964,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:607735,&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;:false,&quot;internalRedirect&quot;:&quot;https://blog.levelupcoding.com/i/198543543?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0ffe4d8-9afb-456b-8a41-10da4f0b9c74_2094x1386.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_!2Iy1!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0ffe4d8-9afb-456b-8a41-10da4f0b9c74_2094x1386.png 424w, https://substackcdn.com/image/fetch/$s_!2Iy1!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0ffe4d8-9afb-456b-8a41-10da4f0b9c74_2094x1386.png 848w, https://substackcdn.com/image/fetch/$s_!2Iy1!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0ffe4d8-9afb-456b-8a41-10da4f0b9c74_2094x1386.png 1272w, https://substackcdn.com/image/fetch/$s_!2Iy1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0ffe4d8-9afb-456b-8a41-10da4f0b9c74_2094x1386.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 role="img" 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><title></title><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>Organizations with more than 81% AI-generated code reported shipping vulnerable code <strong>3.4x more often</strong> than organizations with low AI adoption. That&#8217;s just one of several findings from <strong><a href="https://lucode.co/checkmarx-appsec-2027-outlook-report-z7nl">Checkmarx&#8217;s</a> </strong><em>Future of Application Security in the Era of AI</em> Report. <strong><a href="https://lucode.co/checkmarx-appsec-2027-outlook-report-z7nl">See what the data reveals</a></strong>.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://lucode.co/checkmarx-appsec-2027-outlook-report-z7nl&quot;,&quot;text&quot;:&quot;Download the Full Report&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://lucode.co/checkmarx-appsec-2027-outlook-report-z7nl"><span>Download the Full Report</span></a></p><div><hr></div><h1>LLMs: The Essential Guide</h1><p><span>LLMs are not just smarter search engines.</span></p><p><span>They are distributed systems built from many moving parts: the model itself, training pipelines, retrieval systems, inference infrastructure, safety layers, and the product experience around them.</span></p><p><span>Most engineers only see the API layer. That works fine until something goes wrong.</span></p><p><span>And when LLM systems fail, the failures are often hard to diagnose. Hallucinations, latency spikes, context loss, rising inference costs, inconsistent outputs; the problem is usually somewhere beneath the response itself.</span></p><p><span>Understanding how these systems work changes how you debug them, scale them, and design around their limitations. From tokenization and transformers to retrieval, fine-tuning, inference, and guardrails, every layer shapes the final answer you see on screen.</span></p><h2><span>The four layers</span></h2><p><span>An LLM system has four practical layers:</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!v1be!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77565228-17b2-4264-87f4-50d7baeeb73d_2000x1080.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!v1be!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77565228-17b2-4264-87f4-50d7baeeb73d_2000x1080.png 424w, https://substackcdn.com/image/fetch/$s_!v1be!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77565228-17b2-4264-87f4-50d7baeeb73d_2000x1080.png 848w, https://substackcdn.com/image/fetch/$s_!v1be!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77565228-17b2-4264-87f4-50d7baeeb73d_2000x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!v1be!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77565228-17b2-4264-87f4-50d7baeeb73d_2000x1080.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!v1be!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77565228-17b2-4264-87f4-50d7baeeb73d_2000x1080.png" width="1456" height="786" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/77565228-17b2-4264-87f4-50d7baeeb73d_2000x1080.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:786,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:424386,&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://blog.levelupcoding.com/i/203498745?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77565228-17b2-4264-87f4-50d7baeeb73d_2000x1080.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_!v1be!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77565228-17b2-4264-87f4-50d7baeeb73d_2000x1080.png 424w, https://substackcdn.com/image/fetch/$s_!v1be!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77565228-17b2-4264-87f4-50d7baeeb73d_2000x1080.png 848w, https://substackcdn.com/image/fetch/$s_!v1be!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77565228-17b2-4264-87f4-50d7baeeb73d_2000x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!v1be!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77565228-17b2-4264-87f4-50d7baeeb73d_2000x1080.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 role="img" 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><title></title><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><span>Most mistakes happen when teams blur these layers.</span></p><p><span>You do not fix missing company knowledge with a clever prompt. You do not fix hallucinations by blindly fine-tuning. You do not fix latency by only picking a &#8220;smarter&#8221; model. Each layer has its own job.</span></p><h2><span>Transformers</span></h2><p><span>Transformers are the neural network architecture behind modern LLMs.</span></p><p><span>Their core mechanism is attention: a way for tokens to look at other tokens in the sequence and decide what matters most.</span></p><p><span>Instead of reading text strictly one word at a time, Transformers build relationships across the entire context window. In a sentence like &#8220;The server crashed because it ran out of memory,&#8221; attention helps the model understand that &#8220;it&#8221; refers to the server.</span></p><p><span>Different Transformer architectures fit different jobs:</span></p><ul><li><p><strong><span>Encoder-only</span></strong><span> &#8594; Good for classification, embeddings, and semantic search.</span></p></li><li><p><strong><span>Encoder-decoder</span></strong><span> &#8594; Good for transformations like translation and summarization.</span></p></li><li><p><strong><span>Decoder-only</span></strong><span> &#8594; Good for chat, code generation, and next-token prediction.</span></p></li></ul><p><span>Most modern chat models are decoder-only because they generate text one token at a time.</span></p><h2><span>Tokenization</span></h2><p><span>Tokenization is how text becomes something a model can process.</span></p><p><span>LLMs do not read raw text directly. They read tokens: small pieces of text created by a tokenizer. A single word may become multiple tokens, and symbols, code, or emojis can expand even further.</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!o_ZR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d59da42-5515-45c4-be14-2a0984963ae6_2000x835.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!o_ZR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d59da42-5515-45c4-be14-2a0984963ae6_2000x835.png 424w, https://substackcdn.com/image/fetch/$s_!o_ZR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d59da42-5515-45c4-be14-2a0984963ae6_2000x835.png 848w, https://substackcdn.com/image/fetch/$s_!o_ZR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d59da42-5515-45c4-be14-2a0984963ae6_2000x835.png 1272w, https://substackcdn.com/image/fetch/$s_!o_ZR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d59da42-5515-45c4-be14-2a0984963ae6_2000x835.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!o_ZR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d59da42-5515-45c4-be14-2a0984963ae6_2000x835.png" width="1456" height="608" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6d59da42-5515-45c4-be14-2a0984963ae6_2000x835.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:608,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:500660,&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://blog.levelupcoding.com/i/203498745?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d59da42-5515-45c4-be14-2a0984963ae6_2000x835.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_!o_ZR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d59da42-5515-45c4-be14-2a0984963ae6_2000x835.png 424w, https://substackcdn.com/image/fetch/$s_!o_ZR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d59da42-5515-45c4-be14-2a0984963ae6_2000x835.png 848w, https://substackcdn.com/image/fetch/$s_!o_ZR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d59da42-5515-45c4-be14-2a0984963ae6_2000x835.png 1272w, https://substackcdn.com/image/fetch/$s_!o_ZR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d59da42-5515-45c4-be14-2a0984963ae6_2000x835.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 role="img" 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><title></title><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><span>Tokens matter because they shape almost every system constraint:</span></p><ul><li><p><strong><span>Cost</span></strong><span> &#8594; Most providers bill by input and output tokens.</span></p></li><li><p><strong><span>Context window</span></strong><span> &#8594; A model&#8217;s working memory is measured in tokens, not words.</span></p></li><li><p><strong><span>Latency</span></strong><span> &#8594; More tokens usually mean more processing time.</span></p></li><li><p><strong><span>Retrieval chunking</span></strong><span> &#8594; Documents must be split by token limits, not page count.</span></p></li></ul><p><span>This becomes especially important with code, logs, multilingual text, and large prompts. Two inputs with the same word count can produce very different token counts.</span></p><h2><span>Embeddings</span></h2><p><span>Embeddings turn text into vectors which are lists of numbers that represent meaning.</span></p><p><span>If two pieces of text mean similar things, their vectors should land close together. That makes embeddings the foundation of semantic search and retrieval systems.</span></p><p><span>A support platform might embed every help article. When a user asks, &#8220;Why was my payment declined?&#8221;, the system searches for nearby vectors and retrieves related articles about billing failures, fraud checks, or declined cards.</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!uslY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa08fe690-363f-4a8c-bd6e-1aa12805f565_2000x900.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!uslY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa08fe690-363f-4a8c-bd6e-1aa12805f565_2000x900.png 424w, https://substackcdn.com/image/fetch/$s_!uslY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa08fe690-363f-4a8c-bd6e-1aa12805f565_2000x900.png 848w, https://substackcdn.com/image/fetch/$s_!uslY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa08fe690-363f-4a8c-bd6e-1aa12805f565_2000x900.png 1272w, https://substackcdn.com/image/fetch/$s_!uslY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa08fe690-363f-4a8c-bd6e-1aa12805f565_2000x900.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!uslY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa08fe690-363f-4a8c-bd6e-1aa12805f565_2000x900.png" width="1456" height="655" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a08fe690-363f-4a8c-bd6e-1aa12805f565_2000x900.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:655,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:350114,&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://blog.levelupcoding.com/i/203498745?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa08fe690-363f-4a8c-bd6e-1aa12805f565_2000x900.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_!uslY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa08fe690-363f-4a8c-bd6e-1aa12805f565_2000x900.png 424w, https://substackcdn.com/image/fetch/$s_!uslY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa08fe690-363f-4a8c-bd6e-1aa12805f565_2000x900.png 848w, https://substackcdn.com/image/fetch/$s_!uslY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa08fe690-363f-4a8c-bd6e-1aa12805f565_2000x900.png 1272w, https://substackcdn.com/image/fetch/$s_!uslY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa08fe690-363f-4a8c-bd6e-1aa12805f565_2000x900.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 role="img" 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><title></title><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><span>This is the backbone of retrieval-augmented generation (RAG), where external knowledge is fetched before the LLM generates a response.</span></p><p><span>There is no universally best embedding model. Different models optimize for different retrieval patterns. Some work better for semantic similarity, others for clustering or reranking. So the important part is testing them against your actual data and queries.</span></p><h2><span>Attention, context windows, and long-context methods</span></h2><p><span>Attention lets the model decide which earlier tokens matter most.</span></p><p><span>But attention becomes expensive as inputs grow because tokens may need to compare against many other tokens. That is one reason long-context systems are difficult to scale efficiently.</span></p><p><span>A context window is the amount of text a model can consider in one request. Larger windows help with long documents, codebases, and multi-step workflows, but more context is not always better.</span></p><p><span>A giant prompt full of loosely related information can behave like a desk buried under papers. The answer may exist somewhere in the pile, but finding the right signal becomes harder as the noise grows.</span></p><p><span>Good long-context systems usually follow a few principles:</span></p><ul><li><p><strong><span>Keep instructions clear</span></strong><span> &#8594; Signal matters more than volume.</span></p></li><li><p><strong><span>Retrieve only relevant information</span></strong><span> &#8594; Smaller context is often more effective.</span></p></li><li><p><strong><span>Summarize stale state</span></strong><span> &#8594; Compaction keeps the prompt focused.</span></p></li></ul><p><span>Long context works best when many related facts are needed at the same time. Otherwise, retrieval is usually faster and cheaper.</span></p><h2><span>Scaling laws</span></h2><p><span>Scaling laws describe how model performance changes as parameters, data, and compute increase.</span></p><p><span>A common misconception is that bigger models automatically create better systems. Size helps, but only when the model is trained with enough high-quality data and served efficiently. A poorly trained large model can still underperform a smaller, better-balanced one.</span></p><p><span>Model selection is not a popularity contest. You need to balance several tradeoffs:</span></p><ul><li><p><strong><span>Quality</span></strong><span> &#8594; Does it solve the actual task well?</span></p></li><li><p><strong><span>Latency</span></strong><span> &#8594; Can it respond fast enough for users?</span></p></li><li><p><strong><span>Cost</span></strong><span> &#8594; Does unit economics make sense?</span></p></li><li><p><strong><span>Reliability</span></strong><span> &#8594; Does it behave predictably under edge cases?</span></p></li><li><p><strong><span>Grounding</span></strong><span> &#8594; Does it use the right source material correctly?</span></p></li></ul><p><span>The best model is usually not the largest one. It is the one that delivers enough quality at the right cost, latency, and risk level.</span></p><h2><span>Pretraining, fine-tuning, and instruction tuning</span></h2><p><span>LLMs are trained in stages, with each stage solving a different problem.</span></p><ul><li><p><strong><span>Pretraining</span></strong><span> &#8594; The model learns general language patterns and broad knowledge from massive datasets.</span></p></li><li><p><strong><span>Fine-tuning</span></strong><span> &#8594; The pretrained model is adapted for a narrower domain, behavior, or task.</span></p></li><li><p><strong><span>Instruction tuning</span></strong><span> &#8594; The model learns how to follow prompts and respond in a more conversational, task-oriented way.</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!MplU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fddf23cf5-c155-4a9b-b167-943458ebd45e_2000x1011.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!MplU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fddf23cf5-c155-4a9b-b167-943458ebd45e_2000x1011.png 424w, https://substackcdn.com/image/fetch/$s_!MplU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fddf23cf5-c155-4a9b-b167-943458ebd45e_2000x1011.png 848w, https://substackcdn.com/image/fetch/$s_!MplU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fddf23cf5-c155-4a9b-b167-943458ebd45e_2000x1011.png 1272w, https://substackcdn.com/image/fetch/$s_!MplU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fddf23cf5-c155-4a9b-b167-943458ebd45e_2000x1011.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!MplU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fddf23cf5-c155-4a9b-b167-943458ebd45e_2000x1011.png" width="1456" height="736" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ddf23cf5-c155-4a9b-b167-943458ebd45e_2000x1011.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:736,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:798553,&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://blog.levelupcoding.com/i/203498745?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fddf23cf5-c155-4a9b-b167-943458ebd45e_2000x1011.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_!MplU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fddf23cf5-c155-4a9b-b167-943458ebd45e_2000x1011.png 424w, https://substackcdn.com/image/fetch/$s_!MplU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fddf23cf5-c155-4a9b-b167-943458ebd45e_2000x1011.png 848w, https://substackcdn.com/image/fetch/$s_!MplU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fddf23cf5-c155-4a9b-b167-943458ebd45e_2000x1011.png 1272w, https://substackcdn.com/image/fetch/$s_!MplU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fddf23cf5-c155-4a9b-b167-943458ebd45e_2000x1011.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 role="img" 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><title></title><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></ul><p><span>A common mistake is treating fine-tuning as the solution for everything.</span></p><p><span>Fine-tuning works best for stable behavior, like tone, formatting, or repeated workflows. A customer support assistant, for example, may need consistent escalation rules and response style.</span></p><p><span>But fast-changing information usually does not belong in the model weights. Product pricing, internal docs, or policy updates are usually better handled through retrieval systems like RAG.</span></p><p><span>In practice, fine-tuning shapes behavior. Retrieval supplies fresh knowledge.</span></p><h2><span>Alignment</span></h2><p><span>Alignment is the process of shaping model behavior toward goals like helpfulness, safety, and policy compliance.</span></p><p><span>The three main approaches are:</span></p><ul><li><p><strong><span>RLHF (Reinforcement Learning from Human Feedback)</span></strong><span> &#8594; Human reviewers rank model outputs, and the model learns to prefer responses people rate more highly.</span></p></li><li><p><strong><span>DPO (Direct Preference Optimisation)</span></strong><span> &#8594; A simpler approach that learns directly from preference comparisons without a full reinforcement learning loop.</span></p></li><li><p><strong><span>Constitutional AI</span></strong><span> &#8594; The model critiques and revises its own responses using a defined set of rules or principles.</span></p></li></ul><p><span>Alignment is a balancing act, not a safety switch.</span></p><p><span>A model can become more helpful while also becoming more willing to follow harmful instructions. It can become safer while also refusing harmless requests too often. A polished response can still contain incorrect information.</span></p><p><span>That is why alignment alone is not enough. Reliable LLM systems still need retrieval, permissions, evaluation, and monitoring around the model itself.</span></p><h2><span>Prompt engineering</span></h2><p><span>Prompt engineering is the design of instructions, examples, and context given to the model.</span></p><p><span>It is often the fastest way to improve an LLM system because changing a prompt is far cheaper than retraining a model. A good prompt can define the model&#8217;s role, constrain the output format, provide examples, and tell the model how to use retrieved information.</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Iall!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f6e0812-1146-42d0-b7b7-38ef864f6b7c_2000x933.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Iall!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f6e0812-1146-42d0-b7b7-38ef864f6b7c_2000x933.png 424w, https://substackcdn.com/image/fetch/$s_!Iall!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f6e0812-1146-42d0-b7b7-38ef864f6b7c_2000x933.png 848w, https://substackcdn.com/image/fetch/$s_!Iall!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f6e0812-1146-42d0-b7b7-38ef864f6b7c_2000x933.png 1272w, https://substackcdn.com/image/fetch/$s_!Iall!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f6e0812-1146-42d0-b7b7-38ef864f6b7c_2000x933.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Iall!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f6e0812-1146-42d0-b7b7-38ef864f6b7c_2000x933.png" width="1456" height="679" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4f6e0812-1146-42d0-b7b7-38ef864f6b7c_2000x933.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:679,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:827399,&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://blog.levelupcoding.com/i/203498745?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f6e0812-1146-42d0-b7b7-38ef864f6b7c_2000x933.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_!Iall!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f6e0812-1146-42d0-b7b7-38ef864f6b7c_2000x933.png 424w, https://substackcdn.com/image/fetch/$s_!Iall!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f6e0812-1146-42d0-b7b7-38ef864f6b7c_2000x933.png 848w, https://substackcdn.com/image/fetch/$s_!Iall!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f6e0812-1146-42d0-b7b7-38ef864f6b7c_2000x933.png 1272w, https://substackcdn.com/image/fetch/$s_!Iall!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f6e0812-1146-42d0-b7b7-38ef864f6b7c_2000x933.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 role="img" 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><title></title><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><span>But prompts become fragile when they grow without structure.</span></p><ul><li><p><strong><span>Model updates can change behavior</span></strong><span> &#8594; A prompt that works today may drift tomorrow.</span></p></li><li><p><strong><span>Examples can overfit</span></strong><span> &#8594; The model may mimic patterns instead of understanding intent.</span></p></li><li><p><strong><span>Complexity accumulates</span></strong><span> &#8594; Large prompts can turn into brittle mini-applications.</span></p></li></ul><p><span>Treat prompts like production code. Version them, test them, and monitor them because prompt behavior directly affects system behavior.</span></p><h2><span>Reasoning patterns</span></h2><p><span>Reasoning techniques help LLMs handle tasks with multiple steps, dependencies, or external information needs.</span></p><ul><li><p><strong><span>Chain-of-thought prompting</span></strong><span> &#8594; Encourages the model to reason step by step.</span></p></li><li><p><strong><span>Self-consistency</span></strong><span> &#8594; Samples multiple reasoning paths and selects the most consistent answer.</span></p></li><li><p><strong><span>ReAct</span></strong><span> &#8594; Combines reasoning with tool use, letting the model think, act, observe results, and continue.</span></p></li></ul><p><span>These approaches work especially well for math, coding, research, and agent workflows where planning and evidence gathering matter more than fast responses.</span></p><p><span>But reasoning comes with tradeoffs.</span></p><p><span>Extra reasoning uses more tokens. Tool calls add latency. Multiple reasoning attempts increase cost even further.</span></p><p><span>Use reasoning patterns when correctness matters more than speed. For simpler tasks like classification, routing, or formatting, they usually add overhead without much benefit.</span></p><h2><span>Retrieval-augmented generation (RAG)</span></h2><p><span>Retrieval-augmented generation (RAG) connects an LLM to external knowledge sources.</span></p><p><span>The flow is simple: a user asks a question, the system retrieves relevant documents, and the model generates an answer using that retrieved context.</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!7mE0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff490c0a2-3862-4cb5-93dc-4b8c31562f8e_2000x880.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7mE0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff490c0a2-3862-4cb5-93dc-4b8c31562f8e_2000x880.png 424w, https://substackcdn.com/image/fetch/$s_!7mE0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff490c0a2-3862-4cb5-93dc-4b8c31562f8e_2000x880.png 848w, https://substackcdn.com/image/fetch/$s_!7mE0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff490c0a2-3862-4cb5-93dc-4b8c31562f8e_2000x880.png 1272w, https://substackcdn.com/image/fetch/$s_!7mE0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff490c0a2-3862-4cb5-93dc-4b8c31562f8e_2000x880.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7mE0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff490c0a2-3862-4cb5-93dc-4b8c31562f8e_2000x880.png" width="1456" height="641" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f490c0a2-3862-4cb5-93dc-4b8c31562f8e_2000x880.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:641,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:489060,&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://blog.levelupcoding.com/i/203498745?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff490c0a2-3862-4cb5-93dc-4b8c31562f8e_2000x880.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_!7mE0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff490c0a2-3862-4cb5-93dc-4b8c31562f8e_2000x880.png 424w, https://substackcdn.com/image/fetch/$s_!7mE0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff490c0a2-3862-4cb5-93dc-4b8c31562f8e_2000x880.png 848w, https://substackcdn.com/image/fetch/$s_!7mE0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff490c0a2-3862-4cb5-93dc-4b8c31562f8e_2000x880.png 1272w, https://substackcdn.com/image/fetch/$s_!7mE0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff490c0a2-3862-4cb5-93dc-4b8c31562f8e_2000x880.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 role="img" 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><title></title><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><span>RAG matters because business knowledge changes far faster than model training. Instead of retraining the model every time information changes, you update the data source.</span></p><p><span>RAG works especially well when:</span></p><ul><li><p><strong><span>Facts change frequently</span></strong><span> &#8594; Policies, pricing, tickets, and docs evolve constantly.</span></p></li><li><p><strong><span>Provenance matters</span></strong><span> &#8594; Users need to know where answers came from.</span></p></li><li><p><strong><span>Knowledge is private</span></strong><span> &#8594; Internal documents should not require retraining a foundation model.</span></p></li><li><p><strong><span>Updates must stay cheap</span></strong><span> &#8594; Reindexing documents is far easier than retraining models.</span></p></li></ul><p><span>But RAG introduces its own failure modes.</span></p><p><span>The retriever may miss the right document. Chunking may separate information from its context. Ranking may surface misleading evidence. The model may even ignore the retrieved material entirely.</span></p><p><span>That is why grounding matters. Grounding means tying responses to verified source material instead of letting the model freely improvise.</span></p><h2><span>Hallucination, evaluation, and safety</span></h2><p><span>A hallucination is an unsupported or misleading output generated by the model.</span></p><p><span>But hallucinations are not caused by one single problem. The model may lack knowledge, retrieval may fail, the prompt may be unclear, the source material may be wrong, or a tool may return stale data.</span></p><p><span>That is why hallucinations cannot be solved with one technique. Reliable systems reduce them through layers of validation:</span></p><ul><li><p><strong><span>Retrieval evaluation</span></strong><span> &#8594; Did the system fetch the right evidence?</span></p></li><li><p><strong><span>Grounding checks</span></strong><span> &#8594; Is the answer actually supported by the source material?</span></p></li><li><p><strong><span>Safety testing</span></strong><span> &#8594; Does the system resist harmful or manipulative inputs?</span></p></li><li><p><strong><span>Monitoring</span></strong><span> &#8594; Do real users expose failures missed during testing?</span></p></li></ul><p><span>Benchmarks help, but they are only proxies. A model can perform well offline and still fail in production.</span></p><p><span>The real test is whether the system answers your users correctly, safely, and consistently under real-world conditions.</span></p><h2><span>Compression and optimization</span></h2><p><span>Efficiency is what turns an impressive model into something financially and operationally viable.</span></p><p><span>LLM inference is expensive because every generated token depends on the one before it. As outputs grow, latency and compute costs grow with them.</span></p><p><span>That is why production systems rely on techniques that reduce memory use and improve serving efficiency:</span></p><ul><li><p><strong><span>Quantization</span></strong><span> &#8594; Uses lower-precision weights to reduce memory and compute costs.</span></p></li><li><p><strong><span>Pruning</span></strong><span> &#8594; Remove less useful parts of the model or computation.</span></p></li><li><p><strong><span>Distillation</span></strong><span> &#8594; Trains a smaller model to mimic a larger one.</span></p></li><li><p><strong><span>FlashAttention</span></strong><span> &#8594; Makes attention faster and more memory-efficient.</span></p></li><li><p><strong><span>Speculative decoding</span></strong><span> &#8594; Uses a smaller model to draft tokens before a larger model verifies them.</span></p></li><li><p><strong><span>PagedAttention</span></strong><span> &#8594; Improves memory management during inference serving.</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!uYU7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09c8a88a-304a-4b2e-9a12-5df43c7f9cbd_2000x948.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!uYU7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09c8a88a-304a-4b2e-9a12-5df43c7f9cbd_2000x948.png 424w, https://substackcdn.com/image/fetch/$s_!uYU7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09c8a88a-304a-4b2e-9a12-5df43c7f9cbd_2000x948.png 848w, https://substackcdn.com/image/fetch/$s_!uYU7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09c8a88a-304a-4b2e-9a12-5df43c7f9cbd_2000x948.png 1272w, https://substackcdn.com/image/fetch/$s_!uYU7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09c8a88a-304a-4b2e-9a12-5df43c7f9cbd_2000x948.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!uYU7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09c8a88a-304a-4b2e-9a12-5df43c7f9cbd_2000x948.png" width="1456" height="690" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/09c8a88a-304a-4b2e-9a12-5df43c7f9cbd_2000x948.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:690,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:344305,&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://blog.levelupcoding.com/i/203498745?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09c8a88a-304a-4b2e-9a12-5df43c7f9cbd_2000x948.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_!uYU7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09c8a88a-304a-4b2e-9a12-5df43c7f9cbd_2000x948.png 424w, https://substackcdn.com/image/fetch/$s_!uYU7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09c8a88a-304a-4b2e-9a12-5df43c7f9cbd_2000x948.png 848w, https://substackcdn.com/image/fetch/$s_!uYU7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09c8a88a-304a-4b2e-9a12-5df43c7f9cbd_2000x948.png 1272w, https://substackcdn.com/image/fetch/$s_!uYU7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09c8a88a-304a-4b2e-9a12-5df43c7f9cbd_2000x948.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 role="img" 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><title></title><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></ul><p><span>In practice, the biggest gains often come from simpler optimizations first: shorter prompts, capped outputs, cached context, batching, and smaller fallback models. You usually do not need a larger GPU cluster as the first solution.</span></p><h2><span>Deployment patterns</span></h2><p><span>Deployment determines where model inference happens, and that decision affects latency, privacy, reliability, and cost.</span></p><p><span>There are three common deployment patterns:</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tB45!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe475cfdf-2a36-454e-a4f5-8f81e5ebead4_2000x726.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tB45!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe475cfdf-2a36-454e-a4f5-8f81e5ebead4_2000x726.png 424w, https://substackcdn.com/image/fetch/$s_!tB45!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe475cfdf-2a36-454e-a4f5-8f81e5ebead4_2000x726.png 848w, https://substackcdn.com/image/fetch/$s_!tB45!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe475cfdf-2a36-454e-a4f5-8f81e5ebead4_2000x726.png 1272w, https://substackcdn.com/image/fetch/$s_!tB45!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe475cfdf-2a36-454e-a4f5-8f81e5ebead4_2000x726.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tB45!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe475cfdf-2a36-454e-a4f5-8f81e5ebead4_2000x726.png" width="1456" height="529" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e475cfdf-2a36-454e-a4f5-8f81e5ebead4_2000x726.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:529,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:361782,&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://blog.levelupcoding.com/i/203498745?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe475cfdf-2a36-454e-a4f5-8f81e5ebead4_2000x726.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_!tB45!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe475cfdf-2a36-454e-a4f5-8f81e5ebead4_2000x726.png 424w, https://substackcdn.com/image/fetch/$s_!tB45!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe475cfdf-2a36-454e-a4f5-8f81e5ebead4_2000x726.png 848w, https://substackcdn.com/image/fetch/$s_!tB45!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe475cfdf-2a36-454e-a4f5-8f81e5ebead4_2000x726.png 1272w, https://substackcdn.com/image/fetch/$s_!tB45!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe475cfdf-2a36-454e-a4f5-8f81e5ebead4_2000x726.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 role="img" 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><title></title><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><span>Edge deployment runs the model on-device or close to the user. Cloud deployment sends requests to centralized model infrastructure. Hybrid systems split workloads between both.</span></p><p><span>Choose edge when responsiveness and data locality matter most. Choose cloud when model capability and tooling matter more. Choose hybrid when you need both and can cleanly separate the workflow.</span></p><h2><span>Privacy and data governance</span></h2><p><span>Privacy and governance shape how data enters, moves through, and leaves an LLM system.</span></p><p><span>This is not just a compliance problem. It directly affects architecture.</span></p><p><span>A privacy-sensitive system may require local processing, encrypted logs, restricted tool access, and short retention windows. Regulated workflows may need human approval before the model can send messages, update records, or trigger actions.</span></p><p><span>Good governance usually comes down to a few core controls:</span></p><ul><li><p><strong><span>Classify inputs</span></strong><span> &#8594; Know which data is sensitive or regulated.</span></p></li><li><p><strong><span>Separate instructions from retrieved data</span></strong><span> &#8594; External content should not override system rules.</span></p></li><li><p><strong><span>Limit tool permissions</span></strong><span> &#8594; Give the model only the access it actually needs.</span></p></li><li><p><strong><span>Control retention</span></strong><span> &#8594; Store logs only as long as necessary.</span></p></li><li><p><strong><span>Review vendor policies</span></strong><span> &#8594; Understand how providers handle training and data storage.</span></p></li></ul><p><span>The more autonomy a model has, the more important the guardrails become.</span></p><h2><span>Multimodality</span></h2><p><span>Multimodal models work with more than just text. They can process images, audio, video, documents, and combinations of different inputs together.</span></p><p><span>That expands what LLM systems can do: document analysis, visual search, voice assistants, meeting summaries, accessibility tools, and more natural interfaces.</span></p><p><span>But multimodality also increases the failure surface.</span></p><p><span>A model may misread an image, miss small text in a screenshot, mistranscribe audio, or incorrectly connect information across formats. A system that performs well in text may still struggle with visual grounding or audio accuracy.</span></p><p><span>That is why each modality needs separate evaluation:</span></p><ul><li><p><strong><span>Text</span></strong><span> &#8594; Does the model reason correctly?</span></p></li><li><p><strong><span>Images</span></strong><span> &#8594; Does it identify visual details reliably?</span></p></li><li><p><strong><span>Audio</span></strong><span> &#8594; Does transcription preserve meaning?</span></p></li><li><p><strong><span>Combined inputs</span></strong><span> &#8594; Does it connect the right information across formats?</span></p></li></ul><p><span>Evaluate each modality separately then evaluate the combined system, and keep modality-specific fallbacks where accuracy matters.</span></p><h2><span>Observability and monitoring</span></h2><p><span>Traditional monitoring tells you whether a request succeeded. LLM observability needs much deeper visibility.</span></p><p><span>You need visibility into the entire execution path: which prompt was used, what documents were retrieved, how many tokens were consumed, which tools were called, what safety checks fired, and whether the answer actually helped the user.</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!FAr3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0a0da80-a418-437e-8ba1-80e33939604d_2000x975.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!FAr3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0a0da80-a418-437e-8ba1-80e33939604d_2000x975.png 424w, https://substackcdn.com/image/fetch/$s_!FAr3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0a0da80-a418-437e-8ba1-80e33939604d_2000x975.png 848w, https://substackcdn.com/image/fetch/$s_!FAr3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0a0da80-a418-437e-8ba1-80e33939604d_2000x975.png 1272w, https://substackcdn.com/image/fetch/$s_!FAr3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0a0da80-a418-437e-8ba1-80e33939604d_2000x975.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!FAr3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0a0da80-a418-437e-8ba1-80e33939604d_2000x975.png" width="1456" height="710" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d0a0da80-a418-437e-8ba1-80e33939604d_2000x975.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:710,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:486315,&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://blog.levelupcoding.com/i/203498745?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0a0da80-a418-437e-8ba1-80e33939604d_2000x975.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_!FAr3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0a0da80-a418-437e-8ba1-80e33939604d_2000x975.png 424w, https://substackcdn.com/image/fetch/$s_!FAr3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0a0da80-a418-437e-8ba1-80e33939604d_2000x975.png 848w, https://substackcdn.com/image/fetch/$s_!FAr3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0a0da80-a418-437e-8ba1-80e33939604d_2000x975.png 1272w, https://substackcdn.com/image/fetch/$s_!FAr3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0a0da80-a418-437e-8ba1-80e33939604d_2000x975.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 role="img" 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><title></title><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><span>That usually means tracing several layers at once:</span></p><ul><li><p><strong><span>Prompt version</span></strong><span> &#8594; Which instructions generated the output?</span></p></li><li><p><strong><span>Token usage</span></strong><span> &#8594; Did costs spike because prompts or outputs grew?</span></p></li><li><p><strong><span>Retrieval results</span></strong><span> &#8594; Was the right evidence returned?</span></p></li><li><p><strong><span>Tool calls</span></strong><span> &#8594; Did the model use the correct tools safely?</span></p></li><li><p><strong><span>Latency</span></strong><span> &#8594; Was time spent in retrieval, generation, or external tools?</span></p></li><li><p><strong><span>Safety events</span></strong><span> &#8594; Did the system detect prompt injection or sensitive data risks?</span></p></li><li><p><strong><span>User outcomes</span></strong><span> &#8594; Did the response actually solve the problem?</span></p></li></ul><p><span>Without observability, debugging LLM systems becomes guesswork. With it, failures become traceable.</span></p><h2><span>Wrapping up</span></h2><p><span>LLMs make more sense when you treat them as systems, not just models.</span></p><p><span>The difficult part is not generating text. It is making the entire system reliable, grounded, observable, fast, and safe under real-world conditions.</span></p><p><span>That is why successful LLM products are not built from prompts alone. They come from layers working together: retrieval, evaluation, guardrails, serving infrastructure, observability, governance, and careful system design.</span></p><p><span>The model produces the response.</span></p><p><span>The system around it determines whether that response can be trusted.</span></p><div><hr></div><p>&#128075; If you found this useful &#8594; Like + Restack to help others learn system design.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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 get high-signal, clear, and visual system design breakdowns straight to your inbox:&nbsp;</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[MCP Clearly Explained]]></title><description><![CDATA[Plus: Big upgrades are coming to LUC. Vote on what you'd like to see first.]]></description><link>https://blog.levelupcoding.com/p/mcp-clearly-explained</link><guid isPermaLink="false">https://blog.levelupcoding.com/p/mcp-clearly-explained</guid><dc:creator><![CDATA[Nikki Siapno]]></dc:creator><pubDate>Mon, 15 Jun 2026 12:57:01 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/332edc58-66c9-4497-8dcd-414ad975e8fc_2400x1260.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_!yLV0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yLV0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" width="1292" height="266" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:266,&quot;width&quot;:1292,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:343451,&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://lvlupcoding.substack.com/i/171357839?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.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_!yLV0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><div><hr></div><h2>&#128640; What's Next for LUC</h2><p>We're building LUC into a world-class resource for learning system design.</p><p>To get there, we&#8217;re introducing several new content series over the coming months:</p><h4>&#10003; System Design Case Studies</h4><p>Real-world analyses of how systems at companies like Netflix, Uber, Anthropic, and Amazon are designed.</p><h4>&#10003; System Design Deep Dive Series</h4><p>Deeper, more extensive breakdowns than our regular articles.</p><h4>&#10003; AI Engineering Breakdowns</h4><p>Clear, high-signal breakdowns of AI engineering concepts that can be consumed in ~5 minutes.</p><h4>&#10003; AI Engineering Deep Dive Series</h4><p>Deeper, more extensive breakdowns than our regular articles of AI engineering concepts.</p><h4>&#10003; Learning Tracks</h4><p>Curated learning paths that connect related concepts into structured journeys across system design, AI engineering, and software engineering.</p><p><strong>We&#8217;d love your input.</strong></p><div class="poll-embed" data-attrs="{&quot;id&quot;:590928}" data-component-name="PollToDOM"></div><p>We&#8217;ll use the results to help prioritize what we build next. Thanks for being part of the LUC community. We&#8217;re excited to share what&#8217;s coming next!</p><div><hr></div><h1>What MCP Actually Is and Why It Matters</h1><p>How many custom integrations does your AI stack have?</p><p>One for the database, one for Slack, one for the internal knowledge base; each written from scratch, each maintained separately.</p><p>Add a new model and the count multiplies again.</p><p>Model Context Protocol (MCP) is Anthropic&#8217;s answer to that problem.</p><p>Rather than building a new connector for every model-tool pairing, MCP defines a single standard interface so any compliant AI host can speak to any compliant server. Add a new tool once, every model that supports MCP can use it immediately.</p><p>Understanding how MCP works and where it fits changes how you design AI systems.</p><h2>What is MCP?</h2><p>Model Context Protocol (MCP) is a standard way for an AI application to talk to external services.</p><p>Instead of inventing a new integration pattern for each tool, MCP defines a common protocol for discovering capabilities, requesting data, and invoking actions.</p><p>But it doesn&#8217;t stop at message formats.</p><p>MCP also defines how a session is established, what features are allowed, and how both sides stay compatible over time.</p><p>MCP is structured around three core roles:</p><ul><li><p><strong>Host</strong> &#8594; The AI application the user interacts with, such as a chat app or coding assistant</p></li><li><p><strong>Client</strong> &#8594; The connector inside that host that manages one server connection</p></li><li><p><strong>Server</strong> &#8594; The external process or service that exposes capabilities to the host</p></li></ul><p>That separation is what makes MCP scale.</p><p>The host decides when to ask for help. The client handles the protocol details. The server owns the actual side effects, such as reading data, calling an API, or writing to a system.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!p4X6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d29141-d640-4a99-bd66-cb18b0ec03c6_2000x1118.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!p4X6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d29141-d640-4a99-bd66-cb18b0ec03c6_2000x1118.png 424w, https://substackcdn.com/image/fetch/$s_!p4X6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d29141-d640-4a99-bd66-cb18b0ec03c6_2000x1118.png 848w, https://substackcdn.com/image/fetch/$s_!p4X6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d29141-d640-4a99-bd66-cb18b0ec03c6_2000x1118.png 1272w, https://substackcdn.com/image/fetch/$s_!p4X6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d29141-d640-4a99-bd66-cb18b0ec03c6_2000x1118.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!p4X6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d29141-d640-4a99-bd66-cb18b0ec03c6_2000x1118.png" width="1456" height="814" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a1d29141-d640-4a99-bd66-cb18b0ec03c6_2000x1118.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:814,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1113754,&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://blog.levelupcoding.com/i/197830407?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d29141-d640-4a99-bd66-cb18b0ec03c6_2000x1118.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_!p4X6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d29141-d640-4a99-bd66-cb18b0ec03c6_2000x1118.png 424w, https://substackcdn.com/image/fetch/$s_!p4X6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d29141-d640-4a99-bd66-cb18b0ec03c6_2000x1118.png 848w, https://substackcdn.com/image/fetch/$s_!p4X6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d29141-d640-4a99-bd66-cb18b0ec03c6_2000x1118.png 1272w, https://substackcdn.com/image/fetch/$s_!p4X6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d29141-d640-4a99-bd66-cb18b0ec03c6_2000x1118.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 role="img" 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><title></title><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>How MCP sessions actually work</h2><p>Under the hood, MCP is a capability protocol with a negotiated lifecycle.</p><p>Every connection starts with a handshake where the client and server agree on:</p><ul><li><p><strong>Protocol version</strong> &#8594; Ensures both sides speak the same language</p></li><li><p><strong>Capabilities</strong> &#8594; Defines what features are available in this session </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ABIo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbdd15d4-96c4-457c-a5db-85794b1861f3_2000x847.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ABIo!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbdd15d4-96c4-457c-a5db-85794b1861f3_2000x847.png 424w, https://substackcdn.com/image/fetch/$s_!ABIo!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbdd15d4-96c4-457c-a5db-85794b1861f3_2000x847.png 848w, https://substackcdn.com/image/fetch/$s_!ABIo!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbdd15d4-96c4-457c-a5db-85794b1861f3_2000x847.png 1272w, https://substackcdn.com/image/fetch/$s_!ABIo!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbdd15d4-96c4-457c-a5db-85794b1861f3_2000x847.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ABIo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbdd15d4-96c4-457c-a5db-85794b1861f3_2000x847.png" width="1456" height="617" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bbdd15d4-96c4-457c-a5db-85794b1861f3_2000x847.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:617,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:303679,&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://blog.levelupcoding.com/i/197830407?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbdd15d4-96c4-457c-a5db-85794b1861f3_2000x847.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_!ABIo!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbdd15d4-96c4-457c-a5db-85794b1861f3_2000x847.png 424w, https://substackcdn.com/image/fetch/$s_!ABIo!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbdd15d4-96c4-457c-a5db-85794b1861f3_2000x847.png 848w, https://substackcdn.com/image/fetch/$s_!ABIo!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbdd15d4-96c4-457c-a5db-85794b1861f3_2000x847.png 1272w, https://substackcdn.com/image/fetch/$s_!ABIo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbdd15d4-96c4-457c-a5db-85794b1861f3_2000x847.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 role="img" 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><title></title><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></ul><p>After that, all interactions are constrained by what was agreed upfront. No hidden features. No assumptions.</p><p>This is what makes MCP different from typical APIs. It&#8217;s not just &#8220;send a request, get a response.&#8221; It&#8217;s a structured session where both sides explicitly agree on what&#8217;s possible before anything happens.</p><p>That extra layer is what turns MCP from a simple integration pattern into something that can scale across many tools, models, and environments.</p><h2>What servers expose</h2><p>MCP servers expose capabilities in three distinct ways. Each one exists for a different job, and mixing them leads to messy systems.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-wtH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c705537-1d7f-45ea-be4c-55336ef9b60e_2000x884.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-wtH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c705537-1d7f-45ea-be4c-55336ef9b60e_2000x884.png 424w, https://substackcdn.com/image/fetch/$s_!-wtH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c705537-1d7f-45ea-be4c-55336ef9b60e_2000x884.png 848w, https://substackcdn.com/image/fetch/$s_!-wtH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c705537-1d7f-45ea-be4c-55336ef9b60e_2000x884.png 1272w, https://substackcdn.com/image/fetch/$s_!-wtH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c705537-1d7f-45ea-be4c-55336ef9b60e_2000x884.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-wtH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c705537-1d7f-45ea-be4c-55336ef9b60e_2000x884.png" width="1456" height="644" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5c705537-1d7f-45ea-be4c-55336ef9b60e_2000x884.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:644,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:436057,&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://blog.levelupcoding.com/i/197830407?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c705537-1d7f-45ea-be4c-55336ef9b60e_2000x884.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_!-wtH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c705537-1d7f-45ea-be4c-55336ef9b60e_2000x884.png 424w, https://substackcdn.com/image/fetch/$s_!-wtH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c705537-1d7f-45ea-be4c-55336ef9b60e_2000x884.png 848w, https://substackcdn.com/image/fetch/$s_!-wtH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c705537-1d7f-45ea-be4c-55336ef9b60e_2000x884.png 1272w, https://substackcdn.com/image/fetch/$s_!-wtH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c705537-1d7f-45ea-be4c-55336ef9b60e_2000x884.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 role="img" 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><title></title><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 important distinction is between <strong>tools and resources</strong>.</p><p>If you blur that line, your system becomes harder to reason about.</p><p>Use this rule:</p><ul><li><p><strong>Context-heavy</strong> &#8594; Use a resource because you&#8217;re supplying data</p></li><li><p><strong>Action-oriented</strong> &#8594; Use a tool because you&#8217;re performing something </p></li></ul><p>If a &#8220;tool&#8221; mostly returns data with no real side effect, it&#8217;s probably a resource in disguise.</p><p>Keeping this separation clean makes your system easier to test, easier to secure, and easier to evolve.</p><h2>The benefits of MCP</h2><p>MCP solves a scaling problem that shows up fast in real AI systems.</p><p>Without a shared protocol, every integration becomes custom work. Your chat app talks to one tool one way, your IDE talks to another tool another way, and your internal agent framework invents a third pattern.</p><p>That fragmentation slows teams down because every product repeats the same connector logic.</p><p>MCP changes that in a few concrete ways:</p><ul><li><p><strong>Standardized integration surface</strong> &#8594; New tools do not require a brand-new communication pattern each time.</p></li><li><p><strong>Better separation of concerns</strong> &#8594; Product logic stays in the host, protocol handling stays in the client, and domain actions stay in the server.</p></li><li><p><strong>Safer extensibility</strong> &#8594; Teams can add capabilities gradually because features are negotiated instead of assumed.</p></li><li><p><strong>Easier composition</strong> &#8594; One host can connect to multiple servers without turning every connection into a one-off project.</p></li></ul><p>This is especially useful in products where the model needs live context.</p><p>A coding assistant may need repository data, documentation, terminal access, and issue tracker actions in the same session. MCP gives those capabilities a shared protocol so the host can compose them without stitching together a fresh protocol per tool.</p><h2>The tradeoffs</h2><p>MCP simplifies integration, but it does not remove the hard parts of building safe and reliable systems.</p><p>The most common mistake is treating the protocol as the safety layer.</p><p>It isn&#8217;t.</p><p>MCP gives you structure. You still decide what gets exposed, what requires user consent, and how risky actions are controlled. If those decisions are weak, the protocol won&#8217;t save you.</p><p>That means core distributed-systems discipline still applies:</p><ul><li><p><strong>Check inputs carefully</strong> &#8594; Don&#8217;t assume tool inputs are safe; AI can make mistakes or send bad data</p></li><li><p><strong>Limit what tools can do</strong> &#8594; Give each tool only the access it really needs to avoid misuse.</p></li><li><p><strong>Don&#8217;t trust descriptions</strong> &#8594; Just because a tool says it does something doesn&#8217;t make it safe.</p></li><li><p><strong>Make things easy to track</strong> &#8594; Use IDs, logs, and progress updates so you can see what&#8217;s happening when things get complicated.</p></li><li><p><strong>Use structured data</strong> &#8594; Systems are more reliable when they pass clear, well-defined data instead of free-form text.</p></li></ul><p>There is also a system design tradeoff.</p><p>MCP standardises communication, but it does not orchestrate behavior.</p><ul><li><p><strong>No model strategy</strong> &#8594; You still choose which model to use and when</p></li><li><p><strong>No context ranking </strong>&#8594; You decide what data is relevant and how it&#8217;s selected</p></li><li><p><strong>No tool arbitration</strong> &#8594; You define how conflicts between tools are resolved</p></li><li><p><strong>No workflow control</strong> &#8594; You design how multi-step tasks are executed</p></li></ul><p>MCP removes the need to rebuild integrations, but it leaves system design decisions exactly where they belong; with you.</p><h2>When MCP makes sense (and when it doesn&#8217;t)</h2><p>MCP is designed for systems that need to scale across multiple tools, data sources, and workflows.</p><p>It works best when your AI application needs to:</p><ul><li><p><strong>Connect to multiple services</strong> &#8594; Each capability can be exposed and managed independently</p></li><li><p><strong>Compose workflows</strong> &#8594; Outputs from one tool feed into another across a session</p></li><li><p><strong>Evolve over time</strong> &#8594; New tools can be added without rewriting integrations</p></li><li><p><strong>Support agent-like behavior</strong> &#8594; The model dynamically discovers and uses capabilities</p></li></ul><p>In these systems, MCP reduces long-term complexity because integrations become reusable and consistent.</p><p>On the other hand, it&#8217;s likely overkill when a single, simple API call is all you need.</p><p>If your setup is just one model calling one tool with a fixed setup, a direct API call is easier to build, easier to monitor, and cheaper to run.</p><p>MCP brings extra layers: like managing versions, handling communication rules, and running supporting infrastructure; which only really make sense once your system starts getting more complex.</p><h2>Wrapping up</h2><p>As systems grow, the hardest part isn&#8217;t adding intelligence.</p><p>It&#8217;s making everything work together without breaking.</p><p>What starts as a simple integration quickly turns into a web of connectors, assumptions, and edge cases. Over time, that complexity becomes the bottleneck.</p><p>MCP addresses that at the foundation level.</p><p>It gives you a consistent way to connect systems so you can focus on what those systems should do, not how they talk to each other.</p><p>And that shift matters.</p><p>Because the teams that move fastest aren&#8217;t the ones writing the most integrations.<br> They&#8217;re the ones who can reuse, extend, and evolve what they&#8217;ve already built.</p><p>That&#8217;s the real advantage MCP offers.</p><div><hr></div><p>&#128075; If you found this useful &#8594; Like + Restack to help others learn system design.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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 get high-signal, clear, and visual system design breakdowns straight to your inbox:&nbsp;</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[REST vs GraphQL vs gRPC]]></title><description><![CDATA[The tradeoffs behind resource-driven, query-driven, and method-driven APIs.]]></description><link>https://blog.levelupcoding.com/p/rest-vs-graphql-vs-grpc</link><guid isPermaLink="false">https://blog.levelupcoding.com/p/rest-vs-graphql-vs-grpc</guid><dc:creator><![CDATA[Nikki Siapno]]></dc:creator><pubDate>Thu, 28 May 2026 10:32:52 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/a0e93e32-3873-49a3-adf0-f583b6367380_2400x1260.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_!yLV0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yLV0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" width="1292" height="266" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:266,&quot;width&quot;:1292,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:343451,&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://lvlupcoding.substack.com/i/171357839?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.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_!yLV0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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">Get our 142-page System Design Handbook for FREE on newsletter signup:</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><h2><a href="https://lucode.co/oracle-developer-hub-z67nl">A Practical Hub for Building AI Systems</a></h2><h5>Presented by Oracle</h5><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!n6bu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb844538-26a2-4f40-9f2b-5e2838ec6c93_1068x659.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!n6bu!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb844538-26a2-4f40-9f2b-5e2838ec6c93_1068x659.png 424w, https://substackcdn.com/image/fetch/$s_!n6bu!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb844538-26a2-4f40-9f2b-5e2838ec6c93_1068x659.png 848w, https://substackcdn.com/image/fetch/$s_!n6bu!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb844538-26a2-4f40-9f2b-5e2838ec6c93_1068x659.png 1272w, https://substackcdn.com/image/fetch/$s_!n6bu!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb844538-26a2-4f40-9f2b-5e2838ec6c93_1068x659.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!n6bu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb844538-26a2-4f40-9f2b-5e2838ec6c93_1068x659.png" width="1068" height="659" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/db844538-26a2-4f40-9f2b-5e2838ec6c93_1068x659.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:659,&quot;width&quot;:1068,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:284995,&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;:false,&quot;internalRedirect&quot;:&quot;https://blog.levelupcoding.com/i/198543543?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb844538-26a2-4f40-9f2b-5e2838ec6c93_1068x659.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_!n6bu!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb844538-26a2-4f40-9f2b-5e2838ec6c93_1068x659.png 424w, https://substackcdn.com/image/fetch/$s_!n6bu!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb844538-26a2-4f40-9f2b-5e2838ec6c93_1068x659.png 848w, https://substackcdn.com/image/fetch/$s_!n6bu!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb844538-26a2-4f40-9f2b-5e2838ec6c93_1068x659.png 1272w, https://substackcdn.com/image/fetch/$s_!n6bu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb844538-26a2-4f40-9f2b-5e2838ec6c93_1068x659.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 role="img" 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><title></title><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>Building production AI systems means combining far more than just models. Retrieval pipelines, memory layers, agent orchestration, evaluation workflows, observability, and infrastructure all need to work together. Oracle&#8217;s <strong><a href="https://lucode.co/oracle-developer-hub-z67nl">AI Developer Hub</a></strong> brings these concepts into one place through practical architectures, implementation guides, courses, and real engineering examples for modern AI applications.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://lucode.co/oracle-developer-hub-z67nl&quot;,&quot;text&quot;:&quot;Explore the AI Hub&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://lucode.co/oracle-developer-hub-z67nl"><span>Explore the AI Hub</span></a></p><div><hr></div><h1>REST, GraphQL, or gRPC? Choosing the Right Tool for the Job</h1><p>Your mobile app over-fetches because REST returns the entire resource, even when the screen only needs three fields. Your internal services waste CPU serializing JSON nobody reads. Your front-end team rewrites the same data-fetching glue for every page because the API never lets them ask for exactly what they need.</p><p>These look like separate performance problems, but they usually come from the same root cause: using the wrong API style for the interaction.</p><p>REST, GraphQL, and gRPC solve different communication problems.</p><p>The mistake is treating them as interchangeable.</p><p>An API style is really a tradeoff between flexibility, simplicity, efficiency, and control. Once you understand which tradeoff your system actually needs, the decision becomes much clearer.</p><h2>The core mental model</h2><p>Before comparing performance, tooling, or syntax, focus on the interaction pattern each API style is designed around.</p><ul><li><p><strong>REST</strong> &#8594; Organizes communication around resources. A resource is a stable thing like a user, product, or order, exposed through URLs that clients fetch, create, update, or delete over HTTP.</p></li><li><p><strong>GraphQL</strong> &#8594; Organizes communication around queries. Clients describe the exact shape of data they want, and the server resolves only those fields.</p></li><li><p><strong>gRPC</strong> &#8594; Organizes communication around methods. Services expose strongly typed procedures that other services call directly over HTTP/2 using compact binary messages.</p></li></ul><p>That distinction matters more than the syntax itself.</p><p>If your system naturally revolves around stable entities like products, accounts, or invoices, REST usually feels predictable and easy to reason about. The API behaves like a catalog where every resource has a clear address and lifecycle.</p><p>If different clients constantly need different views of the same data, GraphQL reduces the coordination overhead. A mobile app might need five fields while a dashboard needs fifty. Instead of creating endless custom endpoints, clients ask for exactly what they need.</p><p>If your biggest bottleneck is service-to-service communication, gRPC optimizes for efficiency. Binary payloads are smaller, contracts are strict, and HTTP/2 keeps connections open instead of repeatedly starting new ones. It behaves less like browsing web pages and more like calling functions across the network.</p><p>Once you identify whether your system is resource-driven, query-driven, or method-driven, the tradeoffs become much easier to evaluate.</p><h2>REST: the default for clear resources and public APIs</h2><p>REST works best when your API benefits from standard web behavior.</p><p>A product catalog is a good example. Products, categories, prices, and images are stable resources with clear identities. Browsers, CDNs, proxies, and HTTP caches already know how to handle them efficiently.</p><p>That simplicity is REST&#8217;s biggest advantage. The URL identifies the resource, the HTTP method describes the action, and the status code explains the result.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nBqg!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68e9eca3-764e-486a-beee-0b7e0b21b321_2000x962.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nBqg!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68e9eca3-764e-486a-beee-0b7e0b21b321_2000x962.png 424w, https://substackcdn.com/image/fetch/$s_!nBqg!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68e9eca3-764e-486a-beee-0b7e0b21b321_2000x962.png 848w, https://substackcdn.com/image/fetch/$s_!nBqg!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68e9eca3-764e-486a-beee-0b7e0b21b321_2000x962.png 1272w, https://substackcdn.com/image/fetch/$s_!nBqg!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68e9eca3-764e-486a-beee-0b7e0b21b321_2000x962.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nBqg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68e9eca3-764e-486a-beee-0b7e0b21b321_2000x962.png" width="1456" height="700" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/68e9eca3-764e-486a-beee-0b7e0b21b321_2000x962.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:700,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:617351,&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://blog.levelupcoding.com/i/199286433?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68e9eca3-764e-486a-beee-0b7e0b21b321_2000x962.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_!nBqg!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68e9eca3-764e-486a-beee-0b7e0b21b321_2000x962.png 424w, https://substackcdn.com/image/fetch/$s_!nBqg!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68e9eca3-764e-486a-beee-0b7e0b21b321_2000x962.png 848w, https://substackcdn.com/image/fetch/$s_!nBqg!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68e9eca3-764e-486a-beee-0b7e0b21b321_2000x962.png 1272w, https://substackcdn.com/image/fetch/$s_!nBqg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68e9eca3-764e-486a-beee-0b7e0b21b321_2000x962.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 role="img" 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><title></title><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>REST gives you:</p><ul><li><p><strong>Browser reach</strong> &#8594; Standard HTTP works everywhere without special tooling</p></li><li><p><strong>Cacheability</strong> &#8594; GET requests work naturally with browsers, proxies, and CDNs</p></li><li><p><strong>Simplicity</strong> &#8594; Most developers already understand URLs, headers, and status codes</p></li><li><p><strong>Public API friendliness</strong> &#8594; Requests are easy to inspect, test, and debug</p></li></ul><p>The tradeoff is composition.</p><p>If a single screen needs products, reviews, recommendations, inventory, and shipping data, REST can turn into multiple round trips. You can create larger endpoints, but clients often receive far more data than they actually use.</p><p>Use REST when stability, simplicity, and web infrastructure matter more than fine-grained data control.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!65m7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12809ff0-3dbc-497f-93de-13b75c628b4e_2000x871.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!65m7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12809ff0-3dbc-497f-93de-13b75c628b4e_2000x871.png 424w, https://substackcdn.com/image/fetch/$s_!65m7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12809ff0-3dbc-497f-93de-13b75c628b4e_2000x871.png 848w, https://substackcdn.com/image/fetch/$s_!65m7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12809ff0-3dbc-497f-93de-13b75c628b4e_2000x871.png 1272w, https://substackcdn.com/image/fetch/$s_!65m7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12809ff0-3dbc-497f-93de-13b75c628b4e_2000x871.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!65m7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12809ff0-3dbc-497f-93de-13b75c628b4e_2000x871.png" width="1456" height="634" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/12809ff0-3dbc-497f-93de-13b75c628b4e_2000x871.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:634,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:415191,&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://blog.levelupcoding.com/i/199286433?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12809ff0-3dbc-497f-93de-13b75c628b4e_2000x871.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_!65m7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12809ff0-3dbc-497f-93de-13b75c628b4e_2000x871.png 424w, https://substackcdn.com/image/fetch/$s_!65m7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12809ff0-3dbc-497f-93de-13b75c628b4e_2000x871.png 848w, https://substackcdn.com/image/fetch/$s_!65m7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12809ff0-3dbc-497f-93de-13b75c628b4e_2000x871.png 1272w, https://substackcdn.com/image/fetch/$s_!65m7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12809ff0-3dbc-497f-93de-13b75c628b4e_2000x871.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 role="img" 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><title></title><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>GraphQL: the choice for client-shaped data</h2><p>GraphQL solves a different problem: different clients often need different views of the same data.</p><p>A mobile app may only need a product name and price. An admin dashboard may also need inventory, supplier details, and audit history. With REST, you either create many specialized endpoints or return oversized responses that waste bandwidth.</p><p>GraphQL lets clients request the exact shape they need.</p><p>A view can ask for:</p><ul><li><p>Product name</p></li><li><p>Price</p></li><li><p>Inventory status</p></li><li><p>First three reviews</p></li></ul><p>Nothing more.</p><p>The server validates every query against a schema, which is a typed definition of what clients are allowed to request. That schema becomes a shared contract between frontend and backend teams.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!IvWF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1457c8a0-c8c2-4329-9d52-0390cccfebf1_2000x906.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!IvWF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1457c8a0-c8c2-4329-9d52-0390cccfebf1_2000x906.png 424w, https://substackcdn.com/image/fetch/$s_!IvWF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1457c8a0-c8c2-4329-9d52-0390cccfebf1_2000x906.png 848w, https://substackcdn.com/image/fetch/$s_!IvWF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1457c8a0-c8c2-4329-9d52-0390cccfebf1_2000x906.png 1272w, https://substackcdn.com/image/fetch/$s_!IvWF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1457c8a0-c8c2-4329-9d52-0390cccfebf1_2000x906.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!IvWF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1457c8a0-c8c2-4329-9d52-0390cccfebf1_2000x906.png" width="1456" height="660" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1457c8a0-c8c2-4329-9d52-0390cccfebf1_2000x906.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:660,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:485201,&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://blog.levelupcoding.com/i/199286433?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1457c8a0-c8c2-4329-9d52-0390cccfebf1_2000x906.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_!IvWF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1457c8a0-c8c2-4329-9d52-0390cccfebf1_2000x906.png 424w, https://substackcdn.com/image/fetch/$s_!IvWF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1457c8a0-c8c2-4329-9d52-0390cccfebf1_2000x906.png 848w, https://substackcdn.com/image/fetch/$s_!IvWF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1457c8a0-c8c2-4329-9d52-0390cccfebf1_2000x906.png 1272w, https://substackcdn.com/image/fetch/$s_!IvWF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1457c8a0-c8c2-4329-9d52-0390cccfebf1_2000x906.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 role="img" 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><title></title><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>GraphQL gives you:</p><ul><li><p><strong>Flexible field selection</strong> &#8594; Clients avoid over-fetching and under-fetching</p></li><li><p><strong>Strong schema</strong> &#8594; Teams can discover data and generate types automatically</p></li><li><p><strong>Better composition</strong> &#8594; One query can gather all data needed for a screen</p></li><li><p><strong>Frontend independence</strong> &#8594; Web, mobile, and internal tools can request different shapes</p></li></ul><p>The tradeoff shifts to the server.</p><p>Resolvers (responsible for fetching each field) can accidentally trigger large numbers of database calls. A small query can create expensive backend work if you do not control query depth, batching, and caching carefully. Authorization also becomes more complex because many operations flow through a single endpoint.</p><p>Use GraphQL when client data needs vary frequently because it reduces endpoint sprawl while keeping the schema 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_!5pxO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77c5ee78-996a-4bdd-a4fa-14d1fbfe3465_2000x976.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!5pxO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77c5ee78-996a-4bdd-a4fa-14d1fbfe3465_2000x976.png 424w, https://substackcdn.com/image/fetch/$s_!5pxO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77c5ee78-996a-4bdd-a4fa-14d1fbfe3465_2000x976.png 848w, https://substackcdn.com/image/fetch/$s_!5pxO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77c5ee78-996a-4bdd-a4fa-14d1fbfe3465_2000x976.png 1272w, https://substackcdn.com/image/fetch/$s_!5pxO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77c5ee78-996a-4bdd-a4fa-14d1fbfe3465_2000x976.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!5pxO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77c5ee78-996a-4bdd-a4fa-14d1fbfe3465_2000x976.png" width="1456" height="711" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/77c5ee78-996a-4bdd-a4fa-14d1fbfe3465_2000x976.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:711,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:428754,&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://blog.levelupcoding.com/i/199286433?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77c5ee78-996a-4bdd-a4fa-14d1fbfe3465_2000x976.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_!5pxO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77c5ee78-996a-4bdd-a4fa-14d1fbfe3465_2000x976.png 424w, https://substackcdn.com/image/fetch/$s_!5pxO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77c5ee78-996a-4bdd-a4fa-14d1fbfe3465_2000x976.png 848w, https://substackcdn.com/image/fetch/$s_!5pxO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77c5ee78-996a-4bdd-a4fa-14d1fbfe3465_2000x976.png 1272w, https://substackcdn.com/image/fetch/$s_!5pxO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77c5ee78-996a-4bdd-a4fa-14d1fbfe3465_2000x976.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 role="img" 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><title></title><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>gRPC: the go-to for efficient service-to-service calls</h2><p>gRPC works best when both the client and server are controlled by your organization.</p><p>Instead of exposing resources, gRPC exposes services and methods defined in a <code>.proto</code> contract file. Code generation then creates typed clients and servers in different languages, so network calls feel more like local function calls.</p><p>That model fits distributed systems well.</p><p>A checkout service may need to call pricing, inventory, fraud, shipping, and tax services in milliseconds. Those calls need low overhead, strong contracts, retries, deadlines, and sometimes real-time streaming.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!WlOl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97770df0-8e7a-4b5f-9c3c-cfb3f971537a_2000x952.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!WlOl!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97770df0-8e7a-4b5f-9c3c-cfb3f971537a_2000x952.png 424w, https://substackcdn.com/image/fetch/$s_!WlOl!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97770df0-8e7a-4b5f-9c3c-cfb3f971537a_2000x952.png 848w, https://substackcdn.com/image/fetch/$s_!WlOl!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97770df0-8e7a-4b5f-9c3c-cfb3f971537a_2000x952.png 1272w, https://substackcdn.com/image/fetch/$s_!WlOl!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97770df0-8e7a-4b5f-9c3c-cfb3f971537a_2000x952.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!WlOl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97770df0-8e7a-4b5f-9c3c-cfb3f971537a_2000x952.png" width="1456" height="693" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/97770df0-8e7a-4b5f-9c3c-cfb3f971537a_2000x952.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:693,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:343497,&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://blog.levelupcoding.com/i/199286433?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97770df0-8e7a-4b5f-9c3c-cfb3f971537a_2000x952.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_!WlOl!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97770df0-8e7a-4b5f-9c3c-cfb3f971537a_2000x952.png 424w, https://substackcdn.com/image/fetch/$s_!WlOl!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97770df0-8e7a-4b5f-9c3c-cfb3f971537a_2000x952.png 848w, https://substackcdn.com/image/fetch/$s_!WlOl!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97770df0-8e7a-4b5f-9c3c-cfb3f971537a_2000x952.png 1272w, https://substackcdn.com/image/fetch/$s_!WlOl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97770df0-8e7a-4b5f-9c3c-cfb3f971537a_2000x952.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 role="img" 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><title></title><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>gRPC gives you:</p><ul><li><p><strong>Strong contracts</strong> &#8594; <code>.proto</code> files define services and message formats clearly</p></li><li><p><strong>Efficient payloads</strong> &#8594; Binary messages are smaller and faster than JSON</p></li><li><p><strong>HTTP/2 support</strong> &#8594; Multiplexing and persistent connections reduce network overhead</p></li><li><p><strong>Streaming support</strong> &#8594; Services can stream data in one or both directions</p></li><li><p><strong>Better service controls</strong> &#8594; Deadlines, retries, and health checks fit internal systems naturally</p></li></ul><p>The tradeoff is browser compatibility.</p><p>Browsers work naturally with plain HTTP and JSON, but gRPC usually needs gRPC-Web and a proxy layer at the edge. That complexity is often acceptable internally, but it creates friction for public-facing APIs.</p><p>Use gRPC for internal service communication because controlled environments benefit most from typed contracts and efficient transport.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QIQs!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcddfaa49-72b1-4327-83e4-b0d85948838e_2000x923.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QIQs!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcddfaa49-72b1-4327-83e4-b0d85948838e_2000x923.png 424w, https://substackcdn.com/image/fetch/$s_!QIQs!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcddfaa49-72b1-4327-83e4-b0d85948838e_2000x923.png 848w, https://substackcdn.com/image/fetch/$s_!QIQs!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcddfaa49-72b1-4327-83e4-b0d85948838e_2000x923.png 1272w, https://substackcdn.com/image/fetch/$s_!QIQs!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcddfaa49-72b1-4327-83e4-b0d85948838e_2000x923.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QIQs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcddfaa49-72b1-4327-83e4-b0d85948838e_2000x923.png" width="1456" height="672" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cddfaa49-72b1-4327-83e4-b0d85948838e_2000x923.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:672,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:434498,&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://blog.levelupcoding.com/i/199286433?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcddfaa49-72b1-4327-83e4-b0d85948838e_2000x923.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_!QIQs!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcddfaa49-72b1-4327-83e4-b0d85948838e_2000x923.png 424w, https://substackcdn.com/image/fetch/$s_!QIQs!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcddfaa49-72b1-4327-83e4-b0d85948838e_2000x923.png 848w, https://substackcdn.com/image/fetch/$s_!QIQs!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcddfaa49-72b1-4327-83e4-b0d85948838e_2000x923.png 1272w, https://substackcdn.com/image/fetch/$s_!QIQs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcddfaa49-72b1-4327-83e4-b0d85948838e_2000x923.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 role="img" 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><title></title><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>Side-by-side comparison</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!xptA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08310e31-e7c9-4f1e-8942-01e78e2f8e74_2000x1866.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!xptA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08310e31-e7c9-4f1e-8942-01e78e2f8e74_2000x1866.png 424w, https://substackcdn.com/image/fetch/$s_!xptA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08310e31-e7c9-4f1e-8942-01e78e2f8e74_2000x1866.png 848w, https://substackcdn.com/image/fetch/$s_!xptA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08310e31-e7c9-4f1e-8942-01e78e2f8e74_2000x1866.png 1272w, https://substackcdn.com/image/fetch/$s_!xptA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08310e31-e7c9-4f1e-8942-01e78e2f8e74_2000x1866.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!xptA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08310e31-e7c9-4f1e-8942-01e78e2f8e74_2000x1866.png" width="1456" height="1358" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/08310e31-e7c9-4f1e-8942-01e78e2f8e74_2000x1866.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1358,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:556027,&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://blog.levelupcoding.com/i/199286433?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08310e31-e7c9-4f1e-8942-01e78e2f8e74_2000x1866.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_!xptA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08310e31-e7c9-4f1e-8942-01e78e2f8e74_2000x1866.png 424w, https://substackcdn.com/image/fetch/$s_!xptA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08310e31-e7c9-4f1e-8942-01e78e2f8e74_2000x1866.png 848w, https://substackcdn.com/image/fetch/$s_!xptA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08310e31-e7c9-4f1e-8942-01e78e2f8e74_2000x1866.png 1272w, https://substackcdn.com/image/fetch/$s_!xptA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08310e31-e7c9-4f1e-8942-01e78e2f8e74_2000x1866.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 role="img" 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><title></title><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>When not to use each</h2><p>Every API style has cases where it becomes the wrong abstraction.</p><p>Avoid REST when clients constantly need data from many related resources in a single screen. Multiple round trips add latency quickly, especially on mobile networks. Teams often respond by building oversized aggregation endpoints, which slowly weakens REST&#8217;s clean resource model.</p><p>Avoid GraphQL when your API is small, stable, and public-facing. Schema governance, query optimization, resolver efficiency, and access control all add operational overhead. If a handful of REST endpoints already solves the problem cleanly, GraphQL can introduce unnecessary complexity.</p><p>Avoid gRPC when browsers or third parties are your primary consumers. gRPC-Web works, but it requires extra proxy infrastructure and specialized tooling. For public web APIs, REST or GraphQL is usually the simpler choice.</p><h2>The pattern most systems end up using</h2><p>Most production systems do not choose a single API style. They choose boundaries.</p><p>A common pattern is:</p><ul><li><p><strong>REST or GraphQL at the edge</strong> &#8594; Where browsers, mobile apps, and third parties interact</p></li><li><p><strong>gRPC internally</strong> &#8594; Where services benefit from fast transport, typed contracts, retries, and streaming</p></li></ul><p>For example, a product catalog may expose a REST API that CDNs cache aggressively. A mobile app may query a GraphQL layer to fetch only the fields needed for a screen. Behind that layer, internal services communicate through gRPC using compact protobuf messages and deadline-aware calls.</p><p>The architecture works because each technology sits where its strengths matter most.</p><p>The trap isn&#8217;t choosing the wrong one. It&#8217;s choosing one and using it everywhere. Most systems benefit from treating these as complementary layers, not competing philosophies.</p><div><hr></div><p>&#128075; If you found this useful &#8594; Like + Restack to help others learn system design.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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 get high-signal, clear, and visual system design breakdowns straight to your inbox:&nbsp;</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[Service Discovery in Distributed Systems Clearly Explained]]></title><description><![CDATA[How modern systems dynamically locate healthy services as infrastructure constantly changes.]]></description><link>https://blog.levelupcoding.com/p/service-discovery-in-distributed-systems</link><guid isPermaLink="false">https://blog.levelupcoding.com/p/service-discovery-in-distributed-systems</guid><dc:creator><![CDATA[Nikki Siapno]]></dc:creator><pubDate>Wed, 13 May 2026 10:37:55 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/0501d4c4-ab43-407e-9709-f0ab85dffcb6_2400x1260.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_!yLV0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yLV0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" width="1292" height="266" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:266,&quot;width&quot;:1292,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:343451,&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://lvlupcoding.substack.com/i/171357839?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.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_!yLV0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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">Get our 142-page System Design Handbook for FREE on newsletter signup:</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><h2><a href="https://lucode.co/ai-developer-hub-oracle-z57nl">AI Developer Hub: Patterns, Architectures, and Guides in One Repo</a></h2><h5>Presented by Oracle</h5><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ok1F!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F173dc9eb-f96c-4e6b-9b71-8fcd48ded620_1798x1072.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ok1F!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F173dc9eb-f96c-4e6b-9b71-8fcd48ded620_1798x1072.png 424w, https://substackcdn.com/image/fetch/$s_!ok1F!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F173dc9eb-f96c-4e6b-9b71-8fcd48ded620_1798x1072.png 848w, https://substackcdn.com/image/fetch/$s_!ok1F!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F173dc9eb-f96c-4e6b-9b71-8fcd48ded620_1798x1072.png 1272w, https://substackcdn.com/image/fetch/$s_!ok1F!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F173dc9eb-f96c-4e6b-9b71-8fcd48ded620_1798x1072.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ok1F!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F173dc9eb-f96c-4e6b-9b71-8fcd48ded620_1798x1072.png" width="1456" height="868" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/173dc9eb-f96c-4e6b-9b71-8fcd48ded620_1798x1072.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:868,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:249833,&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;:false,&quot;internalRedirect&quot;:&quot;https://blog.levelupcoding.com/i/190397808?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F173dc9eb-f96c-4e6b-9b71-8fcd48ded620_1798x1072.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_!ok1F!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F173dc9eb-f96c-4e6b-9b71-8fcd48ded620_1798x1072.png 424w, https://substackcdn.com/image/fetch/$s_!ok1F!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F173dc9eb-f96c-4e6b-9b71-8fcd48ded620_1798x1072.png 848w, https://substackcdn.com/image/fetch/$s_!ok1F!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F173dc9eb-f96c-4e6b-9b71-8fcd48ded620_1798x1072.png 1272w, https://substackcdn.com/image/fetch/$s_!ok1F!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F173dc9eb-f96c-4e6b-9b71-8fcd48ded620_1798x1072.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 role="img" 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><title></title><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><a href="https://lucode.co/ai-developer-hub-oracle-z57nl">Oracle AI Developer Hub</a></strong> is a curated collection of real-world examples, architectures, and guides for building AI-powered applications. From RAG pipelines to agent-based systems, and everything in between. Star it to keep it bookmarked, this repo will keep growing, and you&#8217;ll want it on hand as you build.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://lucode.co/ai-developer-hub-oracle-z57nl&quot;,&quot;text&quot;:&quot;Explore and Star the Repo&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://lucode.co/ai-developer-hub-oracle-z57nl"><span>Explore and Star the Repo</span></a></p><div><hr></div><h1>Service Discovery in Distributed Systems</h1><p>In distributed systems, services appear, disappear, and relocate constantly.</p><p>If you don&#8217;t have a way to track them, your calls will end up in the void.</p><p>Service discovery solves this problem by always pointing clients to a healthy, live instance.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Vpgv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61c5729d-9616-45a9-9e40-e918097b6b06_2000x1135.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Vpgv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61c5729d-9616-45a9-9e40-e918097b6b06_2000x1135.png 424w, https://substackcdn.com/image/fetch/$s_!Vpgv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61c5729d-9616-45a9-9e40-e918097b6b06_2000x1135.png 848w, https://substackcdn.com/image/fetch/$s_!Vpgv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61c5729d-9616-45a9-9e40-e918097b6b06_2000x1135.png 1272w, https://substackcdn.com/image/fetch/$s_!Vpgv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61c5729d-9616-45a9-9e40-e918097b6b06_2000x1135.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Vpgv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61c5729d-9616-45a9-9e40-e918097b6b06_2000x1135.png" width="1456" height="826" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/61c5729d-9616-45a9-9e40-e918097b6b06_2000x1135.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:826,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:471392,&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://blog.levelupcoding.com/i/174425013?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61c5729d-9616-45a9-9e40-e918097b6b06_2000x1135.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_!Vpgv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61c5729d-9616-45a9-9e40-e918097b6b06_2000x1135.png 424w, https://substackcdn.com/image/fetch/$s_!Vpgv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61c5729d-9616-45a9-9e40-e918097b6b06_2000x1135.png 848w, https://substackcdn.com/image/fetch/$s_!Vpgv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61c5729d-9616-45a9-9e40-e918097b6b06_2000x1135.png 1272w, https://substackcdn.com/image/fetch/$s_!Vpgv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61c5729d-9616-45a9-9e40-e918097b6b06_2000x1135.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 role="img" 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><title></title><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>The problem</h2><p>A payments service that worked yesterday on one IP might be gone today. If your application still points to the old address, every request ends in failure.</p><p>Now add dozens of microservices, each with multiple replicas, and you have a system where connections break whenever the environment shifts.</p><p>Static approaches like hard-coding addresses or juggling config files might hold up in a small setup, but they collapse under the churn of microservices.</p><p>What&#8217;s needed is a way to always know which instances are alive and how to reach them.</p><p>That&#8217;s the role of service discovery. Instead of binding calls to fixed addresses, it keeps a live registry of running instances and resolves a simple name like <code>inventory-service</code> into a healthy endpoint at runtime.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!YM0N!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feef1351a-7506-4e43-b34b-3870dc4f8ce0_2000x1057.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!YM0N!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feef1351a-7506-4e43-b34b-3870dc4f8ce0_2000x1057.png 424w, https://substackcdn.com/image/fetch/$s_!YM0N!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feef1351a-7506-4e43-b34b-3870dc4f8ce0_2000x1057.png 848w, https://substackcdn.com/image/fetch/$s_!YM0N!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feef1351a-7506-4e43-b34b-3870dc4f8ce0_2000x1057.png 1272w, https://substackcdn.com/image/fetch/$s_!YM0N!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feef1351a-7506-4e43-b34b-3870dc4f8ce0_2000x1057.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!YM0N!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feef1351a-7506-4e43-b34b-3870dc4f8ce0_2000x1057.png" width="1456" height="769" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/eef1351a-7506-4e43-b34b-3870dc4f8ce0_2000x1057.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:769,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:452304,&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://blog.levelupcoding.com/i/174425013?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feef1351a-7506-4e43-b34b-3870dc4f8ce0_2000x1057.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_!YM0N!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feef1351a-7506-4e43-b34b-3870dc4f8ce0_2000x1057.png 424w, https://substackcdn.com/image/fetch/$s_!YM0N!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feef1351a-7506-4e43-b34b-3870dc4f8ce0_2000x1057.png 848w, https://substackcdn.com/image/fetch/$s_!YM0N!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feef1351a-7506-4e43-b34b-3870dc4f8ce0_2000x1057.png 1272w, https://substackcdn.com/image/fetch/$s_!YM0N!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feef1351a-7506-4e43-b34b-3870dc4f8ce0_2000x1057.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 role="img" 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><title></title><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>The benefits</h2><ul><li><p><strong>Dynamic scaling</strong> &#8594; New instances register automatically, so traffic flows without manual updates.</p></li><li><p><strong>Fault tolerance</strong> &#8594; Dead or unhealthy instances drop out, keeping requests routed to live services.</p></li><li><p><strong>Load distribution</strong> &#8594; Requests spread across instances, avoiding overload on a single node.</p></li><li><p><strong>Location transparency</strong> &#8594; Clients call by name, not by IP, decoupling deployments from connectivity.</p></li><li><p><strong>Polyglot support</strong> &#8594; Any language or framework can participate, as long as it can query the registry.</p></li><li><p><strong>Faster iteration</strong> &#8594; Teams deploy services independently without reconfiguring every other client.</p></li><li><p><strong>Operational consistency</strong> &#8594; A single naming and lookup system replaces scattered configs.</p></li></ul><h2>Client-side discovery</h2><p>In client-side discovery, the service making the call is responsible for finding a healthy instance of the target service.</p><p>The client queries the service registry, receives a list of available endpoints, and then applies its own load balancing logic to pick an endpoint. Once selected, the client sends the request directly, with no middle layer in between.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!YYFS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a769972-772d-4ffd-9c2f-69d993370ed3_2000x1115.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!YYFS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a769972-772d-4ffd-9c2f-69d993370ed3_2000x1115.png 424w, https://substackcdn.com/image/fetch/$s_!YYFS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a769972-772d-4ffd-9c2f-69d993370ed3_2000x1115.png 848w, https://substackcdn.com/image/fetch/$s_!YYFS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a769972-772d-4ffd-9c2f-69d993370ed3_2000x1115.png 1272w, https://substackcdn.com/image/fetch/$s_!YYFS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a769972-772d-4ffd-9c2f-69d993370ed3_2000x1115.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!YYFS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a769972-772d-4ffd-9c2f-69d993370ed3_2000x1115.png" width="1456" height="812" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0a769972-772d-4ffd-9c2f-69d993370ed3_2000x1115.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:812,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:398197,&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://blog.levelupcoding.com/i/174425013?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a769972-772d-4ffd-9c2f-69d993370ed3_2000x1115.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_!YYFS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a769972-772d-4ffd-9c2f-69d993370ed3_2000x1115.png 424w, https://substackcdn.com/image/fetch/$s_!YYFS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a769972-772d-4ffd-9c2f-69d993370ed3_2000x1115.png 848w, https://substackcdn.com/image/fetch/$s_!YYFS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a769972-772d-4ffd-9c2f-69d993370ed3_2000x1115.png 1272w, https://substackcdn.com/image/fetch/$s_!YYFS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a769972-772d-4ffd-9c2f-69d993370ed3_2000x1115.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 role="img" 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><title></title><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 benefits</h3><ul><li><p><strong>Lower latency</strong> &#8594; Requests go straight from client to service without an extra network hop.</p></li><li><p><strong>Fine-grained control</strong> &#8594; Clients can choose their own load-balancing strategy or routing rules.</p></li><li><p><strong>Simpler infrastructure</strong> &#8594; No central router or proxy to deploy and maintain.</p></li><li><p><strong>Predictable performance</strong> &#8594; Each service handles its own lookups, avoiding potential bottlenecks in a shared routing tier.</p></li></ul><h3>The tradeoffs</h3><ul><li><p><strong>Added complexity in clients</strong> &#8594; Every service must include discovery logic or a sidecar, often across multiple languages.</p></li><li><p><strong>Higher maintenance burden</strong> &#8594; Polyglot systems require consistent libraries or tooling in each stack.</p></li><li><p><strong>Tighter coupling</strong> &#8594; Clients become aware of registry details, making it harder to swap out technologies later.</p></li><li><p><strong>Risk of duplicated logic</strong> &#8594; Without careful standardization, different teams may implement discovery inconsistently.</p></li></ul><p>Client-side discovery shines when you value direct connections and low latency, and when your teams can standardize on a shared library or sidecar pattern. But if simplicity in clients or language diversity is a priority, the tradeoffs can outweigh the benefits.</p><h2>Server-side discovery</h2><p>In server-side discovery, the client doesn&#8217;t talk to the registry at all.</p><p>Instead, it sends every request to a stable endpoint; usually a load balancer, reverse proxy, or gateway. That component then queries the registry, picks a healthy instance, and forwards the request on the client&#8217;s behalf.</p><p>From the client&#8217;s perspective, it&#8217;s always calling the same address, regardless of where services are actually running.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Xmge!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe71b9d3f-e70e-4126-ac1d-6f9c1542cc99_2000x1135.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Xmge!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe71b9d3f-e70e-4126-ac1d-6f9c1542cc99_2000x1135.png 424w, https://substackcdn.com/image/fetch/$s_!Xmge!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe71b9d3f-e70e-4126-ac1d-6f9c1542cc99_2000x1135.png 848w, https://substackcdn.com/image/fetch/$s_!Xmge!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe71b9d3f-e70e-4126-ac1d-6f9c1542cc99_2000x1135.png 1272w, https://substackcdn.com/image/fetch/$s_!Xmge!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe71b9d3f-e70e-4126-ac1d-6f9c1542cc99_2000x1135.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Xmge!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe71b9d3f-e70e-4126-ac1d-6f9c1542cc99_2000x1135.png" width="1456" height="826" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e71b9d3f-e70e-4126-ac1d-6f9c1542cc99_2000x1135.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:826,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:471392,&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://blog.levelupcoding.com/i/174425013?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe71b9d3f-e70e-4126-ac1d-6f9c1542cc99_2000x1135.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_!Xmge!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe71b9d3f-e70e-4126-ac1d-6f9c1542cc99_2000x1135.png 424w, https://substackcdn.com/image/fetch/$s_!Xmge!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe71b9d3f-e70e-4126-ac1d-6f9c1542cc99_2000x1135.png 848w, https://substackcdn.com/image/fetch/$s_!Xmge!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe71b9d3f-e70e-4126-ac1d-6f9c1542cc99_2000x1135.png 1272w, https://substackcdn.com/image/fetch/$s_!Xmge!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe71b9d3f-e70e-4126-ac1d-6f9c1542cc99_2000x1135.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 role="img" 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><title></title><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 benefits</h3><ul><li><p><strong>Simpler clients</strong> &#8594; Every client calls the same stable endpoint with no extra logic required.</p></li><li><p><strong>Easier polyglot support</strong> &#8594; One routing tier works for all languages and frameworks.</p></li><li><p><strong>Centralized control</strong> &#8594; Load-balancing, retries, and security policies can be managed in one place.</p></li><li><p><strong>Operational consistency</strong> &#8594; A single router can log, monitor, and enforce rules across all requests.</p></li></ul><h3>The tradeoffs</h3><ul><li><p><strong>Extra network hop</strong> &#8594; Each request passes through a proxy or load balancer, adding some latency.</p></li><li><p><strong>Infrastructure dependency</strong> &#8594; The router or proxy must be highly available, since it becomes part of the critical path.</p></li><li><p><strong>Operational overhead</strong> &#8594; Teams need to run, scale, and monitor an additional component.</p></li><li><p><strong>Less flexibility in clients</strong> &#8594; Custom routing strategies are harder, since decision-making happens elsewhere.</p></li></ul><p>Server-side discovery works best when your system has many different kinds of clients, or when you want to centralize complexity in the platform instead of scattering it across services. The tradeoff is accepting one more hop in exchange for simpler and more uniform clients.</p><h2>Recap</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!1ygN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1628d9c-e95c-46a7-805f-7cf43d850962_2000x1118.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!1ygN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1628d9c-e95c-46a7-805f-7cf43d850962_2000x1118.png 424w, https://substackcdn.com/image/fetch/$s_!1ygN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1628d9c-e95c-46a7-805f-7cf43d850962_2000x1118.png 848w, https://substackcdn.com/image/fetch/$s_!1ygN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1628d9c-e95c-46a7-805f-7cf43d850962_2000x1118.png 1272w, https://substackcdn.com/image/fetch/$s_!1ygN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1628d9c-e95c-46a7-805f-7cf43d850962_2000x1118.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!1ygN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1628d9c-e95c-46a7-805f-7cf43d850962_2000x1118.png" width="1456" height="814" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c1628d9c-e95c-46a7-805f-7cf43d850962_2000x1118.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:814,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:498042,&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://blog.levelupcoding.com/i/174425013?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1628d9c-e95c-46a7-805f-7cf43d850962_2000x1118.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_!1ygN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1628d9c-e95c-46a7-805f-7cf43d850962_2000x1118.png 424w, https://substackcdn.com/image/fetch/$s_!1ygN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1628d9c-e95c-46a7-805f-7cf43d850962_2000x1118.png 848w, https://substackcdn.com/image/fetch/$s_!1ygN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1628d9c-e95c-46a7-805f-7cf43d850962_2000x1118.png 1272w, https://substackcdn.com/image/fetch/$s_!1ygN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1628d9c-e95c-46a7-805f-7cf43d850962_2000x1118.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 role="img" 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><title></title><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>Service discovery may run quietly in the background, but it&#8217;s one of the foundations of modern distributed systems.</p><p>Without it, scaling, deploying, or even just keeping services connected becomes a fragile mess of broken addresses and manual fixes.</p><p>Even if you get service discovery &#8220;for free,&#8221; knowing the patterns and tradeoffs makes you better equipped to debug failures, scale confidently, and design services that can evolve.</p><p>Think of service discovery not as an add-on, but as a design principle that allows distributed systems to operate as a cohesive whole instead of disconnected pieces.</p><div><hr></div><p>&#128075; If you found this useful &#8594; Like + Restack to help others learn system design.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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 get high-signal, clear, and visual system design breakdowns straight to your inbox:</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[Docker vs Kubernetes]]></title><description><![CDATA[(4 min read) | The real difference that actually matters, how to decide, where teams go wrong, and more...]]></description><link>https://blog.levelupcoding.com/p/docker-vs-kubernetes</link><guid isPermaLink="false">https://blog.levelupcoding.com/p/docker-vs-kubernetes</guid><dc:creator><![CDATA[Nikki Siapno]]></dc:creator><pubDate>Mon, 11 May 2026 12:32:56 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/82010dd4-b348-4fff-87a6-b4e76a7950c0_2400x1260.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_!yLV0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yLV0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" width="1292" height="266" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:266,&quot;width&quot;:1292,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:343451,&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://lvlupcoding.substack.com/i/171357839?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.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_!yLV0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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">Get our 142-page System Design Handbook for FREE on newsletter signup:</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><h2><a href="https://lucode.co/codecrafters-nikkisiapno-40off">Build Kafka, Redis, Git, &amp; Claude Code From Scratch</a></h2><h5>Presented by CodeCrafters</h5><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!bIBu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc50fc70-4a40-4ad4-9684-5ec6742c583b_1200x630.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!bIBu!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc50fc70-4a40-4ad4-9684-5ec6742c583b_1200x630.jpeg 424w, https://substackcdn.com/image/fetch/$s_!bIBu!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc50fc70-4a40-4ad4-9684-5ec6742c583b_1200x630.jpeg 848w, https://substackcdn.com/image/fetch/$s_!bIBu!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc50fc70-4a40-4ad4-9684-5ec6742c583b_1200x630.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!bIBu!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc50fc70-4a40-4ad4-9684-5ec6742c583b_1200x630.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!bIBu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc50fc70-4a40-4ad4-9684-5ec6742c583b_1200x630.jpeg" width="1200" height="630" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dc50fc70-4a40-4ad4-9684-5ec6742c583b_1200x630.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:630,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:238686,&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;:false,&quot;internalRedirect&quot;:&quot;https://blog.levelupcoding.com/i/194073685?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc50fc70-4a40-4ad4-9684-5ec6742c583b_1200x630.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_!bIBu!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc50fc70-4a40-4ad4-9684-5ec6742c583b_1200x630.jpeg 424w, https://substackcdn.com/image/fetch/$s_!bIBu!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc50fc70-4a40-4ad4-9684-5ec6742c583b_1200x630.jpeg 848w, https://substackcdn.com/image/fetch/$s_!bIBu!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc50fc70-4a40-4ad4-9684-5ec6742c583b_1200x630.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!bIBu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc50fc70-4a40-4ad4-9684-5ec6742c583b_1200x630.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 role="img" 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><title></title><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>Want to become a better software engineer?</p><p>Trusted by engineers at Google, Anthropic, and Vercel, CodeCrafters helps you rebuild technologies like <a href="https://lucode.co/kafka-codecrafters">Kafka</a>, <a href="https://lucode.co/codecrafters-redis">Redis</a>, <a href="https://lucode.co/git-codecrafters">Git</a>, and <a href="https://lucode.co/claude-code-codecrafters">Claude Code</a> from scratch so you can deeply understand how real systems work.</p><p>We&#8217;ve partnered with <a href="https://lucode.co/codecrafters-nikkisiapno-40off">CodeCrafters</a> to give LUC readers an <a href="https://lucode.co/codecrafters-nikkisiapno-40off">exclusive 40% lifetime discount</a>.</p><p>&#128161; Many engineers <a href="https://codecrafters.io/expense">expense platforms like this through their team&#8217;s learning budget</a>.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://lucode.co/codecrafters-nikkisiapno-40off&quot;,&quot;text&quot;:&quot;Start Building &amp; Unlock 40% Off&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://lucode.co/codecrafters-nikkisiapno-40off"><span>Start Building &amp; Unlock 40% Off</span></a></p><div><hr></div><h1>Docker vs Kubernetes: The Real Difference That Matters</h1><p>Docker and Kubernetes are often framed as competitors. That framing leads to the wrong decisions.</p><p>One is about <strong>packaging and running software</strong>. The other is about <strong>managing it at scale</strong>.</p><p>Treating them as rivals is what leads teams to swap one out for the other at exactly the wrong time; either staying on Docker long past the point where orchestration would help, or jumping to Kubernetes before the complexity is justified.</p><p>The gap between them is more specific than it first appears, and closing it starts with understanding what each tool is actually responsible for.</p><h2>What Docker actually solves</h2><p>Docker is a container platform. It solves a very specific problem:<br>&#8220;How do I package and run my application reliably anywhere?&#8221;</p><p>It does this through a few core components:</p><ul><li><p><strong>Images</strong> &#8594; Immutable blueprints of your app</p></li><li><p><strong>Containers</strong> &#8594; Running instances of those images</p></li><li><p><strong>Daemon</strong> &#8594; The engine that manages everything</p></li><li><p><strong>Docker Client</strong> &#8594; The command-line interface (CLI) tool that you use to interact with the Docker daemon</p></li><li><p><strong>Compose</strong> &#8594; Defines multi-container apps on one machine</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3CPu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F391ff805-2a5a-4e80-b987-f42fc28dbe68_2000x918.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3CPu!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F391ff805-2a5a-4e80-b987-f42fc28dbe68_2000x918.png 424w, https://substackcdn.com/image/fetch/$s_!3CPu!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F391ff805-2a5a-4e80-b987-f42fc28dbe68_2000x918.png 848w, https://substackcdn.com/image/fetch/$s_!3CPu!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F391ff805-2a5a-4e80-b987-f42fc28dbe68_2000x918.png 1272w, https://substackcdn.com/image/fetch/$s_!3CPu!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F391ff805-2a5a-4e80-b987-f42fc28dbe68_2000x918.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3CPu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F391ff805-2a5a-4e80-b987-f42fc28dbe68_2000x918.png" width="1456" height="668" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/391ff805-2a5a-4e80-b987-f42fc28dbe68_2000x918.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:668,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:723456,&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://blog.levelupcoding.com/i/194073685?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F391ff805-2a5a-4e80-b987-f42fc28dbe68_2000x918.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_!3CPu!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F391ff805-2a5a-4e80-b987-f42fc28dbe68_2000x918.png 424w, https://substackcdn.com/image/fetch/$s_!3CPu!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F391ff805-2a5a-4e80-b987-f42fc28dbe68_2000x918.png 848w, https://substackcdn.com/image/fetch/$s_!3CPu!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F391ff805-2a5a-4e80-b987-f42fc28dbe68_2000x918.png 1272w, https://substackcdn.com/image/fetch/$s_!3CPu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F391ff805-2a5a-4e80-b987-f42fc28dbe68_2000x918.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 role="img" 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><title></title><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></ul><p>The Docker client sends instructions to the Docker daemon, which manages images, containers, networks, and volumes. Docker Compose sits one layer above, letting you define multi-container apps in a YAML file and start them with a single command.</p><p>Docker Swarm is Docker&#8217;s built-in clustering mode. Manager nodes maintain cluster state using a Raft consensus protocol; worker nodes execute containers.</p><h3>Where Docker works best</h3><ul><li><p>Local development</p></li><li><p>CI pipelines</p></li><li><p>Small production deployments</p></li><li><p>Single-server applications</p></li></ul><h3>What you gain</h3><ul><li><p><strong>Fast setup</strong> &#8594; Run apps with one command</p></li><li><p><strong>Predictability</strong> &#8594; Same container everywhere</p></li><li><p><strong>Low operational overhead</strong> &#8594; Fewer moving parts</p></li></ul><h3>Where it breaks</h3><ul><li><p><strong>Multi-node scaling</strong> &#8594; Limited native orchestration compared to Kubernetes</p></li><li><p><strong>Self-healing</strong> &#8594; Containers don&#8217;t restart intelligently across hosts</p></li><li><p><strong>Complex deployments</strong> &#8594; Rolling updates and traffic routing are manual</p></li></ul><p>Docker focuses on building images, running containers, and managing them on a host.</p><h2>What Kubernetes actually solves</h2><p>Kubernetes is an orchestration system. It answers a different question:<br>&#8220;How do I run thousands of containers reliably across many machines?&#8221;</p><p>It introduces a control loop: you declare what you want, and the system keeps correcting reality until it matches.</p><p>Here are the key components:</p><ul><li><p><strong>Pod</strong> &#8594; Smallest deployable unit</p></li><li><p><strong>Control plane</strong> &#8594; API server, scheduler, controllers</p></li><li><p><strong>Nodes</strong> &#8594; Machines that run workloads</p></li><li><p><strong>Services</strong> &#8594; Stable endpoints for dynamic pods</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8eq6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb3a3b89-9b82-4f8f-83e6-a8e1bf7349c9_2000x1000.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8eq6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb3a3b89-9b82-4f8f-83e6-a8e1bf7349c9_2000x1000.png 424w, https://substackcdn.com/image/fetch/$s_!8eq6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb3a3b89-9b82-4f8f-83e6-a8e1bf7349c9_2000x1000.png 848w, https://substackcdn.com/image/fetch/$s_!8eq6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb3a3b89-9b82-4f8f-83e6-a8e1bf7349c9_2000x1000.png 1272w, https://substackcdn.com/image/fetch/$s_!8eq6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb3a3b89-9b82-4f8f-83e6-a8e1bf7349c9_2000x1000.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8eq6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb3a3b89-9b82-4f8f-83e6-a8e1bf7349c9_2000x1000.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/db3a3b89-9b82-4f8f-83e6-a8e1bf7349c9_2000x1000.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:925448,&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://blog.levelupcoding.com/i/194073685?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb3a3b89-9b82-4f8f-83e6-a8e1bf7349c9_2000x1000.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_!8eq6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb3a3b89-9b82-4f8f-83e6-a8e1bf7349c9_2000x1000.png 424w, https://substackcdn.com/image/fetch/$s_!8eq6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb3a3b89-9b82-4f8f-83e6-a8e1bf7349c9_2000x1000.png 848w, https://substackcdn.com/image/fetch/$s_!8eq6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb3a3b89-9b82-4f8f-83e6-a8e1bf7349c9_2000x1000.png 1272w, https://substackcdn.com/image/fetch/$s_!8eq6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb3a3b89-9b82-4f8f-83e6-a8e1bf7349c9_2000x1000.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 role="img" 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><title></title><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></ul><p>Kubernetes is architecturally richer. Its control plane includes an API server, a scheduler, a controller manager, and <code>etcd</code> (a distributed key-value store that holds all cluster state). Worker nodes run a <code>kubelet</code> (which ensures Pods stay running), <code>kube-proxy</code> (which handles network routing), and a container runtime like containerd.</p><h3>Where Kubernetes works best</h3><ul><li><p>Multi-service architectures</p></li><li><p>High-availability systems</p></li><li><p>Large-scale platforms</p></li><li><p>Teams needing standardized deployment workflows</p></li></ul><h3>What you gain</h3><ul><li><p><strong>Self-healing</strong> &#8594; Failed containers restart automatically</p></li><li><p><strong>Autoscaling</strong> &#8594; Add/remove instances based on demand</p></li><li><p><strong>Rolling updates</strong> &#8594; Deploy without downtime</p></li><li><p><strong>Service discovery</strong> &#8594; Built-in networking abstractions</p></li></ul><h3>What it costs</h3><ul><li><p><strong>Operational complexity</strong> &#8594; Many components to manage</p></li><li><p><strong>Learning curve</strong> &#8594; Concepts like Pods, Services, RBAC</p></li><li><p><strong>Infrastructure overhead</strong> &#8594; Control plane + networking + storage</p></li></ul><p>Kubernetes supports clusters with thousands of nodes, but that power comes with significant complexity.</p><h2>The comparison at a glance</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!VKHb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1821ca84-0441-412a-ab89-4a8e848e279a_2000x1302.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!VKHb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1821ca84-0441-412a-ab89-4a8e848e279a_2000x1302.png 424w, https://substackcdn.com/image/fetch/$s_!VKHb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1821ca84-0441-412a-ab89-4a8e848e279a_2000x1302.png 848w, https://substackcdn.com/image/fetch/$s_!VKHb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1821ca84-0441-412a-ab89-4a8e848e279a_2000x1302.png 1272w, https://substackcdn.com/image/fetch/$s_!VKHb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1821ca84-0441-412a-ab89-4a8e848e279a_2000x1302.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!VKHb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1821ca84-0441-412a-ab89-4a8e848e279a_2000x1302.png" width="1456" height="948" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1821ca84-0441-412a-ab89-4a8e848e279a_2000x1302.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:948,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:387671,&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://blog.levelupcoding.com/i/194073685?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1821ca84-0441-412a-ab89-4a8e848e279a_2000x1302.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_!VKHb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1821ca84-0441-412a-ab89-4a8e848e279a_2000x1302.png 424w, https://substackcdn.com/image/fetch/$s_!VKHb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1821ca84-0441-412a-ab89-4a8e848e279a_2000x1302.png 848w, https://substackcdn.com/image/fetch/$s_!VKHb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1821ca84-0441-412a-ab89-4a8e848e279a_2000x1302.png 1272w, https://substackcdn.com/image/fetch/$s_!VKHb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1821ca84-0441-412a-ab89-4a8e848e279a_2000x1302.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 role="img" 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><title></title><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>How they actually work together</h2><p>The real-world setup is not &#8220;Docker vs Kubernetes.&#8221; It&#8217;s:</p><ul><li><p>Docker builds the image</p></li><li><p>A registry stores it</p></li><li><p>Kubernetes runs and manages it</p></li></ul><p>This separation matters because it keeps concerns clean:</p><ul><li><p>Build once (Docker)</p></li><li><p>Run anywhere (Kubernetes)</p></li></ul><p>Even though Kubernetes removed direct Docker runtime support, it still runs Docker-built images through OCI-compatible runtimes.</p><h2>How to decide</h2><h3>When Docker is enough</h3><p>You don&#8217;t need Kubernetes just because it exists.</p><p>Use Docker alone when:</p><ul><li><p>You run on a single server</p></li><li><p>Your system has few services</p></li><li><p>Downtime during deploys is acceptable</p></li><li><p>Your team prefers simplicity over automation</p></li></ul><p>Because every added abstraction has a cost. If you don&#8217;t need orchestration, Kubernetes becomes overhead, not value.</p><h3>When Kubernetes is worth it</h3><p>Kubernetes becomes the right choice when coordination starts hurting.</p><p>Use it when:</p><ul><li><p>You deploy across multiple machines</p></li><li><p>You need zero-downtime deployments</p></li><li><p>Traffic fluctuates and needs autoscaling</p></li><li><p>You run many services with independent lifecycles</p></li></ul><p>Because Kubernetes solves <strong>coordination problems</strong>, not just runtime problems.</p><h2>Where teams go wrong</h2><p>Most mistakes come from using the right tool at the wrong stage.</p><p><strong>1. Starting with Kubernetes too early</strong></p><ul><li><p>Adds complexity before it solves real problems</p></li><li><p>Slows development and onboarding</p></li></ul><p><strong>2. Scaling Docker beyond its limits</strong></p><ul><li><p>Manual scripts replace missing orchestration</p></li><li><p>Reliability becomes fragile</p></li></ul><p><strong>3. Treating them as interchangeable</strong></p><ul><li><p>Leads to poor architecture decisions</p></li></ul><p>The ideal mindset is this: <strong>Use the simplest tool that solves your current problem.</strong></p><h2>Final takeaway</h2><p>Start simple. Stay simple as long as you can.</p><p>Then, when scaling turns into coordination problems, reach for Kubernetes.</p><p>Docker is where most systems should begin. Kubernetes is where many systems eventually need to go.</p><p>The transition is a response to real complexity.</p><div><hr></div><p>&#128075; If you liked this post &#8594; Like + Restack + Share to help others learn system design.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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">&nbsp;Subscribe to get high-signal, clear, and visual system design breakdowns straight to your inbox:</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[OAuth Clearly Explained]]></title><description><![CDATA[(4 min read) | OAuth flow, three different tokens, three different jobs, what OAuth actually solves, where OAuth systems usually break, and more]]></description><link>https://blog.levelupcoding.com/p/oauth-clearly-explained</link><guid isPermaLink="false">https://blog.levelupcoding.com/p/oauth-clearly-explained</guid><dc:creator><![CDATA[Nikki Siapno]]></dc:creator><pubDate>Fri, 01 May 2026 05:56:21 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/fc326d43-dbd6-4f79-81cf-49ed3edcf682_2400x1260.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_!yLV0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yLV0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" width="1292" height="266" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:266,&quot;width&quot;:1292,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:343451,&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://lvlupcoding.substack.com/i/171357839?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.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_!yLV0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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">Get our 142-page System Design Handbook for FREE on newsletter signup:</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><h2><a href="https://lucode.co/ai-developer-hub-oracle-z7nl">AI Code, Architectures, and Patterns in One Repo</a></h2><h5>Presented by Oracle</h5><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ok1F!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F173dc9eb-f96c-4e6b-9b71-8fcd48ded620_1798x1072.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ok1F!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F173dc9eb-f96c-4e6b-9b71-8fcd48ded620_1798x1072.png 424w, https://substackcdn.com/image/fetch/$s_!ok1F!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F173dc9eb-f96c-4e6b-9b71-8fcd48ded620_1798x1072.png 848w, https://substackcdn.com/image/fetch/$s_!ok1F!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F173dc9eb-f96c-4e6b-9b71-8fcd48ded620_1798x1072.png 1272w, https://substackcdn.com/image/fetch/$s_!ok1F!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F173dc9eb-f96c-4e6b-9b71-8fcd48ded620_1798x1072.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ok1F!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F173dc9eb-f96c-4e6b-9b71-8fcd48ded620_1798x1072.png" width="1456" height="868" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/173dc9eb-f96c-4e6b-9b71-8fcd48ded620_1798x1072.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:868,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:249833,&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;:false,&quot;internalRedirect&quot;:&quot;https://blog.levelupcoding.com/i/190397808?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F173dc9eb-f96c-4e6b-9b71-8fcd48ded620_1798x1072.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_!ok1F!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F173dc9eb-f96c-4e6b-9b71-8fcd48ded620_1798x1072.png 424w, https://substackcdn.com/image/fetch/$s_!ok1F!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F173dc9eb-f96c-4e6b-9b71-8fcd48ded620_1798x1072.png 848w, https://substackcdn.com/image/fetch/$s_!ok1F!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F173dc9eb-f96c-4e6b-9b71-8fcd48ded620_1798x1072.png 1272w, https://substackcdn.com/image/fetch/$s_!ok1F!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F173dc9eb-f96c-4e6b-9b71-8fcd48ded620_1798x1072.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 role="img" 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><title></title><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><a href="https://lucode.co/ai-developer-hub-oracle-z7nl">Oracle AI Developer Hub</a></strong> is a curated collection of real-world examples, architectures, and guides for building AI-powered applications. From RAG pipelines to agent-based systems, it brings together practical patterns, code samples, and best practices to help individuals and teams build production-grade AI solutions. If you find it useful, give it a star.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://lucode.co/ai-developer-hub-oracle-z7nl&quot;,&quot;text&quot;:&quot;Explore and Star the Repo&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://lucode.co/ai-developer-hub-oracle-z7nl"><span>Explore and Star the Repo</span></a></p><div><hr></div><h1>How OAuth Actually Works</h1><p>OAuth is not login. It is permission.</p><p>That confusion causes a surprising number of design mistakes.</p><p>Teams pass around access tokens as if they prove identity, store them in risky places, or keep old flows alive because they &#8220;still work.&#8221; The result is a system that looks modern on paper but leaks security in the seams.</p><p>At its core, OAuth lets one application get limited access to another service without handing over the user&#8217;s password. Used well, it narrows access. Used poorly, it creates a false sense of security.</p><h2>What OAuth actually solves</h2><p>OAuth exists because &#8220;just give the app your password&#8221; is a bad system boundary. The moment a third-party app sees user credentials, you lose separation between identity, consent, and API access.</p><p>Every OAuth transaction involves four roles:</p><ul><li><p><strong>Resource owner</strong> &#8594; The user who owns the data and decides what to share.</p></li><li><p><strong>Client</strong> &#8594; The application requesting access (a web app, mobile app, or background service).</p></li><li><p><strong>Authorization server</strong> &#8594; Issues tokens after verifying the user&#8217;s identity and consent.</p></li><li><p><strong>Resource server</strong> &#8594; The API that holds the protected data and validates tokens on every request.</p></li></ul><p>The separation between the authorization server (which authenticates) and the resource server (which serves data) is intentional.</p><p>It lets companies run a single sign-on service across dozens of APIs without coupling their identity infrastructure to every service.</p><p>A typical flow looks like this:</p><ol><li><p>The client redirects the user to the authorization server</p></li><li><p>The user authenticates and consents</p></li><li><p>The server sends an authorization code back to the client</p></li><li><p>The client exchanges that code for an access token over a secure back-channel.</p></li><li><p>That access token is then sent with every API request.</p></li></ol><p>The user&#8217;s credentials never leave the authorization server.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!BNqA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4e03ac6-6e30-492c-88c4-478ae782eada_2000x1223.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!BNqA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4e03ac6-6e30-492c-88c4-478ae782eada_2000x1223.png 424w, https://substackcdn.com/image/fetch/$s_!BNqA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4e03ac6-6e30-492c-88c4-478ae782eada_2000x1223.png 848w, https://substackcdn.com/image/fetch/$s_!BNqA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4e03ac6-6e30-492c-88c4-478ae782eada_2000x1223.png 1272w, https://substackcdn.com/image/fetch/$s_!BNqA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4e03ac6-6e30-492c-88c4-478ae782eada_2000x1223.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!BNqA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4e03ac6-6e30-492c-88c4-478ae782eada_2000x1223.png" width="1456" height="890" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e4e03ac6-6e30-492c-88c4-478ae782eada_2000x1223.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:890,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:432953,&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://blog.levelupcoding.com/i/193420623?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4e03ac6-6e30-492c-88c4-478ae782eada_2000x1223.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_!BNqA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4e03ac6-6e30-492c-88c4-478ae782eada_2000x1223.png 424w, https://substackcdn.com/image/fetch/$s_!BNqA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4e03ac6-6e30-492c-88c4-478ae782eada_2000x1223.png 848w, https://substackcdn.com/image/fetch/$s_!BNqA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4e03ac6-6e30-492c-88c4-478ae782eada_2000x1223.png 1272w, https://substackcdn.com/image/fetch/$s_!BNqA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4e03ac6-6e30-492c-88c4-478ae782eada_2000x1223.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 role="img" 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><title></title><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><h2>Three tokens, three different jobs</h2><p>OAuth&#8217;s token model trips up a lot of developers because the three token types look similar but serve completely different purposes.</p><ul><li><p><strong>Access token</strong> &#8594; Short-lived credential sent with every API call. The resource server validates it on each request.</p></li><li><p><strong>Refresh token</strong> &#8594; Long-lived credential used only at the token endpoint to get a new access token without re-prompting the user. Never send this to an API. If it leaks, an attacker can silently maintain access long after the original session should have expired.</p></li><li><p><strong>ID token</strong> &#8594; A signed JWT that carries <em>authentication claims</em>; who the user is, when they authenticated, which identity provider issued it.</p></li></ul><p>That last one is a common gotcha.</p><p>An <strong>ID token is not an OAuth token</strong>.</p><p>It belongs to <strong>OpenID Connect (OIDC)</strong>, which adds an identity layer on top of OAuth. So if your real goal is &#8220;log the user in and know who they are,&#8221; OAuth is not the answer. OIDC is.</p><p>Treating an access token as a login token (i.e. as proof of user identity) is one of the most common implementation mistakes.</p><h2>Where OAuth systems usually break</h2><p>Under the hood, OAuth uses bearer tokens. Bearer tokens are especially sensitive because whoever possesses them can use them.</p><p>There&#8217;s no built-in proof of identity or cryptographic binding; the API simply trusts whoever presents the token. As a result, token leakage is effectively credential theft.</p><p>Leaks can occur through logs, query strings, browser storage, referrer headers, or weak transport. That&#8217;s why modern guidance focuses on limiting both exposure and impact: use HTTPS everywhere, keep access tokens short-lived, store them carefully, rotate refresh tokens on every use, and strictly validate redirect URIs.</p><p>For higher-risk environments, you can go further with <strong>sender-constrained tokens</strong>, which bind a token to a specific client instead of treating it as transferable:</p><ul><li><p><strong>mTLS</strong> &#8594; ties the token to the client&#8217;s TLS certificate</p></li><li><p><strong>DPoP</strong> &#8594; binds the token to a client-controlled key pair</p></li></ul><p>These add complexity, but they close the gap that bearer tokens leave open.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!I0iH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d2fd90b-1067-4468-8a79-ca93ac8094d1_2000x1079.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!I0iH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d2fd90b-1067-4468-8a79-ca93ac8094d1_2000x1079.png 424w, https://substackcdn.com/image/fetch/$s_!I0iH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d2fd90b-1067-4468-8a79-ca93ac8094d1_2000x1079.png 848w, https://substackcdn.com/image/fetch/$s_!I0iH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d2fd90b-1067-4468-8a79-ca93ac8094d1_2000x1079.png 1272w, https://substackcdn.com/image/fetch/$s_!I0iH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d2fd90b-1067-4468-8a79-ca93ac8094d1_2000x1079.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!I0iH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d2fd90b-1067-4468-8a79-ca93ac8094d1_2000x1079.png" width="1456" height="786" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1d2fd90b-1067-4468-8a79-ca93ac8094d1_2000x1079.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:786,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:431630,&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://blog.levelupcoding.com/i/193420623?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d2fd90b-1067-4468-8a79-ca93ac8094d1_2000x1079.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_!I0iH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d2fd90b-1067-4468-8a79-ca93ac8094d1_2000x1079.png 424w, https://substackcdn.com/image/fetch/$s_!I0iH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d2fd90b-1067-4468-8a79-ca93ac8094d1_2000x1079.png 848w, https://substackcdn.com/image/fetch/$s_!I0iH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d2fd90b-1067-4468-8a79-ca93ac8094d1_2000x1079.png 1272w, https://substackcdn.com/image/fetch/$s_!I0iH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d2fd90b-1067-4468-8a79-ca93ac8094d1_2000x1079.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 role="img" 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><title></title><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 to do for web, mobile, and SPAs</h2><p>For traditional server-rendered web apps, keep it simple: handle the OAuth flow on the server, store tokens there, and give the browser a hardened session cookie instead.</p><p>That way, the browser never directly touches OAuth tokens, which significantly reduces exposure to XSS attacks.</p><p>For mobile and desktop apps, assume they&#8217;re public clients:</p><ul><li><p>Use Authorization Code + PKCE (a flow where the app gets a one-time code after login and proves it initiated the request)</p></li><li><p>Open the system browser (not an embedded web view)</p></li><li><p>Store refresh tokens in secure platform storage like Keychain or Keystore.</p></li></ul><p>For single-page apps, a Backend-for-Frontend (BFF) is often the safest route. The browser talks to your backend, the backend handles OAuth, and the browser just holds a session cookie.</p><p>If a BFF isn&#8217;t practical:</p><ul><li><p>Fall back to Authorization Code + PKCE (get a one-time code after login and prove the request came from your app)</p></li><li><p>Validate the state parameter (to prevent CSRF attacks)</p></li><li><p>Keep tokens in memory rather than persistent storage like localStorage</p></li><li><p>Lock down CORS as tightly as possible</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ATdv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F049a8910-9871-4477-baf2-3461b8cc23a9_2000x1061.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ATdv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F049a8910-9871-4477-baf2-3461b8cc23a9_2000x1061.png 424w, https://substackcdn.com/image/fetch/$s_!ATdv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F049a8910-9871-4477-baf2-3461b8cc23a9_2000x1061.png 848w, https://substackcdn.com/image/fetch/$s_!ATdv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F049a8910-9871-4477-baf2-3461b8cc23a9_2000x1061.png 1272w, https://substackcdn.com/image/fetch/$s_!ATdv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F049a8910-9871-4477-baf2-3461b8cc23a9_2000x1061.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ATdv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F049a8910-9871-4477-baf2-3461b8cc23a9_2000x1061.png" width="1456" height="772" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/049a8910-9871-4477-baf2-3461b8cc23a9_2000x1061.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:772,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:412940,&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://blog.levelupcoding.com/i/193420623?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F049a8910-9871-4477-baf2-3461b8cc23a9_2000x1061.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_!ATdv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F049a8910-9871-4477-baf2-3461b8cc23a9_2000x1061.png 424w, https://substackcdn.com/image/fetch/$s_!ATdv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F049a8910-9871-4477-baf2-3461b8cc23a9_2000x1061.png 848w, https://substackcdn.com/image/fetch/$s_!ATdv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F049a8910-9871-4477-baf2-3461b8cc23a9_2000x1061.png 1272w, https://substackcdn.com/image/fetch/$s_!ATdv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F049a8910-9871-4477-baf2-3461b8cc23a9_2000x1061.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 role="img" 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><title></title><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></ul><h2>Wrapping up</h2><p>OAuth gives applications permission to act, not identity to impersonate.</p><p>Every design decision in the framework (scoped tokens, short lifetimes, separate authorization and resource servers) exists to keep that boundary clean.</p><p>When something goes wrong with an OAuth implementation, it almost always traces back to that boundary getting blurred: a token meant for one API accepted by another, an access token used to prove identity, a scope granted that was never actually needed.</p><p>Keep the boundary clear, and the rest of OAuth becomes straightforward.</p><div><hr></div><p>&#128075; If you liked this post &#8594; Like + Restack + Share to help others learn system design.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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 get high-signal, clear, and visual system design breakdowns straight to your inbox:&nbsp;</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[Infrastructure as Code Clearly Explained]]></title><description><![CDATA[The IaC workflow that actually works, why it matters in practice, security risks you can't ignore, and more...]]></description><link>https://blog.levelupcoding.com/p/infrastructure-as-code-clearly-explained</link><guid isPermaLink="false">https://blog.levelupcoding.com/p/infrastructure-as-code-clearly-explained</guid><dc:creator><![CDATA[Nikki Siapno]]></dc:creator><pubDate>Mon, 27 Apr 2026 14:34:41 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/54af9bdb-9469-4fcf-8f1a-ec981b99e310_2400x1260.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_!yLV0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yLV0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" width="1292" height="266" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:266,&quot;width&quot;:1292,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:343451,&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://lvlupcoding.substack.com/i/171357839?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.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_!yLV0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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">Get our 142-page System Design Handbook for FREE on newsletter signup:</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><h2><a href="https://lucode.co/postmortems-rebuilt-z7nl">Postmortems Without the Reconstruction Work</a></h2><h5>Presented by <a href="https://lucode.co/postmortems-rebuilt-z7nl">incident.io</a></h5><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!xlmD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35e5e169-9602-45b7-88a4-01ef1ca787d7_2000x1125.avif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!xlmD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35e5e169-9602-45b7-88a4-01ef1ca787d7_2000x1125.avif 424w, https://substackcdn.com/image/fetch/$s_!xlmD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35e5e169-9602-45b7-88a4-01ef1ca787d7_2000x1125.avif 848w, https://substackcdn.com/image/fetch/$s_!xlmD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35e5e169-9602-45b7-88a4-01ef1ca787d7_2000x1125.avif 1272w, https://substackcdn.com/image/fetch/$s_!xlmD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35e5e169-9602-45b7-88a4-01ef1ca787d7_2000x1125.avif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!xlmD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35e5e169-9602-45b7-88a4-01ef1ca787d7_2000x1125.avif" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/35e5e169-9602-45b7-88a4-01ef1ca787d7_2000x1125.avif&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;:27594,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/avif&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.levelupcoding.com/i/194274200?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35e5e169-9602-45b7-88a4-01ef1ca787d7_2000x1125.avif&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_!xlmD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35e5e169-9602-45b7-88a4-01ef1ca787d7_2000x1125.avif 424w, https://substackcdn.com/image/fetch/$s_!xlmD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35e5e169-9602-45b7-88a4-01ef1ca787d7_2000x1125.avif 848w, https://substackcdn.com/image/fetch/$s_!xlmD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35e5e169-9602-45b7-88a4-01ef1ca787d7_2000x1125.avif 1272w, https://substackcdn.com/image/fetch/$s_!xlmD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35e5e169-9602-45b7-88a4-01ef1ca787d7_2000x1125.avif 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 role="img" 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><title></title><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>Writing postmortems is traditionally slow, painful, and often incomplete. Sometimes they don&#8217;t get written at all. That&#8217;s not just a process problem, it&#8217;s an experience problem. <strong><a href="https://lucode.co/postmortems-rebuilt-z7nl">incident.io</a></strong> flips this by generating a draft from real incident data, so teams start with context and focus on refining what matters. It turns postmortems into a structured, collaborative workflow that&#8217;s actually easy to complete.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://lucode.co/postmortems-rebuilt-z7nl&quot;,&quot;text&quot;:&quot;Read the Article&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://lucode.co/postmortems-rebuilt-z7nl"><span>Read the Article</span></a></p><div><hr></div><h1>Infrastructure as Code Clearly Explained</h1><p>Can you rebuild your entire production environment from scratch today?</p><p>Not approximately. Not &#8220;close enough.&#8221; Exactly as-is.</p><p>If the answer is no, your infrastructure depends on tribal knowledge, console history, or luck.</p><p>Infrastructure as Code (IaC) replaces all three with something far more reliable: versioned, reviewable definitions that can be applied again and again without surprises.</p><h2>What Infrastructure as Code actually means</h2><p>Infrastructure as Code (IaC) is the practice of defining infrastructure in machine-readable files instead of configuring it manually in consoles or through one-off scripts.</p><p>There are two closely related disciplines:</p><ul><li><p><strong>Provisioning IaC</strong> &#8594; Defines cloud resources such as networks, IAM roles, compute instances, and managed services.</p></li><li><p><strong>Configuration IaC</strong> &#8594; Defines the desired state of machines and services, such as installed packages, files, and system settings.</p></li></ul><p>Provisioning creates the building.<br>Configuration furnishes and maintains it.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3VAx!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47400b19-8afc-4b77-88e5-1a0c0ac299e8_2000x973.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3VAx!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47400b19-8afc-4b77-88e5-1a0c0ac299e8_2000x973.png 424w, https://substackcdn.com/image/fetch/$s_!3VAx!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47400b19-8afc-4b77-88e5-1a0c0ac299e8_2000x973.png 848w, https://substackcdn.com/image/fetch/$s_!3VAx!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47400b19-8afc-4b77-88e5-1a0c0ac299e8_2000x973.png 1272w, https://substackcdn.com/image/fetch/$s_!3VAx!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47400b19-8afc-4b77-88e5-1a0c0ac299e8_2000x973.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3VAx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47400b19-8afc-4b77-88e5-1a0c0ac299e8_2000x973.png" width="1456" height="708" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/47400b19-8afc-4b77-88e5-1a0c0ac299e8_2000x973.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;:282497,&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://blog.levelupcoding.com/i/193317693?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47400b19-8afc-4b77-88e5-1a0c0ac299e8_2000x973.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_!3VAx!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47400b19-8afc-4b77-88e5-1a0c0ac299e8_2000x973.png 424w, https://substackcdn.com/image/fetch/$s_!3VAx!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47400b19-8afc-4b77-88e5-1a0c0ac299e8_2000x973.png 848w, https://substackcdn.com/image/fetch/$s_!3VAx!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47400b19-8afc-4b77-88e5-1a0c0ac299e8_2000x973.png 1272w, https://substackcdn.com/image/fetch/$s_!3VAx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47400b19-8afc-4b77-88e5-1a0c0ac299e8_2000x973.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 role="img" 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><title></title><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>Both aim at the same outcome: <strong>desired state and convergence</strong>. You describe what should exist, and a tool calculates the steps required to make reality match that description.</p><p>Infrastructure stops being something you &#8220;set up&#8221; and becomes something you <strong>declare, review, and reapply safely</strong>.</p><h2>Why it matters in practice</h2><p>The benefits of IaC flow directly from treating infrastructure like code.</p><ul><li><p><strong>Reproducibility</strong> &#8594; Every environment gets built from the same source, eliminating the &#8220;works on my machine&#8221; problem at the infrastructure level.</p></li><li><p><strong>Auditability</strong> &#8594; Every change goes through version control and peer review, so you always know who changed what, when, and why.</p></li><li><p><strong>Faster, safer delivery</strong> &#8594; Automated pipelines with preview steps replace manual deploys, so teams ship more often with less risk.</p></li><li><p><strong>Scalable governance</strong> &#8594; Policy checks run before anything is provisioned, so compliance rules are enforced automatically rather than audited after the fact.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ekmB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F852de703-9aa3-46c5-811a-3e6912f8e607_2000x870.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ekmB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F852de703-9aa3-46c5-811a-3e6912f8e607_2000x870.png 424w, https://substackcdn.com/image/fetch/$s_!ekmB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F852de703-9aa3-46c5-811a-3e6912f8e607_2000x870.png 848w, https://substackcdn.com/image/fetch/$s_!ekmB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F852de703-9aa3-46c5-811a-3e6912f8e607_2000x870.png 1272w, https://substackcdn.com/image/fetch/$s_!ekmB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F852de703-9aa3-46c5-811a-3e6912f8e607_2000x870.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ekmB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F852de703-9aa3-46c5-811a-3e6912f8e607_2000x870.png" width="1456" height="633" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/852de703-9aa3-46c5-811a-3e6912f8e607_2000x870.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:633,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:378491,&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://blog.levelupcoding.com/i/193317693?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F852de703-9aa3-46c5-811a-3e6912f8e607_2000x870.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_!ekmB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F852de703-9aa3-46c5-811a-3e6912f8e607_2000x870.png 424w, https://substackcdn.com/image/fetch/$s_!ekmB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F852de703-9aa3-46c5-811a-3e6912f8e607_2000x870.png 848w, https://substackcdn.com/image/fetch/$s_!ekmB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F852de703-9aa3-46c5-811a-3e6912f8e607_2000x870.png 1272w, https://substackcdn.com/image/fetch/$s_!ekmB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F852de703-9aa3-46c5-811a-3e6912f8e607_2000x870.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 role="img" 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><title></title><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></ul><p>Without IaC, every environment eventually diverges in small, invisible ways. That divergence is the root cause of a wide range of production incidents.</p><h2>Choosing a tool</h2><p>The tool choice depends on your context more than on which tool is &#8220;best.&#8221; Here&#8217;s a practical 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_!BMLR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef61a502-36f6-4402-8c96-6fb36b898d0f_2000x1276.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!BMLR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef61a502-36f6-4402-8c96-6fb36b898d0f_2000x1276.png 424w, https://substackcdn.com/image/fetch/$s_!BMLR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef61a502-36f6-4402-8c96-6fb36b898d0f_2000x1276.png 848w, https://substackcdn.com/image/fetch/$s_!BMLR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef61a502-36f6-4402-8c96-6fb36b898d0f_2000x1276.png 1272w, https://substackcdn.com/image/fetch/$s_!BMLR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef61a502-36f6-4402-8c96-6fb36b898d0f_2000x1276.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!BMLR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef61a502-36f6-4402-8c96-6fb36b898d0f_2000x1276.png" width="1456" height="929" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ef61a502-36f6-4402-8c96-6fb36b898d0f_2000x1276.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:929,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:469167,&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://blog.levelupcoding.com/i/193317693?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef61a502-36f6-4402-8c96-6fb36b898d0f_2000x1276.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_!BMLR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef61a502-36f6-4402-8c96-6fb36b898d0f_2000x1276.png 424w, https://substackcdn.com/image/fetch/$s_!BMLR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef61a502-36f6-4402-8c96-6fb36b898d0f_2000x1276.png 848w, https://substackcdn.com/image/fetch/$s_!BMLR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef61a502-36f6-4402-8c96-6fb36b898d0f_2000x1276.png 1272w, https://substackcdn.com/image/fetch/$s_!BMLR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef61a502-36f6-4402-8c96-6fb36b898d0f_2000x1276.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 role="img" 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><title></title><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 common pattern in large organizations is to use Terraform or CloudFormation to provision the infrastructure; and Ansible for OS hardening, package installs, and app configuration.</p><h2>The IaC workflow that actually works</h2><p>Effective IaC is less about which tool you use and more about the workflow controls around it.</p><p>Most failures don&#8217;t come from syntax; they come from skipping validation, review, or safe rollout.</p><p>Here&#8217;s what a robust pipeline typically looks like:</p><ol><li><p><strong>Developer writes and pushes IaC to Git </strong>&#8594; Infrastructure is defined as code (networks, databases, IAM, etc.), making Git the single source of truth.</p></li><li><p><strong>CI runs validation checks </strong>&#8594; Formatting, syntax validation, linting, and dependency checks ensure the code is correct and consistent.</p></li><li><p><strong>Security &amp; policy checks run </strong>&#8594; Misconfiguration scanners, policy-as-code rules, and security tools catch risky permissions or unsafe defaults early.</p></li><li><p><strong>A preview (plan) is generated </strong>&#8594; The system compares desired vs current state and shows exactly what will be created, updated, or deleted before anything changes.</p></li><li><p><strong>Peer review and approval </strong>&#8594; Engineers review both the code and the plan to catch issues like accidental deletions, cost spikes, or overly broad access.</p></li><li><p><strong>Apply via a deployment pipeline </strong>&#8594; A trusted CI/CD runner applies the changes, ensuring consistent execution and controlled credentials.</p></li><li><p><strong>Environment-specific config is injected </strong>&#8594; The same code is reused across dev, staging, and prod, with differences handled through variables and separate state.</p></li><li><p><strong>Post-deploy checks run </strong>&#8594; Smoke tests, connectivity checks, and monitoring validation confirm the system actually works after deployment.</p></li><li><p><strong>Environment rollout </strong>&#8594; Changes move from dev &#8594; staging &#8594; production with increasing levels of approval to reduce risk.</p></li><li><p><strong>State is updated for future runs</strong> &#8594; The IaC tool records what exists so future changes can safely build on top of it.</p></li><li><p><strong>Continuous drift detection</strong> &#8594; Scheduled checks alert when real infrastructure diverges from what&#8217;s defined in code.</p></li></ol><p>A simple way to think about it: you declare what you want, the pipeline proves it&#8217;s safe, and automation makes it real; consistently, every time.</p><h2>The security risks you can&#8217;t ignore</h2><p>IaC security failures tend to be systemic: fast pipelines amplify mistakes quickly.</p><p>These are the three most dominant risk categories.</p><h3>1. Secrets exposure</h3><p>Secrets exposure in IaC happens when sensitive data (like passwords or API keys) is stored or leaked through code, state files, logs, or pipelines.</p><p>This can lead to serious risks.</p><p>Prevent it by using secret managers, encrypting state, avoiding hardcoding, and enforcing least-privilege access.</p><h3>2. Over-privileged automation</h3><p>CI/CD pipelines often get broad permissions &#8220;just to make it work.&#8221;</p><p>Instead, the right model separates preview roles from apply roles, scope permissions per environment, and enforces least privilege.</p><h3>3. Supply chain integrity</h3><p>Compromised or untrusted external modules, templates, or dependencies are a quiet attack surface.</p><p>If these components are tampered with, they can introduce vulnerabilities or malicious code into your infrastructure.</p><p>Without pinning and verification, your infrastructure depends on unverified external code.</p><h2>When not to use full IaC automation</h2><p>IaC is almost always worth adopting, but the level of automation should match your maturity.</p><p>Full automated apply-on-merge makes sense when you have strong test coverage, good observability, and practiced runbooks. Without those foundations, it moves fast in the wrong direction.</p><p>For small prototypes or rarely-changed legacy systems, basic version-controlled templates with manual apply still deliver most of the value: reproducibility, auditability, and the ability to review changes before they land.</p><h2>The pitfalls teams hit first</h2><p>A few failure patterns show up reliably when teams adopt IaC without the right habits.</p><ul><li><p><strong>State mishandling</strong> &#8594; Storing Terraform state locally, or in source control, leads to conflicts and leaks. Use a remote backend with locking from day one.</p></li><li><p><strong>Configuration drift</strong> &#8594; An urgent fix applied via the console creates a gap between reality and the definition. Enforce a norm: no manual changes without a follow-up pull request, and run drift detection on a schedule.</p></li><li><p><strong>Unsafe changes</strong> &#8594; A small template edit can silently force a resource replacement. Preview gates and policy-as-code checks catch this before it reaches production.</p></li><li><p><strong>Skipping validation</strong> &#8594; Treating IaC as &#8220;just YAML&#8221; and skipping linting and formatting in CI creates a debt that compounds fast.</p></li></ul><h2>Recap</h2><p>IaC is not a tool you adopt; it&#8217;s a discipline you commit to.</p><p>The tools (Terraform, CloudFormation, Pulumi, Ansible) are expressions of a single idea: infrastructure should be reproducible, reviewable, and automatable by default.</p><p>Start with version control and validation. Add preview gates before you automate applies. Lock down secrets and pipeline permissions early.</p><p>When IaC is done well, provisioning an environment feels like merging a pull request; not like defusing a bomb.</p><div><hr></div><p>&#128075; If you liked this post &#8594; Like + Restack + Share to help others learn system design.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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 get high-signal, clear, and visual system design breakdowns straight to your inbox:&nbsp;</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[Redis Clearly Explained]]></title><description><![CDATA[(5 min read) | How Redis works under the hood, where it fits in the stack, where it shines, and when NOT to use it]]></description><link>https://blog.levelupcoding.com/p/redis-clearly-explained</link><guid isPermaLink="false">https://blog.levelupcoding.com/p/redis-clearly-explained</guid><dc:creator><![CDATA[Nikki Siapno]]></dc:creator><pubDate>Tue, 21 Apr 2026 10:36:16 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/ae2174cd-f4ac-4233-8f24-2048c3a0f484_1456x1048.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_!yLV0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yLV0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" width="1292" height="266" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:266,&quot;width&quot;:1292,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:343451,&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://lvlupcoding.substack.com/i/171357839?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.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_!yLV0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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">Get our 142-page System Design Handbook for FREE on newsletter signup:</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><h2><a href="https://lucode.co/exe-dot-dev-z8nl">Just a Computer. On the Internet. Instantly.</a></h2><h5>Presented by <a href="https://lucode.co/exe-dot-dev-z8nl">exe.dev</a></h5><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!qbPa!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e742826-0983-4853-8d0a-3cb0a3ff0221_2204x1338.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!qbPa!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e742826-0983-4853-8d0a-3cb0a3ff0221_2204x1338.png 424w, https://substackcdn.com/image/fetch/$s_!qbPa!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e742826-0983-4853-8d0a-3cb0a3ff0221_2204x1338.png 848w, https://substackcdn.com/image/fetch/$s_!qbPa!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e742826-0983-4853-8d0a-3cb0a3ff0221_2204x1338.png 1272w, https://substackcdn.com/image/fetch/$s_!qbPa!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e742826-0983-4853-8d0a-3cb0a3ff0221_2204x1338.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!qbPa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e742826-0983-4853-8d0a-3cb0a3ff0221_2204x1338.png" width="1456" height="884" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5e742826-0983-4853-8d0a-3cb0a3ff0221_2204x1338.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:884,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:192231,&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;:false,&quot;internalRedirect&quot;:&quot;https://blog.levelupcoding.com/i/193454211?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e742826-0983-4853-8d0a-3cb0a3ff0221_2204x1338.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_!qbPa!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e742826-0983-4853-8d0a-3cb0a3ff0221_2204x1338.png 424w, https://substackcdn.com/image/fetch/$s_!qbPa!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e742826-0983-4853-8d0a-3cb0a3ff0221_2204x1338.png 848w, https://substackcdn.com/image/fetch/$s_!qbPa!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e742826-0983-4853-8d0a-3cb0a3ff0221_2204x1338.png 1272w, https://substackcdn.com/image/fetch/$s_!qbPa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e742826-0983-4853-8d0a-3cb0a3ff0221_2204x1338.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 role="img" 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><title></title><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>Sometimes you just need a machine on the internet. One that keeps running when your laptop sleeps, runs your cron jobs, and is accessible when others need it. <strong><a href="https://lucode.co/exe-dot-dev-z8nl">Exe.dev</a></strong> gives you exactly that. A real VM with persistent disk, built-in HTTPS, and secure access out of the box. No auth setup, no config files, no infrastructure overhead. Spin one up with a single command and start building. It stays live and ready to share.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://lucode.co/exe-dot-dev-z8nl&quot;,&quot;text&quot;:&quot;Try it Out&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://lucode.co/exe-dot-dev-z8nl"><span>Try it Out</span></a></p><div><hr></div><h1>Redis Clearly Explained</h1><p>Your database is fast. Your queries are optimized. Your indexes are in place. And yet, under real load, the system still slows down.</p><p>The problem often isn&#8217;t the database itself. It&#8217;s that you&#8217;re asking it to answer the same questions, over and over, thousands of times a second.</p><p>This is where Redis starts to matter.</p><p>It shows up at the edge: handling sessions, caching responses, tracking limits, moving messages. Quietly taking pressure off everything else.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!URDr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F021c57b4-f894-4afd-a6d2-b41e42fab5df_2000x821.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!URDr!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F021c57b4-f894-4afd-a6d2-b41e42fab5df_2000x821.png 424w, https://substackcdn.com/image/fetch/$s_!URDr!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F021c57b4-f894-4afd-a6d2-b41e42fab5df_2000x821.png 848w, https://substackcdn.com/image/fetch/$s_!URDr!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F021c57b4-f894-4afd-a6d2-b41e42fab5df_2000x821.png 1272w, https://substackcdn.com/image/fetch/$s_!URDr!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F021c57b4-f894-4afd-a6d2-b41e42fab5df_2000x821.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!URDr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F021c57b4-f894-4afd-a6d2-b41e42fab5df_2000x821.png" width="1456" height="598" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/021c57b4-f894-4afd-a6d2-b41e42fab5df_2000x821.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:598,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:251213,&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://blog.levelupcoding.com/i/194275659?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F021c57b4-f894-4afd-a6d2-b41e42fab5df_2000x821.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_!URDr!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F021c57b4-f894-4afd-a6d2-b41e42fab5df_2000x821.png 424w, https://substackcdn.com/image/fetch/$s_!URDr!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F021c57b4-f894-4afd-a6d2-b41e42fab5df_2000x821.png 848w, https://substackcdn.com/image/fetch/$s_!URDr!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F021c57b4-f894-4afd-a6d2-b41e42fab5df_2000x821.png 1272w, https://substackcdn.com/image/fetch/$s_!URDr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F021c57b4-f894-4afd-a6d2-b41e42fab5df_2000x821.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 role="img" 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><title></title><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>How Redis works under the hood</h2><p>Redis stores everything in RAM as key&#8211;value pairs, but the values are not limited to plain strings. It supports a rich set of data structures:</p><ul><li><p><strong>Strings</strong> &#8594; Simple values; used for counters, flags, and cached results.</p></li><li><p><strong>Hashes</strong> &#8594; Field-value maps; ideal for user profiles and session data.</p></li><li><p><strong>Lists</strong> &#8594; Ordered sequences; used for queues and recent activity feeds.</p></li><li><p><strong>Sets / Sorted Sets</strong> &#8594; Unique element collections with optional scoring; used for leaderboards and tag systems.</p></li></ul><p>Each structure comes with optimized commands. Instead of fetching data and processing it in your app, Redis lets you operate directly on the data.</p><p>That&#8217;s the difference between:</p><ul><li><p>&#8220;Get everything, then sort it&#8221;<br>vs</p></li><li><p>&#8220;Ask Redis for the top 10 directly&#8221;</p></li></ul><h3>Execution model</h3><p>Redis uses a <strong>single-threaded event loop</strong>, meaning one command executes at a time.</p><p>This sounds limiting, but it avoids locking and keeps operations atomic. In practice, it handles massive throughput because the work per operation is small and predictable.</p><h3>Persistence (optional but important)</h3><p>Even though Redis is in-memory, it can persist data:</p><ul><li><p><strong>RDB snapshots</strong> &#8594; Periodic full saves</p></li><li><p><strong>AOF logs</strong> &#8594; Append every write operation</p></li></ul><p>You choose how durable you want it to be. Faster setups risk losing recent data; safer setups add overhead.</p><h2>Where Redis actually shines</h2><p>Redis is not a general-purpose database replacement. It&#8217;s a <strong>performance layer</strong> that solves specific problems extremely well.</p><h3>1. Caching</h3><p>The most common use case is caching expensive reads.</p><p>The application checks Redis first; on a hit, data returns in microseconds; on a miss, the app queries the primary database and populates Redis for next time.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!yMC9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5967205-956a-4b3a-bf7d-ec1759b0eb1f_2000x877.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yMC9!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5967205-956a-4b3a-bf7d-ec1759b0eb1f_2000x877.png 424w, https://substackcdn.com/image/fetch/$s_!yMC9!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5967205-956a-4b3a-bf7d-ec1759b0eb1f_2000x877.png 848w, https://substackcdn.com/image/fetch/$s_!yMC9!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5967205-956a-4b3a-bf7d-ec1759b0eb1f_2000x877.png 1272w, https://substackcdn.com/image/fetch/$s_!yMC9!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5967205-956a-4b3a-bf7d-ec1759b0eb1f_2000x877.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yMC9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5967205-956a-4b3a-bf7d-ec1759b0eb1f_2000x877.png" width="1456" height="638" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f5967205-956a-4b3a-bf7d-ec1759b0eb1f_2000x877.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:638,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:272827,&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://blog.levelupcoding.com/i/194275659?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5967205-956a-4b3a-bf7d-ec1759b0eb1f_2000x877.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_!yMC9!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5967205-956a-4b3a-bf7d-ec1759b0eb1f_2000x877.png 424w, https://substackcdn.com/image/fetch/$s_!yMC9!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5967205-956a-4b3a-bf7d-ec1759b0eb1f_2000x877.png 848w, https://substackcdn.com/image/fetch/$s_!yMC9!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5967205-956a-4b3a-bf7d-ec1759b0eb1f_2000x877.png 1272w, https://substackcdn.com/image/fetch/$s_!yMC9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5967205-956a-4b3a-bf7d-ec1759b0eb1f_2000x877.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 role="img" 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><title></title><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 primary database stays as the source of truth, Redis handles the hot path.</p><p>This works especially well for expensive query results, API responses, rendered HTML fragments, or any data that is read far more often than it changes.</p><ul><li><p><strong>Faster responses</strong> &#8594; Microseconds instead of milliseconds</p></li><li><p><strong>Lower DB load</strong> &#8594; Fewer repeated queries</p></li><li><p><strong>Better scalability</strong> &#8594; Handles spikes smoothly</p></li></ul><p>This pattern alone can reduce database traffic dramatically.</p><h3>2. Session storage</h3><p>User sessions need fast reads and writes across every request.</p><p>Redis fits because:</p><ul><li><p><strong>Low latency</strong> &#8594; No delay on every request</p></li><li><p><strong>Time-to-live support</strong> &#8594; Sessions expire automatically</p></li><li><p><strong>High throughput</strong> &#8594; Handles large user bases</p></li></ul><p>Instead of storing sessions in a database, Redis keeps them close to the application.</p><h3>3. Rate limiting</h3><p>Redis makes rate limiting simple through atomic operations.</p><p>Each request increments a counter per user, there&#8217;s a set expiration per counter (e.g. 10 minutes), requests are rejected after a threshold is reached.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!7LYd!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea471326-cde0-4a23-9b5b-e276645d4d50_2000x958.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7LYd!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea471326-cde0-4a23-9b5b-e276645d4d50_2000x958.png 424w, https://substackcdn.com/image/fetch/$s_!7LYd!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea471326-cde0-4a23-9b5b-e276645d4d50_2000x958.png 848w, https://substackcdn.com/image/fetch/$s_!7LYd!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea471326-cde0-4a23-9b5b-e276645d4d50_2000x958.png 1272w, https://substackcdn.com/image/fetch/$s_!7LYd!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea471326-cde0-4a23-9b5b-e276645d4d50_2000x958.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7LYd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea471326-cde0-4a23-9b5b-e276645d4d50_2000x958.png" width="1456" height="697" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ea471326-cde0-4a23-9b5b-e276645d4d50_2000x958.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:697,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:337041,&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://blog.levelupcoding.com/i/194275659?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea471326-cde0-4a23-9b5b-e276645d4d50_2000x958.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_!7LYd!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea471326-cde0-4a23-9b5b-e276645d4d50_2000x958.png 424w, https://substackcdn.com/image/fetch/$s_!7LYd!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea471326-cde0-4a23-9b5b-e276645d4d50_2000x958.png 848w, https://substackcdn.com/image/fetch/$s_!7LYd!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea471326-cde0-4a23-9b5b-e276645d4d50_2000x958.png 1272w, https://substackcdn.com/image/fetch/$s_!7LYd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea471326-cde0-4a23-9b5b-e276645d4d50_2000x958.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 role="img" 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><title></title><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>Because these are atomic in-memory operations, they add almost no overhead to the request path. This is why Redis is often used behind API gateways.</p><h3>4. Pub/Sub and queues</h3><p>Redis has a built-in publish/subscribe mechanism: one service publishes to a channel; all subscribers receive the message in real time.</p><p>For more durable workloads, Redis Lists support simple FIFO queues, and Redis Streams add consumer groups and persistence for cases where message durability matters.</p><p>It&#8217;s simple, fast, and good enough for many workloads before you need heavier tools.</p><h2>Benefits vs trade-offs</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!SaVN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58a6d95f-d598-4a79-bde6-e460276f77ff_2000x1498.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!SaVN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58a6d95f-d598-4a79-bde6-e460276f77ff_2000x1498.png 424w, https://substackcdn.com/image/fetch/$s_!SaVN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58a6d95f-d598-4a79-bde6-e460276f77ff_2000x1498.png 848w, https://substackcdn.com/image/fetch/$s_!SaVN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58a6d95f-d598-4a79-bde6-e460276f77ff_2000x1498.png 1272w, https://substackcdn.com/image/fetch/$s_!SaVN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58a6d95f-d598-4a79-bde6-e460276f77ff_2000x1498.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!SaVN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58a6d95f-d598-4a79-bde6-e460276f77ff_2000x1498.png" width="1456" height="1091" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/58a6d95f-d598-4a79-bde6-e460276f77ff_2000x1498.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1091,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:528127,&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://blog.levelupcoding.com/i/194275659?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58a6d95f-d598-4a79-bde6-e460276f77ff_2000x1498.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_!SaVN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58a6d95f-d598-4a79-bde6-e460276f77ff_2000x1498.png 424w, https://substackcdn.com/image/fetch/$s_!SaVN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58a6d95f-d598-4a79-bde6-e460276f77ff_2000x1498.png 848w, https://substackcdn.com/image/fetch/$s_!SaVN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58a6d95f-d598-4a79-bde6-e460276f77ff_2000x1498.png 1272w, https://substackcdn.com/image/fetch/$s_!SaVN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58a6d95f-d598-4a79-bde6-e460276f77ff_2000x1498.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 role="img" 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><title></title><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>Where Redis fits in the stack</h2><p>Redis complements a primary database.</p><p>In microservices architectures, Redis plays a second role as a shared fast datastore: a central session store that all frontends hit, a rate limiter that all API gateways respect, or a lightweight message broker that connects services without the overhead of a full queue system like Kafka or RabbitMQ.</p><p>Cloud providers offer managed Redis services (AWS ElastiCache, Azure Cache for Redis, and Google Cloud Memorystore) that handle provisioning, scaling, and failover automatically. This makes slotting Redis into an existing stack straightforward, without managing infrastructure directly.</p><h2>When not to use Redis</h2><p>Redis is not the right tool when:</p><ul><li><p><strong>Your dataset is large and cold</strong> &#8594; RAM is expensive per GB. Storing a 10TB archive in Redis would cost a fortune. Use a disk-based store and cache only the hot subset in Redis.</p></li><li><p><strong>You need complex queries</strong> &#8594; &#8220;Find all users from Region A who purchased Product B in the last 30 days&#8221; requires a relational database. Redis retrieves by key; it does not scan or join.</p></li><li><p><strong>You need strong durability</strong> &#8594; If losing even a few seconds of writes is unacceptable (financial transactions, medical records), Redis&#8217;s persistence model needs careful configuration, and a fully ACID-compliant database is the safer option.</p></li><li><p><strong>Your workload is stateless and simple</strong> &#8594; For systems that don&#8217;t cache, don&#8217;t need sessions, and don&#8217;t need messaging, adding Redis introduces operational complexity without a proportional benefit.</p></li></ul><h2>The takeaway</h2><p>Redis is best understood as a <strong>performance multiplier</strong>, not a database replacement.</p><p>It doesn&#8217;t try to solve everything. It solves a narrow set of problems extremely well: caching, sessions, rate limiting, lightweight messaging.</p><p>And that&#8217;s exactly why it&#8217;s everywhere.</p><p>Used correctly, Redis turns slow paths into fast ones and fragile systems into responsive ones.</p><p>Used blindly, it becomes an expensive, leaky abstraction.</p><div><hr></div><p>&#128075; If you liked this post &#8594; Like + Restack + Share to help others learn system design.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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 get high-signal, clear, and visual system design breakdowns straight to your inbox:&nbsp;</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[Database Indexing Clearly Explained]]></title><description><![CDATA[(4 minutes) | What indexes really do, index types, how the optimizer decides, when they help (and when they hurt), and the right mental model]]></description><link>https://blog.levelupcoding.com/p/database-indexing-clearly-explained</link><guid isPermaLink="false">https://blog.levelupcoding.com/p/database-indexing-clearly-explained</guid><dc:creator><![CDATA[Nikki Siapno]]></dc:creator><pubDate>Mon, 13 Apr 2026 11:12:46 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/c357108e-5f8d-452b-b81e-c1556ec881c6_1456x1048.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_!yLV0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yLV0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" width="1292" height="266" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:266,&quot;width&quot;:1292,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:343451,&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://lvlupcoding.substack.com/i/171357839?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.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_!yLV0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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">Get our 142-page System Design Handbook for free on newsletter signup:</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><h2><a href="https://lucode.co/building-memory-aware-agents-course-oracle-z7nl">Agent Memory: Building Memory-Aware Agents</a></h2><h5>Presented by Oracle</h5><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!FG3I!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ee65843-8b4e-406b-8c0e-6f9aa7beb738_950x534.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!FG3I!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ee65843-8b4e-406b-8c0e-6f9aa7beb738_950x534.png 424w, https://substackcdn.com/image/fetch/$s_!FG3I!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ee65843-8b4e-406b-8c0e-6f9aa7beb738_950x534.png 848w, https://substackcdn.com/image/fetch/$s_!FG3I!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ee65843-8b4e-406b-8c0e-6f9aa7beb738_950x534.png 1272w, https://substackcdn.com/image/fetch/$s_!FG3I!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ee65843-8b4e-406b-8c0e-6f9aa7beb738_950x534.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!FG3I!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ee65843-8b4e-406b-8c0e-6f9aa7beb738_950x534.png" width="950" height="534" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2ee65843-8b4e-406b-8c0e-6f9aa7beb738_950x534.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:534,&quot;width&quot;:950,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:496175,&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;:false,&quot;internalRedirect&quot;:&quot;https://blog.levelupcoding.com/i/190397808?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ee65843-8b4e-406b-8c0e-6f9aa7beb738_950x534.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_!FG3I!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ee65843-8b4e-406b-8c0e-6f9aa7beb738_950x534.png 424w, https://substackcdn.com/image/fetch/$s_!FG3I!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ee65843-8b4e-406b-8c0e-6f9aa7beb738_950x534.png 848w, https://substackcdn.com/image/fetch/$s_!FG3I!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ee65843-8b4e-406b-8c0e-6f9aa7beb738_950x534.png 1272w, https://substackcdn.com/image/fetch/$s_!FG3I!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ee65843-8b4e-406b-8c0e-6f9aa7beb738_950x534.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 role="img" 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><title></title><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><a href="https://lucode.co/building-memory-aware-agents-course-oracle-z7nl">Free short course</a></strong> on DeepLearning. By the end, you&#8217;ll have assembled a fully stateful Memory Aware Agent that loads prior context at startup, assembles relevant context, state, tools, and outputs and improves across sessions.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://lucode.co/building-memory-aware-agents-course-oracle-z7nl&quot;,&quot;text&quot;:&quot;Start Building&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://lucode.co/building-memory-aware-agents-course-oracle-z7nl"><span>Start Building</span></a></p><div><hr></div><h1>How Database Indexing Really Works</h1><p>Slow queries have a reflex fix: add an index.</p><p>It works often enough that teams keep doing it; until write latency creeps up, storage balloons, and the query planner starts making strange choices.</p><p>That&#8217;s the index tax. Real, measurable, and entirely predictable once you understand what an index actually costs.</p><p>The goal isn&#8217;t to index everything. It&#8217;s to index the right things, and know when to stop.</p><h2>What an index really does</h2><p>At the simplest level, an index maps a search key to where the row lives, much like a book index maps a chapter to page numbers.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!bHeI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2629356-c499-4a6b-8718-9525b5f760c3_2000x647.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!bHeI!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2629356-c499-4a6b-8718-9525b5f760c3_2000x647.png 424w, https://substackcdn.com/image/fetch/$s_!bHeI!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2629356-c499-4a6b-8718-9525b5f760c3_2000x647.png 848w, https://substackcdn.com/image/fetch/$s_!bHeI!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2629356-c499-4a6b-8718-9525b5f760c3_2000x647.png 1272w, https://substackcdn.com/image/fetch/$s_!bHeI!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2629356-c499-4a6b-8718-9525b5f760c3_2000x647.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!bHeI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2629356-c499-4a6b-8718-9525b5f760c3_2000x647.png" width="1456" height="471" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e2629356-c499-4a6b-8718-9525b5f760c3_2000x647.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:471,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:609848,&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://blog.levelupcoding.com/i/193543901?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2629356-c499-4a6b-8718-9525b5f760c3_2000x647.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_!bHeI!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2629356-c499-4a6b-8718-9525b5f760c3_2000x647.png 424w, https://substackcdn.com/image/fetch/$s_!bHeI!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2629356-c499-4a6b-8718-9525b5f760c3_2000x647.png 848w, https://substackcdn.com/image/fetch/$s_!bHeI!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2629356-c499-4a6b-8718-9525b5f760c3_2000x647.png 1272w, https://substackcdn.com/image/fetch/$s_!bHeI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2629356-c499-4a6b-8718-9525b5f760c3_2000x647.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 role="img" 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><title></title><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 goal is to cut down how much of the table the engine must look through to answer a query.</p><p>That helps in a few common cases:</p><ul><li><p><strong>Point lookups</strong> &#8594; <code>WHERE id = 42</code> becomes a targeted search instead of a full scan.</p></li><li><p><strong>Range queries</strong> &#8594; <code>BETWEEN</code>, <code>&lt;</code>, and <code>&gt;</code> work well when keys stay in order.</p></li><li><p><strong>Joins</strong> &#8594; An index on join keys helps the engine find matching rows faster.</p></li><li><p><strong>Ordering</strong> &#8594; A tree index can return rows in sorted order without an extra sort step.</p></li><li><p><strong>Uniqueness</strong> &#8594; Unique indexes help enforce &#8220;this value must appear only once.&#8221;</p></li></ul><p>The catch is that every <code>INSERT</code>, <code>UPDATE</code>, and <code>DELETE</code> must also update the index. So every helpful index also comes with a write tax. Add too many, and your database starts carrying extra baggage on every row change.</p><h2>Index types</h2><p>Not all indexes work the same way. Each structure solves a different query pattern.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QxKW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aa7b969-0be7-49bb-9134-c758fab1690c_2000x1119.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QxKW!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aa7b969-0be7-49bb-9134-c758fab1690c_2000x1119.png 424w, https://substackcdn.com/image/fetch/$s_!QxKW!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aa7b969-0be7-49bb-9134-c758fab1690c_2000x1119.png 848w, https://substackcdn.com/image/fetch/$s_!QxKW!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aa7b969-0be7-49bb-9134-c758fab1690c_2000x1119.png 1272w, https://substackcdn.com/image/fetch/$s_!QxKW!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aa7b969-0be7-49bb-9134-c758fab1690c_2000x1119.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QxKW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aa7b969-0be7-49bb-9134-c758fab1690c_2000x1119.png" width="1456" height="815" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0aa7b969-0be7-49bb-9134-c758fab1690c_2000x1119.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:815,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:430453,&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://blog.levelupcoding.com/i/193543901?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aa7b969-0be7-49bb-9134-c758fab1690c_2000x1119.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_!QxKW!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aa7b969-0be7-49bb-9134-c758fab1690c_2000x1119.png 424w, https://substackcdn.com/image/fetch/$s_!QxKW!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aa7b969-0be7-49bb-9134-c758fab1690c_2000x1119.png 848w, https://substackcdn.com/image/fetch/$s_!QxKW!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aa7b969-0be7-49bb-9134-c758fab1690c_2000x1119.png 1272w, https://substackcdn.com/image/fetch/$s_!QxKW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aa7b969-0be7-49bb-9134-c758fab1690c_2000x1119.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 role="img" 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><title></title><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>Most relational databases use B-tree style indexes by default, often implemented internally as B+ trees.</p><p>B-trees are the safe first choice for most OLTP queries:</p><ul><li><p><strong>Equality filters</strong> &#8594; Great for exact matches.</p></li><li><p><strong>Range filters</strong> &#8594; Great for time windows and ordered values.</p></li><li><p><strong>Ordered reads</strong> &#8594; Helpful for <code>ORDER BY</code>.</p></li><li><p><strong>General-purpose use</strong> &#8594; Good default when your data is sortable and your workload is mixed.</p></li></ul><p>B-trees are the workhorse, while other index families exist for more specialized conditions and data shapes.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!SgxG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac97d918-20e5-416c-abc1-998b215c6d5c_2000x1219.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!SgxG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac97d918-20e5-416c-abc1-998b215c6d5c_2000x1219.png 424w, https://substackcdn.com/image/fetch/$s_!SgxG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac97d918-20e5-416c-abc1-998b215c6d5c_2000x1219.png 848w, https://substackcdn.com/image/fetch/$s_!SgxG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac97d918-20e5-416c-abc1-998b215c6d5c_2000x1219.png 1272w, https://substackcdn.com/image/fetch/$s_!SgxG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac97d918-20e5-416c-abc1-998b215c6d5c_2000x1219.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!SgxG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac97d918-20e5-416c-abc1-998b215c6d5c_2000x1219.png" width="1456" height="887" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ac97d918-20e5-416c-abc1-998b215c6d5c_2000x1219.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:887,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:543184,&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://blog.levelupcoding.com/i/193543901?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac97d918-20e5-416c-abc1-998b215c6d5c_2000x1219.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_!SgxG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac97d918-20e5-416c-abc1-998b215c6d5c_2000x1219.png 424w, https://substackcdn.com/image/fetch/$s_!SgxG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac97d918-20e5-416c-abc1-998b215c6d5c_2000x1219.png 848w, https://substackcdn.com/image/fetch/$s_!SgxG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac97d918-20e5-416c-abc1-998b215c6d5c_2000x1219.png 1272w, https://substackcdn.com/image/fetch/$s_!SgxG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac97d918-20e5-416c-abc1-998b215c6d5c_2000x1219.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 role="img" 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><title></title><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>How the optimizer decides</h2><p>This is what catches most engineers: just because the index exists, doesn&#8217;t mean it&#8217;ll be used.</p><p>The optimizer decides to use an index when its cost model estimates that the index path is cheaper than reading the table directly.</p><p>That decision depends heavily on statistics: row counts, value distribution, selectivity, and sometimes histograms. If those statistics are stale, the optimizer can make a bad decision.</p><p>This is why keeping statistics fresh matters.</p><p>PostgreSQL uses <code>ANALYZE</code> to populate <code>pg_statistic</code>. MySQL manages histograms via <code>ANALYZE TABLE</code>. If statistics are stale, the optimizer can pick a costly plan even when a good index exists.</p><p>The optimizer assigns a cost to each candidate plan and picks the cheapest. In PostgreSQL, you can nudge this by tuning <code>random_page_cost</code> relative to <code>seq_page_cost</code>; lowering the ratio makes the planner more willing to use index scans.</p><h2>When not to add an index</h2><p>You shouldn&#8217;t add an index just because a column appears in a <code>WHERE</code> clause once. Indexes pay off when they serve a repeated access pattern better than their write and storage cost.</p><p>Avoid or remove an index when:</p><ul><li><p><strong>It is rarely used</strong> &#8594; Unused indexes still slow writes.</p></li><li><p><strong>It duplicates another index</strong> &#8594; Same leading columns often mean overlapping value.</p></li><li><p><strong>The predicate is not selective</strong> &#8594; If most rows match, scanning may still be cheaper.</p></li><li><p><strong>Writes dominate the workload</strong> &#8594; More indexes means more maintenance on every change.</p></li><li><p><strong>The query prevents index use</strong> &#8594; Wrapping a column in a function can block index use unless you build the matching expression index.</p></li></ul><p>There is also a physical side to this.</p><p>Indexes can fragment, bloat, and lose page density over time, especially under heavy updates. That&#8217;s why rebuild, reorganize, or reindex operations exist across major databases. An index can be conceptually correct and still operationally unhealthy.</p><h2>The right mental model</h2><p>The best indexing strategy is not &#8220;index everything.&#8221;</p><p>It is &#8220;match the structure to the predicate, then verify with real plans.&#8221;</p><p>That means:</p><ul><li><p><strong>Start with the query pattern</strong> &#8594; Index for how you filter, join, and sort.</p></li><li><p><strong>Start with B-trees</strong> &#8594; Switch only when the data shape clearly demands another family.</p></li><li><p><strong>Keep stats fresh</strong> &#8594; The optimizer can only choose well with up-to-date statistics.</p></li><li><p><strong>Prefer fewer, sharper indexes</strong> &#8594; Each one should earn its keep.</p></li><li><p><strong>Re-check over time</strong> &#8594; Workloads shift, and yesterday&#8217;s useful index becomes tomorrow&#8217;s write penalty.</p></li></ul><p>Indexes are best understood as a trade: you spend extra work on writes so reads can skip unnecessary work. Once you see that trade clearly, index tuning stops feeling like superstition and starts feeling like engineering.</p><div><hr></div><p>&#128075; If you liked this post &#8594; Like + Restack + Share to help others learn system design.</p><div><hr></div><p>Subscribe to get high-signal, clear, and visual system design breakdowns straight to your inbox:</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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">&nbsp;</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[Circuit Breakers: How to Stop Small Failures from Spreading]]></title><description><![CDATA[(4 Minutes) | What they are, what triggers a trip, why they help so much, observability, and when to use them (and when not to)]]></description><link>https://blog.levelupcoding.com/p/circuit-breakers-explained</link><guid isPermaLink="false">https://blog.levelupcoding.com/p/circuit-breakers-explained</guid><dc:creator><![CDATA[Nikki Siapno]]></dc:creator><pubDate>Thu, 09 Apr 2026 12:03:57 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/cf80439c-073e-435e-9546-107c7ea29ba8_1456x1048.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_!yLV0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yLV0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" width="1292" height="266" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:266,&quot;width&quot;:1292,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:343451,&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://lvlupcoding.substack.com/i/171357839?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.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_!yLV0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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">Get our 142-page System Design Handbook for free on newsletter signup:</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><h2><a href="https://lucode.co/exe-dot-dev-z7nl">Write Software: Private, Persistent, Share with a Link</a></h2><h5>Presented by <a href="https://lucode.co/exe-dot-dev-z7nl">exe.dev</a></h5><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!M9ig!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F111082ac-d23f-453f-9346-7aba1aac2aa1_1009x544.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!M9ig!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F111082ac-d23f-453f-9346-7aba1aac2aa1_1009x544.png 424w, https://substackcdn.com/image/fetch/$s_!M9ig!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F111082ac-d23f-453f-9346-7aba1aac2aa1_1009x544.png 848w, https://substackcdn.com/image/fetch/$s_!M9ig!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F111082ac-d23f-453f-9346-7aba1aac2aa1_1009x544.png 1272w, https://substackcdn.com/image/fetch/$s_!M9ig!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F111082ac-d23f-453f-9346-7aba1aac2aa1_1009x544.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!M9ig!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F111082ac-d23f-453f-9346-7aba1aac2aa1_1009x544.png" width="1009" height="544" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/111082ac-d23f-453f-9346-7aba1aac2aa1_1009x544.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:544,&quot;width&quot;:1009,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:108855,&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;:false,&quot;internalRedirect&quot;:&quot;https://blog.levelupcoding.com/i/193454211?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F111082ac-d23f-453f-9346-7aba1aac2aa1_1009x544.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_!M9ig!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F111082ac-d23f-453f-9346-7aba1aac2aa1_1009x544.png 424w, https://substackcdn.com/image/fetch/$s_!M9ig!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F111082ac-d23f-453f-9346-7aba1aac2aa1_1009x544.png 848w, https://substackcdn.com/image/fetch/$s_!M9ig!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F111082ac-d23f-453f-9346-7aba1aac2aa1_1009x544.png 1272w, https://substackcdn.com/image/fetch/$s_!M9ig!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F111082ac-d23f-453f-9346-7aba1aac2aa1_1009x544.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 role="img" 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><title></title><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><a href="https://lucode.co/exe-dot-dev-z7nl">Exe.dev</a></strong> gives you <strong>instant VMs over SSH</strong>. Spin up a full VM in seconds over SSH with built-in HTTPS exposure, persistent storage, and zero cloud configuration. No networking setup, no rebuilding environments, no YAML. Optimized for side projects, internal tools, and AI agents. Start a new sandbox, systemd and all, in a second.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://lucode.co/exe-dot-dev-z7nl&quot;,&quot;text&quot;:&quot;Try it Out&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://lucode.co/exe-dot-dev-z7nl"><span>Try it Out</span></a></p><div><hr></div><h1>Circuit Breakers: How to Stop Small Failures from Spreading</h1><p>Retries make your system more resilient. Until they make it worse.</p><p>When a dependency is genuinely down, retrying doesn&#8217;t help.</p><p>That is how a small outage turns into a bigger one: threads pile up, retries multiply, queues grow, and healthy parts of the system start failing just because they are waiting on something unhealthy.</p><p>A circuit breaker exists to stop that spread.</p><p>It fails fast on purpose, because a quick &#8220;no&#8221; is often safer than a slow collapse.</p><h2>What a circuit breaker actually is</h2><p>A circuit breaker is a proxy that sits between your code and a dependency like an API, database, or downstream service.</p><p>It monitors every call for failures, timeouts, and slow responses. When things look bad enough, it stops forwarding requests entirely and starts failing fast instead of letting threads pile up waiting for a service that won&#8217;t recover on its own.</p><p>Most health-based circuit breakers use three states:</p><ul><li><p><strong>Closed</strong> &#8594; Requests flow normally, and the breaker tracks failures, timeouts, or slow calls.</p></li><li><p><strong>Open</strong> &#8594; Requests fail immediately instead of touching the unhealthy dependency.</p></li><li><p><strong>Half-open</strong> &#8594; A small number of trial calls test whether the dependency has recovered.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!M5FZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdefb79eb-37f0-4f83-b941-c4d2509ffd44_2000x1299.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!M5FZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdefb79eb-37f0-4f83-b941-c4d2509ffd44_2000x1299.png 424w, https://substackcdn.com/image/fetch/$s_!M5FZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdefb79eb-37f0-4f83-b941-c4d2509ffd44_2000x1299.png 848w, https://substackcdn.com/image/fetch/$s_!M5FZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdefb79eb-37f0-4f83-b941-c4d2509ffd44_2000x1299.png 1272w, https://substackcdn.com/image/fetch/$s_!M5FZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdefb79eb-37f0-4f83-b941-c4d2509ffd44_2000x1299.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!M5FZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdefb79eb-37f0-4f83-b941-c4d2509ffd44_2000x1299.png" width="1456" height="946" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/defb79eb-37f0-4f83-b941-c4d2509ffd44_2000x1299.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:946,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:629677,&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://blog.levelupcoding.com/i/192820234?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdefb79eb-37f0-4f83-b941-c4d2509ffd44_2000x1299.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_!M5FZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdefb79eb-37f0-4f83-b941-c4d2509ffd44_2000x1299.png 424w, https://substackcdn.com/image/fetch/$s_!M5FZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdefb79eb-37f0-4f83-b941-c4d2509ffd44_2000x1299.png 848w, https://substackcdn.com/image/fetch/$s_!M5FZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdefb79eb-37f0-4f83-b941-c4d2509ffd44_2000x1299.png 1272w, https://substackcdn.com/image/fetch/$s_!M5FZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdefb79eb-37f0-4f83-b941-c4d2509ffd44_2000x1299.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 role="img" 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><title></title><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></ul><h2>What triggers a trip</h2><p>Not all failures look the same, so not all circuit breakers trip for the same reason.</p><p>Some open after a run of consecutive failures. That works well for low-traffic calls where even a few failures are meaningful.</p><p>Some open on failure rate. Instead of asking &#8220;Did five calls fail in a row?&#8221; they ask &#8220;Is too large a share of recent traffic failing?&#8221; That works better for high-volume services because it filters out noise.</p><p>Some open on slow-call rate. This is important because a dependency does not need to be fully down to be dangerous. A slow database can burn your connection pool long before it starts returning errors.</p><p>And some proxy or mesh-level breakers focus on capacity rather than health. They trip on too many active requests, pending requests, retries, or connections. These don&#8217;t ask whether the dependency is broken. They ask whether the system can safely take more load.</p><p>Here is the key difference:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!o-_t!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ff16d28-f905-42b9-8877-ad1d2fc8944f_2000x639.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!o-_t!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ff16d28-f905-42b9-8877-ad1d2fc8944f_2000x639.png 424w, https://substackcdn.com/image/fetch/$s_!o-_t!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ff16d28-f905-42b9-8877-ad1d2fc8944f_2000x639.png 848w, https://substackcdn.com/image/fetch/$s_!o-_t!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ff16d28-f905-42b9-8877-ad1d2fc8944f_2000x639.png 1272w, https://substackcdn.com/image/fetch/$s_!o-_t!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ff16d28-f905-42b9-8877-ad1d2fc8944f_2000x639.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!o-_t!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ff16d28-f905-42b9-8877-ad1d2fc8944f_2000x639.png" width="1456" height="465" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9ff16d28-f905-42b9-8877-ad1d2fc8944f_2000x639.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:465,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:406566,&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://blog.levelupcoding.com/i/192820234?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ff16d28-f905-42b9-8877-ad1d2fc8944f_2000x639.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_!o-_t!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ff16d28-f905-42b9-8877-ad1d2fc8944f_2000x639.png 424w, https://substackcdn.com/image/fetch/$s_!o-_t!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ff16d28-f905-42b9-8877-ad1d2fc8944f_2000x639.png 848w, https://substackcdn.com/image/fetch/$s_!o-_t!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ff16d28-f905-42b9-8877-ad1d2fc8944f_2000x639.png 1272w, https://substackcdn.com/image/fetch/$s_!o-_t!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ff16d28-f905-42b9-8877-ad1d2fc8944f_2000x639.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 role="img" 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><title></title><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>That is why teams often use both. One protects against unhealthy behavior. The other protects against unhealthy volume.</p><h2>Why circuit breakers help so much</h2><p>The biggest benefit is not speed. It is containment.</p><p>When a dependency is clearly struggling, the breaker stops your service from wasting resources on calls that are likely to fail anyway.</p><p>That gives the rest of your system room to breathe.</p><p>It also makes failure easier to shape.</p><ul><li><p><strong>Fail fast</strong> &#8594; Users get a quick error or fallback instead of waiting through long timeouts.</p></li><li><p><strong>Protect capacity</strong> &#8594; Threads, sockets, and pools stay available for work that still has a chance to succeed.</p></li><li><p><strong>Reduce blast radius</strong> &#8594; One broken service is less likely to drag healthy services down with it.</p></li><li><p><strong>Support graceful degradation</strong> &#8594; You can return cached data, defaults, or partial results instead of total failure.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!M4Km!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ae3cc8b-ecf9-47ed-ac75-712715fd0aa4_2000x1101.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!M4Km!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ae3cc8b-ecf9-47ed-ac75-712715fd0aa4_2000x1101.png 424w, https://substackcdn.com/image/fetch/$s_!M4Km!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ae3cc8b-ecf9-47ed-ac75-712715fd0aa4_2000x1101.png 848w, https://substackcdn.com/image/fetch/$s_!M4Km!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ae3cc8b-ecf9-47ed-ac75-712715fd0aa4_2000x1101.png 1272w, https://substackcdn.com/image/fetch/$s_!M4Km!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ae3cc8b-ecf9-47ed-ac75-712715fd0aa4_2000x1101.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!M4Km!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ae3cc8b-ecf9-47ed-ac75-712715fd0aa4_2000x1101.png" width="1456" height="802" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0ae3cc8b-ecf9-47ed-ac75-712715fd0aa4_2000x1101.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:802,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1338471,&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://blog.levelupcoding.com/i/192820234?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ae3cc8b-ecf9-47ed-ac75-712715fd0aa4_2000x1101.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_!M4Km!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ae3cc8b-ecf9-47ed-ac75-712715fd0aa4_2000x1101.png 424w, https://substackcdn.com/image/fetch/$s_!M4Km!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ae3cc8b-ecf9-47ed-ac75-712715fd0aa4_2000x1101.png 848w, https://substackcdn.com/image/fetch/$s_!M4Km!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ae3cc8b-ecf9-47ed-ac75-712715fd0aa4_2000x1101.png 1272w, https://substackcdn.com/image/fetch/$s_!M4Km!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ae3cc8b-ecf9-47ed-ac75-712715fd0aa4_2000x1101.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 role="img" 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><title></title><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></ul><p>This is why circuit breakers often pair well with fallbacks. If a recommendation service is down, your app can still show popular items. If a profile service is slow, you can still render most of the page.</p><p>The user sees degraded behavior, not a frozen system.</p><h2>Observability is non-negotiable</h2><p>A circuit breaker without monitoring is a black box that silently shapes your availability.</p><p>At minimum, track:</p><ul><li><p><strong>State transitions</strong> (Closed &#8594; Open &#8594; Half-Open)</p></li><li><p><strong>Failure rate</strong> and <strong>slow-call rate</strong> gauges</p></li><li><p><strong>Not-permitted calls</strong>, requests the breaker rejected without forwarding</p></li><li><p><strong>Overflow counters</strong> if you&#8217;re using Envoy (e.g. <code>upstream_cx_overflow</code>)</p></li></ul><p>Alert on state transitions when they exceed a rate threshold, and alert on sustained not-permitted calls correlated with user-impact SLIs (service level indicators).</p><p>One-off blips don&#8217;t warrant pages; sustained opens that burn your error budget do.</p><h2>When not to lean on a circuit breaker</h2><p>Circuit breakers are powerful, but they are not a substitute for basic resilience hygiene.</p><p>Do not use circuit breakers as a bandage for missing timeouts. If your calls can hang indefinitely, a circuit breaker will only react after damage is already done. Always set clear, enforced timeouts first, because they limit how long resources stay blocked.</p><p>Separate retries from circuit breakers. They solve different failure patterns. Retries help with brief, transient failures. Circuit breakers help when failure lasts long enough that retrying becomes harmful.</p><p>Avoid adding breakers everywhere. Not every dependency needs one. Each breaker introduces configuration, monitoring, and edge cases. Use them where failure is costly, not where it is merely inconvenient.</p><p>And be careful with shared breakers. If one breaker covers several independent shards or providers, failures in one can block traffic to the healthy ones too.</p><h2>Wrapping up</h2><p>Cascading failure doesn&#8217;t start with a catastrophic event.</p><p>It starts with one slow service and nothing to stop the pressure from spreading.</p><p>A circuit breaker is that stop.</p><p>That is the real win: a smaller blast radius when something goes wrong. And in distributed systems, survival often depends less on avoiding failure and more on containing it.</p><div><hr></div><p>&#128075; If you liked this post &#8594; Like + Restack + Share to help others learn system design.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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 get high-signal, clear, and visual system design breakdowns straight to your inbox:&nbsp;</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[REST APIs Properly Explained]]></title><description><![CDATA[(4 minutes) | Constraints, trade-offs, when not to use it, and more]]></description><link>https://blog.levelupcoding.com/p/rest-apis-properly-explained</link><guid isPermaLink="false">https://blog.levelupcoding.com/p/rest-apis-properly-explained</guid><dc:creator><![CDATA[Nikki Siapno]]></dc:creator><pubDate>Tue, 31 Mar 2026 11:27:44 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/5f79476c-24c9-42b8-bfd5-744c14ad2086_1456x1048.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_!yLV0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yLV0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" width="1292" height="266" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:266,&quot;width&quot;:1292,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:343451,&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://lvlupcoding.substack.com/i/171357839?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.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_!yLV0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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">Get our 142-page System Design Handbook for FREE on newsletter signup:</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><h2><a href="https://lucode.co/unblocked-z7nl">Unblocked: Context That Saves You Time and Tokens</a></h2><h5>Presented by Unblocked</h5><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Q2ce!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe880ec27-8639-4d2c-997a-d8c49a81ebac_1920x1080.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Q2ce!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe880ec27-8639-4d2c-997a-d8c49a81ebac_1920x1080.png 424w, https://substackcdn.com/image/fetch/$s_!Q2ce!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe880ec27-8639-4d2c-997a-d8c49a81ebac_1920x1080.png 848w, https://substackcdn.com/image/fetch/$s_!Q2ce!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe880ec27-8639-4d2c-997a-d8c49a81ebac_1920x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!Q2ce!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe880ec27-8639-4d2c-997a-d8c49a81ebac_1920x1080.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Q2ce!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe880ec27-8639-4d2c-997a-d8c49a81ebac_1920x1080.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e880ec27-8639-4d2c-997a-d8c49a81ebac_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;:619586,&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;:false,&quot;internalRedirect&quot;:&quot;https://blog.levelupcoding.com/i/191124687?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe880ec27-8639-4d2c-997a-d8c49a81ebac_1920x1080.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_!Q2ce!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe880ec27-8639-4d2c-997a-d8c49a81ebac_1920x1080.png 424w, https://substackcdn.com/image/fetch/$s_!Q2ce!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe880ec27-8639-4d2c-997a-d8c49a81ebac_1920x1080.png 848w, https://substackcdn.com/image/fetch/$s_!Q2ce!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe880ec27-8639-4d2c-997a-d8c49a81ebac_1920x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!Q2ce!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe880ec27-8639-4d2c-997a-d8c49a81ebac_1920x1080.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 role="img" 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><title></title><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>Stop babysitting your coding agents. <strong><a href="https://lucode.co/unblocked-z7nl">Unblocked</a></strong> gives them the organizational knowledge to generate mergeable code without the back and forth. It pulls context from across your engineering stack, resolves conflicts, and cuts the rework cycle by delivering only what agents need for the task at hand.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://lucode.co/unblocked-z7nl&quot;,&quot;text&quot;:&quot;See how it works&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://lucode.co/unblocked-z7nl"><span>See how it works</span></a></p><div><hr></div><h1>REST APIs Principles Explained Clearly</h1><p>What makes an API RESTful?</p><p>If your first thought is &#8220;resources and CRUD,&#8221; you&#8217;re missing half the picture.</p><p>REST is an architectural style with specific constraints, and most APIs only follow a subset. Knowing the full model helps you design better interfaces; and know when to choose something else.</p><h2>What is REST</h2><p>REST (Representational State Transfer) is an <strong>architectural style</strong> for distributed systems. It&#8217;s not a protocol, not &#8220;just JSON,&#8221; and not a synonym for &#8220;HTTP API.&#8221;</p><p>To be truly RESTful, a system follows six constraints:</p><ul><li><p><strong>Client&#8211;server separation</strong> &#8594; UI and data/service concerns are split so each can evolve independently</p></li><li><p><strong>Stateless interactions</strong> &#8594; Every request carries the full context; the server stores no client session</p></li><li><p><strong>Cacheable responses</strong> &#8594; Responses say whether they can be cached, so intermediaries can safely reuse them</p></li><li><p><strong>Uniform interface</strong> &#8594; Resources have URIs; standard HTTP methods and status codes describe operations. In strict REST, the interface is also driven by hypermedia (HATEOAS), though most APIs don&#8217;t fully implement this.</p></li><li><p><strong>Layered system</strong> &#8594; Clients can&#8217;t tell if they talk to the origin server, a gateway, or a proxy in the middle</p></li><li><p><strong>Code-on-demand (optional)</strong> &#8594; Servers may send executable code (like JS) to extend client behavior</p></li></ul><p>These rules sound theoretical, but they explain why REST scales, why it&#8217;s easy to debug, and why you can throw a CDN or API gateway in front without rewriting your app.</p><h2>The REST constraints, de-jargoned</h2><p>Here&#8217;s how the core constraints translate into day-to-day API design:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!O90Y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18d7877-3d85-4ae5-b01a-51423e6ff54d_2000x1477.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!O90Y!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18d7877-3d85-4ae5-b01a-51423e6ff54d_2000x1477.png 424w, https://substackcdn.com/image/fetch/$s_!O90Y!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18d7877-3d85-4ae5-b01a-51423e6ff54d_2000x1477.png 848w, https://substackcdn.com/image/fetch/$s_!O90Y!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18d7877-3d85-4ae5-b01a-51423e6ff54d_2000x1477.png 1272w, https://substackcdn.com/image/fetch/$s_!O90Y!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18d7877-3d85-4ae5-b01a-51423e6ff54d_2000x1477.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!O90Y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18d7877-3d85-4ae5-b01a-51423e6ff54d_2000x1477.png" width="1456" height="1075" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a18d7877-3d85-4ae5-b01a-51423e6ff54d_2000x1477.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1075,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:499310,&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://blog.levelupcoding.com/i/189857171?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18d7877-3d85-4ae5-b01a-51423e6ff54d_2000x1477.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_!O90Y!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18d7877-3d85-4ae5-b01a-51423e6ff54d_2000x1477.png 424w, https://substackcdn.com/image/fetch/$s_!O90Y!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18d7877-3d85-4ae5-b01a-51423e6ff54d_2000x1477.png 848w, https://substackcdn.com/image/fetch/$s_!O90Y!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18d7877-3d85-4ae5-b01a-51423e6ff54d_2000x1477.png 1272w, https://substackcdn.com/image/fetch/$s_!O90Y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18d7877-3d85-4ae5-b01a-51423e6ff54d_2000x1477.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 role="img" 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><title></title><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>Think of REST as the web&#8217;s &#8220;grammar&#8221; for talking about resources. Once you learn it for one API, others feel familiar because they follow the same structure.</p><h2>How a REST API actually works</h2><p>A REST API is basically: <strong>resources + URIs + HTTP semantics</strong>.</p><ul><li><p><strong>Resources</strong> &#8594; Domain nouns like <code>users</code>, <code>orders</code>, <code>products</code>, <code>employees</code></p></li><li><p><strong>URIs</strong> &#8594; Stable paths: <code>/products</code>, <code>/products/42</code>, <code>/customers/123/orders</code></p></li><li><p><strong>Methods</strong> &#8594; Map closely to CRUD:</p><ul><li><p><code>GET</code> &#8594; Read</p></li><li><p><code>POST</code> &#8594; Create</p></li><li><p><code>PUT</code> / <code>PATCH</code> &#8594; Update</p></li><li><p><code>DELETE</code> &#8594; Remove</p></li></ul></li></ul><p>Add to that:</p><ul><li><p><strong>Representations</strong> &#8594; Usually JSON documents that describe the resource state</p></li><li><p><strong>Status codes</strong> &#8594; Shared language for outcomes (<code>200 OK</code>, <code>201 Created</code>, <code>404 Not Found</code>, <code>500 Internal Server Error</code>)</p></li><li><p><strong>Caching</strong> &#8594; <code>GET</code> endpoints designed to be safely cached at browser, proxy, or CDN layers</p></li></ul><p>For example: in an e-commerce API, <code>GET /products</code> lists items, <code>GET /products/123</code> shows one product, <code>POST /orders</code> creates an order, and <code>GET /customers/123/orders</code> lists a customer&#8217;s history. Internally, the server can switch databases or split into microservices, but as long as those URIs and contracts stay stable, clients don&#8217;t care.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!oVgt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a309145-644f-4041-a4db-4523ac36a61f_1225x572.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!oVgt!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a309145-644f-4041-a4db-4523ac36a61f_1225x572.png 424w, https://substackcdn.com/image/fetch/$s_!oVgt!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a309145-644f-4041-a4db-4523ac36a61f_1225x572.png 848w, https://substackcdn.com/image/fetch/$s_!oVgt!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a309145-644f-4041-a4db-4523ac36a61f_1225x572.png 1272w, https://substackcdn.com/image/fetch/$s_!oVgt!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a309145-644f-4041-a4db-4523ac36a61f_1225x572.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!oVgt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a309145-644f-4041-a4db-4523ac36a61f_1225x572.png" width="1225" height="572" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3a309145-644f-4041-a4db-4523ac36a61f_1225x572.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:572,&quot;width&quot;:1225,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:203039,&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://blog.levelupcoding.com/i/189857171?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a309145-644f-4041-a4db-4523ac36a61f_1225x572.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_!oVgt!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a309145-644f-4041-a4db-4523ac36a61f_1225x572.png 424w, https://substackcdn.com/image/fetch/$s_!oVgt!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a309145-644f-4041-a4db-4523ac36a61f_1225x572.png 848w, https://substackcdn.com/image/fetch/$s_!oVgt!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a309145-644f-4041-a4db-4523ac36a61f_1225x572.png 1272w, https://substackcdn.com/image/fetch/$s_!oVgt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a309145-644f-4041-a4db-4523ac36a61f_1225x572.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 role="img" 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><title></title><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 REST became the default</h2><p>REST won not because it&#8217;s perfect, but because the trade-offs line up well with how most applications work.</p><ul><li><p><strong>Simple to learn</strong> &#8594; You can poke at a REST API with a browser or <code>curl</code> because it&#8217;s just HTTP</p></li><li><p><strong>Interoperable</strong> &#8594; Any language, framework, or device that can speak HTTP can be a client</p></li><li><p><strong>Scalable</strong> &#8594; Stateless servers are easy to scale horizontally behind a load balancer</p></li><li><p><strong>Fast enough</strong> &#8594; Built-in HTTP caching plus lightweight JSON is plenty for most CRUD-style workloads</p></li><li><p><strong>Decoupled</strong> &#8594; Backend teams can refactor internals or swap infrastructure without breaking clients</p></li><li><p><strong>Great tooling</strong> &#8594; OpenAPI, Postman, language SDK generators, gateways, and observability stacks all &#8220;speak REST&#8221;</p></li></ul><p>If your domain is resource-centric (products, posts, users, tickets) and most operations are CRUD-ish, REST is usually the path of least resistance.</p><h2>Where REST starts to creak</h2><p>REST&#8217;s weaknesses show up once your data needs get more complex or more demanding than &#8220;list + detail&#8221;:</p><ul><li><p><strong>Over-fetching</strong> &#8594; Clients get big objects when they only needed a few fields</p></li><li><p><strong>Under-fetching</strong> &#8594; Clients chain multiple calls (<code>user</code>, then <code>orders</code>, then <code>recommendations</code>) to render one screen</p></li><li><p><strong>Chattiness</strong> &#8594; Many small HTTP requests stack up latency, especially on mobile networks</p></li><li><p><strong>Loose contracts</strong> &#8594; JSON shapes are enforced by convention and docs, not by the protocol itself</p></li><li><p><strong>Versioning pain</strong> &#8594; Breaking changes often mean <code>/v2</code> endpoints or awkward backwards compatibility</p></li><li><p><strong>Real-time gaps</strong> &#8594; REST is request&#8211;response; you need WebSockets or SSE for live updates</p></li></ul><p>These aren&#8217;t fatal flaws, but they&#8217;re signals that you might need something <em>in addition</em> to REST.</p><h2>REST vs GraphQL vs gRPC: choosing wisely</h2><p>You don&#8217;t have to pick a single style for everything. Use them where they fit best: </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!W-GC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99eb1e62-a545-4db7-bad2-8206a850aa89_2000x886.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!W-GC!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99eb1e62-a545-4db7-bad2-8206a850aa89_2000x886.png 424w, https://substackcdn.com/image/fetch/$s_!W-GC!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99eb1e62-a545-4db7-bad2-8206a850aa89_2000x886.png 848w, https://substackcdn.com/image/fetch/$s_!W-GC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99eb1e62-a545-4db7-bad2-8206a850aa89_2000x886.png 1272w, https://substackcdn.com/image/fetch/$s_!W-GC!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99eb1e62-a545-4db7-bad2-8206a850aa89_2000x886.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!W-GC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99eb1e62-a545-4db7-bad2-8206a850aa89_2000x886.png" width="1456" height="645" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/99eb1e62-a545-4db7-bad2-8206a850aa89_2000x886.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:645,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:394294,&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://blog.levelupcoding.com/i/189857171?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99eb1e62-a545-4db7-bad2-8206a850aa89_2000x886.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_!W-GC!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99eb1e62-a545-4db7-bad2-8206a850aa89_2000x886.png 424w, https://substackcdn.com/image/fetch/$s_!W-GC!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99eb1e62-a545-4db7-bad2-8206a850aa89_2000x886.png 848w, https://substackcdn.com/image/fetch/$s_!W-GC!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99eb1e62-a545-4db7-bad2-8206a850aa89_2000x886.png 1272w, https://substackcdn.com/image/fetch/$s_!W-GC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99eb1e62-a545-4db7-bad2-8206a850aa89_2000x886.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 role="img" 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><title></title><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>A good rule of thumb:</p><ul><li><p><strong>Start with REST</strong> &#8594; because it&#8217;s simple, well-understood, and easy to expose externally</p></li><li><p><strong>Add GraphQL</strong> &#8594; when specific clients juggle too many REST calls or need tailored payloads</p></li><li><p><strong>Use gRPC</strong> &#8594; inside your backend when performance, streaming, or strong typing is critical</p></li></ul><h2>When not to use REST</h2><p>Avoid pure REST as the main interface when:</p><ul><li><p>Your main goal is to <strong>query complex data</strong>, not manage individual resources.</p></li><li><p>Your services call each other <strong>thousands of times per second</strong> and every millisecond and byte counts</p></li><li><p>Your clients need <strong>live streams of updates</strong>, not occasional snapshots</p></li></ul><p>In these cases, REST can still play a supporting role (for management, control, or external access), but it shouldn&#8217;t carry the whole workload.</p><h2>Recap</h2><p>REST is more than JSON over HTTP. It&#8217;s a set of constraints that, when followed, give you APIs that are simple, scalable, cacheable, and widely compatible.</p><p>Understand those principles and you can do three important things: design cleaner APIs, recognize when a &#8220;REST API&#8221; isn&#8217;t really RESTful, and know when to reach for GraphQL or gRPC instead.</p><p>That&#8217;s the difference between copying patterns and making deliberate architectural choices.</p><div><hr></div><p>&#128075; If you liked this post &#8594; Like + Restack + Share to help others learn system design.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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">&nbsp;Subscribe to get high-signal, clear, and visual system design breakdowns straight to your inbox:</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 SSO Actually Works]]></title><description><![CDATA[(5 minutes) | What actually happens when you click &#8220;Sign in with Google&#8221;]]></description><link>https://blog.levelupcoding.com/p/sso-explained</link><guid isPermaLink="false">https://blog.levelupcoding.com/p/sso-explained</guid><dc:creator><![CDATA[Nikki Siapno]]></dc:creator><pubDate>Sat, 28 Mar 2026 13:38:36 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/f25a42d6-fb1e-4bdc-9e08-43a3f873552a_1456x1048.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_!yLV0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yLV0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" width="1292" height="266" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:266,&quot;width&quot;:1292,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:343451,&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://lvlupcoding.substack.com/i/171357839?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.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_!yLV0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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">Get our 142-page System Design Handbook for FREE on newsletter signup:</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><h2><a href="https://lucode.co/guide-build-multi-agent-rag-system-oracle-z7nl">Build a Multi Agent RAG system with A2A Protocol and LangChain</a></h2><h5>Presented by Oracle</h5><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!MYg7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fbef3da-e004-486c-b156-5ec3af20d205_1280x720.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!MYg7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fbef3da-e004-486c-b156-5ec3af20d205_1280x720.jpeg 424w, https://substackcdn.com/image/fetch/$s_!MYg7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fbef3da-e004-486c-b156-5ec3af20d205_1280x720.jpeg 848w, https://substackcdn.com/image/fetch/$s_!MYg7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fbef3da-e004-486c-b156-5ec3af20d205_1280x720.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!MYg7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fbef3da-e004-486c-b156-5ec3af20d205_1280x720.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!MYg7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fbef3da-e004-486c-b156-5ec3af20d205_1280x720.jpeg" width="1280" height="720" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6fbef3da-e004-486c-b156-5ec3af20d205_1280x720.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:720,&quot;width&quot;:1280,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:154603,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.levelupcoding.com/i/192085891?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fbef3da-e004-486c-b156-5ec3af20d205_1280x720.jpeg&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_!MYg7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fbef3da-e004-486c-b156-5ec3af20d205_1280x720.jpeg 424w, https://substackcdn.com/image/fetch/$s_!MYg7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fbef3da-e004-486c-b156-5ec3af20d205_1280x720.jpeg 848w, https://substackcdn.com/image/fetch/$s_!MYg7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fbef3da-e004-486c-b156-5ec3af20d205_1280x720.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!MYg7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fbef3da-e004-486c-b156-5ec3af20d205_1280x720.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 role="img" 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><title></title><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>Most multi-agent systems hit a bottleneck when one agent gets overloaded. The usual fix is scaling the entire pipeline, which adds cost without solving the real problem. With the A2A protocol, agents can discover each other, declare capabilities, and dynamically share workload so you can scale only the bottleneck.</p><p><strong><a href="https://lucode.co/guide-build-multi-agent-rag-system-oracle-z7nl">This guide</a></strong> walks you through building a scalable multi-agent RAG system.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://lucode.co/guide-build-multi-agent-rag-system-oracle-z7nl&quot;,&quot;text&quot;:&quot;Start building&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://lucode.co/guide-build-multi-agent-rag-system-oracle-z7nl"><span>Start building</span></a></p><div><hr></div><h1>How Single Sign-On Actually Works</h1><p>You&#8217;ve used SSO dozens of times without thinking about it.</p><p>You click &#8220;Sign in with Google,&#8221; land on a familiar login page, and seconds later you&#8217;re inside an app that never asked for your password.</p><p>It felt instant and frictionless.</p><p>But behind that smooth experience is a precise sequence of redirects, tokens, and cryptographic checks played out in an instant.</p><p>SSO isn&#8217;t magic. It&#8217;s a trust protocol; and understanding it changes how you design authentication, debug login failures, and make decisions about identity infrastructure.</p><h2>The core idea: Centralize identity, decentralize access</h2><p>At its heart, SSO separates authentication from application logic.</p><p>Instead of every app verifying usernames and passwords, one central service does it. That service is called the <strong>Identity Provider (IdP)</strong>. The applications you actually use are called <strong>Service Providers (SPs)</strong>.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cUWE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcecc6857-5dc7-4c2b-b4c0-a6db34dd6e61_2000x1083.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cUWE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcecc6857-5dc7-4c2b-b4c0-a6db34dd6e61_2000x1083.png 424w, https://substackcdn.com/image/fetch/$s_!cUWE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcecc6857-5dc7-4c2b-b4c0-a6db34dd6e61_2000x1083.png 848w, https://substackcdn.com/image/fetch/$s_!cUWE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcecc6857-5dc7-4c2b-b4c0-a6db34dd6e61_2000x1083.png 1272w, https://substackcdn.com/image/fetch/$s_!cUWE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcecc6857-5dc7-4c2b-b4c0-a6db34dd6e61_2000x1083.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cUWE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcecc6857-5dc7-4c2b-b4c0-a6db34dd6e61_2000x1083.png" width="1456" height="788" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cecc6857-5dc7-4c2b-b4c0-a6db34dd6e61_2000x1083.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:788,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:419332,&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://blog.levelupcoding.com/i/192175942?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcecc6857-5dc7-4c2b-b4c0-a6db34dd6e61_2000x1083.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_!cUWE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcecc6857-5dc7-4c2b-b4c0-a6db34dd6e61_2000x1083.png 424w, https://substackcdn.com/image/fetch/$s_!cUWE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcecc6857-5dc7-4c2b-b4c0-a6db34dd6e61_2000x1083.png 848w, https://substackcdn.com/image/fetch/$s_!cUWE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcecc6857-5dc7-4c2b-b4c0-a6db34dd6e61_2000x1083.png 1272w, https://substackcdn.com/image/fetch/$s_!cUWE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcecc6857-5dc7-4c2b-b4c0-a6db34dd6e61_2000x1083.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 role="img" 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><title></title><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 key shift is this: SPs don&#8217;t authenticate you. They verify that the IdP authenticated you.</p><p>That distinction matters because it defines who owns credentials, who signs tokens, and who enforces trust.</p><h2>Why browsers make this necessary</h2><p>Browsers enforce the same-origin policy. That means one website cannot read another website&#8217;s cookies.</p><p>So if <code>app1.com</code> and <code>app2.com</code> are separate domains, they cannot directly share login sessions.</p><p>SSO solves this by introducing a trusted third party: the IdP lives on its own domain (e.g. <code>login.company.com</code>). Each application redirects you there when authentication is required. The IdP becomes the only place where credentials are checked.</p><p>Instead of apps sharing cookies, they share trust.</p><h2>The step-by-step flow</h2><p>Here&#8217;s what happens when you access an SSO-protected app for the first time:</p><h3>1. User requests a protected app</h3><p>You visit <code>serviceprovider.com</code>.</p><p>The SP checks for a valid session cookie, finds none, and knows it needs to authenticate you.</p><h3>2. SP redirects to the IdP</h3><p>Instead of showing a login form, the SP issues a HTTP redirect to the IdP.</p><p>That redirect includes:</p><ul><li><p>A request identifying the SP</p></li><li><p>A return URL</p></li><li><p>Possibly a signed authentication request</p></li></ul><p>Your browser now talks to the IdP.</p><h3>3. IdP authenticates the user</h3><p>If you&#8217;re not already logged in at the IdP, it presents a login page.</p><p>You enter credentials. The IdP verifies them. It may also enforce:</p><ul><li><p>Multi-factor authentication</p></li><li><p>Device checks</p></li><li><p>Risk-based policies</p></li></ul><p>If successful, the IdP creates its own session cookie for you.</p><h3>4. IdP issues a token</h3><p>The IdP generates an authentication token. This token contains:</p><ul><li><p>User identity</p></li><li><p>Issuer (the IdP)</p></li><li><p>Audience (the SP)</p></li><li><p>Expiration timestamp</p></li><li><p>Digital signature</p></li></ul><p>The browser is redirected back to the SP with this token attached.</p><h3>5. SP validates the token</h3><p>The SP verifies:</p><ul><li><p><strong>Signature</strong> &#8594; Was it signed by the trusted IdP?</p></li><li><p><strong>Expiry</strong> &#8594; Is it still valid?</p></li><li><p><strong>Audience</strong> &#8594; Was it intended for this app?</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_!JdOr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa86a91b6-6ac5-4737-9793-05c5cb0f5e96_2000x1268.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JdOr!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa86a91b6-6ac5-4737-9793-05c5cb0f5e96_2000x1268.png 424w, https://substackcdn.com/image/fetch/$s_!JdOr!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa86a91b6-6ac5-4737-9793-05c5cb0f5e96_2000x1268.png 848w, https://substackcdn.com/image/fetch/$s_!JdOr!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa86a91b6-6ac5-4737-9793-05c5cb0f5e96_2000x1268.png 1272w, https://substackcdn.com/image/fetch/$s_!JdOr!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa86a91b6-6ac5-4737-9793-05c5cb0f5e96_2000x1268.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JdOr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa86a91b6-6ac5-4737-9793-05c5cb0f5e96_2000x1268.png" width="1456" height="923" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a86a91b6-6ac5-4737-9793-05c5cb0f5e96_2000x1268.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:923,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:436485,&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://blog.levelupcoding.com/i/192175942?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa86a91b6-6ac5-4737-9793-05c5cb0f5e96_2000x1268.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_!JdOr!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa86a91b6-6ac5-4737-9793-05c5cb0f5e96_2000x1268.png 424w, https://substackcdn.com/image/fetch/$s_!JdOr!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa86a91b6-6ac5-4737-9793-05c5cb0f5e96_2000x1268.png 848w, https://substackcdn.com/image/fetch/$s_!JdOr!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa86a91b6-6ac5-4737-9793-05c5cb0f5e96_2000x1268.png 1272w, https://substackcdn.com/image/fetch/$s_!JdOr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa86a91b6-6ac5-4737-9793-05c5cb0f5e96_2000x1268.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 role="img" 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><title></title><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>If everything checks out, the SP creates its own session and logs the user in.</p><p>At no point did the SP see the password.</p><h2>Where &#8220;single&#8221; sign-on actually happens</h2><p>The magic appears when you visit a second application.</p><p>You go to <code>anotherservice.com</code>.</p><p>It redirects you to the same IdP.</p><p>But now the IdP sees its session cookie. You&#8217;re already authenticated.</p><p>So it immediately generates a new token for the second app without asking for credentials again.</p><p>From your perspective, no login screen appears.</p><p>Behind the scenes, the full protocol still runs. It just skips the credential step.</p><p>That&#8217;s single sign-on.</p><h2>What makes it secure</h2><p>The authentication token is the core artifact. Its security rests on three properties:</p><ul><li><p><strong>Digital signature</strong> &#8594; The IdP signs the token with its private key. The SP verifies the signature with the IdP&#8217;s public key, proving the token wasn&#8217;t forged or altered in transit.</p></li><li><p><strong>Bounded lifetime</strong> &#8594; Tokens include an expiry timestamp. A stolen token becomes useless after minutes, limiting the blast radius of interception.</p></li><li><p><strong>Audience restriction</strong> &#8594; Tokens name the intended SP. A token issued for <code>app1.com</code> is rejected by <code>app2.com</code>, preventing token reuse across services.</p></li></ul><p>The SP never sees the user&#8217;s password. It only sees the signed assertion.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!NNfK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F649ab52f-5a0c-4b30-9b11-a0b48ae03c79_2000x1260.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!NNfK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F649ab52f-5a0c-4b30-9b11-a0b48ae03c79_2000x1260.png 424w, https://substackcdn.com/image/fetch/$s_!NNfK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F649ab52f-5a0c-4b30-9b11-a0b48ae03c79_2000x1260.png 848w, https://substackcdn.com/image/fetch/$s_!NNfK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F649ab52f-5a0c-4b30-9b11-a0b48ae03c79_2000x1260.png 1272w, https://substackcdn.com/image/fetch/$s_!NNfK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F649ab52f-5a0c-4b30-9b11-a0b48ae03c79_2000x1260.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!NNfK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F649ab52f-5a0c-4b30-9b11-a0b48ae03c79_2000x1260.png" width="1456" height="917" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/649ab52f-5a0c-4b30-9b11-a0b48ae03c79_2000x1260.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:917,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:416285,&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://blog.levelupcoding.com/i/192175942?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F649ab52f-5a0c-4b30-9b11-a0b48ae03c79_2000x1260.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_!NNfK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F649ab52f-5a0c-4b30-9b11-a0b48ae03c79_2000x1260.png 424w, https://substackcdn.com/image/fetch/$s_!NNfK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F649ab52f-5a0c-4b30-9b11-a0b48ae03c79_2000x1260.png 848w, https://substackcdn.com/image/fetch/$s_!NNfK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F649ab52f-5a0c-4b30-9b11-a0b48ae03c79_2000x1260.png 1272w, https://substackcdn.com/image/fetch/$s_!NNfK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F649ab52f-5a0c-4b30-9b11-a0b48ae03c79_2000x1260.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 role="img" 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><title></title><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>When SSO becomes a risk</h2><p>SSO centralizes authentication. That&#8217;s powerful, but it concentrates risk.</p><ul><li><p><strong>If the IdP goes down</strong> &#8594; every SP login fails</p></li><li><p><strong>If the IdP is compromised</strong> &#8594; every integrated app is exposed</p></li></ul><p>SSO reduces password sprawl but increases dependency on identity infrastructure.</p><p><strong>It works best when:</strong></p><ul><li><p>The app is used by teams or organizations, not just individuals</p></li><li><p>Customers expect centralized admin control (onboarding, offboarding, permissions)</p></li><li><p>The app handles sensitive data or privileged actions (finance, customer data, infra, admin tooling)</p></li><li><p>You&#8217;re selling into mid-market or enterprise, where SSO is often a requirement</p></li><li><p>Users are part of a broader ecosystem (Google Workspace, Entra, Okta) and need seamless access across tools</p></li><li><p>The product is part of a multi-app suite, and reducing login friction improves workflow</p></li></ul><p><strong>It may be overkill for:</strong></p><ul><li><p>Consumer apps with individual users and no org-level administration</p></li><li><p>Early-stage products where few (or no) customers are asking for SSO yet</p></li><li><p>Low-risk applications that don&#8217;t handle sensitive data or critical operations</p></li><li><p>Small internal tools used by a fixed group, especially behind VPN or other trust boundaries</p></li><li><p>Apps where identity is not central to the workflow and login happens infrequently</p></li></ul><h2>Wrapping up</h2><p>SSO removes the password from your app.</p><p>It doesn&#8217;t remove the responsibility.</p><p>Token validation, session expiry, single logout, and IdP availability all stay on your plate; and they matter more, not less, because authentication is now shared infrastructure.</p><p>The protocol handles the authentication. Everything that follows is still yours to design.</p><div><hr></div><p>&#128075; If you liked this post &#8594; Like + Restack + Share to help others learn system design.</p><div><hr></div><p>Subscribe to get high-signal, clear, and visual system design breakdowns straight to your inbox:</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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">&nbsp;</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[Hashing vs Encryption vs Tokenization]]></title><description><![CDATA[(5 minutes) | One question decides which one you should use...]]></description><link>https://blog.levelupcoding.com/p/hashing-vs-encryption-vs-tokenization</link><guid isPermaLink="false">https://blog.levelupcoding.com/p/hashing-vs-encryption-vs-tokenization</guid><dc:creator><![CDATA[Nikki Siapno]]></dc:creator><pubDate>Tue, 24 Mar 2026 10:34:31 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/829281df-7d1d-4638-a140-154f2ea93252_1456x1048.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_!yLV0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yLV0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" width="1292" height="266" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:266,&quot;width&quot;:1292,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:343451,&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://lvlupcoding.substack.com/i/171357839?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.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_!yLV0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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">Get our 142-page System Design Handbook for FREE on newsletter signup:</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><h2><a href="https://lucode.co/flox-z7nl">Reproducible Dev Environments That Work Everywhere</a></h2><h5>Presented by Flox</h5><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!YRn8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac69ee37-aa29-4999-bde2-f3b78d2a71b0_1209x461.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!YRn8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac69ee37-aa29-4999-bde2-f3b78d2a71b0_1209x461.png 424w, https://substackcdn.com/image/fetch/$s_!YRn8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac69ee37-aa29-4999-bde2-f3b78d2a71b0_1209x461.png 848w, https://substackcdn.com/image/fetch/$s_!YRn8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac69ee37-aa29-4999-bde2-f3b78d2a71b0_1209x461.png 1272w, https://substackcdn.com/image/fetch/$s_!YRn8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac69ee37-aa29-4999-bde2-f3b78d2a71b0_1209x461.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!YRn8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac69ee37-aa29-4999-bde2-f3b78d2a71b0_1209x461.png" width="1209" height="461" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ac69ee37-aa29-4999-bde2-f3b78d2a71b0_1209x461.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:461,&quot;width&quot;:1209,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:127351,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.levelupcoding.com/i/190729549?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac69ee37-aa29-4999-bde2-f3b78d2a71b0_1209x461.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_!YRn8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac69ee37-aa29-4999-bde2-f3b78d2a71b0_1209x461.png 424w, https://substackcdn.com/image/fetch/$s_!YRn8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac69ee37-aa29-4999-bde2-f3b78d2a71b0_1209x461.png 848w, https://substackcdn.com/image/fetch/$s_!YRn8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac69ee37-aa29-4999-bde2-f3b78d2a71b0_1209x461.png 1272w, https://substackcdn.com/image/fetch/$s_!YRn8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac69ee37-aa29-4999-bde2-f3b78d2a71b0_1209x461.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 role="img" 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><title></title><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><a href="https://lucode.co/flox-z7nl">Flox</a></strong> lets teams define development environments once and run them consistently across local environments, CI pipelines, and production systems. By capturing dependencies, tools, and environment variables in a single manifest, teams can eliminate environment drift and ship software more reliably.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://lucode.co/flox-z7nl&quot;,&quot;text&quot;:&quot;Learn More&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://lucode.co/flox-z7nl"><span>Learn More</span></a></p><div><hr></div><h1>Hashing vs Encryption vs Tokenization: How to Pick the Right Tool</h1><p>Most security vulnerabilities aren&#8217;t caused by weak algorithms.</p><p>They come from using the right tool in the wrong situation.</p><p>Encrypting what should be hashed, or hashing what should be tokenized, doesn&#8217;t trigger an alarm; it just quietly erodes your defenses while everything appears to be working fine.</p><p>Hashing, encryption, and tokenization all transform sensitive data, but they answer completely different questions. Knowing which question you&#8217;re asking is the whole game.</p><h2>The core question: what are you trying to protect?</h2><p>Before picking a tool, answer one question:</p><p><strong>Do you need to recover the original value?</strong></p><ul><li><p>If no &#8594; hashing is likely the right fit.</p></li><li><p>If yes, and the goal is confidentiality &#8594; use encryption.</p></li><li><p>If yes, but the goal is limiting where sensitive data spreads &#8594; use tokenization.</p></li></ul><p>Each technique maps cleanly to a different security objective:</p><ul><li><p><strong>Hashing &#8594; Integrity and verification</strong></p></li><li><p><strong>Encryption &#8594; Confidentiality with controlled access</strong></p></li><li><p><strong>Tokenization &#8594; Exposure reduction across systems</strong></p></li></ul><p>They overlap in underlying mechanisms. They do not overlap in purpose.</p><h2>Hashing</h2><p>A cryptographic hash function takes input of any size and produces a fixed-length output called a digest. Change a single character, and the output changes completely.</p><p>It is intentionally one-way: you cannot feasibly recover the original input from the digest.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!5fM5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd918a5a7-9d3d-4efc-beb4-b12cb2c1c1bc_2000x1000.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!5fM5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd918a5a7-9d3d-4efc-beb4-b12cb2c1c1bc_2000x1000.png 424w, https://substackcdn.com/image/fetch/$s_!5fM5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd918a5a7-9d3d-4efc-beb4-b12cb2c1c1bc_2000x1000.png 848w, https://substackcdn.com/image/fetch/$s_!5fM5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd918a5a7-9d3d-4efc-beb4-b12cb2c1c1bc_2000x1000.png 1272w, https://substackcdn.com/image/fetch/$s_!5fM5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd918a5a7-9d3d-4efc-beb4-b12cb2c1c1bc_2000x1000.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!5fM5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd918a5a7-9d3d-4efc-beb4-b12cb2c1c1bc_2000x1000.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d918a5a7-9d3d-4efc-beb4-b12cb2c1c1bc_2000x1000.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:339005,&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://blog.levelupcoding.com/i/191344843?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd918a5a7-9d3d-4efc-beb4-b12cb2c1c1bc_2000x1000.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_!5fM5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd918a5a7-9d3d-4efc-beb4-b12cb2c1c1bc_2000x1000.png 424w, https://substackcdn.com/image/fetch/$s_!5fM5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd918a5a7-9d3d-4efc-beb4-b12cb2c1c1bc_2000x1000.png 848w, https://substackcdn.com/image/fetch/$s_!5fM5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd918a5a7-9d3d-4efc-beb4-b12cb2c1c1bc_2000x1000.png 1272w, https://substackcdn.com/image/fetch/$s_!5fM5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd918a5a7-9d3d-4efc-beb4-b12cb2c1c1bc_2000x1000.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 role="img" 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><title></title><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>Hashing is built for <strong>integrity</strong>:</p><ul><li><p>Verifying file downloads</p></li><li><p>Detecting message tampering</p></li><li><p>Supporting digital signatures</p></li><li><p>Storing passwords (with specialized constructions)</p></li></ul><p>But hashing has a subtlety most developers miss: <strong>not all hashing is the same</strong>.</p><ul><li><p><strong>Unkeyed hash (e.g. SHA-256)</strong> &#8594; Confirm that data hasn&#8217;t changed, but only through a trusted channel. An attacker who controls both the file and its published digest can swap both.</p></li><li><p><strong>Keyed hash (e.g. HMAC)</strong> &#8594; Use a shared secret to authenticate data against an active attacker. Required when you need integrity <em>and</em> authenticity.</p></li><li><p><strong>Password hashing (e.g. Argon2, scrypt, bcrypt)</strong> &#8594; A specialized case. Deliberately slow and memory-hard to make brute-force attacks expensive after a database breach. Never use SHA-256 for passwords.</p></li></ul><p>The most common failure here is using a fast, unkeyed hash as a stand-in for authentication.</p><p>It isn&#8217;t.</p><p><strong>What hashing cannot do:</strong></p><ul><li><p>It cannot provide confidentiality.</p></li><li><p>It cannot restore data.</p></li><li><p>It does not automatically provide authentication unless keyed.</p></li></ul><p>If you need the original value later, hashing is the wrong tool.</p><h2>Encryption</h2><p>Encryption transforms plaintext into ciphertext using a key. Only someone with the right key can reverse it.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!4juA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c0cf7b3-e6d6-45bd-832c-3602f758236c_2000x1000.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4juA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c0cf7b3-e6d6-45bd-832c-3602f758236c_2000x1000.png 424w, https://substackcdn.com/image/fetch/$s_!4juA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c0cf7b3-e6d6-45bd-832c-3602f758236c_2000x1000.png 848w, https://substackcdn.com/image/fetch/$s_!4juA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c0cf7b3-e6d6-45bd-832c-3602f758236c_2000x1000.png 1272w, https://substackcdn.com/image/fetch/$s_!4juA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c0cf7b3-e6d6-45bd-832c-3602f758236c_2000x1000.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4juA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c0cf7b3-e6d6-45bd-832c-3602f758236c_2000x1000.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8c0cf7b3-e6d6-45bd-832c-3602f758236c_2000x1000.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:370155,&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://blog.levelupcoding.com/i/191344843?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c0cf7b3-e6d6-45bd-832c-3602f758236c_2000x1000.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_!4juA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c0cf7b3-e6d6-45bd-832c-3602f758236c_2000x1000.png 424w, https://substackcdn.com/image/fetch/$s_!4juA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c0cf7b3-e6d6-45bd-832c-3602f758236c_2000x1000.png 848w, https://substackcdn.com/image/fetch/$s_!4juA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c0cf7b3-e6d6-45bd-832c-3602f758236c_2000x1000.png 1272w, https://substackcdn.com/image/fetch/$s_!4juA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c0cf7b3-e6d6-45bd-832c-3602f758236c_2000x1000.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 role="img" 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><title></title><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>Unlike hashing, encryption is reversible by design.</p><p>This makes it the right tool for confidentiality:</p><ul><li><p>Data in transit (TLS)</p></li><li><p>Data at rest (disk/database encryption)</p></li><li><p>Secure messaging</p></li><li><p>Secure storage</p></li></ul><p>Modern encryption comes in two main shapes:</p><ul><li><p><strong>Symmetric encryption (AES)</strong> &#8594; The same key encrypts and decrypts. Fast and designed for bulk data.</p></li><li><p><strong>Asymmetric encryption (RSA, ECC)</strong> &#8594; Public key encrypts, private key decrypts. Slower, used primarily for key exchange and signatures, not bulk data.</p></li></ul><p>Real systems almost always use <strong>hybrid encryption</strong>: symmetric encryption for the data itself, asymmetric encryption to securely exchange the symmetric key. TLS works exactly this way.</p><p>There&#8217;s one critical nuance: <strong>confidentiality is not the same as integrity</strong>.</p><p>Today, encryption without integrity is considered incomplete. Authenticated Encryption with Associated Data (AEAD), such as AES-GCM, protects both:</p><ul><li><p><strong>Confidentiality</strong> &#8594; Attackers can&#8217;t read it.</p></li><li><p><strong>Integrity/authenticity</strong> &#8594; Attackers can&#8217;t modify it undetected .</p></li></ul><p>Older designs that are encrypted without authentication can be manipulated by an attacker who never sees the plaintext. This is why AEAD is now strongly preferred.</p><p>What encryption optimizes for:</p><ul><li><p>Controlled access to original data</p></li><li><p>Strong confidentiality guarantees</p></li><li><p>Regulatory recognition (GDPR, HIPAA references encryption explicitly)</p></li></ul><p>But encryption introduces a heavy dependency:</p><p>Key management.</p><p>Key lifecycle, rotation, storage (often HSM-backed), and cryptoperiod policies become first-class concerns.</p><p>Encryption protects content. It does not reduce how widely that content spreads.</p><h2>Tokenization</h2><p>Tokenization replaces a sensitive value with a surrogate &#8220;token&#8221;. The token carries no exploitable meaning on its own.</p><p>For example, in payment systems a PAN (Primary Account Number) becomes a token and downstream systems store the token, not the card number.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QpNL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8eea45d5-3f70-4fef-bfa3-0466fa21a608_2000x1000.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QpNL!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8eea45d5-3f70-4fef-bfa3-0466fa21a608_2000x1000.png 424w, https://substackcdn.com/image/fetch/$s_!QpNL!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8eea45d5-3f70-4fef-bfa3-0466fa21a608_2000x1000.png 848w, https://substackcdn.com/image/fetch/$s_!QpNL!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8eea45d5-3f70-4fef-bfa3-0466fa21a608_2000x1000.png 1272w, https://substackcdn.com/image/fetch/$s_!QpNL!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8eea45d5-3f70-4fef-bfa3-0466fa21a608_2000x1000.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QpNL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8eea45d5-3f70-4fef-bfa3-0466fa21a608_2000x1000.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8eea45d5-3f70-4fef-bfa3-0466fa21a608_2000x1000.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:293321,&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://blog.levelupcoding.com/i/191344843?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8eea45d5-3f70-4fef-bfa3-0466fa21a608_2000x1000.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_!QpNL!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8eea45d5-3f70-4fef-bfa3-0466fa21a608_2000x1000.png 424w, https://substackcdn.com/image/fetch/$s_!QpNL!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8eea45d5-3f70-4fef-bfa3-0466fa21a608_2000x1000.png 848w, https://substackcdn.com/image/fetch/$s_!QpNL!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8eea45d5-3f70-4fef-bfa3-0466fa21a608_2000x1000.png 1272w, https://substackcdn.com/image/fetch/$s_!QpNL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8eea45d5-3f70-4fef-bfa3-0466fa21a608_2000x1000.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 role="img" 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><title></title><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 difference from encryption is architectural:</p><ul><li><p>Encryption protects data.</p></li><li><p>Tokenization limits exposure of data across systems.</p></li></ul><p>Encryption is the answer to &#8220;how do we hide this data?&#8221;. Tokenization is the answer to &#8220;how do we stop this data from spreading?&#8221;.</p><p>There are three main implementations:</p><ul><li><p><strong>Vault-based tokenization</strong> &#8594; A random token is generated and stored alongside the original value in a protected database (the vault). De-tokenization means querying the vault. Simple to reason about, but the vault becomes your highest-value attack target.</p></li><li><p><strong>Vaultless (cryptographic) tokenization</strong> &#8594; The token is generated using format-preserving encryption. No vault needed, but key management becomes critical.</p></li><li><p><strong>Irreversible tokenization</strong> &#8594; Tokens are never designed to be reversed. Used when you only need to validate or reference a record, not recover the original value.</p></li></ul><p>Tokenization earns its place in regulated environments because it limits <em>where</em> sensitive data lives.</p><h2>Side-by-side comparison</h2><p>Hashing, encryption, and tokenization all transform data, but they protect it in very different ways.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!H5bd!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06e18d9e-15cb-44e4-9de6-9dc88cdc1bcc_2000x1474.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!H5bd!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06e18d9e-15cb-44e4-9de6-9dc88cdc1bcc_2000x1474.png 424w, https://substackcdn.com/image/fetch/$s_!H5bd!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06e18d9e-15cb-44e4-9de6-9dc88cdc1bcc_2000x1474.png 848w, https://substackcdn.com/image/fetch/$s_!H5bd!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06e18d9e-15cb-44e4-9de6-9dc88cdc1bcc_2000x1474.png 1272w, https://substackcdn.com/image/fetch/$s_!H5bd!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06e18d9e-15cb-44e4-9de6-9dc88cdc1bcc_2000x1474.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!H5bd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06e18d9e-15cb-44e4-9de6-9dc88cdc1bcc_2000x1474.png" width="1456" height="1073" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/06e18d9e-15cb-44e4-9de6-9dc88cdc1bcc_2000x1474.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1073,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:497471,&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://blog.levelupcoding.com/i/191344843?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06e18d9e-15cb-44e4-9de6-9dc88cdc1bcc_2000x1474.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_!H5bd!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06e18d9e-15cb-44e4-9de6-9dc88cdc1bcc_2000x1474.png 424w, https://substackcdn.com/image/fetch/$s_!H5bd!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06e18d9e-15cb-44e4-9de6-9dc88cdc1bcc_2000x1474.png 848w, https://substackcdn.com/image/fetch/$s_!H5bd!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06e18d9e-15cb-44e4-9de6-9dc88cdc1bcc_2000x1474.png 1272w, https://substackcdn.com/image/fetch/$s_!H5bd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06e18d9e-15cb-44e4-9de6-9dc88cdc1bcc_2000x1474.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 role="img" 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><title></title><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>When not to use each</h2><p>Knowing when <em>not</em> to reach for a tool is as important as knowing when to use it.</p><p><strong>Don&#8217;t use hashing when:</strong></p><ul><li><p>You need to retrieve the original value. A hash is a one-way door.</p></li><li><p>You&#8217;re protecting a password with a fast algorithm like SHA-256. Use bcrypt, scrypt, or Argon2 instead, because speed is the enemy of password security.</p></li><li><p>You&#8217;re treating an unkeyed hash as a MAC. It isn&#8217;t, and extension attacks will prove it.</p></li></ul><p><strong>Don&#8217;t use encryption when:</strong></p><ul><li><p>You never need to read the original value back. Hashing is simpler and removes the key-management burden.</p></li><li><p>You&#8217;re trying to limit data spread across services. Encrypting a PAN and sending the ciphertext everywhere just moves the problem; tokenization removes it.</p></li></ul><p><strong>Don&#8217;t use tokenization when:</strong></p><ul><li><p>Your system is small and doesn&#8217;t have a serious compliance or data-minimization requirement. Running a vault adds availability dependencies and operational overhead that may not be justified.</p></li><li><p>You need the original value to be queryable for range scans or analytics joins. Tokenization scatters values in ways that break ordering and aggregation.</p></li></ul><h2>Recap</h2><p>Hashing, encryption, and tokenization aren&#8217;t variations of the same idea; they&#8217;re answers to different questions.</p><p>Hash when you need to verify. Encrypt when you need to retrieve. Tokenize when you need to contain.</p><p>Get the question wrong and the technique doesn&#8217;t fail loudly; it just quietly protects the wrong thing.</p><p>The algorithm is rarely the problem. The choice usually is.</p><div><hr></div><p>&#128075; If you liked this post &#8594; Like + Restack + Share to help others learn system design.</p><div><hr></div><p>Subscribe to get high-signal, clear, and visual system design breakdowns straight to your inbox:</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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">&nbsp;</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[Sync vs Async Clearly Explained]]></title><description><![CDATA[(5 minutes) | One design choice determines if your system blocks or flows.]]></description><link>https://blog.levelupcoding.com/p/sync-vs-async-communication</link><guid isPermaLink="false">https://blog.levelupcoding.com/p/sync-vs-async-communication</guid><dc:creator><![CDATA[Nikki Siapno]]></dc:creator><pubDate>Sat, 21 Mar 2026 11:54:22 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/b014a247-2f6d-4888-8107-420d83cc2bd5_1456x1048.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_!yLV0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yLV0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" width="1292" height="266" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:266,&quot;width&quot;:1292,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:343451,&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://lvlupcoding.substack.com/i/171357839?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.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_!yLV0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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">Get our 142-page System Design Handbook for FREE on newsletter signup:</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><h2><a href="https://lucode.co/aiven-free-tier-competition-z7nl">The Aiven Free Tier Competition</a></h2><h5>Presented by Aiven</h5><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!kQ9r!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F461f1a79-1e1f-4d71-8fe1-0e67252c9561_800x445.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!kQ9r!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F461f1a79-1e1f-4d71-8fe1-0e67252c9561_800x445.jpeg 424w, https://substackcdn.com/image/fetch/$s_!kQ9r!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F461f1a79-1e1f-4d71-8fe1-0e67252c9561_800x445.jpeg 848w, https://substackcdn.com/image/fetch/$s_!kQ9r!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F461f1a79-1e1f-4d71-8fe1-0e67252c9561_800x445.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!kQ9r!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F461f1a79-1e1f-4d71-8fe1-0e67252c9561_800x445.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!kQ9r!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F461f1a79-1e1f-4d71-8fe1-0e67252c9561_800x445.jpeg" width="800" height="445" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/461f1a79-1e1f-4d71-8fe1-0e67252c9561_800x445.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:445,&quot;width&quot;:800,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:32141,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.levelupcoding.com/i/189857171?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F461f1a79-1e1f-4d71-8fe1-0e67252c9561_800x445.jpeg&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_!kQ9r!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F461f1a79-1e1f-4d71-8fe1-0e67252c9561_800x445.jpeg 424w, https://substackcdn.com/image/fetch/$s_!kQ9r!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F461f1a79-1e1f-4d71-8fe1-0e67252c9561_800x445.jpeg 848w, https://substackcdn.com/image/fetch/$s_!kQ9r!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F461f1a79-1e1f-4d71-8fe1-0e67252c9561_800x445.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!kQ9r!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F461f1a79-1e1f-4d71-8fe1-0e67252c9561_800x445.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 role="img" 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><title></title><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 best way to learn is by doing. Build with <strong><a href="https://lucode.co/aiven-free-tier-competition-z7nl">Aiven&#8217;s</a></strong> free tier services like Kafka and PostgreSQL. No credit cards, no expiring trials, just real, managed instances to help you get your project off the ground. Build, share, and win $1,000!</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://lucode.co/aiven-free-tier-competition-z7nl&quot;,&quot;text&quot;:&quot;Start building&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://lucode.co/aiven-free-tier-competition-z7nl"><span>Start building</span></a></p><div><hr></div><h1>Synchronous vs Asynchronous Communication</h1><p>Why does placing an order feel instant in one product and slow in another?</p><p>The difference is often invisible to users but fundamental to the system.</p><p>It comes down to how much of the checkout flow runs <strong>synchronously</strong>, waiting for every dependency to confirm success, versus how much runs <strong>asynchronously</strong>, allowing non-critical work to complete after the order is accepted.</p><h2>The only difference that matters: do you wait?</h2><p>Imagine clicking <strong>&#8220;Purchase&#8221;.</strong></p><p>Behind that button, the system fans out to payments, inventory, shipping, email, analytics, and fraud checks.</p><p>In a <strong>synchronous</strong> design, the checkout flow waits.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!PphT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4616ce36-3985-4030-8397-c0c9558189d9_2000x1154.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PphT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4616ce36-3985-4030-8397-c0c9558189d9_2000x1154.png 424w, https://substackcdn.com/image/fetch/$s_!PphT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4616ce36-3985-4030-8397-c0c9558189d9_2000x1154.png 848w, https://substackcdn.com/image/fetch/$s_!PphT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4616ce36-3985-4030-8397-c0c9558189d9_2000x1154.png 1272w, https://substackcdn.com/image/fetch/$s_!PphT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4616ce36-3985-4030-8397-c0c9558189d9_2000x1154.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PphT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4616ce36-3985-4030-8397-c0c9558189d9_2000x1154.png" width="1456" height="840" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4616ce36-3985-4030-8397-c0c9558189d9_2000x1154.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:840,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:518195,&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://blog.levelupcoding.com/i/189858660?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4616ce36-3985-4030-8397-c0c9558189d9_2000x1154.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_!PphT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4616ce36-3985-4030-8397-c0c9558189d9_2000x1154.png 424w, https://substackcdn.com/image/fetch/$s_!PphT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4616ce36-3985-4030-8397-c0c9558189d9_2000x1154.png 848w, https://substackcdn.com/image/fetch/$s_!PphT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4616ce36-3985-4030-8397-c0c9558189d9_2000x1154.png 1272w, https://substackcdn.com/image/fetch/$s_!PphT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4616ce36-3985-4030-8397-c0c9558189d9_2000x1154.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 role="img" 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><title></title><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 order service calls each dependency and blocks until every one responds. If payment is slow or the email service hiccups, the user stares at a spinner. Nothing moves forward until the last response comes back.</p><p>In an <strong>asynchronous</strong> design, the order is accepted first.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ogMC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb844c35b-004d-43f9-9eff-6121c636ab1f_2000x1200.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ogMC!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb844c35b-004d-43f9-9eff-6121c636ab1f_2000x1200.png 424w, https://substackcdn.com/image/fetch/$s_!ogMC!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb844c35b-004d-43f9-9eff-6121c636ab1f_2000x1200.png 848w, https://substackcdn.com/image/fetch/$s_!ogMC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb844c35b-004d-43f9-9eff-6121c636ab1f_2000x1200.png 1272w, https://substackcdn.com/image/fetch/$s_!ogMC!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb844c35b-004d-43f9-9eff-6121c636ab1f_2000x1200.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ogMC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb844c35b-004d-43f9-9eff-6121c636ab1f_2000x1200.png" width="1456" height="874" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b844c35b-004d-43f9-9eff-6121c636ab1f_2000x1200.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:874,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:515633,&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://blog.levelupcoding.com/i/189858660?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb844c35b-004d-43f9-9eff-6121c636ab1f_2000x1200.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_!ogMC!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb844c35b-004d-43f9-9eff-6121c636ab1f_2000x1200.png 424w, https://substackcdn.com/image/fetch/$s_!ogMC!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb844c35b-004d-43f9-9eff-6121c636ab1f_2000x1200.png 848w, https://substackcdn.com/image/fetch/$s_!ogMC!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb844c35b-004d-43f9-9eff-6121c636ab1f_2000x1200.png 1272w, https://substackcdn.com/image/fetch/$s_!ogMC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb844c35b-004d-43f9-9eff-6121c636ab1f_2000x1200.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 role="img" 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><title></title><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 system records the order, responds to the user, and emits messages for the rest of the work. Payment confirmation, receipts, analytics, and fulfillment happen independently, often through a queue or event bus, without holding the checkout flow hostage.</p><p>That&#8217;s the real distinction.</p><p>Synchronous communication means sending a request and <strong>waiting</strong> for a reply before continuing.</p><p>Asynchronous communication means sending a message and <strong>moving on</strong>, trusting the system to finish the work later.</p><h2>Synchronous communication: wait for the response</h2><p>Synchronous calls feel clean because the control flow stays linear:</p><ul><li><p><strong>Inline response</strong> &#8594; you get a result (or error) right away, in the same execution path.</p></li><li><p><strong>Known outcome on return</strong> &#8594; the caller knows whether it succeeded as soon as the call finishes.</p></li><li><p><strong>User-facing fit</strong> &#8594; logins, reads, validations, and short operations match the &#8220;user is waiting&#8221; model.</p></li></ul><p>But synchronous has <strong>temporal coupling</strong> (dependency on being up <em>at the same time</em>). If the downstream service slows down or fails, the caller waits, times out, or fails too; often turning one slow component into a platform-wide incident.</p><p>It also stacks latency. A single call can be fast, but a <em>chain</em> of calls is serial: A waits for B, then B waits for C, and the user waits for all of it. Under load, threads pile up waiting and throughput collapses.</p><h3>When not to use synchronous communication</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!almE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59f4cb03-6dfd-4902-91f5-20e0a4593ffa_2001x730.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!almE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59f4cb03-6dfd-4902-91f5-20e0a4593ffa_2001x730.png 424w, https://substackcdn.com/image/fetch/$s_!almE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59f4cb03-6dfd-4902-91f5-20e0a4593ffa_2001x730.png 848w, https://substackcdn.com/image/fetch/$s_!almE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59f4cb03-6dfd-4902-91f5-20e0a4593ffa_2001x730.png 1272w, https://substackcdn.com/image/fetch/$s_!almE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59f4cb03-6dfd-4902-91f5-20e0a4593ffa_2001x730.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!almE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59f4cb03-6dfd-4902-91f5-20e0a4593ffa_2001x730.png" width="1456" height="531" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/59f4cb03-6dfd-4902-91f5-20e0a4593ffa_2001x730.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:531,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:391508,&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://blog.levelupcoding.com/i/189858660?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59f4cb03-6dfd-4902-91f5-20e0a4593ffa_2001x730.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_!almE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59f4cb03-6dfd-4902-91f5-20e0a4593ffa_2001x730.png 424w, https://substackcdn.com/image/fetch/$s_!almE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59f4cb03-6dfd-4902-91f5-20e0a4593ffa_2001x730.png 848w, https://substackcdn.com/image/fetch/$s_!almE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59f4cb03-6dfd-4902-91f5-20e0a4593ffa_2001x730.png 1272w, https://substackcdn.com/image/fetch/$s_!almE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59f4cb03-6dfd-4902-91f5-20e0a4593ffa_2001x730.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 role="img" 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><title></title><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>Asynchronous communication: send and continue</h2><p>Asynchronous systems usually introduce a <strong>message broker</strong> (a system that stores and routes messages) and communicate via <strong>queues</strong> or <strong>topics</strong>. Producers publish; consumers process when they can.</p><p>This changes the system&#8217;s structure:</p><ul><li><p><strong>Decoupling &amp; resilience</strong> &#8594; messages can wait when a consumer is slow or offline, reducing cascading failures.</p></li><li><p><strong>Throughput &amp; scalability </strong>&#8594; producers don&#8217;t block, and you can scale consumers horizontally to chew through backlog.</p></li><li><p><strong>Fan-out by default</strong> &#8594; one &#8220;order placed&#8221; event can trigger email, analytics, fraud checks, and inventory updates without the producer calling each service directly.</p></li></ul><p>The trade is <strong>eventual consistency</strong>: the system acknowledges the request now, but the final outcome happens later. How long it takes depends on how many messages are waiting and how fast consumers process them.</p><p>Async also raises the engineering bar:</p><ul><li><p><strong>More moving parts</strong> &#8594; brokers, persistence, acknowledgements, retries.</p></li><li><p><strong>Idempotency required </strong>&#8594; consumers must safely handle duplicates (idempotent means &#8220;running it twice produces the same effect as once&#8221;).</p></li><li><p><strong>Harder failure handling </strong>&#8594; errors may surface later, sometimes via a <strong>dead-letter queue</strong> (messages that repeatedly fail and need inspection).</p></li></ul><h3>When not to use asynchronous communication</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!MLDF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd13dcb55-6dbe-4716-95c3-05f777f6eda1_2001x729.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!MLDF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd13dcb55-6dbe-4716-95c3-05f777f6eda1_2001x729.png 424w, https://substackcdn.com/image/fetch/$s_!MLDF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd13dcb55-6dbe-4716-95c3-05f777f6eda1_2001x729.png 848w, https://substackcdn.com/image/fetch/$s_!MLDF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd13dcb55-6dbe-4716-95c3-05f777f6eda1_2001x729.png 1272w, https://substackcdn.com/image/fetch/$s_!MLDF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd13dcb55-6dbe-4716-95c3-05f777f6eda1_2001x729.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!MLDF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd13dcb55-6dbe-4716-95c3-05f777f6eda1_2001x729.png" width="1456" height="530" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d13dcb55-6dbe-4716-95c3-05f777f6eda1_2001x729.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:530,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:391077,&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://blog.levelupcoding.com/i/189858660?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd13dcb55-6dbe-4716-95c3-05f777f6eda1_2001x729.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_!MLDF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd13dcb55-6dbe-4716-95c3-05f777f6eda1_2001x729.png 424w, https://substackcdn.com/image/fetch/$s_!MLDF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd13dcb55-6dbe-4716-95c3-05f777f6eda1_2001x729.png 848w, https://substackcdn.com/image/fetch/$s_!MLDF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd13dcb55-6dbe-4716-95c3-05f777f6eda1_2001x729.png 1272w, https://substackcdn.com/image/fetch/$s_!MLDF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd13dcb55-6dbe-4716-95c3-05f777f6eda1_2001x729.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 role="img" 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><title></title><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>How to choose in practice</h2><p>Most real systems don&#8217;t pick one style.</p><p>They <strong>place synchronous and asynchronous communication deliberately</strong>.</p><p>Use <strong>synchronous communication</strong> when the system cannot move forward without a definitive answer.</p><p>This includes login checks, payment authorization, inventory validation, and critical reads. In these cases, waiting is the point because correctness matters more than throughput. Failures should surface immediately and stop the flow.</p><p>Use <strong>asynchronous communication</strong> when the work does not need to block the user.</p><p>Long-running tasks, bursty workloads, and fan-out behavior belong here. Queuing the work keeps the system responsive and prevents one slow dependency from stalling everything else.</p><p>This is how systems gain autonomy and absorb partial failure.</p><p>Most mature architectures follow a simple pattern:</p><ul><li><p><strong>Sync at the edge</strong> &#8594; confirm the user&#8217;s action quickly and clearly.</p></li><li><p><strong>Async behind the edge</strong> &#8594; process side effects like notifications, analytics, and downstream updates without holding the request open.</p></li></ul><p>That split keeps the user experience fast while letting the system scale and recover under load.</p><p>One important caveat: <strong>&#8220;async code&#8221; is not the same as asynchronous communication</strong>.</p><p>If a service must wait for a response before it can proceed, the interaction is still synchronous at the architecture level; even if it uses promises, callbacks, or non-blocking I/O.</p><h2>Wrapping up</h2><p>Go back to the moment the user clicks <strong>&#8220;Purchase.&#8221;</strong></p><p>Whether that action feels instant or slow is a design choice.</p><p>Payment authorization, inventory checks, and order creation run synchronously because the system needs a definitive answer.</p><p>Waiting there is intentional. That&#8217;s the critical path.</p><p>Everything else (emails, analytics, fraud checks, fulfillment) doesn&#8217;t need to block the user. Those steps run asynchronously so the order can complete even when downstream systems are slow or unavailable.</p><p>That&#8217;s the real trade-off.</p><p>Synchronous communication gives you immediate certainty but shared failure. Asynchronous communication gives you resilience and throughput by letting work finish later.</p><p>Well-designed systems use both.</p><p>If a user flow feels slow, the fix isn&#8217;t always faster processing.</p><p>Often, it&#8217;s deciding what truly needs an answer now; and what can wait.</p><div><hr></div><p>&#128075; If you liked this post &#8594; Like + Restack + Share to help others learn system design.</p><div><hr></div><p>Subscribe to get high-signal, clear, and visual system design breakdowns straight to your inbox:</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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">&nbsp;</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[Why “Hash the Password” Isn’t Enough]]></title><description><![CDATA[(5 minutes) | How salts, key stretching, and memory-hard algorithms stop brute-force attacks.]]></description><link>https://blog.levelupcoding.com/p/how-databases-keep-passwords-safe</link><guid isPermaLink="false">https://blog.levelupcoding.com/p/how-databases-keep-passwords-safe</guid><dc:creator><![CDATA[Nikki Siapno]]></dc:creator><pubDate>Mon, 16 Mar 2026 11:24:23 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/79417bff-5a3d-4ca9-a83f-2bee7dc5b330_1456x1048.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_!yLV0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yLV0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" width="1292" height="266" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:266,&quot;width&quot;:1292,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:343451,&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://lvlupcoding.substack.com/i/171357839?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.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_!yLV0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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">Get our 142-page System Design Handbook for FREE on newsletter signup:</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><h2><a href="https://lucode.co/agent-memory-article-oracle-z7nl">Why Your AI Agent Has Amnesia</a></h2><h5>Presented by Oracle</h5><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!lXae!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5059d33c-0c70-4911-8ebc-932b0c191a97_1354x826.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lXae!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5059d33c-0c70-4911-8ebc-932b0c191a97_1354x826.png 424w, https://substackcdn.com/image/fetch/$s_!lXae!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5059d33c-0c70-4911-8ebc-932b0c191a97_1354x826.png 848w, https://substackcdn.com/image/fetch/$s_!lXae!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5059d33c-0c70-4911-8ebc-932b0c191a97_1354x826.png 1272w, https://substackcdn.com/image/fetch/$s_!lXae!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5059d33c-0c70-4911-8ebc-932b0c191a97_1354x826.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!lXae!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5059d33c-0c70-4911-8ebc-932b0c191a97_1354x826.png" width="1354" height="826" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5059d33c-0c70-4911-8ebc-932b0c191a97_1354x826.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:826,&quot;width&quot;:1354,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:143183,&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;:false,&quot;internalRedirect&quot;:&quot;https://blog.levelupcoding.com/i/190397808?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5059d33c-0c70-4911-8ebc-932b0c191a97_1354x826.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_!lXae!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5059d33c-0c70-4911-8ebc-932b0c191a97_1354x826.png 424w, https://substackcdn.com/image/fetch/$s_!lXae!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5059d33c-0c70-4911-8ebc-932b0c191a97_1354x826.png 848w, https://substackcdn.com/image/fetch/$s_!lXae!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5059d33c-0c70-4911-8ebc-932b0c191a97_1354x826.png 1272w, https://substackcdn.com/image/fetch/$s_!lXae!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5059d33c-0c70-4911-8ebc-932b0c191a97_1354x826.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 role="img" 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><title></title><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>Many AI agents struggle with memory. They lose context, forget prior steps, and produce inconsistent outputs across sessions. <strong><a href="https://lucode.co/agent-memory-article-oracle-z7nl">This guide</a></strong> explores why it happens and how to fix it using agent memory patterns. A great read!</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://lucode.co/agent-memory-article-oracle-z7nl&quot;,&quot;text&quot;:&quot;Read the article&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://lucode.co/agent-memory-article-oracle-z7nl"><span>Read the article</span></a></p><div><hr></div><h1>How Databases Keep Passwords Safe</h1><p>&#8220;Hash it and you&#8217;re done&#8221; isn&#8217;t a strategy. It&#8217;s how breaches turn into headlines.</p><p>Every system is one misconfiguration, forgotten backup, or zero-day exploit away from a database leak.</p><p>When that happens, the only thing standing between you and a wave of account takeovers is how those passwords were stored.</p><p>Password security isn&#8217;t about keeping data secret; it&#8217;s about making stolen data useless.</p><p>That&#8217;s why modern storage relies on one-way hashing, unique salts, and slow, memory-hard algorithms that make every brute-force attempt painfully expensive.</p><p>Real security doesn&#8217;t assume safety, it assumes compromise and plans for it.</p><h2>How secure storage works</h2><p>When a database breach happens, it&#8217;s already too late to protect the data itself.</p><p>What still matters is <strong>how much that data can be used against you</strong>.</p><p>If your system stores plaintext passwords, attackers can log in immediately. Even &#8220;hashed&#8221; passwords aren&#8217;t safe if you used fast, general-purpose algorithms like MD5 or SHA-1.</p><p>GPUs can brute-force at billions of guesses per second.</p><p>To prevent that, password storage must <strong>slow attackers down</strong>.</p><p>Modern password storage relies on <strong>layered defenses</strong>. Each step (hashing, salting, stretching, and sometimes peppering) closes a different gap that attackers exploit.</p><ul><li><p><strong>Hashing</strong> &#8594; Converts a password into a one-way digest that can&#8217;t be reversed. The server never stores the password itself, only its hash.</p><ul><li><p>Use password-specific algorithms like <strong>bcrypt</strong>, <strong>scrypt</strong>, or <strong>Argon2id</strong>, not general-purpose hashes like SHA-256. Fast hashes are designed for data integrity, not for resisting brute force. A proper password KDF (Key Derivation Function) intentionally slows verification to make offline guessing expensive.</p></li></ul></li><li><p><strong>Salting</strong> &#8594; Adds a random, per-user value to each password before hashing.</p><ul><li><p>Salts ensure that identical passwords never produce the same hash and stop <strong>rainbow table</strong> lookups. They don&#8217;t need to be secret, but they must be <strong>unique and unpredictable</strong> (16 bytes or more).</p></li></ul></li><li><p><strong>Key stretching</strong> &#8594; Increases the cost of each hash operation through extra iterations or memory hardness.</p><ul><li><p>This throttles brute-force attacks: where a fast hash might take microseconds, a stretched one takes hundreds of milliseconds. On your servers, that&#8217;s manageable. For an attacker, multiplied by millions of guesses, it&#8217;s economically pointless.</p></li></ul></li><li><p><strong>Peppering (optional)</strong> &#8594; Adds a server-side secret, stored outside the database (like in an HSM or key vault).</p><ul><li><p>Even if the database leaks, the attacker can&#8217;t verify guesses without the pepper. It strengthens security but complicates rotation; use it only if your infrastructure can protect and rotate secrets safely.</p></li></ul></li></ul><p>The goal isn&#8217;t to make passwords uncrackable, but to make cracking <strong>so slow and individualized</strong> that attackers move on long before they succeed.</p><h2>How passwords are stored and verified</h2><p>When a user creates an account or logs in later, the system never handles their password in plain text.</p><p>Both flows (signup and login) rely on the same hashing process but apply it at different points.</p><h3>1. Signup &#8594; Creating and storing the hash</h3><p>When a user signs up or resets their password, the system never stores the password itself. Instead, it transforms it into a secure representation:</p><ol><li><p><strong>Generate a salt</strong> &#8594; Create a random, unique salt for this user (usually 16 bytes or more).</p></li><li><p><strong>Hash the password</strong> &#8594; Run the password and salt through a <strong>password hashing function</strong> such as Argon2id, bcrypt, or scrypt. The function also takes cost parameters (iterations, memory, or parallelism) that control how slow the process is.</p></li><li><p><strong>Store the result</strong> &#8594; Save the resulting hash, along with the salt and parameters, in the database.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!beBt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45033b17-a125-452b-b970-77e2e74e9ab8_2000x1000.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!beBt!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45033b17-a125-452b-b970-77e2e74e9ab8_2000x1000.png 424w, https://substackcdn.com/image/fetch/$s_!beBt!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45033b17-a125-452b-b970-77e2e74e9ab8_2000x1000.png 848w, https://substackcdn.com/image/fetch/$s_!beBt!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45033b17-a125-452b-b970-77e2e74e9ab8_2000x1000.png 1272w, https://substackcdn.com/image/fetch/$s_!beBt!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45033b17-a125-452b-b970-77e2e74e9ab8_2000x1000.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!beBt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45033b17-a125-452b-b970-77e2e74e9ab8_2000x1000.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/45033b17-a125-452b-b970-77e2e74e9ab8_2000x1000.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:424376,&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://blog.levelupcoding.com/i/189851964?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45033b17-a125-452b-b970-77e2e74e9ab8_2000x1000.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_!beBt!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45033b17-a125-452b-b970-77e2e74e9ab8_2000x1000.png 424w, https://substackcdn.com/image/fetch/$s_!beBt!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45033b17-a125-452b-b970-77e2e74e9ab8_2000x1000.png 848w, https://substackcdn.com/image/fetch/$s_!beBt!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45033b17-a125-452b-b970-77e2e74e9ab8_2000x1000.png 1272w, https://substackcdn.com/image/fetch/$s_!beBt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45033b17-a125-452b-b970-77e2e74e9ab8_2000x1000.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 role="img" 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><title></title><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><p>The original password is discarded immediately. Only the salted hash and configuration is stored.</p><h3>2. Login &#8594; Verifying the password</h3><p>When the user logs in later, the system must check the password without knowing the original one:</p><ol><li><p><strong>Retrieve stored values</strong> &#8594; Fetch the user&#8217;s stored hash, salt, and parameters.</p></li><li><p><strong>Re-hash the input</strong> &#8594; Run the entered password through the same function using the retrieved salt and parameters.</p></li><li><p><strong>Compare securely</strong> &#8594; Use a <strong>constant-time comparison</strong> to check whether the new hash matches the stored one. Unlike normal string checks that exit early on mismatches, constant-time comparisons take the <strong>same amount of time</strong> no matter how similar the inputs are. This prevents timing attacks, where an attacker measures tiny response-time differences to guess parts of the correct hash one byte at a time.</p></li><li><p><strong>Rehash if needed</strong> &#8594; If parameters are outdated (for example, fewer iterations, lower memory, or an outdated algorithm), re-hash and update the stored entry after a successful login.</p></li><li><p><strong>Authorize access</strong> &#8594; If hashes match, issue a session token or JWT for the user.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ACWt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb20f92cd-f211-470a-879c-4ce84cda0a46_2000x1000.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ACWt!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb20f92cd-f211-470a-879c-4ce84cda0a46_2000x1000.png 424w, https://substackcdn.com/image/fetch/$s_!ACWt!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb20f92cd-f211-470a-879c-4ce84cda0a46_2000x1000.png 848w, https://substackcdn.com/image/fetch/$s_!ACWt!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb20f92cd-f211-470a-879c-4ce84cda0a46_2000x1000.png 1272w, https://substackcdn.com/image/fetch/$s_!ACWt!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb20f92cd-f211-470a-879c-4ce84cda0a46_2000x1000.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ACWt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb20f92cd-f211-470a-879c-4ce84cda0a46_2000x1000.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b20f92cd-f211-470a-879c-4ce84cda0a46_2000x1000.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:434299,&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://blog.levelupcoding.com/i/189851964?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb20f92cd-f211-470a-879c-4ce84cda0a46_2000x1000.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_!ACWt!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb20f92cd-f211-470a-879c-4ce84cda0a46_2000x1000.png 424w, https://substackcdn.com/image/fetch/$s_!ACWt!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb20f92cd-f211-470a-879c-4ce84cda0a46_2000x1000.png 848w, https://substackcdn.com/image/fetch/$s_!ACWt!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb20f92cd-f211-470a-879c-4ce84cda0a46_2000x1000.png 1272w, https://substackcdn.com/image/fetch/$s_!ACWt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb20f92cd-f211-470a-879c-4ce84cda0a46_2000x1000.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 role="img" 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><title></title><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><p>At no point does the system store, transmit, or recover the plaintext password. The entire process proves identity by <em>reproducing</em> the same one-way result, not by revealing the secret itself.</p><h2>What not to do</h2><p>Most password breaches don&#8217;t happen because teams ignored security, they happen because they trusted weak defaults or outdated practices.</p><p>Here&#8217;s what to avoid if you want your password storage to hold up under real attacks.</p><ul><li><p><strong>Store plaintext passwords</strong> &#8594; The worst-case scenario. A single database dump means instant access to every account. There&#8217;s no recovery from this.</p></li><li><p><strong>Use general-purpose hashes (MD5, SHA-1, SHA-256)</strong> &#8594; These functions are designed for speed, not security. They are trivial to brute-force at scale with modern GPUs and ASICs.</p></li><li><p><strong>Skip or reuse salts</strong> &#8594; Without a unique, random salt per password, identical passwords produce identical hashes, enabling rainbow table attacks and cross-user correlation.</p></li><li><p><strong>Set low cost factors</strong> &#8594; bcrypt cost=8 or PBKDF2 with a few thousand iterations might have been fine a decade ago. Today, it&#8217;s too cheap to crack. Always tune cost to current hardware performance.</p></li><li><p><strong>Roll out your own algorithm</strong> &#8594; Security through creativity is not security. Established KDFs like Argon2id, bcrypt, or scrypt have been battle-tested and peer-reviewed; your custom hashing function has not.</p></li><li><p><strong>Forget edge behaviors</strong> &#8594; Logging plaintext passwords during debugging or including them in error traces can silently undo all your protections.</p></li><li><p><strong>Expose hints or partial passwords</strong> &#8594; Anything that helps an attacker narrow the search space reduces the work of cracking. Even &#8220;helpful&#8221; password hints expose predictable details.</p></li></ul><h2>Recap</h2><p>Good password storage doesn&#8217;t depend on secrecy; it depends on math, cost, and discipline.</p><p>Hashing, salting, stretching, and (optionally) peppering turn every password into a unique, expensive problem for attackers to solve.</p><p>The goal isn&#8217;t to make breaches impossible, but to make them irrelevant by ensuring stolen data is useless.</p><p>Use proven KDFs like Argon2id or bcrypt, tune them regularly, and avoid shortcuts that trade speed for safety.</p><p>When done right, a database leak becomes an inconvenience; not a disaster.</p><div><hr></div><p>&#128075; If you liked this post &#8594; Like + Restack + Share to help others learn system design.</p><div><hr></div><p>Subscribe to get high-signal, clear, and visual system design breakdowns straight to your inbox:</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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">&nbsp;</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[CAP Theorem Clearly Explained]]></title><description><![CDATA[(4 minutes) | Choosing your failure mode, avoiding common mistakes, and a decision checklist.]]></description><link>https://blog.levelupcoding.com/p/cap-theorem-explained</link><guid isPermaLink="false">https://blog.levelupcoding.com/p/cap-theorem-explained</guid><dc:creator><![CDATA[Nikki Siapno]]></dc:creator><pubDate>Fri, 13 Mar 2026 12:40:09 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/68504485-766b-458a-aedd-fa61bd08cf97_1456x1048.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_!yLV0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yLV0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" width="1292" height="266" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:266,&quot;width&quot;:1292,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:343451,&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://lvlupcoding.substack.com/i/171357839?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.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_!yLV0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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">Get our 142-page System Design Handbook for FREE on newsletter signup:</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><h2><a href="https://lucode.co/mongodb-ai-learning-hub-z7nl">Build AI Apps with MongoDB</a></h2><h5>Presented by MongoDB</h5><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Hlpw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ead0bb5-d130-4f46-889e-49f40dbb4390_2900x1120.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Hlpw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ead0bb5-d130-4f46-889e-49f40dbb4390_2900x1120.png 424w, https://substackcdn.com/image/fetch/$s_!Hlpw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ead0bb5-d130-4f46-889e-49f40dbb4390_2900x1120.png 848w, https://substackcdn.com/image/fetch/$s_!Hlpw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ead0bb5-d130-4f46-889e-49f40dbb4390_2900x1120.png 1272w, https://substackcdn.com/image/fetch/$s_!Hlpw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ead0bb5-d130-4f46-889e-49f40dbb4390_2900x1120.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Hlpw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ead0bb5-d130-4f46-889e-49f40dbb4390_2900x1120.png" width="1456" height="562" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1ead0bb5-d130-4f46-889e-49f40dbb4390_2900x1120.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:562,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:199786,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.levelupcoding.com/i/182433036?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ead0bb5-d130-4f46-889e-49f40dbb4390_2900x1120.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_!Hlpw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ead0bb5-d130-4f46-889e-49f40dbb4390_2900x1120.png 424w, https://substackcdn.com/image/fetch/$s_!Hlpw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ead0bb5-d130-4f46-889e-49f40dbb4390_2900x1120.png 848w, https://substackcdn.com/image/fetch/$s_!Hlpw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ead0bb5-d130-4f46-889e-49f40dbb4390_2900x1120.png 1272w, https://substackcdn.com/image/fetch/$s_!Hlpw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ead0bb5-d130-4f46-889e-49f40dbb4390_2900x1120.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 role="img" 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><title></title><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>Looking to stay ahead of the curve on AI? <a href="https://lucode.co/mongodb-ai-learning-hub-z7nl">MongoDB AI Learning Hub</a> has the technical training pathways and tools you need to level up your AI app-building game. Explore practical guides, tutorials, and quick starts for all skill levels, from foundational concepts like understanding AI tool stacks to advanced implementations using RAG, MongoDB Vector Search, and LLM optimization.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://lucode.co/mongodb-ai-learning-hub-z7nl&quot;,&quot;text&quot;:&quot;Check it out (it's free)&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://lucode.co/mongodb-ai-learning-hub-z7nl"><span>Check it out (it's free)</span></a></p><div><hr></div><h1>CAP Theorem Clearly Explained</h1><p>&#8220;Make it consistent, highly available, and fault-tolerant&#8221; sounds like a reasonable requirement.</p><p>It isn&#8217;t.</p><p>In any distributed system, a network failure forces a choice that no amount of engineering can avoid: either your nodes agree on the truth and some requests fail, or every request gets an answer and some of those answers are wrong.</p><p>Both are valid designs, and CAP Theorem is the lens that makes that tradeoff explicit so you choose deliberately instead of by accident.</p><h2>What is CAP Theorem?</h2><p>CAP Theorem states that a distributed data store cannot simultaneously guarantee all three of the following properties at the same time:</p><ul><li><p><strong>Consistency (C)</strong> &#8594; Every read returns the most recent write, or an error; never stale data.</p></li><li><p><strong>Availability (A)</strong> &#8594; Every request receives a response, even if some nodes are out of date.</p></li><li><p><strong>Partition Tolerance (P)</strong> &#8594; The system keeps operating despite network failures that split nodes into isolated groups.</p></li></ul><p>The common summary is &#8220;pick two of three.&#8221;</p><p>It&#8217;s catchy, but misleading.</p><p>CAP is not about permanently giving something up. It&#8217;s about what happens when the network splits.</p><p>A clearer way to look at it: when a partition occurs, you must choose between consistency (all nodes agree on the same data) and availability (every request receives a response).</p><p>During normal operation, when nodes can communicate reliably, you can have both.</p><p>The tradeoff only appears the moment the network breaks.</p><h2>CP vs AP: two different failure philosophies</h2><p>Systems that lean toward <strong>Consistency + Partition Tolerance (CP)</strong> will refuse or delay operations when they can&#8217;t guarantee a single, up-to-date view of the data. They&#8217;d rather return an error than return something wrong.</p><p>Systems that lean toward <strong>Availability + Partition Tolerance (AP)</strong> will keep serving requests even when nodes disagree, accepting that some responses may be stale. They&#8217;d rather serve something than serve 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_!8zE9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a533819-34ee-4e6e-a827-5955d6431b26_2000x1062.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8zE9!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a533819-34ee-4e6e-a827-5955d6431b26_2000x1062.png 424w, https://substackcdn.com/image/fetch/$s_!8zE9!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a533819-34ee-4e6e-a827-5955d6431b26_2000x1062.png 848w, https://substackcdn.com/image/fetch/$s_!8zE9!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a533819-34ee-4e6e-a827-5955d6431b26_2000x1062.png 1272w, https://substackcdn.com/image/fetch/$s_!8zE9!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a533819-34ee-4e6e-a827-5955d6431b26_2000x1062.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8zE9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a533819-34ee-4e6e-a827-5955d6431b26_2000x1062.png" width="1456" height="773" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5a533819-34ee-4e6e-a827-5955d6431b26_2000x1062.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:773,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:449451,&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://blog.levelupcoding.com/i/189734261?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a533819-34ee-4e6e-a827-5955d6431b26_2000x1062.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_!8zE9!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a533819-34ee-4e6e-a827-5955d6431b26_2000x1062.png 424w, https://substackcdn.com/image/fetch/$s_!8zE9!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a533819-34ee-4e6e-a827-5955d6431b26_2000x1062.png 848w, https://substackcdn.com/image/fetch/$s_!8zE9!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a533819-34ee-4e6e-a827-5955d6431b26_2000x1062.png 1272w, https://substackcdn.com/image/fetch/$s_!8zE9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a533819-34ee-4e6e-a827-5955d6431b26_2000x1062.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 role="img" 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><title></title><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>How a partition actually plays out</h2><p>A partition occurs when there&#8217;s a network split and nodes can&#8217;t reliably talk to each other.</p><p>Imagine a five-node cluster. A network failure divides it into two groups: three nodes on one side, two on the other.</p><h3>CP behavior</h3><p>CP systems preserve a single source of truth by refusing to make progress without enough agreement.</p><ul><li><p><strong>Quorums/consensus</strong> &#8594; Writes (and sometimes reads) require enough nodes to agree.</p></li><li><p><strong>Leader-based replication</strong> &#8594; Only one leader can accept writes; the other side of a split becomes read-only or errors out.</p></li><li><p><strong>User experience</strong> &#8594; Some users see failures/timeouts, but you avoid split-brain state.</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_!qiCU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21597c19-dfc3-4b7a-813b-cf119595702c_2000x1042.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!qiCU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21597c19-dfc3-4b7a-813b-cf119595702c_2000x1042.png 424w, https://substackcdn.com/image/fetch/$s_!qiCU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21597c19-dfc3-4b7a-813b-cf119595702c_2000x1042.png 848w, https://substackcdn.com/image/fetch/$s_!qiCU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21597c19-dfc3-4b7a-813b-cf119595702c_2000x1042.png 1272w, https://substackcdn.com/image/fetch/$s_!qiCU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21597c19-dfc3-4b7a-813b-cf119595702c_2000x1042.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!qiCU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21597c19-dfc3-4b7a-813b-cf119595702c_2000x1042.png" width="1456" height="759" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/21597c19-dfc3-4b7a-813b-cf119595702c_2000x1042.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:759,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:665722,&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://blog.levelupcoding.com/i/189734261?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21597c19-dfc3-4b7a-813b-cf119595702c_2000x1042.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_!qiCU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21597c19-dfc3-4b7a-813b-cf119595702c_2000x1042.png 424w, https://substackcdn.com/image/fetch/$s_!qiCU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21597c19-dfc3-4b7a-813b-cf119595702c_2000x1042.png 848w, https://substackcdn.com/image/fetch/$s_!qiCU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21597c19-dfc3-4b7a-813b-cf119595702c_2000x1042.png 1272w, https://substackcdn.com/image/fetch/$s_!qiCU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21597c19-dfc3-4b7a-813b-cf119595702c_2000x1042.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 role="img" 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><title></title><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 three-node side has a majority, so it continues processing requests.</p><p>The two-node side does not, so it stops accepting writes. It may become read-only or fully unavailable.</p><p>When the network heals, the minority side syncs from the majority. There is no data conflict because only one side was allowed to move forward.</p><p>The result is clean, but some users saw errors or timeouts during the split.</p><h3>AP behavior</h3><p>An AP system keeps accepting operations on each side of the partition and repairs the mismatch later.</p><ul><li><p><strong>Eventual consistency</strong> &#8594; Replicas converge after communication returns.</p></li><li><p><strong>Conflict resolution</strong> &#8594; You need a resolution plan: last-write-wins, merge, keep multiple versions, or domain-specific reconciliation.</p></li><li><p><strong>User experience</strong> &#8594; The system stays up, but different users may see different answers temporarily.</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_!9LE4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36acfe99-9a6d-49ef-8d55-47c066135952_2000x1054.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9LE4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36acfe99-9a6d-49ef-8d55-47c066135952_2000x1054.png 424w, https://substackcdn.com/image/fetch/$s_!9LE4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36acfe99-9a6d-49ef-8d55-47c066135952_2000x1054.png 848w, https://substackcdn.com/image/fetch/$s_!9LE4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36acfe99-9a6d-49ef-8d55-47c066135952_2000x1054.png 1272w, https://substackcdn.com/image/fetch/$s_!9LE4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36acfe99-9a6d-49ef-8d55-47c066135952_2000x1054.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9LE4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36acfe99-9a6d-49ef-8d55-47c066135952_2000x1054.png" width="1456" height="767" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/36acfe99-9a6d-49ef-8d55-47c066135952_2000x1054.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:767,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:678477,&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://blog.levelupcoding.com/i/189734261?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36acfe99-9a6d-49ef-8d55-47c066135952_2000x1054.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_!9LE4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36acfe99-9a6d-49ef-8d55-47c066135952_2000x1054.png 424w, https://substackcdn.com/image/fetch/$s_!9LE4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36acfe99-9a6d-49ef-8d55-47c066135952_2000x1054.png 848w, https://substackcdn.com/image/fetch/$s_!9LE4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36acfe99-9a6d-49ef-8d55-47c066135952_2000x1054.png 1272w, https://substackcdn.com/image/fetch/$s_!9LE4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36acfe99-9a6d-49ef-8d55-47c066135952_2000x1054.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 role="img" 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><title></title><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>Each side believes it has the latest state. When the network reconnects, the system detects divergent updates; for example, two users modifying the same record on different sides.</p><p>Now reconciliation begins.</p><p>The database applies a conflict strategy such as last-write-wins. The service stayed available, but some data required conflict resolution.</p><p>Neither outcome is a bug. Both are deliberate design decisions baked into the system you chose.</p><h2>Common mistakes that cause outages</h2><p>Most confusion around CAP doesn&#8217;t come from the theorem itself.</p><p>It comes from how we simplify it.</p><p>Here are the mistakes that cause the most architectural regret.</p><ul><li><p><strong>Treating CAP as a permanent label</strong> &#8594; A system is not &#8220;CP&#8221; or &#8220;AP&#8221; as a fixed identity. During normal operation, well-designed systems provide both consistency and availability because the network is healthy.</p></li><li><p><strong>Assuming partition tolerance is optional</strong> &#8594; You cannot avoid partitions by trusting your infrastructure. You can reduce their frequency with better networking, tighter time synchronization, or private backbone links, but you cannot eliminate its possibility entirely.</p></li><li><p><strong>Confusing CAP consistency with ACID consistency</strong> &#8594; These are different guarantees. ACID consistency means a transaction leaves the database in a valid state according to defined rules. CAP consistency means every read returns the most recent write across nodes.</p></li><li><p><strong>Forgetting to design recovery logic</strong> &#8594; Choosing availability during a partition is only half the decision. &#8220;Eventually consistent&#8221; requires a reconciliation strategy. You must define how conflicts resolve.</p></li></ul><h2>A decision checklist you can actually use</h2><p>Start by asking one question: <strong>what hurts your product more, returning incorrect data, or returning no data at all?</strong></p><ul><li><p><strong>Returning incorrect data hurts more</strong> &#8594; Choose CP.</p><ul><li><p>Common use cases: payments, balances, inventory counts, permissions, leader election</p></li></ul></li><li><p><strong>Returning no data at all hurts more</strong> &#8594; Choose AP.</p><ul><li><p>Common use cases: feeds, analytics views, caches, activity timelines, search indexes</p></li></ul></li></ul><p>Most real systems don&#8217;t pick one globally; they pick per component.</p><p>A common pattern is to have a small CP core for writes that must be correct (orders, balances, permissions), and AP layers that serve and cache data quickly across regions.</p><p>The core enforces truth; the edge keeps the system fast.</p><p>The worst outcome is not choosing consciously. Systems that ignore CAP don&#8217;t escape its constraints; they just encounter them as surprises.</p><h2>Wrapping up</h2><p>Every distributed system has already answered the CAP question, either deliberately or by default.</p><p>The database you picked, the replication strategy you configured, the consistency level you left unchanged: all of it adds up to a position on the spectrum.</p><p>Understanding CAP doesn&#8217;t give you new options. It tells you which option you&#8217;re already on, and whether it&#8217;s the right one.</p><div><hr></div><p>&#128075; If you liked this post &#8594; Like + Restack + Share to help others learn system design.</p><div><hr></div><p>Subscribe to get high-signal, clear, and visual system design breakdowns straight to your inbox:</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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">&nbsp;</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[Event-Driven Architecture Clearly Explained]]></title><description><![CDATA[(4 min read) | When fan-out is power, and when it becomes operational debt.]]></description><link>https://blog.levelupcoding.com/p/event-driven-architecture</link><guid isPermaLink="false">https://blog.levelupcoding.com/p/event-driven-architecture</guid><dc:creator><![CDATA[Nikki Siapno]]></dc:creator><pubDate>Tue, 03 Mar 2026 13:02:21 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/5d10a526-e7cb-4147-a498-926610bdbf5f_1456x1048.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_!yLV0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yLV0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" width="1292" height="266" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:266,&quot;width&quot;:1292,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:343451,&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://lvlupcoding.substack.com/i/171357839?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.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_!yLV0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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">Get our 142-page System Design Handbook for FREE on newsletter signup:</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><h2><a href="https://lucode.co/sonar-summit-z7nl">Sonar Summit: A Global Conversation on Building Better Software in the AI Era</a></h2><h5>Presented by Sonar</h5><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!FOjb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f630fd0-44d5-4023-b4d8-bd34aeb131cf_1200x627.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!FOjb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f630fd0-44d5-4023-b4d8-bd34aeb131cf_1200x627.png 424w, https://substackcdn.com/image/fetch/$s_!FOjb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f630fd0-44d5-4023-b4d8-bd34aeb131cf_1200x627.png 848w, https://substackcdn.com/image/fetch/$s_!FOjb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f630fd0-44d5-4023-b4d8-bd34aeb131cf_1200x627.png 1272w, https://substackcdn.com/image/fetch/$s_!FOjb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f630fd0-44d5-4023-b4d8-bd34aeb131cf_1200x627.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!FOjb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f630fd0-44d5-4023-b4d8-bd34aeb131cf_1200x627.png" width="1200" height="627" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4f630fd0-44d5-4023-b4d8-bd34aeb131cf_1200x627.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:627,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:453732,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.levelupcoding.com/i/189120727?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f630fd0-44d5-4023-b4d8-bd34aeb131cf_1200x627.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_!FOjb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f630fd0-44d5-4023-b4d8-bd34aeb131cf_1200x627.png 424w, https://substackcdn.com/image/fetch/$s_!FOjb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f630fd0-44d5-4023-b4d8-bd34aeb131cf_1200x627.png 848w, https://substackcdn.com/image/fetch/$s_!FOjb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f630fd0-44d5-4023-b4d8-bd34aeb131cf_1200x627.png 1272w, https://substackcdn.com/image/fetch/$s_!FOjb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f630fd0-44d5-4023-b4d8-bd34aeb131cf_1200x627.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 role="img" 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><title></title><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 question isn&#8217;t whether to use AI. It&#8217;s how to adopt it <strong>without quietly increasing risk and degrading code quality</strong>. That shift is exactly why conversations about software quality in the AI era matter right now. This is exactly the kind of conversation happening at <strong><a href="https://lucode.co/sonar-summit-z7nl">Sonar Summit</a></strong>. </p><p>The <strong>virtual event</strong> is on <strong>today</strong>. It&#8217;s free to watch / attend.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://lucode.co/sonar-summit-z7nl&quot;,&quot;text&quot;:&quot;Check it out (for free) here&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://lucode.co/sonar-summit-z7nl"><span>Check it out (for free) here</span></a></p><div><hr></div><h1>Event-Driven Architecture Clearly Explained</h1><p>Most systems start as a neat chain of calls: service A calls B, B calls C, C returns.</p><p>Add one new downstream requirement, and suddenly you&#8217;re editing code three layers deep, redeploying half your stack, and praying the chain holds.</p><p>This is the hidden cost of direct coupling, every new feature tightens the knot. Event-Driven Architecture (EDA) cuts it.</p><p>Instead of services calling each other directly, they broadcast events: facts about things that happened. Any service that cares can react. The one that emitted the event never needs to know who listened.</p><h2>What Event-Driven Architecture actually is</h2><p>Event-Driven Architecture (EDA) is a design style where components communicate by producing and reacting to events rather than calling each other directly.</p><p>An <strong>event</strong> is a message that describes something that happened: &#8220;Order Placed,&#8221; &#8220;Payment Received,&#8221; &#8220;Temperature Exceeded Threshold.&#8221;</p><p>It&#8217;s a fact, not a command.</p><p>Every EDA system has three main roles:</p><ul><li><p><strong>Producers</strong> &#8594; Detect a change and publish an event to the broker. They don&#8217;t know or care who receives it.</p></li><li><p><strong>Broker</strong> &#8594; The central hub (Kafka, RabbitMQ, AWS EventBridge) that receives events from producers and routes copies to every interested subscriber. It can also buffer events during traffic spikes, ensuring consumers aren&#8217;t overwhelmed.</p></li><li><p><strong>Consumers</strong> &#8594; Subscribe to specific event types and react asynchronously. One consumer&#8217;s slowdown doesn&#8217;t affect others or the producer.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zt1S!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ad079b4-cc97-4dc9-8bbf-1c2aa1c08186_2000x1331.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zt1S!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ad079b4-cc97-4dc9-8bbf-1c2aa1c08186_2000x1331.png 424w, https://substackcdn.com/image/fetch/$s_!zt1S!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ad079b4-cc97-4dc9-8bbf-1c2aa1c08186_2000x1331.png 848w, https://substackcdn.com/image/fetch/$s_!zt1S!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ad079b4-cc97-4dc9-8bbf-1c2aa1c08186_2000x1331.png 1272w, https://substackcdn.com/image/fetch/$s_!zt1S!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ad079b4-cc97-4dc9-8bbf-1c2aa1c08186_2000x1331.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zt1S!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ad079b4-cc97-4dc9-8bbf-1c2aa1c08186_2000x1331.png" width="1456" height="969" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2ad079b4-cc97-4dc9-8bbf-1c2aa1c08186_2000x1331.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:969,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:570623,&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://blog.levelupcoding.com/i/189738216?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ad079b4-cc97-4dc9-8bbf-1c2aa1c08186_2000x1331.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_!zt1S!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ad079b4-cc97-4dc9-8bbf-1c2aa1c08186_2000x1331.png 424w, https://substackcdn.com/image/fetch/$s_!zt1S!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ad079b4-cc97-4dc9-8bbf-1c2aa1c08186_2000x1331.png 848w, https://substackcdn.com/image/fetch/$s_!zt1S!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ad079b4-cc97-4dc9-8bbf-1c2aa1c08186_2000x1331.png 1272w, https://substackcdn.com/image/fetch/$s_!zt1S!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ad079b4-cc97-4dc9-8bbf-1c2aa1c08186_2000x1331.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 role="img" 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><title></title><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></ul><p>The flow looks like this:</p><ul><li><p>A customer places an order</p></li><li><p>The Order Service publishes an &#8220;Order Placed&#8221; event</p></li><li><p>The broker routes it</p></li><li><p>The Inventory Service decrements stock</p></li><li><p>The Notification Service sends a confirmation email</p></li><li><p>The Shipping Service prepares a label</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!bOpb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63fb4092-a80a-4e85-95f5-21185eb30e56_2000x1019.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!bOpb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63fb4092-a80a-4e85-95f5-21185eb30e56_2000x1019.png 424w, https://substackcdn.com/image/fetch/$s_!bOpb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63fb4092-a80a-4e85-95f5-21185eb30e56_2000x1019.png 848w, https://substackcdn.com/image/fetch/$s_!bOpb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63fb4092-a80a-4e85-95f5-21185eb30e56_2000x1019.png 1272w, https://substackcdn.com/image/fetch/$s_!bOpb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63fb4092-a80a-4e85-95f5-21185eb30e56_2000x1019.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!bOpb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63fb4092-a80a-4e85-95f5-21185eb30e56_2000x1019.png" width="1456" height="742" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/63fb4092-a80a-4e85-95f5-21185eb30e56_2000x1019.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:742,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:452977,&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://blog.levelupcoding.com/i/189738216?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63fb4092-a80a-4e85-95f5-21185eb30e56_2000x1019.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_!bOpb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63fb4092-a80a-4e85-95f5-21185eb30e56_2000x1019.png 424w, https://substackcdn.com/image/fetch/$s_!bOpb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63fb4092-a80a-4e85-95f5-21185eb30e56_2000x1019.png 848w, https://substackcdn.com/image/fetch/$s_!bOpb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63fb4092-a80a-4e85-95f5-21185eb30e56_2000x1019.png 1272w, https://substackcdn.com/image/fetch/$s_!bOpb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63fb4092-a80a-4e85-95f5-21185eb30e56_2000x1019.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 role="img" 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><title></title><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></ul><p>The Inventory Service, Notification Service, and Shipping Service all work in parallel, without the Order Service knowing any of them exist.</p><p>This is the core power: <strong>decoupling</strong>. Teams deploy independently. Services evolve independently. A new feature means adding a new consumer, not modifying existing ones.</p><h2>Why teams choose it</h2><p>Without EDA, coordination becomes the tax you pay for every new capability.</p><p>EDA earns its place the moment you feel how much friction it removes.</p><ul><li><p><strong>Loose coupling</strong> &#8594; Producers and consumers share only an event contract, so each side evolves independently without needing to know the other&#8217;s internals.</p></li><li><p><strong>Async fan-out</strong> &#8594; One event triggers many parallel workflows instantly, so adding a new downstream step costs nothing in latency.</p></li><li><p><strong>Elastic buffering</strong> &#8594; The broker absorbs traffic spikes so producers keep emitting while consumers scale at their own pace.</p></li><li><p><strong>Plug-in extensibility</strong> &#8594; New features are new consumers, not modifications to existing services.</p></li><li><p><strong>Fault isolation</strong> &#8594; A failed consumer doesn&#8217;t cascade; events queue until the service recovers.</p></li></ul><h2>The tradeoffs you need to know</h2><p>EDA doesn&#8217;t eliminate complexity, it relocates it.</p><p>The architecture gets cleaner upstream; the responsibilities shift to event design, broker operations, and consumer reliability.</p><ul><li><p><strong>Debugging complexity</strong> &#8594; Failures don&#8217;t follow a clean call path. You see a missing outcome, not the cause. Tracing and centralized logging become essential.</p></li><li><p><strong>Delivery semantics</strong> &#8594; Most brokers guarantee <strong>at-least-once delivery</strong>. Duplicates happen. Consumers must be <strong>idempotent</strong> or you risk double charges and inconsistent state.</p></li><li><p><strong>Eventual consistency</strong> &#8594; Services update asynchronously. Temporary disagreement is normal, but unsafe for flows needing immediate correctness.</p></li><li><p><strong>Broker dependency</strong> &#8594; The broker is critical infrastructure. If it fails, events stop flowing; often silently.</p></li></ul><h2>When to use it (and when not to)</h2><p>EDA shines when your system needs to do many things at once in response to a single trigger, or when teams need to move independently without stepping on each other&#8217;s toes.</p><p><strong>Use EDA when:</strong></p><ul><li><p>One action should trigger multiple independent downstream reactions.</p></li><li><p>Traffic is bursty or unpredictable and you need the broker to absorb spikes.</p></li><li><p>You&#8217;re working in a microservices architecture where teams deploy independently.</p></li><li><p>You need to integrate heterogeneous systems without tight API contracts.</p></li><li><p>Requirements change frequently and you want to add behavior by subscribing, not by modifying.</p></li></ul><p><strong>Avoid EDA when:</strong></p><ul><li><p>You need strict transactional atomicity; e.g. debit one account and credit another in one operation. Events introduce eventual consistency where ACID is required.</p></li><li><p>You need guaranteed ordering across multiple consumers. Global ordering in distributed brokers is hard and expensive.</p></li><li><p>You need immediate confirmation. If the workflow requires &#8220;did this succeed right now?&#8221;, request-response fits better.</p></li><li><p>The system is small and simple. Introducing a broker, event schemas, and consumer infrastructure into a three-service app adds overhead without proportional benefit.</p></li></ul><h2>Best practices that make the difference</h2><p>Getting the architecture right is only half the work. These practices determine whether it stays maintainable as it grows.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!M7vZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd56065d2-71ee-4299-8834-5e6f44938c7d_2000x1326.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!M7vZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd56065d2-71ee-4299-8834-5e6f44938c7d_2000x1326.png 424w, https://substackcdn.com/image/fetch/$s_!M7vZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd56065d2-71ee-4299-8834-5e6f44938c7d_2000x1326.png 848w, https://substackcdn.com/image/fetch/$s_!M7vZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd56065d2-71ee-4299-8834-5e6f44938c7d_2000x1326.png 1272w, https://substackcdn.com/image/fetch/$s_!M7vZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd56065d2-71ee-4299-8834-5e6f44938c7d_2000x1326.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!M7vZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd56065d2-71ee-4299-8834-5e6f44938c7d_2000x1326.png" width="1456" height="965" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d56065d2-71ee-4299-8834-5e6f44938c7d_2000x1326.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:965,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:501815,&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://blog.levelupcoding.com/i/189738216?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd56065d2-71ee-4299-8834-5e6f44938c7d_2000x1326.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_!M7vZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd56065d2-71ee-4299-8834-5e6f44938c7d_2000x1326.png 424w, https://substackcdn.com/image/fetch/$s_!M7vZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd56065d2-71ee-4299-8834-5e6f44938c7d_2000x1326.png 848w, https://substackcdn.com/image/fetch/$s_!M7vZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd56065d2-71ee-4299-8834-5e6f44938c7d_2000x1326.png 1272w, https://substackcdn.com/image/fetch/$s_!M7vZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd56065d2-71ee-4299-8834-5e6f44938c7d_2000x1326.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 role="img" 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><title></title><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>Wrapping up</h2><p>The coupling that slows teams down rarely announces itself.</p><p>It builds quietly: one extra call, one more dependency, one more coordinated deploy.</p><p>EDA breaks that pattern by making components responsible only for what they know: something happened.</p><p>What the rest of the system does with that is no longer your problem. That&#8217;s not just a cleaner architecture. It enforces clearer ownership.</p><div><hr></div><p>&#128075; If you liked this post &#8594; Like + Restack + Share to help others learn system design.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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 get high-signal, clear, and visual system design breakdowns straight to your inbox:&nbsp;</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[What Protocols Actually Do When You Load a Page]]></title><description><![CDATA[(7 minutes) | Every layer has a defined responsibility. Learn how to trace failures precisely.]]></description><link>https://blog.levelupcoding.com/p/network-protocols-explained</link><guid isPermaLink="false">https://blog.levelupcoding.com/p/network-protocols-explained</guid><dc:creator><![CDATA[Nikki Siapno]]></dc:creator><pubDate>Fri, 27 Feb 2026 12:47:49 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/7908e456-fb32-4613-8232-61e8aab75691_1456x1048.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_!yLV0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yLV0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" width="1292" height="266" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:266,&quot;width&quot;:1292,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:343451,&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://lvlupcoding.substack.com/i/171357839?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.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_!yLV0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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">Get our 142-page System Design Handbook for FREE on newsletter signup:</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><h2><a href="https://lucode.co/sonar-summit-z7nl">Sonar Summit: A Global Conversation on Building Better Software in the AI Era</a></h2><h5>Presented by Sonar</h5><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!FOjb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f630fd0-44d5-4023-b4d8-bd34aeb131cf_1200x627.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!FOjb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f630fd0-44d5-4023-b4d8-bd34aeb131cf_1200x627.png 424w, https://substackcdn.com/image/fetch/$s_!FOjb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f630fd0-44d5-4023-b4d8-bd34aeb131cf_1200x627.png 848w, https://substackcdn.com/image/fetch/$s_!FOjb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f630fd0-44d5-4023-b4d8-bd34aeb131cf_1200x627.png 1272w, https://substackcdn.com/image/fetch/$s_!FOjb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f630fd0-44d5-4023-b4d8-bd34aeb131cf_1200x627.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!FOjb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f630fd0-44d5-4023-b4d8-bd34aeb131cf_1200x627.png" width="1200" height="627" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4f630fd0-44d5-4023-b4d8-bd34aeb131cf_1200x627.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:627,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:453732,&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://blog.levelupcoding.com/i/189120727?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f630fd0-44d5-4023-b4d8-bd34aeb131cf_1200x627.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_!FOjb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f630fd0-44d5-4023-b4d8-bd34aeb131cf_1200x627.png 424w, https://substackcdn.com/image/fetch/$s_!FOjb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f630fd0-44d5-4023-b4d8-bd34aeb131cf_1200x627.png 848w, https://substackcdn.com/image/fetch/$s_!FOjb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f630fd0-44d5-4023-b4d8-bd34aeb131cf_1200x627.png 1272w, https://substackcdn.com/image/fetch/$s_!FOjb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f630fd0-44d5-4023-b4d8-bd34aeb131cf_1200x627.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 role="img" 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><title></title><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 question isn&#8217;t whether to use AI. It&#8217;s how to adopt it <strong>without quietly increasing risk and degrading code quality</strong>. That shift is exactly why conversations about software quality in the AI era matter right now.</p><p>This is exactly the kind of conversation happening at <strong><a href="https://lucode.co/sonar-summit-z7nl">Sonar Summit</a></strong>. It&#8217;s <strong>free</strong> and open to the community. <strong>If you want to stay sharp in the current landscape</strong>, this is a valuable space to learn how others are approaching it.</p><p>The lineup includes well-known leaders in the engineering space.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://lucode.co/sonar-summit-z7nl&quot;,&quot;text&quot;:&quot;Save your seat here (for free)&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://lucode.co/sonar-summit-z7nl"><span>Save your seat here (for free)</span></a></p><div><hr></div><h1>What Protocols Actually Do When You Load a Page</h1><p>You don&#8217;t &#8220;just&#8221; load a web page.</p><p>Behind every click, a small crowd of network protocols is involved, each doing one very specific job so the whole thing doesn&#8217;t fall apart.</p><p>Each protocol knows its role.</p><p>And the moment you understand how they fit together, debugging shifts from frantic guesswork to methodical investigation.</p><h2>1. Joining the Network &#8594; Physical &amp; Data Link Layers</h2><p>Before your device can reach the wider internet, it has to join a local network. That requires both a physical connection and a way to talk to nearby devices.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!aVeg!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fddebe8cc-19f6-4f70-8e76-cff81f3ccf88_2000x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!aVeg!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fddebe8cc-19f6-4f70-8e76-cff81f3ccf88_2000x800.png 424w, https://substackcdn.com/image/fetch/$s_!aVeg!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fddebe8cc-19f6-4f70-8e76-cff81f3ccf88_2000x800.png 848w, https://substackcdn.com/image/fetch/$s_!aVeg!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fddebe8cc-19f6-4f70-8e76-cff81f3ccf88_2000x800.png 1272w, https://substackcdn.com/image/fetch/$s_!aVeg!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fddebe8cc-19f6-4f70-8e76-cff81f3ccf88_2000x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!aVeg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fddebe8cc-19f6-4f70-8e76-cff81f3ccf88_2000x800.png" width="1456" height="582" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ddebe8cc-19f6-4f70-8e76-cff81f3ccf88_2000x800.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:582,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:286769,&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://blog.levelupcoding.com/i/189120727?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fddebe8cc-19f6-4f70-8e76-cff81f3ccf88_2000x800.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_!aVeg!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fddebe8cc-19f6-4f70-8e76-cff81f3ccf88_2000x800.png 424w, https://substackcdn.com/image/fetch/$s_!aVeg!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fddebe8cc-19f6-4f70-8e76-cff81f3ccf88_2000x800.png 848w, https://substackcdn.com/image/fetch/$s_!aVeg!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fddebe8cc-19f6-4f70-8e76-cff81f3ccf88_2000x800.png 1272w, https://substackcdn.com/image/fetch/$s_!aVeg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fddebe8cc-19f6-4f70-8e76-cff81f3ccf88_2000x800.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 role="img" 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><title></title><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>Ethernet &#8594; Wired physical &amp; data link layers</h3><p>Ethernet defines how bits travel over copper or fiber and how frames identify sender and receiver using MAC addresses. It&#8217;s stable, fast, and predictable; ideal in data centers or offices where performance matters more than mobility.</p><h3>Wi-Fi &#8594; Wireless physical &amp; data link layers</h3><p>Wi-Fi carries the same type of frames, but over radio instead of wires. The convenience costs you some consistency, because radio waves are subject to interference, congestion, and range limitations.</p><h3>ARP &#8594; Data link layer address resolution</h3><p>You can&#8217;t talk to another device using its IP address alone. The data link layer wants a MAC address. ARP fills that gap by asking, &#8220;Who has this IP?&#8221; Local devices respond with the matching MAC. Without ARP, communication would stall on your very first hop.</p><h3>DHCP &#8594; Application layer using network-layer concepts</h3><p>Once you join a network, DHCP assigns your IP address, subnet mask, gateway, DNS servers, and lease duration. It removes the burden of manual configuration and ensures no two devices collide on the same IP.</p><p><strong>When something breaks here:</strong></p><ul><li><p>If you see <em>&#8220;No IP address&#8221;</em> or <em>169.254.x.x</em> self-assigned IPs, the DHCP server didn&#8217;t respond or the broadcasts didn&#8217;t reach it.</p></li><li><p>If you can&#8217;t ping your gateway, the wireless signal may be weak, the cable faulty, or ARP resolution may be incorrect.</p></li><li><p>If the connection keeps dropping, look for Wi-Fi interference, bad cables, or a failing switch port.</p></li></ul><p>At this stage, failures tend to feel blunt: no internet, unstable connection, or outright inability to join the network.</p><h2>2. Figuring out where to go &#8594; Network &amp; application layers</h2><p>You&#8217;re now connected locally, but the website you want isn&#8217;t in your living room. Your device needs two things: a destination IP and a way to reach it.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!j-5n!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6164442d-cdd5-4d84-85a1-3345440dd356_2000x1221.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!j-5n!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6164442d-cdd5-4d84-85a1-3345440dd356_2000x1221.png 424w, https://substackcdn.com/image/fetch/$s_!j-5n!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6164442d-cdd5-4d84-85a1-3345440dd356_2000x1221.png 848w, https://substackcdn.com/image/fetch/$s_!j-5n!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6164442d-cdd5-4d84-85a1-3345440dd356_2000x1221.png 1272w, https://substackcdn.com/image/fetch/$s_!j-5n!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6164442d-cdd5-4d84-85a1-3345440dd356_2000x1221.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!j-5n!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6164442d-cdd5-4d84-85a1-3345440dd356_2000x1221.png" width="1456" height="889" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6164442d-cdd5-4d84-85a1-3345440dd356_2000x1221.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:889,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:630858,&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://blog.levelupcoding.com/i/189120727?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6164442d-cdd5-4d84-85a1-3345440dd356_2000x1221.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-5n!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6164442d-cdd5-4d84-85a1-3345440dd356_2000x1221.png 424w, https://substackcdn.com/image/fetch/$s_!j-5n!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6164442d-cdd5-4d84-85a1-3345440dd356_2000x1221.png 848w, https://substackcdn.com/image/fetch/$s_!j-5n!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6164442d-cdd5-4d84-85a1-3345440dd356_2000x1221.png 1272w, https://substackcdn.com/image/fetch/$s_!j-5n!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6164442d-cdd5-4d84-85a1-3345440dd356_2000x1221.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 role="img" 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><title></title><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>DNS &#8594; Application layer name resolution</h3><p>Humans like words; machines like numbers. DNS translates <code>www.example.com</code> into an IP address the network layer can route. If DNS fails, everything above it collapses. No IP means no connection.</p><h3>IP &#8594; Network layer routing and delivery</h3><p>IP packets carry your data across networks owned by different companies and countries. Each router along the way simply checks the destination address, consults its routing table, and forwards the packet along the best known path.</p><h3>ICMP &#8594; Network layer diagnostics</h3><p>When things go wrong, ICMP speaks up. It reports unreachable networks, expired TTLs, and other routing failures. Tools like <em>ping</em> and <em>traceroute</em> rely on ICMP for visibility into the path your packets take.</p><h3>BGP &#8594; Application layer routing control for the global internet</h3><p>BGP is how the world&#8217;s autonomous networks tell each other which IP ranges they can deliver. It&#8217;s why traffic sent from Sydney eventually finds its way to servers in London or S&#227;o Paulo. Without BGP, the internet would be a collection of isolated networks with no map connecting them.</p><p><strong>When something breaks here:</strong></p><ul><li><p>If DNS queries time out or return wrong answers, you&#8217;ll see instant failures loading any site; even if physical connectivity is fine.</p></li><li><p>If traceroute stalls or jumps unexpectedly, routing loops, misconfigurations, or upstream outages may be dropping packets at specific hops.</p></li><li><p>If ping works but loading pages doesn&#8217;t, packets may reach the server but responses may take a different broken return path.</p></li><li><p>If an entire region suddenly can&#8217;t reach a service, a BGP misannouncement upstream often explains the outage.</p></li></ul><p>These issues often masquerade as &#8220;the internet is slow,&#8221; but the symptoms typically point squarely at name resolution or routing decisions.</p><h2>3. Moving data reliably or fast &#8594; Transport layer</h2><p>Now that your device knows where to send data, it needs a transport mechanism. Two major protocols define two very different philosophies.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QaCU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb9665b7-554f-486f-9442-133f412d992c_2000x644.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QaCU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb9665b7-554f-486f-9442-133f412d992c_2000x644.png 424w, https://substackcdn.com/image/fetch/$s_!QaCU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb9665b7-554f-486f-9442-133f412d992c_2000x644.png 848w, https://substackcdn.com/image/fetch/$s_!QaCU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb9665b7-554f-486f-9442-133f412d992c_2000x644.png 1272w, https://substackcdn.com/image/fetch/$s_!QaCU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb9665b7-554f-486f-9442-133f412d992c_2000x644.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QaCU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb9665b7-554f-486f-9442-133f412d992c_2000x644.png" width="1456" height="469" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cb9665b7-554f-486f-9442-133f412d992c_2000x644.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:469,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:332905,&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://blog.levelupcoding.com/i/189120727?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb9665b7-554f-486f-9442-133f412d992c_2000x644.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_!QaCU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb9665b7-554f-486f-9442-133f412d992c_2000x644.png 424w, https://substackcdn.com/image/fetch/$s_!QaCU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb9665b7-554f-486f-9442-133f412d992c_2000x644.png 848w, https://substackcdn.com/image/fetch/$s_!QaCU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb9665b7-554f-486f-9442-133f412d992c_2000x644.png 1272w, https://substackcdn.com/image/fetch/$s_!QaCU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb9665b7-554f-486f-9442-133f412d992c_2000x644.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 role="img" 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><title></title><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>TCP &#8594; Transport layer reliability and order</h3><p>TCP makes networks feel reliable even when they&#8217;re not. It handles connection setup, retransmissions, flow control, congestion management, and ordering. If a packet gets lost, TCP repeats it. If packets arrive out of sequence, TCP rearranges them.</p><p>Most of the web still uses TCP under the hood: HTTPS, APIs, database connections, and email all depend on TCP&#8217;s guarantees.</p><h3>UDP &#8594; Transport layer speed and simplicity</h3><p>UDP strips out everything except the essentials: ports, length, and checksum. There&#8217;s no handshake, no retransmission, and no ordering. If a packet drops, the application decides whether to care.</p><p>When you&#8217;re in a Zoom call or a multiplayer game, you&#8217;d rather skip a single frame than pause the entire session waiting for recovery. UDP enables that.</p><p><strong>When something breaks here:</strong></p><ul><li><p>If connections hang on &#8220;SYN sent,&#8221; firewalls or rate limits may be blocking TCP handshakes.</p></li><li><p>If applications feel slow despite low CPU, excessive TCP retransmissions may indicate packet loss or congestion.</p></li><li><p>If video or audio stutters over UDP, the network may be too lossy for real-time traffic; and since UDP won&#8217;t retry, the glitch shows up immediately.</p></li><li><p>If long-lived TCP sessions drop unpredictably, Network Address Translation (NAT) timeouts or load balancers may be silently killing idle connections.</p></li></ul><p>Transport issues often feel subtle: partial loads, long pauses, &#8220;sometimes it works&#8221; behavior.</p><h2>4. Securing and speaking meaningfully &#8594; Session/presentation &amp; application layers</h2><p>The transport layer moves bytes. Higher layers give those bytes structure, meaning, and security.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!TwyH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc73e07ef-f647-4578-bec7-63fcf97e28c6_2000x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!TwyH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc73e07ef-f647-4578-bec7-63fcf97e28c6_2000x800.png 424w, https://substackcdn.com/image/fetch/$s_!TwyH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc73e07ef-f647-4578-bec7-63fcf97e28c6_2000x800.png 848w, https://substackcdn.com/image/fetch/$s_!TwyH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc73e07ef-f647-4578-bec7-63fcf97e28c6_2000x800.png 1272w, https://substackcdn.com/image/fetch/$s_!TwyH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc73e07ef-f647-4578-bec7-63fcf97e28c6_2000x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!TwyH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc73e07ef-f647-4578-bec7-63fcf97e28c6_2000x800.png" width="1456" height="582" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c73e07ef-f647-4578-bec7-63fcf97e28c6_2000x800.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:582,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:744619,&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://blog.levelupcoding.com/i/189120727?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc73e07ef-f647-4578-bec7-63fcf97e28c6_2000x800.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_!TwyH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc73e07ef-f647-4578-bec7-63fcf97e28c6_2000x800.png 424w, https://substackcdn.com/image/fetch/$s_!TwyH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc73e07ef-f647-4578-bec7-63fcf97e28c6_2000x800.png 848w, https://substackcdn.com/image/fetch/$s_!TwyH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc73e07ef-f647-4578-bec7-63fcf97e28c6_2000x800.png 1272w, https://substackcdn.com/image/fetch/$s_!TwyH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc73e07ef-f647-4578-bec7-63fcf97e28c6_2000x800.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 role="img" 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><title></title><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>TLS &#8594; Session/presentation layer security</h3><p>TLS encrypts the connection between two endpoints. It prevents snooping, tampering, and impersonation. Almost every meaningful web interaction now runs through TLS.</p><h3>HTTP &#8594; Application layer communication</h3><p>HTTP defines verbs (GET, POST), headers, caching rules, content types, and status codes that let browsers and servers communicate clearly. It is the backbone of everything from websites to REST APIs.</p><h3>HTTPS &#8594; Application layer secure web communication</h3><p>HTTPS is HTTP delivered through a TLS-encrypted channel. It protects requests and responses from interception or tampering and verifies the server&#8217;s identity. Modern browsers and APIs use HTTPS by default to ensure secure, trustworthy communication over the internet.</p><h3>HTTP/3 + QUIC &#8594; Application layer over a modern transport</h3><p>QUIC redesigns transport semantics on top of UDP. It implements its own encryption (TLS integrated), reliability, congestion control, and multiplexing; without inheriting TCP&#8217;s head-of-line blocking.</p><p>HTTP/3 sits atop QUIC and benefits from:</p><ul><li><p>Faster connection setup</p></li><li><p>Independent streams</p></li><li><p>Better behavior in lossy mobile networks</p></li><li><p>Seamless migration when you switch Wi-Fi networks</p></li></ul><h3>FTP &#8594; Application layer file transfer</h3><p>FTP enables basic file uploads and downloads using separate control and data channels. Because it sends credentials and data in plaintext, it&#8217;s now mostly replaced by secure options like FTPS or SFTP.</p><h3>FTPS &#8594; Application layer secure file transfer</h3><p>FTPS adds TLS encryption to traditional FTP, securing credentials and file contents while keeping the same command and data channel structure.</p><p><strong>When something breaks here:</strong></p><ul><li><p>If browsers warn about certificate errors, the TLS handshake is failing; often due to expired certificates, incorrect system clocks, or mismatched hostnames.</p></li><li><p>If an API returns inconsistent data or unexpected codes, the issue is usually HTTP semantics, not the transport.</p></li><li><p>If a connection falls back from HTTP/3 to HTTP/2, middleboxes may be blocking QUIC traffic or UDP entirely.</p></li><li><p>If only certain pages break, expect HTTP caching, header size issues, or content negotiation problems rather than lower-layer failures.</p></li></ul><p>Session and application issues tend to be precise: specific URLs fail, certain clients break, or behavior differs between environments.</p><h2>5. Behind-the-scenes coordination &#8594; Application layer protocols</h2><p>Some application-layer protocols don&#8217;t fetch webpages; they orchestrate backend behavior.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!L4Rv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc05dd355-74d9-47d4-82ad-50495843b03d_2000x580.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!L4Rv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc05dd355-74d9-47d4-82ad-50495843b03d_2000x580.png 424w, https://substackcdn.com/image/fetch/$s_!L4Rv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc05dd355-74d9-47d4-82ad-50495843b03d_2000x580.png 848w, https://substackcdn.com/image/fetch/$s_!L4Rv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc05dd355-74d9-47d4-82ad-50495843b03d_2000x580.png 1272w, https://substackcdn.com/image/fetch/$s_!L4Rv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc05dd355-74d9-47d4-82ad-50495843b03d_2000x580.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!L4Rv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc05dd355-74d9-47d4-82ad-50495843b03d_2000x580.png" width="1456" height="422" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c05dd355-74d9-47d4-82ad-50495843b03d_2000x580.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:422,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:366986,&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://blog.levelupcoding.com/i/189120727?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc05dd355-74d9-47d4-82ad-50495843b03d_2000x580.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_!L4Rv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc05dd355-74d9-47d4-82ad-50495843b03d_2000x580.png 424w, https://substackcdn.com/image/fetch/$s_!L4Rv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc05dd355-74d9-47d4-82ad-50495843b03d_2000x580.png 848w, https://substackcdn.com/image/fetch/$s_!L4Rv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc05dd355-74d9-47d4-82ad-50495843b03d_2000x580.png 1272w, https://substackcdn.com/image/fetch/$s_!L4Rv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc05dd355-74d9-47d4-82ad-50495843b03d_2000x580.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 role="img" 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><title></title><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>gRPC &#8594; High-performance service-to-service communication</h3><p>gRPC lets microservices communicate as if they were calling native functions. It uses HTTP/2 or HTTP/3 streams and compact Protocol Buffers to reduce overhead. It&#8217;s type-safe, efficient, and ideal for modern distributed systems.</p><h3>SSH &#8594; Secure remote administration</h3><p>SSH provides secure remote login, file transfer, and tunneling. It&#8217;s the protocol behind almost every server deployment, debug session, and emergency patch.</p><p><strong>When something breaks here:</strong></p><ul><li><p>If gRPC calls fail while HTTP still works, client/server versions may be out of sync or message definitions incompatible.</p></li><li><p>If SSH hangs on connect, packet filters or intrusion prevention systems may be delaying or dropping the handshake.</p></li><li><p>If tunnels drop frequently, idle timeouts or NAT expiration are likely silently killing the session.</p></li></ul><p>Issues at this layer often look like internal tooling failures rather than customer-facing outages.</p><h2>Final thought</h2><p>Networking feels complicated until you see it as a series of cooperating layers.</p><p>Each one has a narrow responsibility. Each one hands a problem to the next. And once you learn to read those boundaries, the internet becomes less magical and more mechanical; in the best possible way.</p><p>Because now, the next time someone says &#8220;The website is down,&#8221; you won&#8217;t guess. You&#8217;ll walk the layers, protocol by protocol, until the real culprit reveals itself.</p><div><hr></div><p>&#128075; If you liked this post &#8594; Like + Restack + Share to help others learn system design.</p><div><hr></div><p>Subscribe to get high-signal, clear, and visual system design breakdowns straight to your inbox:</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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">&nbsp;</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[Forward Proxy vs Reverse Proxy: A Clean Mental Model]]></title><description><![CDATA[(3 minutes) | They both relay traffic. But they solve completely different problems.]]></description><link>https://blog.levelupcoding.com/p/forward-proxy-vs-reverse-proxy</link><guid isPermaLink="false">https://blog.levelupcoding.com/p/forward-proxy-vs-reverse-proxy</guid><dc:creator><![CDATA[Nikki Siapno]]></dc:creator><pubDate>Wed, 25 Feb 2026 11:56:41 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/ddb0ca9f-e519-4d46-9064-ee80e47a93bc_1456x1048.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_!yLV0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yLV0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" width="1292" height="266" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:266,&quot;width&quot;:1292,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:343451,&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://lvlupcoding.substack.com/i/171357839?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.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_!yLV0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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">Get our 142-page System Design Handbook for FREE on newsletter signup:</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><h2><a href="https://lucode.co/spec-driven-development-rovo-dev-z7nl">Spec Driven Development with Rovo Dev</a></h2><h5>Presented by Atlassian</h5><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!HbJH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89bdae08-4c1d-4990-ba22-01fee251b4eb_1560x760.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!HbJH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89bdae08-4c1d-4990-ba22-01fee251b4eb_1560x760.png 424w, https://substackcdn.com/image/fetch/$s_!HbJH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89bdae08-4c1d-4990-ba22-01fee251b4eb_1560x760.png 848w, https://substackcdn.com/image/fetch/$s_!HbJH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89bdae08-4c1d-4990-ba22-01fee251b4eb_1560x760.png 1272w, https://substackcdn.com/image/fetch/$s_!HbJH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89bdae08-4c1d-4990-ba22-01fee251b4eb_1560x760.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!HbJH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89bdae08-4c1d-4990-ba22-01fee251b4eb_1560x760.png" width="1456" height="709" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/89bdae08-4c1d-4990-ba22-01fee251b4eb_1560x760.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:709,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:28782,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.levelupcoding.com/i/185166649?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89bdae08-4c1d-4990-ba22-01fee251b4eb_1560x760.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_!HbJH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89bdae08-4c1d-4990-ba22-01fee251b4eb_1560x760.png 424w, https://substackcdn.com/image/fetch/$s_!HbJH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89bdae08-4c1d-4990-ba22-01fee251b4eb_1560x760.png 848w, https://substackcdn.com/image/fetch/$s_!HbJH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89bdae08-4c1d-4990-ba22-01fee251b4eb_1560x760.png 1272w, https://substackcdn.com/image/fetch/$s_!HbJH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89bdae08-4c1d-4990-ba22-01fee251b4eb_1560x760.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 role="img" 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><title></title><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>Specs only work if they stay connected to execution. <strong><a href="https://lucode.co/spec-driven-development-rovo-dev-z7nl">Rovo Dev</a></strong> enables spec-driven development by grounding AI directly in Jira tickets, acceptance criteria, and Confluence docs. <strong>Instead of</strong> re-explaining requirements or copying context between tools, developers can generate, validate, and review code against the original spec. <strong>The result is</strong> less drift, fewer misunderstandings, and faster delivery without sacrificing correctness.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://lucode.co/spec-driven-development-rovo-dev-z7nl&quot;,&quot;text&quot;:&quot;Read the article&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://lucode.co/spec-driven-development-rovo-dev-z7nl"><span>Read the article</span></a></p><div><hr></div><h1>Forward Proxy vs Reverse Proxy</h1><p>Many developers confuse forward proxies with reverse proxies.</p><p>Both sit between clients and servers, both relay requests, and both can cache or filter traffic. But their purposes could not be more different.</p><p>The key difference is simple:</p><p>A <strong>forward proxy</strong> acts on behalf of the <strong>client</strong>.</p><p>A <strong>reverse proxy</strong> acts on behalf of the <strong>server</strong>.</p><p>Understanding this distinction is crucial when designing secure, scalable, and efficient systems. Let&#8217;s break it down.</p><h2>Forward proxy</h2><p>A <strong>forward proxy</strong> sits between clients and the open internet. The client configures its device or app to route traffic through the proxy, which then makes requests on the client&#8217;s behalf.</p><p>It&#8217;s like using a VPN service. Websites see the VPN&#8217;s IP, not yours.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!5OXz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd31bab3-63d6-4dce-baf5-726fade44972_2000x1019.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!5OXz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd31bab3-63d6-4dce-baf5-726fade44972_2000x1019.png 424w, https://substackcdn.com/image/fetch/$s_!5OXz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd31bab3-63d6-4dce-baf5-726fade44972_2000x1019.png 848w, https://substackcdn.com/image/fetch/$s_!5OXz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd31bab3-63d6-4dce-baf5-726fade44972_2000x1019.png 1272w, https://substackcdn.com/image/fetch/$s_!5OXz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd31bab3-63d6-4dce-baf5-726fade44972_2000x1019.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!5OXz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd31bab3-63d6-4dce-baf5-726fade44972_2000x1019.png" width="1456" height="742" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bd31bab3-63d6-4dce-baf5-726fade44972_2000x1019.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:742,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1354114,&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://blog.levelupcoding.com/i/174424622?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd31bab3-63d6-4dce-baf5-726fade44972_2000x1019.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_!5OXz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd31bab3-63d6-4dce-baf5-726fade44972_2000x1019.png 424w, https://substackcdn.com/image/fetch/$s_!5OXz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd31bab3-63d6-4dce-baf5-726fade44972_2000x1019.png 848w, https://substackcdn.com/image/fetch/$s_!5OXz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd31bab3-63d6-4dce-baf5-726fade44972_2000x1019.png 1272w, https://substackcdn.com/image/fetch/$s_!5OXz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd31bab3-63d6-4dce-baf5-726fade44972_2000x1019.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 role="img" 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><title></title><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 it does</h2><ul><li><p><strong>Hides identity</strong> &#8594; The server only sees the proxy&#8217;s IP, not the client&#8217;s.</p></li><li><p><strong>Enforces rules</strong> &#8594; Organizations can block or allow certain websites.</p></li><li><p><strong>Caches</strong> &#8594; Frequently accessed content is stored and reused.</p></li><li><p><strong>Bypasses restrictions</strong> &#8594; Users can access geo-blocked or censored sites.</p></li><li><p><strong>Centralizes access</strong> &#8594; All outbound traffic can be monitored in one place.</p></li></ul><h2>When it shines</h2><ul><li><p><strong>Filtering traffic</strong> &#8594; A school blocking access to certain websites.</p></li><li><p><strong>Anonymity and privacy</strong> &#8594; A journalist hiding their location.</p></li><li><p><strong>Reducing bandwidth costs</strong> &#8594; A corporate network caching OS updates.</p></li></ul><h2>Tradeoffs</h2><ul><li><p><strong>Limited protection</strong> &#8594; It doesn&#8217;t stop malware.</p></li><li><p><strong>Possible bottlenecks</strong> &#8594; All traffic passes through one point.</p></li><li><p><strong>Trust risk</strong> &#8594; The proxy can log or alter data.</p></li></ul><p>In short, forward proxies are for <strong>controlling and anonymizing client traffic</strong>.</p><h2>Reverse proxy</h2><p>A <strong>reverse proxy</strong> flips the direction. It sits in front of servers and accepts inbound traffic from clients. To the outside world, the proxy looks like the server itself.</p><p>A reverse proxy works like a load balancer. Clients hit a single endpoint, but requests are distributed across multiple backend servers.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!qzdz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31577c9a-1475-4ece-9b3a-a1899d756dae_2000x932.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!qzdz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31577c9a-1475-4ece-9b3a-a1899d756dae_2000x932.png 424w, https://substackcdn.com/image/fetch/$s_!qzdz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31577c9a-1475-4ece-9b3a-a1899d756dae_2000x932.png 848w, https://substackcdn.com/image/fetch/$s_!qzdz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31577c9a-1475-4ece-9b3a-a1899d756dae_2000x932.png 1272w, https://substackcdn.com/image/fetch/$s_!qzdz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31577c9a-1475-4ece-9b3a-a1899d756dae_2000x932.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!qzdz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31577c9a-1475-4ece-9b3a-a1899d756dae_2000x932.png" width="1456" height="678" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/31577c9a-1475-4ece-9b3a-a1899d756dae_2000x932.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:678,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1193758,&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://blog.levelupcoding.com/i/174424622?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31577c9a-1475-4ece-9b3a-a1899d756dae_2000x932.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_!qzdz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31577c9a-1475-4ece-9b3a-a1899d756dae_2000x932.png 424w, https://substackcdn.com/image/fetch/$s_!qzdz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31577c9a-1475-4ece-9b3a-a1899d756dae_2000x932.png 848w, https://substackcdn.com/image/fetch/$s_!qzdz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31577c9a-1475-4ece-9b3a-a1899d756dae_2000x932.png 1272w, https://substackcdn.com/image/fetch/$s_!qzdz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31577c9a-1475-4ece-9b3a-a1899d756dae_2000x932.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 role="img" 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><title></title><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 it does</h2><ul><li><p><strong>Load balances</strong> &#8594; Distributes traffic across multiple servers.</p></li><li><p><strong>Shields servers </strong>&#8594; Hides backend IP addresses from attackers.</p></li><li><p><strong>Handles TLS</strong> &#8594; Manages encryption/decryption centrally.</p></li><li><p><strong>Caches and compresses</strong> &#8594; Reduces bandwidth and improves speed.</p></li></ul><h2>When it shines</h2><ul><li><p><strong>Handling traffic surges</strong> &#8594; An e-commerce site managing Black Friday traffic.</p></li><li><p><strong>Ensuring high availability</strong> &#8594; A SaaS provider maintaining uptime.</p></li><li><p><strong>Centralizing TLS termination</strong> &#8594; A company offloading encryption from its backend servers.</p></li></ul><h2>Tradeoffs</h2><ul><li><p><strong>Single point of failure</strong> &#8594; If the proxy goes down and isn&#8217;t replicated, the entire service becomes unreachable.</p></li><li><p><strong>Latency overhead</strong> &#8594; Every request takes one extra network hop through the proxy.</p></li><li><p><strong>Operational complexity</strong> &#8594; Proxies require careful setup, tuning, and monitoring to avoid becoming bottlenecks or attack targets.</p></li></ul><p>In short, reverse proxies are for <strong>scaling, securing, and managing server-side infrastructure</strong>.</p><h2>Recap</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!NlsP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6227470-0e67-40b1-8a52-b162d0d9ea0b_1792x2000.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!NlsP!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6227470-0e67-40b1-8a52-b162d0d9ea0b_1792x2000.png 424w, https://substackcdn.com/image/fetch/$s_!NlsP!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6227470-0e67-40b1-8a52-b162d0d9ea0b_1792x2000.png 848w, https://substackcdn.com/image/fetch/$s_!NlsP!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6227470-0e67-40b1-8a52-b162d0d9ea0b_1792x2000.png 1272w, https://substackcdn.com/image/fetch/$s_!NlsP!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6227470-0e67-40b1-8a52-b162d0d9ea0b_1792x2000.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!NlsP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6227470-0e67-40b1-8a52-b162d0d9ea0b_1792x2000.png" width="1456" height="1625" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e6227470-0e67-40b1-8a52-b162d0d9ea0b_1792x2000.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1625,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2122226,&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://blog.levelupcoding.com/i/174424622?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6227470-0e67-40b1-8a52-b162d0d9ea0b_1792x2000.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_!NlsP!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6227470-0e67-40b1-8a52-b162d0d9ea0b_1792x2000.png 424w, https://substackcdn.com/image/fetch/$s_!NlsP!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6227470-0e67-40b1-8a52-b162d0d9ea0b_1792x2000.png 848w, https://substackcdn.com/image/fetch/$s_!NlsP!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6227470-0e67-40b1-8a52-b162d0d9ea0b_1792x2000.png 1272w, https://substackcdn.com/image/fetch/$s_!NlsP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6227470-0e67-40b1-8a52-b162d0d9ea0b_1792x2000.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 role="img" 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><title></title><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 class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OidF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8730e003-bd15-4d9b-b014-99686aa3fd47_2000x961.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OidF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8730e003-bd15-4d9b-b014-99686aa3fd47_2000x961.png 424w, https://substackcdn.com/image/fetch/$s_!OidF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8730e003-bd15-4d9b-b014-99686aa3fd47_2000x961.png 848w, https://substackcdn.com/image/fetch/$s_!OidF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8730e003-bd15-4d9b-b014-99686aa3fd47_2000x961.png 1272w, https://substackcdn.com/image/fetch/$s_!OidF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8730e003-bd15-4d9b-b014-99686aa3fd47_2000x961.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OidF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8730e003-bd15-4d9b-b014-99686aa3fd47_2000x961.png" width="1456" height="700" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8730e003-bd15-4d9b-b014-99686aa3fd47_2000x961.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:700,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:406695,&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://blog.levelupcoding.com/i/174424622?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8730e003-bd15-4d9b-b014-99686aa3fd47_2000x961.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_!OidF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8730e003-bd15-4d9b-b014-99686aa3fd47_2000x961.png 424w, https://substackcdn.com/image/fetch/$s_!OidF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8730e003-bd15-4d9b-b014-99686aa3fd47_2000x961.png 848w, https://substackcdn.com/image/fetch/$s_!OidF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8730e003-bd15-4d9b-b014-99686aa3fd47_2000x961.png 1272w, https://substackcdn.com/image/fetch/$s_!OidF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8730e003-bd15-4d9b-b014-99686aa3fd47_2000x961.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 role="img" 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><title></title><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>Choosing between a forward proxy and a reverse proxy comes down to where your challenge lies. If your concern is outbound traffic; privacy, control, or bypassing restrictions. Use a forward proxy.</p><p>If it&#8217;s inbound traffic; scaling servers, shielding infrastructure, or centralizing SSL. Use a reverse proxy.</p><p>The right choice depends not on the technology itself but on which side of the network you need to strengthen.</p><div><hr></div><p>&#128075; If you liked this post &#8594; Like + Restack + Share to help others learn system design.</p><div><hr></div><p>Subscribe to get high-signal, clear, and visual system design breakdowns straight to your inbox:</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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">&nbsp;</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[Domain-Driven Design, Broken Down]]></title><description><![CDATA[(5 minutes) | How DDD prevents your model from collapsing as systems and teams scale]]></description><link>https://blog.levelupcoding.com/p/domain-driven-design-broken-down</link><guid isPermaLink="false">https://blog.levelupcoding.com/p/domain-driven-design-broken-down</guid><dc:creator><![CDATA[Nikki Siapno]]></dc:creator><pubDate>Sat, 21 Feb 2026 11:59:20 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/462c4ade-53dd-4754-a7fc-db50ba154b25_1456x1048.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_!yLV0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yLV0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png" width="1292" height="266" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:266,&quot;width&quot;:1292,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:343451,&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://lvlupcoding.substack.com/i/171357839?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.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_!yLV0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 424w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 848w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1272w, https://substackcdn.com/image/fetch/$s_!yLV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa58aa08-bd21-454c-9e82-1d7ba2fedfaa_1292x266.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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">Get our 142-page System Design Handbook for FREE on newsletter signup:</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><h2><a href="https://lucode.co/rovo-dev-refactoring-z7nl">Refactor with Context, Not Guesswork</a></h2><h5>Presented by Atlassian</h5><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!pPRC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F121e54c3-edf1-431a-8143-b91a16e2e74f_1560x760.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!pPRC!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F121e54c3-edf1-431a-8143-b91a16e2e74f_1560x760.png 424w, https://substackcdn.com/image/fetch/$s_!pPRC!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F121e54c3-edf1-431a-8143-b91a16e2e74f_1560x760.png 848w, https://substackcdn.com/image/fetch/$s_!pPRC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F121e54c3-edf1-431a-8143-b91a16e2e74f_1560x760.png 1272w, https://substackcdn.com/image/fetch/$s_!pPRC!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F121e54c3-edf1-431a-8143-b91a16e2e74f_1560x760.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!pPRC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F121e54c3-edf1-431a-8143-b91a16e2e74f_1560x760.png" width="1456" height="709" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/121e54c3-edf1-431a-8143-b91a16e2e74f_1560x760.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:709,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:40878,&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;:false,&quot;internalRedirect&quot;:&quot;https://blog.levelupcoding.com/i/183656416?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F121e54c3-edf1-431a-8143-b91a16e2e74f_1560x760.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_!pPRC!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F121e54c3-edf1-431a-8143-b91a16e2e74f_1560x760.png 424w, https://substackcdn.com/image/fetch/$s_!pPRC!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F121e54c3-edf1-431a-8143-b91a16e2e74f_1560x760.png 848w, https://substackcdn.com/image/fetch/$s_!pPRC!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F121e54c3-edf1-431a-8143-b91a16e2e74f_1560x760.png 1272w, https://substackcdn.com/image/fetch/$s_!pPRC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F121e54c3-edf1-431a-8143-b91a16e2e74f_1560x760.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 role="img" 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><title></title><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><a href="https://lucode.co/rovo-dev-refactoring-z7nl">Rovo Dev</a></strong> is <strong>Atlassian&#8217;s context-aware AI agent for the entire SDLC</strong>. One of the use cases where it excels is refactoring. It helps teams plan changes, generate consistent multi-file updates, and review pull requests against Jira acceptance criteria and Confluence context. Learn <strong>how</strong> <strong>Atlassian engineers used Rovo Dev</strong> and AI-driven workflows <strong>to safely refactor a large monorepo</strong>.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://lucode.co/rovo-dev-refactoring-z7nl&quot;,&quot;text&quot;:&quot;Read the article&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://lucode.co/rovo-dev-refactoring-z7nl"><span>Read the article</span></a></p><div><hr></div><h1>Breaking Down Domain-Driven Design</h1><p>Early systems succeed because everyone shares the same mental model.</p><p>Late-stage systems fail because that model fractures.</p><p>Teams grow, terminology drifts, and the code becomes a poor translation of the business. At that point, speed drops even if your infrastructure is flawless.</p><p>Domain-Driven Design targets that exact moment of failure.</p><h2>The real problem DDD solves</h2><p>In complex products, the hardest part is not the codebase. It&#8217;s agreeing on what the business is <em>actually doing</em>.</p><p>Domain-Driven Design (DDD) forces the domain into the foreground.</p><p>You model the business concepts directly, so the code reads like the business operates.</p><p>That only works if you draw boundaries and protect them. Otherwise you get one giant model that tries to mean everything.</p><h2>Five core patterns that make DDD work</h2><h3>1) Ubiquitous Language</h3><p>Most teams think they share vocabulary.</p><p>They usually don&#8217;t.</p><p>In meetings, everyone nods when someone says &#8220;order,&#8221; &#8220;account,&#8221; or &#8220;encounter.&#8221; In code, those same words quietly drift into something else.</p><p>Ubiquitous language is a shared vocabulary that developers and domain experts use everywhere: meetings, tickets, docs, and code.</p><p>You stop translating &#8220;business terms&#8221; into &#8220;engineering terms.&#8221;</p><p><strong>Pros:</strong></p><ul><li><p><strong>Shared meaning</strong> &#8594; Reduces back-and-forth and avoids &#8220;same word, different idea.&#8221;</p></li><li><p><strong>Readable code</strong> &#8594; New engineers learn by reading domain names, not glue code.</p></li><li><p><strong>Better decisions</strong> &#8594; Clear terms expose missing rules and edge cases.</p></li></ul><p><strong>Cons:</strong></p><ul><li><p><strong>Upfront effort</strong> &#8594; Workshops and alignment feel slow early.</p></li><li><p><strong>Requires discipline</strong> &#8594; Sloppy naming breaks the whole benefit.</p></li></ul><h3>2) Bounded Contexts</h3><p>Shared language breaks down at scale.</p><p>Not because people are careless, but because the business is not one thing.</p><p>Bounded Contexts accepts that reality.</p><p>A <strong>bounded context</strong> is a clear boundary where a particular model and language apply. Outside that boundary, the same word can legitimately mean something else.</p><p>In an e-commerce system, &#8220;Product&#8221; in <strong>Inventory</strong> can mean descriptions and pricing, while &#8220;Product&#8221; in <strong>Order Management</strong> can mean a purchasable line item.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Ddcn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc4c7b88-debb-4b62-9232-4cf720c66eba_2000x1381.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Ddcn!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc4c7b88-debb-4b62-9232-4cf720c66eba_2000x1381.png 424w, https://substackcdn.com/image/fetch/$s_!Ddcn!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc4c7b88-debb-4b62-9232-4cf720c66eba_2000x1381.png 848w, https://substackcdn.com/image/fetch/$s_!Ddcn!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc4c7b88-debb-4b62-9232-4cf720c66eba_2000x1381.png 1272w, https://substackcdn.com/image/fetch/$s_!Ddcn!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc4c7b88-debb-4b62-9232-4cf720c66eba_2000x1381.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Ddcn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc4c7b88-debb-4b62-9232-4cf720c66eba_2000x1381.png" width="1456" height="1005" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fc4c7b88-debb-4b62-9232-4cf720c66eba_2000x1381.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1005,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1453788,&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://blog.levelupcoding.com/i/188700043?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc4c7b88-debb-4b62-9232-4cf720c66eba_2000x1381.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_!Ddcn!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc4c7b88-debb-4b62-9232-4cf720c66eba_2000x1381.png 424w, https://substackcdn.com/image/fetch/$s_!Ddcn!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc4c7b88-debb-4b62-9232-4cf720c66eba_2000x1381.png 848w, https://substackcdn.com/image/fetch/$s_!Ddcn!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc4c7b88-debb-4b62-9232-4cf720c66eba_2000x1381.png 1272w, https://substackcdn.com/image/fetch/$s_!Ddcn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc4c7b88-debb-4b62-9232-4cf720c66eba_2000x1381.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 role="img" 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><title></title><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>Bounded contexts prevent your system from becoming one giant argument about what a &#8220;product&#8221; really is.</p><p><strong>Pros:</strong></p><ul><li><p><strong>Clear boundaries</strong> &#8594; Prevents a single model from becoming a &#8220;big ball of mud.&#8221;</p></li><li><p><strong>Team ownership</strong> &#8594; Lets teams evolve independently with fewer collisions.</p></li><li><p><strong>Safer change</strong> &#8594; Local refactors stay local because meanings don&#8217;t leak.</p></li></ul><p><strong>Cons:</strong></p><ul><li><p><strong>Integration work</strong> &#8594; You must design how contexts talk and what they share.</p></li><li><p><strong>Boundary mistakes</strong> &#8594; Wrong splits create friction and duplicated logic.</p></li></ul><h3>3) Model identity and value (Entities + Value Objects)</h3><p>Inside a bounded context, you model the domain with <strong>entities</strong> and <strong>value objects</strong>.</p><p>An <strong>entity</strong> is defined by identity and lifecycle; like a <code>Customer</code> that stays the same &#8220;person&#8221; even if their address changes.</p><p>A <strong>value object</strong> is defined only by its values and is often immutable; like <code>Money</code> or <code>Address</code>.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!FqTz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f2c4133-709f-4eb0-bb91-61f2801a3bbd_2000x962.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!FqTz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f2c4133-709f-4eb0-bb91-61f2801a3bbd_2000x962.png 424w, https://substackcdn.com/image/fetch/$s_!FqTz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f2c4133-709f-4eb0-bb91-61f2801a3bbd_2000x962.png 848w, https://substackcdn.com/image/fetch/$s_!FqTz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f2c4133-709f-4eb0-bb91-61f2801a3bbd_2000x962.png 1272w, https://substackcdn.com/image/fetch/$s_!FqTz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f2c4133-709f-4eb0-bb91-61f2801a3bbd_2000x962.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!FqTz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f2c4133-709f-4eb0-bb91-61f2801a3bbd_2000x962.png" width="1456" height="700" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2f2c4133-709f-4eb0-bb91-61f2801a3bbd_2000x962.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:700,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:885275,&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://blog.levelupcoding.com/i/188700043?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f2c4133-709f-4eb0-bb91-61f2801a3bbd_2000x962.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_!FqTz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f2c4133-709f-4eb0-bb91-61f2801a3bbd_2000x962.png 424w, https://substackcdn.com/image/fetch/$s_!FqTz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f2c4133-709f-4eb0-bb91-61f2801a3bbd_2000x962.png 848w, https://substackcdn.com/image/fetch/$s_!FqTz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f2c4133-709f-4eb0-bb91-61f2801a3bbd_2000x962.png 1272w, https://substackcdn.com/image/fetch/$s_!FqTz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f2c4133-709f-4eb0-bb91-61f2801a3bbd_2000x962.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 role="img" 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><title></title><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>Pros:</strong></p><ul><li><p><strong>Clear intent in code</strong> &#8594; &#8220;Identity&#8221; and &#8220;attributes&#8221; stop being mixed together.</p></li><li><p><strong>Fewer accidental bugs</strong> &#8594; Value objects reduce side effects because they are treated as pure descriptive values.</p></li><li><p><strong>Better tests</strong> &#8594; You can test domain behavior directly, because it lives where the domain lives.</p></li></ul><p><strong>Cons:</strong></p><ul><li><p><strong>More types upfront</strong> &#8594; You will write more domain code early, because clarity has a cost.</p></li><li><p><strong>Requires discipline</strong> &#8594; If you slip into &#8220;anemic models&#8221; (data-only objects), you lose most of the value.</p></li></ul><h3>4) Enforce consistency with Aggregates</h3><p>An <strong>aggregate</strong> is a cluster of domain objects treated as one consistency boundary, controlled by an <strong>aggregate root</strong>.</p><p>Outside code talks to the root, not the internal parts, so business rules stay centralized and enforceable.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Ci-x!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d1aa59d-4c70-49dc-bd7f-99f1de2ef9cf_2000x1255.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Ci-x!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d1aa59d-4c70-49dc-bd7f-99f1de2ef9cf_2000x1255.png 424w, https://substackcdn.com/image/fetch/$s_!Ci-x!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d1aa59d-4c70-49dc-bd7f-99f1de2ef9cf_2000x1255.png 848w, https://substackcdn.com/image/fetch/$s_!Ci-x!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d1aa59d-4c70-49dc-bd7f-99f1de2ef9cf_2000x1255.png 1272w, https://substackcdn.com/image/fetch/$s_!Ci-x!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d1aa59d-4c70-49dc-bd7f-99f1de2ef9cf_2000x1255.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Ci-x!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d1aa59d-4c70-49dc-bd7f-99f1de2ef9cf_2000x1255.png" width="1456" height="914" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8d1aa59d-4c70-49dc-bd7f-99f1de2ef9cf_2000x1255.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:914,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1437061,&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://blog.levelupcoding.com/i/188700043?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d1aa59d-4c70-49dc-bd7f-99f1de2ef9cf_2000x1255.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_!Ci-x!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d1aa59d-4c70-49dc-bd7f-99f1de2ef9cf_2000x1255.png 424w, https://substackcdn.com/image/fetch/$s_!Ci-x!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d1aa59d-4c70-49dc-bd7f-99f1de2ef9cf_2000x1255.png 848w, https://substackcdn.com/image/fetch/$s_!Ci-x!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d1aa59d-4c70-49dc-bd7f-99f1de2ef9cf_2000x1255.png 1272w, https://substackcdn.com/image/fetch/$s_!Ci-x!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d1aa59d-4c70-49dc-bd7f-99f1de2ef9cf_2000x1255.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 role="img" 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><title></title><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>Pros:</strong></p><ul><li><p><strong>Fewer consistency bugs</strong> &#8594; Invariants live in one place, not duplicated across services and controllers.</p></li><li><p><strong>Clear transaction boundaries</strong> &#8594; Updates don&#8217;t cross aggregate boundaries, which simplifies correctness.</p></li><li><p><strong>Better maintainability</strong> &#8594; Code reads like &#8220;business operations,&#8221; because that&#8217;s what the aggregate exposes.</p></li></ul><p><strong>Cons:</strong></p><ul><li><p><strong>You must choose boundaries carefully</strong> &#8594; Oversized aggregates become bottlenecks; undersized ones leak invariants.</p></li><li><p><strong>Cross-aggregate workflows need orchestration</strong> &#8594; Some workflows become event-driven or application-layer-led by necessity.</p></li></ul><h3>5) Decouple workflows with Domain Events + keep persistence out with Repositories</h3><p>A <strong>domain event</strong> captures something meaningful that happened in the domain, usually named in past tense like <code>OrderPlaced</code> or <code>PaymentCompleted</code>.</p><p>Inside one context it models a business fact; when published outward it often becomes an <strong>integration event</strong> used to coordinate other contexts.</p><p>That&#8217;s how you let Inventory react to <code>OrderPlaced</code> without letting Inventory reach into Order&#8217;s internal model.</p><p>A <strong>repository</strong> is a domain-facing interface for loading and saving aggregates (e.g. <code>OrderRepository.save(order)</code>), hiding database details from the domain layer.</p><p><strong>Pros:</strong></p><ul><li><p><strong>Lower coupling</strong> &#8594; Events let systems react without turning everything into direct dependencies.</p></li><li><p><strong>Cleaner domain model</strong> &#8594; Repositories keep persistence concerns out of business logic.</p></li><li><p><strong>Easier evolution</strong> &#8594; You can change databases or infrastructure with less impact on the core model.</p></li></ul><p><strong>Cons:</strong></p><ul><li><p><strong>Event-driven complexity</strong> &#8594; Failures can surface later, and you have to think carefully about cross-context consistency.</p></li><li><p><strong>More upfront work</strong> &#8594; Modeling + workshops can feel slow early on, because you&#8217;re buying long-term clarity.</p></li></ul><h2>When to choose DDD</h2><p>DDD pays off most when <strong>understanding the domain is the hard part</strong>, not just the technical build.</p><p>Use these decision checks:</p><ul><li><p><strong>Domain complexity is high</strong> &#8594; You have lots of rules, exceptions, and nuanced workflows, so modeling reduces chaos.</p></li><li><p><strong>The domain is core to business value</strong> &#8594; You invest because correctness and flexibility create advantage.</p></li><li><p><strong>Many teams touch the system</strong> &#8594; Context boundaries help teams move independently because contracts stay explicit.</p></li><li><p><strong>The system will live for years</strong> &#8594; A strong model acts like documentation because it preserves business knowledge in code.</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_!U4xT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29e5d546-7419-4203-952b-bb1f9e836aa2_2000x1014.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!U4xT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29e5d546-7419-4203-952b-bb1f9e836aa2_2000x1014.png 424w, https://substackcdn.com/image/fetch/$s_!U4xT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29e5d546-7419-4203-952b-bb1f9e836aa2_2000x1014.png 848w, https://substackcdn.com/image/fetch/$s_!U4xT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29e5d546-7419-4203-952b-bb1f9e836aa2_2000x1014.png 1272w, https://substackcdn.com/image/fetch/$s_!U4xT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29e5d546-7419-4203-952b-bb1f9e836aa2_2000x1014.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!U4xT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29e5d546-7419-4203-952b-bb1f9e836aa2_2000x1014.png" width="1456" height="738" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/29e5d546-7419-4203-952b-bb1f9e836aa2_2000x1014.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:738,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:392019,&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://blog.levelupcoding.com/i/188700043?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29e5d546-7419-4203-952b-bb1f9e836aa2_2000x1014.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_!U4xT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29e5d546-7419-4203-952b-bb1f9e836aa2_2000x1014.png 424w, https://substackcdn.com/image/fetch/$s_!U4xT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29e5d546-7419-4203-952b-bb1f9e836aa2_2000x1014.png 848w, https://substackcdn.com/image/fetch/$s_!U4xT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29e5d546-7419-4203-952b-bb1f9e836aa2_2000x1014.png 1272w, https://substackcdn.com/image/fetch/$s_!U4xT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29e5d546-7419-4203-952b-bb1f9e836aa2_2000x1014.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 role="img" 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><title></title><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>When NOT to use DDD</h2><p>DDD struggles when the problem is simple.</p><p>If your app is mostly CRUD, it adds layers and coordination you don&#8217;t need.</p><p>If you cannot get sustained access to domain experts, DDD becomes guesswork. And guesswork hardens into code faster than you think.</p><p>And if the project is short-lived or low-impact, the modeling cost rarely returns value.</p><h2>Final thoughts</h2><p>You don&#8217;t adopt DDD by adding patterns.</p><p>You adopt it by removing ambiguity.</p><p>Start with language, because words drive everything else. Split contexts before you share a model &#8220;for convenience.&#8221; Keep invariants inside aggregates, not scattered across services. Use events when the business thinks in milestones and outcomes.</p><p>If understanding breaks before performance does, DDD is the right tool.</p><div><hr></div><p>&#128075; If you liked this post &#8594; Like + Restack + Share to help others learn system design.</p><div><hr></div><p>Subscribe to get high-signal, clear, and visual system design breakdowns straight to your inbox:</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.levelupcoding.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">&nbsp;</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item></channel></rss>