<?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[Get our System Design Handbook for FREE when you subscribe.]]></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>Tue, 14 Apr 2026 04:15:53 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[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 minutes) | 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><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[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><item><title><![CDATA[Bloom Filters Clearly Explained]]></title><description><![CDATA[(5 minutes) | Most systems waste time proving what isn&#8217;t there. Bloom filters make &#8220;no&#8221; almost free.]]></description><link>https://blog.levelupcoding.com/p/bloom-filters-explained</link><guid isPermaLink="false">https://blog.levelupcoding.com/p/bloom-filters-explained</guid><dc:creator><![CDATA[Nikki Siapno]]></dc:creator><pubDate>Sat, 14 Feb 2026 12:17:57 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/6c6b89ac-5dde-4ccf-831d-0b9677a2fb10_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/subagents-rovo-dev-z7nl">AI Gets Better When Work is Specialized</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_!5ihP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9921ef77-9056-43a2-95ea-412bed7e96a3_1560x760.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!5ihP!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9921ef77-9056-43a2-95ea-412bed7e96a3_1560x760.png 424w, https://substackcdn.com/image/fetch/$s_!5ihP!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9921ef77-9056-43a2-95ea-412bed7e96a3_1560x760.png 848w, https://substackcdn.com/image/fetch/$s_!5ihP!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9921ef77-9056-43a2-95ea-412bed7e96a3_1560x760.png 1272w, https://substackcdn.com/image/fetch/$s_!5ihP!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9921ef77-9056-43a2-95ea-412bed7e96a3_1560x760.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!5ihP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9921ef77-9056-43a2-95ea-412bed7e96a3_1560x760.png" width="1456" height="709" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9921ef77-9056-43a2-95ea-412bed7e96a3_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;:25612,&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/185047559?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9921ef77-9056-43a2-95ea-412bed7e96a3_1560x760.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_!5ihP!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9921ef77-9056-43a2-95ea-412bed7e96a3_1560x760.png 424w, https://substackcdn.com/image/fetch/$s_!5ihP!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9921ef77-9056-43a2-95ea-412bed7e96a3_1560x760.png 848w, https://substackcdn.com/image/fetch/$s_!5ihP!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9921ef77-9056-43a2-95ea-412bed7e96a3_1560x760.png 1272w, https://substackcdn.com/image/fetch/$s_!5ihP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9921ef77-9056-43a2-95ea-412bed7e96a3_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>Planning, coding, testing, and reviewing are different kinds of work. When one AI tries to do everything, quality drops. <strong><a href="https://lucode.co/subagents-rovo-dev-z7nl">Rovo Dev</a></strong> addresses this with focused subagents that operate inside the terminal, reasoning over Jira, Confluence, and repo history via Atlassian&#8217;s Teamwork Graph. Each agent owns a narrow responsibility, enabling workflows that scale without losing context or control.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://lucode.co/subagents-rovo-dev-z7nl&quot;,&quot;text&quot;:&quot;Learn more here&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://lucode.co/subagents-rovo-dev-z7nl"><span>Learn more here</span></a></p><div><hr></div><h1>Bloom Filters Clearly Explained</h1><p>You don&#8217;t notice it, but your system wastes more time proving what <em>isn&#8217;t</em> there than what is.</p><p>Every cache miss, every 404, every &#8220;not found&#8221; database query costs real CPU, I/O, and bandwidth; all to confirm a negative.</p><p>That&#8217;s where Bloom filters quietly shine.</p><p>They don&#8217;t store data; they store <em>possibility.</em> Instead of asking &#8220;is this in the set?&#8221; and paying full price every time, you ask a probabilistic gatekeeper first.</p><p>It answers instantly: <strong>definitely not</strong> or <strong>maybe, go check</strong>.</p><p>The trick is in accepting a sliver of uncertainty to save massive compute.</p><h2>When &#8220;no&#8221; becomes the most expensive answer</h2><p>Every large system eventually asks the same question: <em>does this exist?</em></p><p>A URL, a user ID, a cache key, a file chunk; all get checked millions of times per second.</p><p>That check feels cheap, until you multiply it by scale.</p><p>Take a <strong>web crawler</strong>. It must avoid re-fetching URLs it&#8217;s already seen. The obvious solution is to keep every URL in a hash set. Simple, until &#8220;every&#8221; means billions. Even with compact encoding, that&#8217;s terabytes of memory just to remember what you&#8217;ve touched. Skip the memory, and you waste bandwidth re-downloading duplicates instead.</p><p>At scale, &#8220;no&#8221; dominates.</p><p>Most URLs are new. Most cache lookups miss. Most database keys aren&#8217;t there. Yet every query costs the same as a hit: full network calls, disk reads, and CPU time just to confirm nothing exists.</p><p>What you really need isn&#8217;t a full record of the past, just a <strong>cheap way to say &#8220;definitely not.&#8221;</strong></p><p>You don&#8217;t care <em>which</em> URLs you&#8217;ve seen, only whether something <em>could</em> have been seen before.</p><p>Bloom filters help turn expensive &#8220;no&#8221; answers into near-free ones. What you trade up is a small, controllable chance of being wrong for a massive gain in speed and space.</p><h2>How it works</h2><p>A Bloom filter answers one question fast: <em>could this exist?</em></p><p>It does it without storing the item, just a few bits of evidence that it <em>might</em> have been seen before.</p><p>Here&#8217;s how it works:</p><ol><li><p><strong>Start with an empty bit array.<br></strong>Picture a long row of bits, all set to 0. This is your blank canvas.</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!sZxZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd137ddb6-9967-4c8a-96e6-7c67a545a9fa_2000x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sZxZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd137ddb6-9967-4c8a-96e6-7c67a545a9fa_2000x800.png 424w, https://substackcdn.com/image/fetch/$s_!sZxZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd137ddb6-9967-4c8a-96e6-7c67a545a9fa_2000x800.png 848w, https://substackcdn.com/image/fetch/$s_!sZxZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd137ddb6-9967-4c8a-96e6-7c67a545a9fa_2000x800.png 1272w, https://substackcdn.com/image/fetch/$s_!sZxZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd137ddb6-9967-4c8a-96e6-7c67a545a9fa_2000x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sZxZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd137ddb6-9967-4c8a-96e6-7c67a545a9fa_2000x800.png" width="1456" height="582" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d137ddb6-9967-4c8a-96e6-7c67a545a9fa_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;:255424,&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/185047559?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd137ddb6-9967-4c8a-96e6-7c67a545a9fa_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_!sZxZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd137ddb6-9967-4c8a-96e6-7c67a545a9fa_2000x800.png 424w, https://substackcdn.com/image/fetch/$s_!sZxZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd137ddb6-9967-4c8a-96e6-7c67a545a9fa_2000x800.png 848w, https://substackcdn.com/image/fetch/$s_!sZxZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd137ddb6-9967-4c8a-96e6-7c67a545a9fa_2000x800.png 1272w, https://substackcdn.com/image/fetch/$s_!sZxZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd137ddb6-9967-4c8a-96e6-7c67a545a9fa_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><ol start="2"><li><p><strong>Hash the input several times.<br></strong>Each item (a URL or user ID) is fed into a number of different hash functions.<br>Each hash produces an index which is a position in the bit array.</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8mQ2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8af150e4-440f-4723-9d76-ae02654b5160_2000x1200.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8mQ2!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8af150e4-440f-4723-9d76-ae02654b5160_2000x1200.png 424w, https://substackcdn.com/image/fetch/$s_!8mQ2!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8af150e4-440f-4723-9d76-ae02654b5160_2000x1200.png 848w, https://substackcdn.com/image/fetch/$s_!8mQ2!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8af150e4-440f-4723-9d76-ae02654b5160_2000x1200.png 1272w, https://substackcdn.com/image/fetch/$s_!8mQ2!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8af150e4-440f-4723-9d76-ae02654b5160_2000x1200.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8mQ2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8af150e4-440f-4723-9d76-ae02654b5160_2000x1200.png" width="1456" height="874" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8af150e4-440f-4723-9d76-ae02654b5160_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;:459035,&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/185047559?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8af150e4-440f-4723-9d76-ae02654b5160_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_!8mQ2!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8af150e4-440f-4723-9d76-ae02654b5160_2000x1200.png 424w, https://substackcdn.com/image/fetch/$s_!8mQ2!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8af150e4-440f-4723-9d76-ae02654b5160_2000x1200.png 848w, https://substackcdn.com/image/fetch/$s_!8mQ2!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8af150e4-440f-4723-9d76-ae02654b5160_2000x1200.png 1272w, https://substackcdn.com/image/fetch/$s_!8mQ2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8af150e4-440f-4723-9d76-ae02654b5160_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><ol start="3"><li><p><strong>Set those bits to 1.<br></strong>For every hash output, that bit becomes 1. You never store the item itself, just the pattern of bits it activates.</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!RgIL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f2a45b0-bd45-4a51-9b50-6fef390fe84a_2000x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!RgIL!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f2a45b0-bd45-4a51-9b50-6fef390fe84a_2000x800.png 424w, https://substackcdn.com/image/fetch/$s_!RgIL!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f2a45b0-bd45-4a51-9b50-6fef390fe84a_2000x800.png 848w, https://substackcdn.com/image/fetch/$s_!RgIL!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f2a45b0-bd45-4a51-9b50-6fef390fe84a_2000x800.png 1272w, https://substackcdn.com/image/fetch/$s_!RgIL!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f2a45b0-bd45-4a51-9b50-6fef390fe84a_2000x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!RgIL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f2a45b0-bd45-4a51-9b50-6fef390fe84a_2000x800.png" width="1456" height="582" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5f2a45b0-bd45-4a51-9b50-6fef390fe84a_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;:360464,&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/185047559?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f2a45b0-bd45-4a51-9b50-6fef390fe84a_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_!RgIL!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f2a45b0-bd45-4a51-9b50-6fef390fe84a_2000x800.png 424w, https://substackcdn.com/image/fetch/$s_!RgIL!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f2a45b0-bd45-4a51-9b50-6fef390fe84a_2000x800.png 848w, https://substackcdn.com/image/fetch/$s_!RgIL!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f2a45b0-bd45-4a51-9b50-6fef390fe84a_2000x800.png 1272w, https://substackcdn.com/image/fetch/$s_!RgIL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f2a45b0-bd45-4a51-9b50-6fef390fe84a_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><ol start="4"><li><p><strong>To query, repeat the hashes.<br></strong>When you check if something exists, you hash it again across all hash functions and see which bits it maps to.</p><ul><li><p>If <strong>any</strong> of those bits are 0 &#8594; the item definitely doesn&#8217;t exist.</p></li><li><p>If <strong>all</strong> are 1 &#8594; it might exist.</p></li></ul></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!oyaK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb947be07-22b5-4304-b4ef-f98527e73afb_2000x2000.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!oyaK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb947be07-22b5-4304-b4ef-f98527e73afb_2000x2000.png 424w, https://substackcdn.com/image/fetch/$s_!oyaK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb947be07-22b5-4304-b4ef-f98527e73afb_2000x2000.png 848w, https://substackcdn.com/image/fetch/$s_!oyaK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb947be07-22b5-4304-b4ef-f98527e73afb_2000x2000.png 1272w, https://substackcdn.com/image/fetch/$s_!oyaK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb947be07-22b5-4304-b4ef-f98527e73afb_2000x2000.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!oyaK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb947be07-22b5-4304-b4ef-f98527e73afb_2000x2000.png" width="1456" height="1456" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b947be07-22b5-4304-b4ef-f98527e73afb_2000x2000.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1456,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1053303,&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/185047559?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb947be07-22b5-4304-b4ef-f98527e73afb_2000x2000.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_!oyaK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb947be07-22b5-4304-b4ef-f98527e73afb_2000x2000.png 424w, https://substackcdn.com/image/fetch/$s_!oyaK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb947be07-22b5-4304-b4ef-f98527e73afb_2000x2000.png 848w, https://substackcdn.com/image/fetch/$s_!oyaK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb947be07-22b5-4304-b4ef-f98527e73afb_2000x2000.png 1272w, https://substackcdn.com/image/fetch/$s_!oyaK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb947be07-22b5-4304-b4ef-f98527e73afb_2000x2000.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 Bloom filter never gives false negatives: if you inserted it, it will always return &#8220;maybe.&#8221;</p><p>But it can give <strong>false positives</strong>.</p><p>The more items you insert, the more bits flip to 1, and the higher the chance that unrelated items collide.</p><p>The trick is that you can <em>tune</em> this probability by the number of hash functions you use.</p><p>Each hash function sets one more bit in the array. Too few, and the filter doesn&#8217;t mark enough spots; it forgets what it&#8217;s seen and returns more false positives. Too many, and it flips too many bits; the array fills up faster, and collisions rise, again increasing false positives.</p><p>There&#8217;s a sweet spot where the filter stays balanced: enough hashes to remember patterns, but not so many that everything looks like a match.</p><p>That balance is what makes Bloom filters powerful. You decide how much uncertainty you can afford, and trade a bit of it for massive savings in efficiency.</p><h2>Where they&#8217;re used</h2><p>You&#8217;ve probably relied on Bloom filters without realizing it. They hide inside the systems that need to skip pointless work fast.</p><ul><li><p><strong>Databases</strong> &#8594; Engines like <strong>Cassandra</strong>, <strong>LevelDB</strong>, and <strong>Bigtable</strong> use Bloom filters to skip disk reads for keys that don&#8217;t exist. This cuts random I/O and keeps &#8220;not found&#8221; queries cheap.</p></li><li><p><strong>Web crawlers</strong> &#8594; Track which URLs have been seen before. Instead of storing billions of strings, a Bloom filter flags duplicates in memory and saves massive bandwidth.</p></li><li><p><strong>Browsers and security tools</strong> &#8594; <strong>Chrome Safe Browsing</strong> and spam filters use them to pre-check URLs or sender lists locally, calling a remote service only when there&#8217;s a &#8220;maybe.&#8221;</p></li><li><p><strong>Distributed caches</strong> &#8594; Systems like CDN edge caches use them to decide if an object might exist on another node before sending a request.</p></li><li><p><strong>Stream processors</strong> &#8594; Platforms like <strong>Kafka Streams</strong> and <strong>Flink</strong> use them to drop duplicate events before aggregation or storage.</p></li></ul><h2>When not to use a Bloom filter</h2><p>Bloom filters are powerful, but they&#8217;re not for every job.</p><p>They work best when most lookups miss and precision doesn&#8217;t matter. When the cost of being wrong outweighs the savings, the same trick that speeds you up can quietly hurt you.</p><p>Here&#8217;s when a Bloom filter isn&#8217;t worth that cost:</p><ul><li><p><strong>You need exact answers</strong> &#8594; Bloom filters always allow false positives. If a wrong &#8220;maybe&#8221; breaks correctness (like in billing, access control, or authentication) use an exact set or index instead.</p></li><li><p><strong>You need frequent deletions</strong> &#8594; Standard Bloom filters can&#8217;t remove items. Once a bit is set, it stays set. Counting or Cuckoo filters solve this, but with more memory and complexity.</p></li><li><p><strong>Your dataset is tiny</strong> &#8594; If you&#8217;re only tracking thousands of items, the math doesn&#8217;t pay off. A normal hash set fits in memory and stays simpler to maintain.</p></li><li><p><strong>Your data grows unpredictably</strong> &#8594; Bloom filters must be sized in advance. Exceed that capacity and false positives spike fast. Use scalable variants if growth is unbounded.</p></li></ul><h2>Putting it into practice</h2><p>Bloom filters make sense when the goal is speed, not certainty.</p><p>They shine when most lookups miss, when wasted work costs more than a small chance of being wrong, and when you can live with &#8220;maybe&#8221; as an answer.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!i9Rs!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad9d5c23-cb96-4f02-9a7d-5cf2f97ed010_2000x1621.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!i9Rs!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad9d5c23-cb96-4f02-9a7d-5cf2f97ed010_2000x1621.png 424w, https://substackcdn.com/image/fetch/$s_!i9Rs!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad9d5c23-cb96-4f02-9a7d-5cf2f97ed010_2000x1621.png 848w, https://substackcdn.com/image/fetch/$s_!i9Rs!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad9d5c23-cb96-4f02-9a7d-5cf2f97ed010_2000x1621.png 1272w, https://substackcdn.com/image/fetch/$s_!i9Rs!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad9d5c23-cb96-4f02-9a7d-5cf2f97ed010_2000x1621.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!i9Rs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad9d5c23-cb96-4f02-9a7d-5cf2f97ed010_2000x1621.png" width="1456" height="1180" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ad9d5c23-cb96-4f02-9a7d-5cf2f97ed010_2000x1621.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1180,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:477447,&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/185047559?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad9d5c23-cb96-4f02-9a7d-5cf2f97ed010_2000x1621.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_!i9Rs!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad9d5c23-cb96-4f02-9a7d-5cf2f97ed010_2000x1621.png 424w, https://substackcdn.com/image/fetch/$s_!i9Rs!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad9d5c23-cb96-4f02-9a7d-5cf2f97ed010_2000x1621.png 848w, https://substackcdn.com/image/fetch/$s_!i9Rs!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad9d5c23-cb96-4f02-9a7d-5cf2f97ed010_2000x1621.png 1272w, https://substackcdn.com/image/fetch/$s_!i9Rs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad9d5c23-cb96-4f02-9a7d-5cf2f97ed010_2000x1621.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>Bloom filters remind us that at scale, certainty is overrated.</p><p>They don&#8217;t try to know everything; just enough to skip what doesn&#8217;t matter.</p><p>When most of your system&#8217;s time goes to proving nothing exists, a fast &#8220;maybe&#8221; is all you need.</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[Database Types Clearly Explained]]></title><description><![CDATA[(7 minutes) | It&#8217;s not the schema. It&#8217;s the question you optimize for.]]></description><link>https://blog.levelupcoding.com/p/database-types</link><guid isPermaLink="false">https://blog.levelupcoding.com/p/database-types</guid><dc:creator><![CDATA[Nikki Siapno]]></dc:creator><pubDate>Fri, 06 Feb 2026 15:26:00 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/1706fa4d-a07e-4204-98cf-93fafffaf86e_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;: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/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="" 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. Instead of re-explaining requirements or copying context between tools, developers can generate, validate, and review code against the original spec. The result is 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;Explore now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://lucode.co/spec-driven-development-rovo-dev-z7nl"><span>Explore now</span></a></p><div><hr></div><h1>Database Types Clearly Explained</h1><p>Choosing a database feels like a schema problem. It usually isn&#8217;t.</p><p>It&#8217;s a <em>question</em> problem.</p><p>If your system needs updates to either fully succeed or fully fail, but your database doesn&#8217;t guarantee that, you&#8217;ll constantly deal with subtle bugs. If you need to search by meaning but your database only supports exact matches, you&#8217;ll end up adding another system later.</p><p>One rule cuts through the noise: <strong>pick the database that&#8217;s built for the hardest question you ask most often.</strong></p><h2>&#8220;All-or-nothing updates&#8221; &#8594; Relational and Distributed SQL</h2><p>Some systems live or die on one requirement: multiple changes must succeed together, or not at all.</p><p>That&#8217;s what ACID transactions provide (Atomic, Consistent, Isolated, Durable).</p><p>Relational databases give you that reliability plus rich SQL joins and aggregations. The trade-off is that traditional relational systems often scale up more naturally than they scale out, and schema changes can be slower because the structure is fixed.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!RjNd!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F784ac936-872c-438c-9981-db7e64b9eb16_2001x990.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!RjNd!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F784ac936-872c-438c-9981-db7e64b9eb16_2001x990.png 424w, https://substackcdn.com/image/fetch/$s_!RjNd!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F784ac936-872c-438c-9981-db7e64b9eb16_2001x990.png 848w, https://substackcdn.com/image/fetch/$s_!RjNd!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F784ac936-872c-438c-9981-db7e64b9eb16_2001x990.png 1272w, https://substackcdn.com/image/fetch/$s_!RjNd!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F784ac936-872c-438c-9981-db7e64b9eb16_2001x990.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!RjNd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F784ac936-872c-438c-9981-db7e64b9eb16_2001x990.png" width="1456" height="720" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/784ac936-872c-438c-9981-db7e64b9eb16_2001x990.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:720,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:460247,&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/185166649?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F784ac936-872c-438c-9981-db7e64b9eb16_2001x990.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_!RjNd!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F784ac936-872c-438c-9981-db7e64b9eb16_2001x990.png 424w, https://substackcdn.com/image/fetch/$s_!RjNd!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F784ac936-872c-438c-9981-db7e64b9eb16_2001x990.png 848w, https://substackcdn.com/image/fetch/$s_!RjNd!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F784ac936-872c-438c-9981-db7e64b9eb16_2001x990.png 1272w, https://substackcdn.com/image/fetch/$s_!RjNd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F784ac936-872c-438c-9981-db7e64b9eb16_2001x990.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>Distributed SQL keeps the same promise (SQL + ACID) but spreads data across nodes with consensus protocols so the database still behaves like one logical system. You gain horizontal scale and often multi-region replication, but you pay with network latency and operational complexity, because coordination across nodes is real work.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!oYI0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd81b6134-9116-47a9-a858-68f92d185b97_2000x871.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!oYI0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd81b6134-9116-47a9-a858-68f92d185b97_2000x871.png 424w, https://substackcdn.com/image/fetch/$s_!oYI0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd81b6134-9116-47a9-a858-68f92d185b97_2000x871.png 848w, https://substackcdn.com/image/fetch/$s_!oYI0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd81b6134-9116-47a9-a858-68f92d185b97_2000x871.png 1272w, https://substackcdn.com/image/fetch/$s_!oYI0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd81b6134-9116-47a9-a858-68f92d185b97_2000x871.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!oYI0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd81b6134-9116-47a9-a858-68f92d185b97_2000x871.png" width="1456" height="634" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d81b6134-9116-47a9-a858-68f92d185b97_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;:397889,&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/185166649?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd81b6134-9116-47a9-a858-68f92d185b97_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_!oYI0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd81b6134-9116-47a9-a858-68f92d185b97_2000x871.png 424w, https://substackcdn.com/image/fetch/$s_!oYI0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd81b6134-9116-47a9-a858-68f92d185b97_2000x871.png 848w, https://substackcdn.com/image/fetch/$s_!oYI0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd81b6134-9116-47a9-a858-68f92d185b97_2000x871.png 1272w, https://substackcdn.com/image/fetch/$s_!oYI0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd81b6134-9116-47a9-a858-68f92d185b97_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><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!loVE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F796a2ab5-eec6-40f3-9942-57225bf80c26_2000x871.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!loVE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F796a2ab5-eec6-40f3-9942-57225bf80c26_2000x871.png 424w, https://substackcdn.com/image/fetch/$s_!loVE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F796a2ab5-eec6-40f3-9942-57225bf80c26_2000x871.png 848w, https://substackcdn.com/image/fetch/$s_!loVE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F796a2ab5-eec6-40f3-9942-57225bf80c26_2000x871.png 1272w, https://substackcdn.com/image/fetch/$s_!loVE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F796a2ab5-eec6-40f3-9942-57225bf80c26_2000x871.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!loVE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F796a2ab5-eec6-40f3-9942-57225bf80c26_2000x871.png" width="1456" height="634" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/796a2ab5-eec6-40f3-9942-57225bf80c26_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;:391616,&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/185166649?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F796a2ab5-eec6-40f3-9942-57225bf80c26_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_!loVE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F796a2ab5-eec6-40f3-9942-57225bf80c26_2000x871.png 424w, https://substackcdn.com/image/fetch/$s_!loVE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F796a2ab5-eec6-40f3-9942-57225bf80c26_2000x871.png 848w, https://substackcdn.com/image/fetch/$s_!loVE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F796a2ab5-eec6-40f3-9942-57225bf80c26_2000x871.png 1272w, https://substackcdn.com/image/fetch/$s_!loVE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F796a2ab5-eec6-40f3-9942-57225bf80c26_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><p><strong>When not to use this</strong>: avoid relational databases for workloads dominated by key-based lookups or large append-only streams, because the extra guarantees add unnecessary overhead.</p><h2>&#8220;Give me the whole thing as one object&#8221; &#8594; Document databases</h2><p>Sometimes the core need is simple: store data in the same shape you read it.</p><p>When the read path is &#8220;load a user profile&#8221; or &#8220;load a product,&#8221; document databases are built for that.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!aJ5y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa950e8f5-58fc-4c6e-b9dd-8c85421c56ce_2001x852.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!aJ5y!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa950e8f5-58fc-4c6e-b9dd-8c85421c56ce_2001x852.png 424w, https://substackcdn.com/image/fetch/$s_!aJ5y!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa950e8f5-58fc-4c6e-b9dd-8c85421c56ce_2001x852.png 848w, https://substackcdn.com/image/fetch/$s_!aJ5y!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa950e8f5-58fc-4c6e-b9dd-8c85421c56ce_2001x852.png 1272w, https://substackcdn.com/image/fetch/$s_!aJ5y!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa950e8f5-58fc-4c6e-b9dd-8c85421c56ce_2001x852.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!aJ5y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa950e8f5-58fc-4c6e-b9dd-8c85421c56ce_2001x852.png" width="1456" height="620" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a950e8f5-58fc-4c6e-b9dd-8c85421c56ce_2001x852.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:620,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:481801,&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/185166649?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa950e8f5-58fc-4c6e-b9dd-8c85421c56ce_2001x852.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_!aJ5y!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa950e8f5-58fc-4c6e-b9dd-8c85421c56ce_2001x852.png 424w, https://substackcdn.com/image/fetch/$s_!aJ5y!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa950e8f5-58fc-4c6e-b9dd-8c85421c56ce_2001x852.png 848w, https://substackcdn.com/image/fetch/$s_!aJ5y!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa950e8f5-58fc-4c6e-b9dd-8c85421c56ce_2001x852.png 1272w, https://substackcdn.com/image/fetch/$s_!aJ5y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa950e8f5-58fc-4c6e-b9dd-8c85421c56ce_2001x852.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 document database stores each record as a self-contained document (often JSON) with no fixed schema, so different documents can evolve independently. It&#8217;s a strong fit for nested data because embedding reduces the need for joins.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!JqFc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c3ba3ed-fb26-4031-8188-f1b88dbdba6b_2000x871.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JqFc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c3ba3ed-fb26-4031-8188-f1b88dbdba6b_2000x871.png 424w, https://substackcdn.com/image/fetch/$s_!JqFc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c3ba3ed-fb26-4031-8188-f1b88dbdba6b_2000x871.png 848w, https://substackcdn.com/image/fetch/$s_!JqFc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c3ba3ed-fb26-4031-8188-f1b88dbdba6b_2000x871.png 1272w, https://substackcdn.com/image/fetch/$s_!JqFc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c3ba3ed-fb26-4031-8188-f1b88dbdba6b_2000x871.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JqFc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c3ba3ed-fb26-4031-8188-f1b88dbdba6b_2000x871.png" width="1456" height="634" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1c3ba3ed-fb26-4031-8188-f1b88dbdba6b_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;:401842,&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/185166649?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c3ba3ed-fb26-4031-8188-f1b88dbdba6b_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_!JqFc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c3ba3ed-fb26-4031-8188-f1b88dbdba6b_2000x871.png 424w, https://substackcdn.com/image/fetch/$s_!JqFc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c3ba3ed-fb26-4031-8188-f1b88dbdba6b_2000x871.png 848w, https://substackcdn.com/image/fetch/$s_!JqFc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c3ba3ed-fb26-4031-8188-f1b88dbdba6b_2000x871.png 1272w, https://substackcdn.com/image/fetch/$s_!JqFc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c3ba3ed-fb26-4031-8188-f1b88dbdba6b_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><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!A7XD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3323fec-8869-4ce4-9355-0692b6db0e4f_2000x872.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!A7XD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3323fec-8869-4ce4-9355-0692b6db0e4f_2000x872.png 424w, https://substackcdn.com/image/fetch/$s_!A7XD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3323fec-8869-4ce4-9355-0692b6db0e4f_2000x872.png 848w, https://substackcdn.com/image/fetch/$s_!A7XD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3323fec-8869-4ce4-9355-0692b6db0e4f_2000x872.png 1272w, https://substackcdn.com/image/fetch/$s_!A7XD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3323fec-8869-4ce4-9355-0692b6db0e4f_2000x872.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!A7XD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3323fec-8869-4ce4-9355-0692b6db0e4f_2000x872.png" width="1456" height="635" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f3323fec-8869-4ce4-9355-0692b6db0e4f_2000x872.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:635,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:392886,&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/185166649?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3323fec-8869-4ce4-9355-0692b6db0e4f_2000x872.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_!A7XD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3323fec-8869-4ce4-9355-0692b6db0e4f_2000x872.png 424w, https://substackcdn.com/image/fetch/$s_!A7XD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3323fec-8869-4ce4-9355-0692b6db0e4f_2000x872.png 848w, https://substackcdn.com/image/fetch/$s_!A7XD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3323fec-8869-4ce4-9355-0692b6db0e4f_2000x872.png 1272w, https://substackcdn.com/image/fetch/$s_!A7XD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3323fec-8869-4ce4-9355-0692b6db0e4f_2000x872.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>For example, a product catalog where one product has 5 attributes and another has 50 is naturally &#8220;document-shaped,&#8221; because forcing it into a fixed table often creates sparse columns and migrations.</p><p><strong>When not to use this</strong>: avoid document databases when your core queries are &#8220;join across many collections by relationship,&#8221; because you&#8217;ll rebuild joins in code and lose the simplicity you came for.</p><h2>&#8220;Get me the value for this key, fast&#8221; &#8594; Key-Value and In-Memory</h2><p>When your workload is dominated by direct lookups, the winning option is usually a database that does almost nothing else.</p><p>That&#8217;s the idea behind key-value stores.</p><p>A key-value store is basically a distributed dictionary: you write a value using a key, and you read it back using that same key; all without schemas, joins, or complex queries.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!CzwI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4338f606-e1e5-4b11-abbe-8e2df6f0beec_1998x990.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!CzwI!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4338f606-e1e5-4b11-abbe-8e2df6f0beec_1998x990.png 424w, https://substackcdn.com/image/fetch/$s_!CzwI!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4338f606-e1e5-4b11-abbe-8e2df6f0beec_1998x990.png 848w, https://substackcdn.com/image/fetch/$s_!CzwI!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4338f606-e1e5-4b11-abbe-8e2df6f0beec_1998x990.png 1272w, https://substackcdn.com/image/fetch/$s_!CzwI!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4338f606-e1e5-4b11-abbe-8e2df6f0beec_1998x990.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!CzwI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4338f606-e1e5-4b11-abbe-8e2df6f0beec_1998x990.png" width="1456" height="721" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4338f606-e1e5-4b11-abbe-8e2df6f0beec_1998x990.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:721,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:531279,&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/185166649?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4338f606-e1e5-4b11-abbe-8e2df6f0beec_1998x990.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_!CzwI!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4338f606-e1e5-4b11-abbe-8e2df6f0beec_1998x990.png 424w, https://substackcdn.com/image/fetch/$s_!CzwI!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4338f606-e1e5-4b11-abbe-8e2df6f0beec_1998x990.png 848w, https://substackcdn.com/image/fetch/$s_!CzwI!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4338f606-e1e5-4b11-abbe-8e2df6f0beec_1998x990.png 1272w, https://substackcdn.com/image/fetch/$s_!CzwI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4338f606-e1e5-4b11-abbe-8e2df6f0beec_1998x990.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 simplicity makes partitioning and throughput easier, which is why they show up in sessions, caching layers, and feature flags.</p><p>In-memory databases push the same idea further by keeping working data in RAM for extremely low latency. The trade-off is that memory is expensive and volatility is real unless you enable persistence; and even then, durability often trades off with performance.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!A3ps!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67507711-2fee-4a06-891c-2f492b108a96_2000x871.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!A3ps!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67507711-2fee-4a06-891c-2f492b108a96_2000x871.png 424w, https://substackcdn.com/image/fetch/$s_!A3ps!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67507711-2fee-4a06-891c-2f492b108a96_2000x871.png 848w, https://substackcdn.com/image/fetch/$s_!A3ps!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67507711-2fee-4a06-891c-2f492b108a96_2000x871.png 1272w, https://substackcdn.com/image/fetch/$s_!A3ps!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67507711-2fee-4a06-891c-2f492b108a96_2000x871.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!A3ps!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67507711-2fee-4a06-891c-2f492b108a96_2000x871.png" width="1456" height="634" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/67507711-2fee-4a06-891c-2f492b108a96_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;:393857,&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/185166649?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67507711-2fee-4a06-891c-2f492b108a96_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_!A3ps!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67507711-2fee-4a06-891c-2f492b108a96_2000x871.png 424w, https://substackcdn.com/image/fetch/$s_!A3ps!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67507711-2fee-4a06-891c-2f492b108a96_2000x871.png 848w, https://substackcdn.com/image/fetch/$s_!A3ps!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67507711-2fee-4a06-891c-2f492b108a96_2000x871.png 1272w, https://substackcdn.com/image/fetch/$s_!A3ps!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67507711-2fee-4a06-891c-2f492b108a96_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><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!7G6B!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62f7430a-5809-429c-83dd-4390390af097_2000x872.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7G6B!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62f7430a-5809-429c-83dd-4390390af097_2000x872.png 424w, https://substackcdn.com/image/fetch/$s_!7G6B!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62f7430a-5809-429c-83dd-4390390af097_2000x872.png 848w, https://substackcdn.com/image/fetch/$s_!7G6B!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62f7430a-5809-429c-83dd-4390390af097_2000x872.png 1272w, https://substackcdn.com/image/fetch/$s_!7G6B!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62f7430a-5809-429c-83dd-4390390af097_2000x872.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7G6B!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62f7430a-5809-429c-83dd-4390390af097_2000x872.png" width="1456" height="635" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/62f7430a-5809-429c-83dd-4390390af097_2000x872.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:635,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:389470,&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/185166649?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62f7430a-5809-429c-83dd-4390390af097_2000x872.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_!7G6B!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62f7430a-5809-429c-83dd-4390390af097_2000x872.png 424w, https://substackcdn.com/image/fetch/$s_!7G6B!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62f7430a-5809-429c-83dd-4390390af097_2000x872.png 848w, https://substackcdn.com/image/fetch/$s_!7G6B!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62f7430a-5809-429c-83dd-4390390af097_2000x872.png 1272w, https://substackcdn.com/image/fetch/$s_!7G6B!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62f7430a-5809-429c-83dd-4390390af097_2000x872.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>When not to use this</strong>: a cache shouldn&#8217;t be your source of truth unless you&#8217;ve deliberately designed for persistence and consistency.</p><h2>&#8220;Append forever, query by partitions&#8221; &#8594; Wide-Column and Time-Series</h2><p>Some workloads aren&#8217;t about &#8220;updating records.&#8221;</p><p>They&#8217;re about ingesting a firehose of data and then asking time- or key-based slices like &#8220;give me everything for this device&#8221; or &#8220;show the last 10 minutes.&#8221;</p><p>That&#8217;s where wide-column and time-series databases fit best.</p><p>Wide-column stores (column-family stores) distribute huge tables across clusters and let each row have a sparse, flexible set of columns. They&#8217;re designed for very high throughput when you access data by a primary key (and often range scans on that key), but they require careful up-front modeling because you don&#8217;t get relational joins for free.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!4UVx!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13f850c3-0876-4ca0-9229-b6298c28b4ef_2001x1001.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4UVx!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13f850c3-0876-4ca0-9229-b6298c28b4ef_2001x1001.png 424w, https://substackcdn.com/image/fetch/$s_!4UVx!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13f850c3-0876-4ca0-9229-b6298c28b4ef_2001x1001.png 848w, https://substackcdn.com/image/fetch/$s_!4UVx!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13f850c3-0876-4ca0-9229-b6298c28b4ef_2001x1001.png 1272w, https://substackcdn.com/image/fetch/$s_!4UVx!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13f850c3-0876-4ca0-9229-b6298c28b4ef_2001x1001.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4UVx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13f850c3-0876-4ca0-9229-b6298c28b4ef_2001x1001.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/13f850c3-0876-4ca0-9229-b6298c28b4ef_2001x1001.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;:989773,&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/185166649?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13f850c3-0876-4ca0-9229-b6298c28b4ef_2001x1001.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_!4UVx!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13f850c3-0876-4ca0-9229-b6298c28b4ef_2001x1001.png 424w, https://substackcdn.com/image/fetch/$s_!4UVx!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13f850c3-0876-4ca0-9229-b6298c28b4ef_2001x1001.png 848w, https://substackcdn.com/image/fetch/$s_!4UVx!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13f850c3-0876-4ca0-9229-b6298c28b4ef_2001x1001.png 1272w, https://substackcdn.com/image/fetch/$s_!4UVx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13f850c3-0876-4ca0-9229-b6298c28b4ef_2001x1001.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>Time-series databases (TSDBs) specialize even further: time is the primary axis. They use append-only designs, time partitioning, compression, and features like retention policies and downsampling.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!JYzN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae756d15-529a-4109-8e14-dc0fb8e66bc6_2001x814.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JYzN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae756d15-529a-4109-8e14-dc0fb8e66bc6_2001x814.png 424w, https://substackcdn.com/image/fetch/$s_!JYzN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae756d15-529a-4109-8e14-dc0fb8e66bc6_2001x814.png 848w, https://substackcdn.com/image/fetch/$s_!JYzN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae756d15-529a-4109-8e14-dc0fb8e66bc6_2001x814.png 1272w, https://substackcdn.com/image/fetch/$s_!JYzN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae756d15-529a-4109-8e14-dc0fb8e66bc6_2001x814.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JYzN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae756d15-529a-4109-8e14-dc0fb8e66bc6_2001x814.png" width="1456" height="592" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ae756d15-529a-4109-8e14-dc0fb8e66bc6_2001x814.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:592,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:159740,&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/185166649?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae756d15-529a-4109-8e14-dc0fb8e66bc6_2001x814.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_!JYzN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae756d15-529a-4109-8e14-dc0fb8e66bc6_2001x814.png 424w, https://substackcdn.com/image/fetch/$s_!JYzN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae756d15-529a-4109-8e14-dc0fb8e66bc6_2001x814.png 848w, https://substackcdn.com/image/fetch/$s_!JYzN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae756d15-529a-4109-8e14-dc0fb8e66bc6_2001x814.png 1272w, https://substackcdn.com/image/fetch/$s_!JYzN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae756d15-529a-4109-8e14-dc0fb8e66bc6_2001x814.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>This is why they&#8217;re a natural fit for metrics, telemetry, and monitoring queries like &#8220;last 5 minutes&#8221; or &#8220;hourly average over a month.&#8221;</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!dZKt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff579ed2e-0707-4c81-a281-0918f9120a11_2000x871.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dZKt!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff579ed2e-0707-4c81-a281-0918f9120a11_2000x871.png 424w, https://substackcdn.com/image/fetch/$s_!dZKt!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff579ed2e-0707-4c81-a281-0918f9120a11_2000x871.png 848w, https://substackcdn.com/image/fetch/$s_!dZKt!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff579ed2e-0707-4c81-a281-0918f9120a11_2000x871.png 1272w, https://substackcdn.com/image/fetch/$s_!dZKt!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff579ed2e-0707-4c81-a281-0918f9120a11_2000x871.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!dZKt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff579ed2e-0707-4c81-a281-0918f9120a11_2000x871.png" width="1456" height="634" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f579ed2e-0707-4c81-a281-0918f9120a11_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;:399647,&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/185166649?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff579ed2e-0707-4c81-a281-0918f9120a11_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_!dZKt!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff579ed2e-0707-4c81-a281-0918f9120a11_2000x871.png 424w, https://substackcdn.com/image/fetch/$s_!dZKt!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff579ed2e-0707-4c81-a281-0918f9120a11_2000x871.png 848w, https://substackcdn.com/image/fetch/$s_!dZKt!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff579ed2e-0707-4c81-a281-0918f9120a11_2000x871.png 1272w, https://substackcdn.com/image/fetch/$s_!dZKt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff579ed2e-0707-4c81-a281-0918f9120a11_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><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!xKLY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d0b95f4-4384-4b91-b6d7-33b32c247374_2000x871.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!xKLY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d0b95f4-4384-4b91-b6d7-33b32c247374_2000x871.png 424w, https://substackcdn.com/image/fetch/$s_!xKLY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d0b95f4-4384-4b91-b6d7-33b32c247374_2000x871.png 848w, https://substackcdn.com/image/fetch/$s_!xKLY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d0b95f4-4384-4b91-b6d7-33b32c247374_2000x871.png 1272w, https://substackcdn.com/image/fetch/$s_!xKLY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d0b95f4-4384-4b91-b6d7-33b32c247374_2000x871.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!xKLY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d0b95f4-4384-4b91-b6d7-33b32c247374_2000x871.png" width="1456" height="634" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9d0b95f4-4384-4b91-b6d7-33b32c247374_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;:381289,&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/185166649?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d0b95f4-4384-4b91-b6d7-33b32c247374_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_!xKLY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d0b95f4-4384-4b91-b6d7-33b32c247374_2000x871.png 424w, https://substackcdn.com/image/fetch/$s_!xKLY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d0b95f4-4384-4b91-b6d7-33b32c247374_2000x871.png 848w, https://substackcdn.com/image/fetch/$s_!xKLY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d0b95f4-4384-4b91-b6d7-33b32c247374_2000x871.png 1272w, https://substackcdn.com/image/fetch/$s_!xKLY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d0b95f4-4384-4b91-b6d7-33b32c247374_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><p><strong>When not to use this</strong>: avoid wide-column and time-series databases for workloads that need frequent updates, complex joins, or multi-row transactions.</p><h2>&#8220;How are these things connected?&#8221; &#8594; Graph databases</h2><p>Graph databases make relationships first-class: nodes represent entities, edges represent relationships, and the database is optimized for traversing across those relationships.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!GK5X!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4771a55-3260-45ab-8a29-7e0d25af95a9_2001x729.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GK5X!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4771a55-3260-45ab-8a29-7e0d25af95a9_2001x729.png 424w, https://substackcdn.com/image/fetch/$s_!GK5X!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4771a55-3260-45ab-8a29-7e0d25af95a9_2001x729.png 848w, https://substackcdn.com/image/fetch/$s_!GK5X!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4771a55-3260-45ab-8a29-7e0d25af95a9_2001x729.png 1272w, https://substackcdn.com/image/fetch/$s_!GK5X!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4771a55-3260-45ab-8a29-7e0d25af95a9_2001x729.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GK5X!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4771a55-3260-45ab-8a29-7e0d25af95a9_2001x729.png" width="1456" height="530" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d4771a55-3260-45ab-8a29-7e0d25af95a9_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;:159084,&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/185166649?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4771a55-3260-45ab-8a29-7e0d25af95a9_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_!GK5X!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4771a55-3260-45ab-8a29-7e0d25af95a9_2001x729.png 424w, https://substackcdn.com/image/fetch/$s_!GK5X!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4771a55-3260-45ab-8a29-7e0d25af95a9_2001x729.png 848w, https://substackcdn.com/image/fetch/$s_!GK5X!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4771a55-3260-45ab-8a29-7e0d25af95a9_2001x729.png 1272w, https://substackcdn.com/image/fetch/$s_!GK5X!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4771a55-3260-45ab-8a29-7e0d25af95a9_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><p>If your queries look like &#8220;friends of friends,&#8221; &#8220;how are these things connected,&#8221; or &#8220;what paths exist between them,&#8221; graph databases can answer them quickly, while recursive joins can become slow and complex.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!a0FL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd673e64-941f-4aff-9a3b-1ffd48291b02_2000x872.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!a0FL!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd673e64-941f-4aff-9a3b-1ffd48291b02_2000x872.png 424w, https://substackcdn.com/image/fetch/$s_!a0FL!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd673e64-941f-4aff-9a3b-1ffd48291b02_2000x872.png 848w, https://substackcdn.com/image/fetch/$s_!a0FL!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd673e64-941f-4aff-9a3b-1ffd48291b02_2000x872.png 1272w, https://substackcdn.com/image/fetch/$s_!a0FL!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd673e64-941f-4aff-9a3b-1ffd48291b02_2000x872.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!a0FL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd673e64-941f-4aff-9a3b-1ffd48291b02_2000x872.png" width="1456" height="635" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fd673e64-941f-4aff-9a3b-1ffd48291b02_2000x872.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:635,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:410429,&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/185166649?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd673e64-941f-4aff-9a3b-1ffd48291b02_2000x872.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_!a0FL!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd673e64-941f-4aff-9a3b-1ffd48291b02_2000x872.png 424w, https://substackcdn.com/image/fetch/$s_!a0FL!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd673e64-941f-4aff-9a3b-1ffd48291b02_2000x872.png 848w, https://substackcdn.com/image/fetch/$s_!a0FL!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd673e64-941f-4aff-9a3b-1ffd48291b02_2000x872.png 1272w, https://substackcdn.com/image/fetch/$s_!a0FL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd673e64-941f-4aff-9a3b-1ffd48291b02_2000x872.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_!Vj8-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe612c44f-981b-4189-9647-d4ea1f6a92c0_2000x727.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Vj8-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe612c44f-981b-4189-9647-d4ea1f6a92c0_2000x727.png 424w, https://substackcdn.com/image/fetch/$s_!Vj8-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe612c44f-981b-4189-9647-d4ea1f6a92c0_2000x727.png 848w, https://substackcdn.com/image/fetch/$s_!Vj8-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe612c44f-981b-4189-9647-d4ea1f6a92c0_2000x727.png 1272w, https://substackcdn.com/image/fetch/$s_!Vj8-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe612c44f-981b-4189-9647-d4ea1f6a92c0_2000x727.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Vj8-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe612c44f-981b-4189-9647-d4ea1f6a92c0_2000x727.png" width="1456" height="529" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e612c44f-981b-4189-9647-d4ea1f6a92c0_2000x727.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;:354501,&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/185166649?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe612c44f-981b-4189-9647-d4ea1f6a92c0_2000x727.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_!Vj8-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe612c44f-981b-4189-9647-d4ea1f6a92c0_2000x727.png 424w, https://substackcdn.com/image/fetch/$s_!Vj8-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe612c44f-981b-4189-9647-d4ea1f6a92c0_2000x727.png 848w, https://substackcdn.com/image/fetch/$s_!Vj8-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe612c44f-981b-4189-9647-d4ea1f6a92c0_2000x727.png 1272w, https://substackcdn.com/image/fetch/$s_!Vj8-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe612c44f-981b-4189-9647-d4ea1f6a92c0_2000x727.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>When not to use this</strong>: if you rarely traverse relationships, a graph database is overhead; use a simpler store that matches your access pattern.</p><h2>&#8220;Find text like a human would&#8221; &#8594; Search and Vector databases</h2><p>Search engines answer: &#8220;Which documents contain these terms, and which are most relevant?&#8221; using inverted indexes and relevance scoring.</p><p>They&#8217;re often eventually consistent (documents become searchable after a short delay), and they are not designed to be your transactional source of truth.</p><p>Vector databases answer a different question: &#8220;Which items are closest in meaning?&#8221;</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!A_bl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe329d439-720e-455c-bc8d-90b9cd916ad1_2001x1143.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!A_bl!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe329d439-720e-455c-bc8d-90b9cd916ad1_2001x1143.png 424w, https://substackcdn.com/image/fetch/$s_!A_bl!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe329d439-720e-455c-bc8d-90b9cd916ad1_2001x1143.png 848w, https://substackcdn.com/image/fetch/$s_!A_bl!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe329d439-720e-455c-bc8d-90b9cd916ad1_2001x1143.png 1272w, https://substackcdn.com/image/fetch/$s_!A_bl!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe329d439-720e-455c-bc8d-90b9cd916ad1_2001x1143.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!A_bl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe329d439-720e-455c-bc8d-90b9cd916ad1_2001x1143.png" width="1456" height="832" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e329d439-720e-455c-bc8d-90b9cd916ad1_2001x1143.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:832,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:338914,&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/185166649?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe329d439-720e-455c-bc8d-90b9cd916ad1_2001x1143.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_!A_bl!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe329d439-720e-455c-bc8d-90b9cd916ad1_2001x1143.png 424w, https://substackcdn.com/image/fetch/$s_!A_bl!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe329d439-720e-455c-bc8d-90b9cd916ad1_2001x1143.png 848w, https://substackcdn.com/image/fetch/$s_!A_bl!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe329d439-720e-455c-bc8d-90b9cd916ad1_2001x1143.png 1272w, https://substackcdn.com/image/fetch/$s_!A_bl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe329d439-720e-455c-bc8d-90b9cd916ad1_2001x1143.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>They store embeddings (high-dimensional vectors) and use approximate nearest neighbor (ANN) indexes to avoid brute-force scans.</p><p>The speed comes from approximation, so you trade perfect accuracy for low latency.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!uERc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F19e22235-6389-4ff2-b168-76f34961a679_2000x871.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!uERc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F19e22235-6389-4ff2-b168-76f34961a679_2000x871.png 424w, https://substackcdn.com/image/fetch/$s_!uERc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F19e22235-6389-4ff2-b168-76f34961a679_2000x871.png 848w, https://substackcdn.com/image/fetch/$s_!uERc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F19e22235-6389-4ff2-b168-76f34961a679_2000x871.png 1272w, https://substackcdn.com/image/fetch/$s_!uERc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F19e22235-6389-4ff2-b168-76f34961a679_2000x871.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!uERc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F19e22235-6389-4ff2-b168-76f34961a679_2000x871.png" width="1456" height="634" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/19e22235-6389-4ff2-b168-76f34961a679_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;:402127,&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/185166649?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F19e22235-6389-4ff2-b168-76f34961a679_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_!uERc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F19e22235-6389-4ff2-b168-76f34961a679_2000x871.png 424w, https://substackcdn.com/image/fetch/$s_!uERc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F19e22235-6389-4ff2-b168-76f34961a679_2000x871.png 848w, https://substackcdn.com/image/fetch/$s_!uERc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F19e22235-6389-4ff2-b168-76f34961a679_2000x871.png 1272w, https://substackcdn.com/image/fetch/$s_!uERc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F19e22235-6389-4ff2-b168-76f34961a679_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><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!C30Z!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70ce7aa3-b5ef-42dd-915d-8dd23b0d1c1e_2000x871.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!C30Z!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70ce7aa3-b5ef-42dd-915d-8dd23b0d1c1e_2000x871.png 424w, https://substackcdn.com/image/fetch/$s_!C30Z!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70ce7aa3-b5ef-42dd-915d-8dd23b0d1c1e_2000x871.png 848w, https://substackcdn.com/image/fetch/$s_!C30Z!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70ce7aa3-b5ef-42dd-915d-8dd23b0d1c1e_2000x871.png 1272w, https://substackcdn.com/image/fetch/$s_!C30Z!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70ce7aa3-b5ef-42dd-915d-8dd23b0d1c1e_2000x871.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!C30Z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70ce7aa3-b5ef-42dd-915d-8dd23b0d1c1e_2000x871.png" width="1456" height="634" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/70ce7aa3-b5ef-42dd-915d-8dd23b0d1c1e_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;:378099,&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/185166649?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70ce7aa3-b5ef-42dd-915d-8dd23b0d1c1e_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_!C30Z!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70ce7aa3-b5ef-42dd-915d-8dd23b0d1c1e_2000x871.png 424w, https://substackcdn.com/image/fetch/$s_!C30Z!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70ce7aa3-b5ef-42dd-915d-8dd23b0d1c1e_2000x871.png 848w, https://substackcdn.com/image/fetch/$s_!C30Z!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70ce7aa3-b5ef-42dd-915d-8dd23b0d1c1e_2000x871.png 1272w, https://substackcdn.com/image/fetch/$s_!C30Z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70ce7aa3-b5ef-42dd-915d-8dd23b0d1c1e_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><p><strong>When not to use this</strong>: search and vector databases aren&#8217;t a good fit when you need strong transactions, immediate consistency, or your single source of truth.</p><h2>Final recap: match the database to the question</h2><p>Every database type in this article exists for a reason.</p><p>None of them is &#8220;better&#8221; in general. Each one is optimized for a <strong>specific kind of question</strong>, and struggles when pushed outside that use case.</p><p>The fastest way to choose is to ignore features and focus on this instead:</p><p><strong>What is the hardest question my system asks, every day, under load?</strong></p><p>If you answer that honestly, the right database type usually becomes obvious; and you avoid months of work compensating for a bad fit in application 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_!_iPB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7682c4df-40aa-4dfd-a775-1e7dfa1bfb80_2000x1917.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_iPB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7682c4df-40aa-4dfd-a775-1e7dfa1bfb80_2000x1917.png 424w, https://substackcdn.com/image/fetch/$s_!_iPB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7682c4df-40aa-4dfd-a775-1e7dfa1bfb80_2000x1917.png 848w, https://substackcdn.com/image/fetch/$s_!_iPB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7682c4df-40aa-4dfd-a775-1e7dfa1bfb80_2000x1917.png 1272w, https://substackcdn.com/image/fetch/$s_!_iPB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7682c4df-40aa-4dfd-a775-1e7dfa1bfb80_2000x1917.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_iPB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7682c4df-40aa-4dfd-a775-1e7dfa1bfb80_2000x1917.png" width="1456" height="1396" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7682c4df-40aa-4dfd-a775-1e7dfa1bfb80_2000x1917.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1396,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:792934,&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/185166649?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7682c4df-40aa-4dfd-a775-1e7dfa1bfb80_2000x1917.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_!_iPB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7682c4df-40aa-4dfd-a775-1e7dfa1bfb80_2000x1917.png 424w, https://substackcdn.com/image/fetch/$s_!_iPB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7682c4df-40aa-4dfd-a775-1e7dfa1bfb80_2000x1917.png 848w, https://substackcdn.com/image/fetch/$s_!_iPB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7682c4df-40aa-4dfd-a775-1e7dfa1bfb80_2000x1917.png 1272w, https://substackcdn.com/image/fetch/$s_!_iPB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7682c4df-40aa-4dfd-a775-1e7dfa1bfb80_2000x1917.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>Many production systems don&#8217;t choose <em>one</em> database. They choose a <strong>primary database for correctness</strong> and <strong>secondary databases for access patterns</strong>:</p><ul><li><p>SQL for transactions</p></li><li><p>Search for retrieval</p></li><li><p>Cache for speed</p></li><li><p>Vector for semantic discovery</p></li></ul><p>That&#8217;s not over-engineering. It&#8217;s acknowledging that <strong>no single database answers every hard question well</strong>.</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[Top 5 Database Caching Strategies You Should Know]]></title><description><![CDATA[(5 minutes) | Speed gains, consistency risks, and real trade-offs]]></description><link>https://blog.levelupcoding.com/p/database-caching-strategies</link><guid isPermaLink="false">https://blog.levelupcoding.com/p/database-caching-strategies</guid><dc:creator><![CDATA[Nikki Siapno]]></dc:creator><pubDate>Thu, 29 Jan 2026 13:48:33 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/ef5975a6-e328-4cba-8f1c-eb0b8eb5d8e0_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/coder-cde-z8nl">Coder: Secure Environments for Developers and Their Agents</a></h2><h5>Presented by Coder</h5><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ft22!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc828db73-f437-47ad-98c3-abd85c49b87b_3662x2049.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ft22!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc828db73-f437-47ad-98c3-abd85c49b87b_3662x2049.png 424w, https://substackcdn.com/image/fetch/$s_!ft22!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc828db73-f437-47ad-98c3-abd85c49b87b_3662x2049.png 848w, https://substackcdn.com/image/fetch/$s_!ft22!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc828db73-f437-47ad-98c3-abd85c49b87b_3662x2049.png 1272w, https://substackcdn.com/image/fetch/$s_!ft22!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc828db73-f437-47ad-98c3-abd85c49b87b_3662x2049.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ft22!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc828db73-f437-47ad-98c3-abd85c49b87b_3662x2049.png" width="1456" height="815" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c828db73-f437-47ad-98c3-abd85c49b87b_3662x2049.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;:336079,&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/185286844?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc828db73-f437-47ad-98c3-abd85c49b87b_3662x2049.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_!ft22!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc828db73-f437-47ad-98c3-abd85c49b87b_3662x2049.png 424w, https://substackcdn.com/image/fetch/$s_!ft22!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc828db73-f437-47ad-98c3-abd85c49b87b_3662x2049.png 848w, https://substackcdn.com/image/fetch/$s_!ft22!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc828db73-f437-47ad-98c3-abd85c49b87b_3662x2049.png 1272w, https://substackcdn.com/image/fetch/$s_!ft22!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc828db73-f437-47ad-98c3-abd85c49b87b_3662x2049.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>Local development works because humans are trusted by default. AI agents inherit that same environment, with access to secrets, configs, and systems. Once agents do real work, teams need governed environments with clear boundaries. <strong><a href="https://lucode.co/coder-cde-z8nl">Coder</a></strong> brings developers and coding agents together on your infrastructure, open source and deployable anywhere, without compromising security or performance. It&#8217;s <strong>open source (113k stars)</strong> with a <strong>completely free Community Edition</strong> anyone can run.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://lucode.co/coder-cde-z8nl&quot;,&quot;text&quot;:&quot;Try it now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://lucode.co/coder-cde-z8nl"><span>Try it now</span></a></p><div><hr></div><h1>Top 5 Database Caching Strategies You Should Know</h1><p>Caching is a core performance optimization technique.</p><p>Done well, caching reduces latency, protects your database, and improves throughput. Done poorly, it introduces stale reads, hidden consistency bugs, and memory waste that only shows up in production.</p><p>The problem is not <em>whether</em> to cache.<br>It&#8217;s <em>how</em>.</p><p>Different caching strategies exist because systems have different access patterns, consistency needs, and failure tolerances.</p><p>Let&#8217;s dive into five of the most widely used caching strategies.</p><h2>1) Cache-Aside</h2><p>In a cache-aside strategy, the application explicitly manages reads and writes to the cache.</p><p>It queries the cache first, and on a cache miss, it fetches data from the database, returns it, and updates the cache.</p><p>The cache only stores data after it&#8217;s been read by the app.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!4_NP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb20fc09-8c41-481e-82d9-5887d5cb90aa_2000x1595.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4_NP!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb20fc09-8c41-481e-82d9-5887d5cb90aa_2000x1595.png 424w, https://substackcdn.com/image/fetch/$s_!4_NP!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb20fc09-8c41-481e-82d9-5887d5cb90aa_2000x1595.png 848w, https://substackcdn.com/image/fetch/$s_!4_NP!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb20fc09-8c41-481e-82d9-5887d5cb90aa_2000x1595.png 1272w, https://substackcdn.com/image/fetch/$s_!4_NP!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb20fc09-8c41-481e-82d9-5887d5cb90aa_2000x1595.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4_NP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb20fc09-8c41-481e-82d9-5887d5cb90aa_2000x1595.png" width="1456" height="1161" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cb20fc09-8c41-481e-82d9-5887d5cb90aa_2000x1595.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1161,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1066254,&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/185286844?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb20fc09-8c41-481e-82d9-5887d5cb90aa_2000x1595.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_!4_NP!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb20fc09-8c41-481e-82d9-5887d5cb90aa_2000x1595.png 424w, https://substackcdn.com/image/fetch/$s_!4_NP!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb20fc09-8c41-481e-82d9-5887d5cb90aa_2000x1595.png 848w, https://substackcdn.com/image/fetch/$s_!4_NP!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb20fc09-8c41-481e-82d9-5887d5cb90aa_2000x1595.png 1272w, https://substackcdn.com/image/fetch/$s_!4_NP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb20fc09-8c41-481e-82d9-5887d5cb90aa_2000x1595.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>Pros:</h3><ul><li><p><strong>Full control</strong> &#8594; The application decides what to cache and when.</p></li><li><p><strong>Demand-driven</strong> &#8594; You only cache data that someone asked for.</p></li><li><p><strong>Flexible</strong> &#8594; Works well when access patterns are unpredictable.</p></li></ul><h3>Cons:</h3><ul><li><p><strong>Consistency is your responsibility</strong> &#8594; You must handle invalidation correctly.</p></li><li><p><strong>More application logic</strong> &#8594; Every read path needs cache awareness.</p></li></ul><p>Cache-aside shines in systems where usage patterns are unpredictable or data freshness varies. However, beware that sloppy cache management can lead to stale reads or wasted memory.</p><h2>2) Write-Through</h2><p>Write-through caching updates the cache and the database at the same time.</p><p>Every write goes through the cache first, which then synchronously persists the change to the database. Reads always hit a warm, up-to-date cache.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!pOt_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9dcdb9c-82c5-4b57-be90-389dbb68d53a_2000x1185.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!pOt_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9dcdb9c-82c5-4b57-be90-389dbb68d53a_2000x1185.png 424w, https://substackcdn.com/image/fetch/$s_!pOt_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9dcdb9c-82c5-4b57-be90-389dbb68d53a_2000x1185.png 848w, https://substackcdn.com/image/fetch/$s_!pOt_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9dcdb9c-82c5-4b57-be90-389dbb68d53a_2000x1185.png 1272w, https://substackcdn.com/image/fetch/$s_!pOt_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9dcdb9c-82c5-4b57-be90-389dbb68d53a_2000x1185.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!pOt_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9dcdb9c-82c5-4b57-be90-389dbb68d53a_2000x1185.png" width="1456" height="863" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e9dcdb9c-82c5-4b57-be90-389dbb68d53a_2000x1185.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:863,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:680888,&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/185286844?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9dcdb9c-82c5-4b57-be90-389dbb68d53a_2000x1185.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_!pOt_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9dcdb9c-82c5-4b57-be90-389dbb68d53a_2000x1185.png 424w, https://substackcdn.com/image/fetch/$s_!pOt_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9dcdb9c-82c5-4b57-be90-389dbb68d53a_2000x1185.png 848w, https://substackcdn.com/image/fetch/$s_!pOt_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9dcdb9c-82c5-4b57-be90-389dbb68d53a_2000x1185.png 1272w, https://substackcdn.com/image/fetch/$s_!pOt_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9dcdb9c-82c5-4b57-be90-389dbb68d53a_2000x1185.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>Pros:</h3><ul><li><p><strong>Strong consistency</strong> &#8594; Cache and database never diverge.</p></li><li><p><strong>Simple reads</strong> &#8594; No stale data surprises.</p></li><li><p><strong>Predictable behavior</strong> &#8594; Fewer edge cases to reason about.</p></li></ul><h3>Cons:</h3><ul><li><p><strong>Higher write latency</strong> &#8594; Every write incurs the cost of writing to two systems (cache and database).</p></li><li><p><strong>Cache pollution</strong> &#8594; Cache can be flooded with infrequently read data.</p></li></ul><p>Best used when data integrity and consistency are critical. Think e-commerce transactions or financial apps where stale reads aren&#8217;t an option.</p><h2>3) Write-Behind (Write-Back)</h2><p>Write-behind (or write-back) caching updates the cache first and the database later in the background. &#8220;Dirty&#8221; data is flushed based on a schedule or specific triggers like time or batch size.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!rs9J!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff16c651d-6627-4a95-8ad8-7636191fa282_2000x1179.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rs9J!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff16c651d-6627-4a95-8ad8-7636191fa282_2000x1179.png 424w, https://substackcdn.com/image/fetch/$s_!rs9J!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff16c651d-6627-4a95-8ad8-7636191fa282_2000x1179.png 848w, https://substackcdn.com/image/fetch/$s_!rs9J!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff16c651d-6627-4a95-8ad8-7636191fa282_2000x1179.png 1272w, https://substackcdn.com/image/fetch/$s_!rs9J!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff16c651d-6627-4a95-8ad8-7636191fa282_2000x1179.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rs9J!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff16c651d-6627-4a95-8ad8-7636191fa282_2000x1179.png" width="1456" height="858" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f16c651d-6627-4a95-8ad8-7636191fa282_2000x1179.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:858,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:700977,&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/185286844?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff16c651d-6627-4a95-8ad8-7636191fa282_2000x1179.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_!rs9J!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff16c651d-6627-4a95-8ad8-7636191fa282_2000x1179.png 424w, https://substackcdn.com/image/fetch/$s_!rs9J!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff16c651d-6627-4a95-8ad8-7636191fa282_2000x1179.png 848w, https://substackcdn.com/image/fetch/$s_!rs9J!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff16c651d-6627-4a95-8ad8-7636191fa282_2000x1179.png 1272w, https://substackcdn.com/image/fetch/$s_!rs9J!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff16c651d-6627-4a95-8ad8-7636191fa282_2000x1179.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>Pros:</h3><ul><li><p><strong>Fast writes</strong> &#8594; The application doesn&#8217;t wait on the database.</p></li><li><p><strong>Reduced database pressure</strong> &#8594; Writes are smoothed and batched.</p></li><li><p><strong>High throughput</strong> &#8594; Ideal for write-heavy workloads.</p></li></ul><h3>Cons:</h3><ul><li><p><strong>Data loss risk</strong> &#8594; Risk of data loss if the cache node crashes before the database syncs.</p></li><li><p><strong>Harder debugging</strong> &#8594; Failures surface later, not at write time.</p></li></ul><p>Write-behind is ideal for apps where slight delays in database updates are tolerable, like activity feeds, logs, or ephemeral data.</p><h2>4) Read-Through</h2><p>A read-through cache acts as a middle layer.</p><p>The application queries the cache directly, and on a miss, the cache fetches the data from the database, stores it in the cache, and returns it to the application.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Wdl6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4570ece9-77a6-4b4a-a7fa-7bbcc40931b2_2000x1160.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Wdl6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4570ece9-77a6-4b4a-a7fa-7bbcc40931b2_2000x1160.png 424w, https://substackcdn.com/image/fetch/$s_!Wdl6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4570ece9-77a6-4b4a-a7fa-7bbcc40931b2_2000x1160.png 848w, https://substackcdn.com/image/fetch/$s_!Wdl6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4570ece9-77a6-4b4a-a7fa-7bbcc40931b2_2000x1160.png 1272w, https://substackcdn.com/image/fetch/$s_!Wdl6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4570ece9-77a6-4b4a-a7fa-7bbcc40931b2_2000x1160.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Wdl6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4570ece9-77a6-4b4a-a7fa-7bbcc40931b2_2000x1160.png" width="1456" height="844" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4570ece9-77a6-4b4a-a7fa-7bbcc40931b2_2000x1160.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:844,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:911649,&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/185286844?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4570ece9-77a6-4b4a-a7fa-7bbcc40931b2_2000x1160.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_!Wdl6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4570ece9-77a6-4b4a-a7fa-7bbcc40931b2_2000x1160.png 424w, https://substackcdn.com/image/fetch/$s_!Wdl6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4570ece9-77a6-4b4a-a7fa-7bbcc40931b2_2000x1160.png 848w, https://substackcdn.com/image/fetch/$s_!Wdl6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4570ece9-77a6-4b4a-a7fa-7bbcc40931b2_2000x1160.png 1272w, https://substackcdn.com/image/fetch/$s_!Wdl6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4570ece9-77a6-4b4a-a7fa-7bbcc40931b2_2000x1160.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>Pros:</h3><ul><li><p><strong>Cleaner application code</strong> &#8594; No explicit cache logic on reads.</p></li><li><p><strong>Centralized behavior</strong> &#8594; Caching rules live in one place.</p></li><li><p><strong>Efficient for repeated reads</strong> &#8594; Hot data stays warm automatically.</p></li></ul><h3>Cons:</h3><ul><li><p><strong>Cold start penalty</strong> &#8594; Initial cache misses still hit the database, causing a slight delay.</p></li><li><p><strong>Staleness risk</strong> &#8594; Requires careful TTLs or invalidation rules.</p></li></ul><p>This is a solid choice for read-heavy applications with stable data, like content libraries or product catalogues.</p><h2>5) Write-Around</h2><p>Write-around caching skips the cache during writes, sending data straight to the database.</p><p>Data enters the cache only when it&#8217;s read later. This means new or updated data isn&#8217;t cached until requested.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Z0gE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F774e7ae5-29d8-413d-9a22-604d7abf50c8_2000x1635.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Z0gE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F774e7ae5-29d8-413d-9a22-604d7abf50c8_2000x1635.png 424w, https://substackcdn.com/image/fetch/$s_!Z0gE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F774e7ae5-29d8-413d-9a22-604d7abf50c8_2000x1635.png 848w, https://substackcdn.com/image/fetch/$s_!Z0gE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F774e7ae5-29d8-413d-9a22-604d7abf50c8_2000x1635.png 1272w, https://substackcdn.com/image/fetch/$s_!Z0gE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F774e7ae5-29d8-413d-9a22-604d7abf50c8_2000x1635.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Z0gE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F774e7ae5-29d8-413d-9a22-604d7abf50c8_2000x1635.png" width="1456" height="1190" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/774e7ae5-29d8-413d-9a22-604d7abf50c8_2000x1635.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1190,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1135050,&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/185286844?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F774e7ae5-29d8-413d-9a22-604d7abf50c8_2000x1635.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_!Z0gE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F774e7ae5-29d8-413d-9a22-604d7abf50c8_2000x1635.png 424w, https://substackcdn.com/image/fetch/$s_!Z0gE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F774e7ae5-29d8-413d-9a22-604d7abf50c8_2000x1635.png 848w, https://substackcdn.com/image/fetch/$s_!Z0gE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F774e7ae5-29d8-413d-9a22-604d7abf50c8_2000x1635.png 1272w, https://substackcdn.com/image/fetch/$s_!Z0gE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F774e7ae5-29d8-413d-9a22-604d7abf50c8_2000x1635.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>Pros:</h3><ul><li><p><strong>Lean cache usage</strong> &#8594; Avoids caching data that may never be read.</p></li><li><p><strong>Reduced churn</strong> &#8594; Write bursts don&#8217;t evict hot read data.</p></li><li><p><strong>Simple write path</strong> &#8594; No cache coordination during writes.</p></li></ul><h3>Cons:</h3><ul><li><p><strong>Guaranteed cache misses after writes</strong> &#8594; First reads after a write always miss the cache, causing read latency.</p></li><li><p><strong>Uneven read latency</strong> &#8594; Inconsistent performance if reads for new data spike unexpectedly.</p></li></ul><p>Best for apps with frequent writes and infrequent reads, like analytics logs or activity events.</p><h2>Choosing the right strategy</h2><p>Each caching strategy comes with its own trade-offs. To decide which one fits your system, consider:</p><ul><li><p><strong>Read vs write ratio</strong> &#8594; Is your workload read-heavy, write-heavy, or balanced?</p></li><li><p><strong>Consistency requirements</strong> &#8594; Can your system tolerate stale data, or is strict consistency a must?</p></li><li><p><strong>Operational complexity</strong> &#8594; How much logic are you willing to manage in the application vs the cache layer?</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_!38jn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3072404e-f74b-4638-83ac-e9aa57eb74bc_2000x818.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!38jn!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3072404e-f74b-4638-83ac-e9aa57eb74bc_2000x818.png 424w, https://substackcdn.com/image/fetch/$s_!38jn!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3072404e-f74b-4638-83ac-e9aa57eb74bc_2000x818.png 848w, https://substackcdn.com/image/fetch/$s_!38jn!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3072404e-f74b-4638-83ac-e9aa57eb74bc_2000x818.png 1272w, https://substackcdn.com/image/fetch/$s_!38jn!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3072404e-f74b-4638-83ac-e9aa57eb74bc_2000x818.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!38jn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3072404e-f74b-4638-83ac-e9aa57eb74bc_2000x818.png" width="1456" height="596" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3072404e-f74b-4638-83ac-e9aa57eb74bc_2000x818.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:596,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:375725,&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/185286844?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3072404e-f74b-4638-83ac-e9aa57eb74bc_2000x818.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_!38jn!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3072404e-f74b-4638-83ac-e9aa57eb74bc_2000x818.png 424w, https://substackcdn.com/image/fetch/$s_!38jn!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3072404e-f74b-4638-83ac-e9aa57eb74bc_2000x818.png 848w, https://substackcdn.com/image/fetch/$s_!38jn!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3072404e-f74b-4638-83ac-e9aa57eb74bc_2000x818.png 1272w, https://substackcdn.com/image/fetch/$s_!38jn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3072404e-f74b-4638-83ac-e9aa57eb74bc_2000x818.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>Understanding these trade-offs is key to making caching an enabler, not a liability.</p><h2>Final thoughts</h2><p>Caching is not just a performance optimization.</p><p>It is part of your system&#8217;s correctness model.</p><p>The right strategy reduces load, smooths traffic, and keeps latency predictable. The wrong one quietly accumulates risk until a cache eviction, deployment, or incident exposes it.</p><p>Match your caching strategy to your access patterns, failure tolerance, and consistency needs; and your system will scale calmly instead of nervously.</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[Microservices Clearly Explained]]></title><description><![CDATA[(4 minutes) | The benefits are real. The distributed complexity is too.]]></description><link>https://blog.levelupcoding.com/p/microservices-clearly-explained</link><guid isPermaLink="false">https://blog.levelupcoding.com/p/microservices-clearly-explained</guid><dc:creator><![CDATA[Nikki Siapno]]></dc:creator><pubDate>Sat, 24 Jan 2026 11:40:00 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/316b0e1e-a4a6-424f-8ee8-62bd4bfe4b9b_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/microsoft-foundry-z7nl">Microsoft Foundry: The AI App and Agent Factory</a></h2><h5>Presented by Microsoft</h5><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Py6C!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F478a01d6-eedb-4b1a-afe1-8ade8685e72d_3378x1892.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Py6C!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F478a01d6-eedb-4b1a-afe1-8ade8685e72d_3378x1892.png 424w, https://substackcdn.com/image/fetch/$s_!Py6C!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F478a01d6-eedb-4b1a-afe1-8ade8685e72d_3378x1892.png 848w, https://substackcdn.com/image/fetch/$s_!Py6C!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F478a01d6-eedb-4b1a-afe1-8ade8685e72d_3378x1892.png 1272w, https://substackcdn.com/image/fetch/$s_!Py6C!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F478a01d6-eedb-4b1a-afe1-8ade8685e72d_3378x1892.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Py6C!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F478a01d6-eedb-4b1a-afe1-8ade8685e72d_3378x1892.png" width="1456" height="815" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/478a01d6-eedb-4b1a-afe1-8ade8685e72d_3378x1892.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;:2230913,&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/185039110?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F478a01d6-eedb-4b1a-afe1-8ade8685e72d_3378x1892.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_!Py6C!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F478a01d6-eedb-4b1a-afe1-8ade8685e72d_3378x1892.png 424w, https://substackcdn.com/image/fetch/$s_!Py6C!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F478a01d6-eedb-4b1a-afe1-8ade8685e72d_3378x1892.png 848w, https://substackcdn.com/image/fetch/$s_!Py6C!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F478a01d6-eedb-4b1a-afe1-8ade8685e72d_3378x1892.png 1272w, https://substackcdn.com/image/fetch/$s_!Py6C!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F478a01d6-eedb-4b1a-afe1-8ade8685e72d_3378x1892.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>Most teams can spin up Al demos. Far fewer can run agents reliably in production.</p><p><strong><a href="https://lucode.co/microsoft-foundry-z7nl">Microsoft Foundry</a></strong> is a unified Azure platform for building, optimizing, and governing Al agents at scale. It brings the widest selection of models on any cloud, data, multi-agent workflows, observability, and security controls together in one interoperable system, so teams can move faster without sacrificing openness, control, or security.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://lucode.co/microsoft-foundry-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/microsoft-foundry-z7nl"><span>Learn more</span></a></p><div><hr></div><h1>Microservices Clearly Explained</h1><p>Microservices are not &#8220;small monoliths.&#8221;</p><p>They change how software is built, deployed, and owned; for better and for worse.</p><p>Teams adopt them to move faster and scale more precisely, then discover they&#8217;ve also signed up for distributed complexity.</p><p>Knowing where that trade-off helps, and where it hurts, is what determines success.</p><h2>What microservices really are</h2><p>A <strong>microservices architecture</strong> structures an application as a collection of small, independent services.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!EyLn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74fa5292-cf2b-4d09-850a-1f39bcc8a324_2000x1001.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!EyLn!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74fa5292-cf2b-4d09-850a-1f39bcc8a324_2000x1001.png 424w, https://substackcdn.com/image/fetch/$s_!EyLn!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74fa5292-cf2b-4d09-850a-1f39bcc8a324_2000x1001.png 848w, https://substackcdn.com/image/fetch/$s_!EyLn!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74fa5292-cf2b-4d09-850a-1f39bcc8a324_2000x1001.png 1272w, https://substackcdn.com/image/fetch/$s_!EyLn!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74fa5292-cf2b-4d09-850a-1f39bcc8a324_2000x1001.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!EyLn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74fa5292-cf2b-4d09-850a-1f39bcc8a324_2000x1001.png" width="1456" height="729" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/74fa5292-cf2b-4d09-850a-1f39bcc8a324_2000x1001.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:729,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:530186,&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/185039110?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74fa5292-cf2b-4d09-850a-1f39bcc8a324_2000x1001.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_!EyLn!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74fa5292-cf2b-4d09-850a-1f39bcc8a324_2000x1001.png 424w, https://substackcdn.com/image/fetch/$s_!EyLn!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74fa5292-cf2b-4d09-850a-1f39bcc8a324_2000x1001.png 848w, https://substackcdn.com/image/fetch/$s_!EyLn!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74fa5292-cf2b-4d09-850a-1f39bcc8a324_2000x1001.png 1272w, https://substackcdn.com/image/fetch/$s_!EyLn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74fa5292-cf2b-4d09-850a-1f39bcc8a324_2000x1001.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 service owns a single business capability, runs in its own process, and communicates with others over a network; usually HTTP APIs or asynchronous messaging.</p><p>The key distinction is not size. It&#8217;s <strong>ownership and independence</strong>.</p><ul><li><p>Each service maps to a real domain like payments, orders, or inventory</p></li><li><p>One service can deploy independently</p></li><li><p>Each service manages its own database or storage</p></li></ul><p>Instead of one large codebase and database, you have many smaller ones that cooperate.</p><p>Updating a payment service no longer risks breaking user profiles. Scaling search traffic no longer forces you to scale checkout.</p><h2>How microservices work in practice</h2><p>In a microservices system, a single user action involves multiple service interactions.</p><p>Placing an order may trigger a chain of calls: inventory checks, payment authorization, order creation, notifications. These calls happen over HTTP or via asynchronous messages rather than in-memory function calls.</p><p>To make this all work, most systems introduce supporting infrastructure:</p><ul><li><p>An API gateway routes requests and hides internal structure</p></li><li><p>Service discovery helps services find each other at runtime</p></li><li><p>Message brokers decouple producers from consumers</p></li><li><p>Centralized logging and tracing reconstruct request paths</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_!Gjvo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f8d5980-5bcb-42e2-a5af-263ecb198e3f_2000x1342.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Gjvo!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f8d5980-5bcb-42e2-a5af-263ecb198e3f_2000x1342.png 424w, https://substackcdn.com/image/fetch/$s_!Gjvo!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f8d5980-5bcb-42e2-a5af-263ecb198e3f_2000x1342.png 848w, https://substackcdn.com/image/fetch/$s_!Gjvo!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f8d5980-5bcb-42e2-a5af-263ecb198e3f_2000x1342.png 1272w, https://substackcdn.com/image/fetch/$s_!Gjvo!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f8d5980-5bcb-42e2-a5af-263ecb198e3f_2000x1342.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Gjvo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f8d5980-5bcb-42e2-a5af-263ecb198e3f_2000x1342.png" width="1456" height="977" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2f8d5980-5bcb-42e2-a5af-263ecb198e3f_2000x1342.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:977,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:429106,&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/185039110?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f8d5980-5bcb-42e2-a5af-263ecb198e3f_2000x1342.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_!Gjvo!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f8d5980-5bcb-42e2-a5af-263ecb198e3f_2000x1342.png 424w, https://substackcdn.com/image/fetch/$s_!Gjvo!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f8d5980-5bcb-42e2-a5af-263ecb198e3f_2000x1342.png 848w, https://substackcdn.com/image/fetch/$s_!Gjvo!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f8d5980-5bcb-42e2-a5af-263ecb198e3f_2000x1342.png 1272w, https://substackcdn.com/image/fetch/$s_!Gjvo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f8d5980-5bcb-42e2-a5af-263ecb198e3f_2000x1342.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 result feels less like a single application and more like a small distributed system inside your product. Every service is simple on its own. The complexity lives in the interactions.</p><p>That&#8217;s the trade: you break one big problem into many small ones, and then you have to make them cooperate reliably.</p><h2>Benefits</h2><p>Microservices solve real problems when systems and teams reach a certain scale.</p><ul><li><p><strong>Independent scaling</strong> &#8594; Hot paths can scale without dragging the entire system along, which avoids over-provisioning and wasted resources.</p></li><li><p><strong>Faster deployment</strong> &#8594; Teams ship changes independently, reducing release coordination and lowering the risk of unrelated regressions.</p></li><li><p><strong>Fault isolation</strong> &#8594; A failure in one service degrades part of the product instead of taking everything down.</p></li><li><p><strong>Team autonomy</strong> &#8594; Small teams own services end-to-end, which reduces coordination overhead and increases delivery speed.</p></li><li><p><strong>Technology flexibility</strong> &#8594; Each service can use the language, database, or runtime that fits its workload best.</p></li></ul><p>These advantages come from the same source: strong boundaries.</p><p>The architecture makes it hard for teams to accidentally couple themselves together.</p><h2>Tradeoffs</h2><p>Those same boundaries introduce new costs that don&#8217;t exist in a monolith.</p><ul><li><p><strong>Distributed complexity</strong> &#8594; Network calls replace function calls, bringing latency, retries, and partial failures.</p></li><li><p><strong>Operational overhead</strong> &#8594; CI/CD, observability, and deployment automation become mandatory rather than optional.</p></li><li><p><strong>Testing difficulty</strong> &#8594; End-to-end behavior spans multiple services, making failures harder to reproduce and debug.</p></li><li><p><strong>Data consistency challenges</strong> &#8594; Transactions across services require eventual consistency and compensating actions.</p></li><li><p><strong>Duplication risk</strong> &#8594; Shared logic is harder to centralize, leading to repeated implementations across services.</p></li></ul><p>Microservices don&#8217;t remove complexity. They move it from code structure into system behavior and operations.</p><h2>When microservices make sense</h2><p>Microservices are a solution to specific problems. Use them when those problems are real and persistent.</p><p>They fit best when you need:</p><ul><li><p><strong>Uneven scaling</strong> &#8594; Some features receive far more traffic than others</p></li><li><p><strong>Frequent independent releases</strong> &#8594; Deployment speed matters more than simplicity</p></li><li><p><strong>Clear domain boundaries </strong>&#8594; Business logic splits cleanly into services</p></li><li><p><strong>Large or growing teams</strong> &#8594; Ownership needs to scale with people</p></li><li><p><strong>Strict resilience requirements</strong> &#8594; Partial failure is preferable to total outage</p></li></ul><p>In contrast, small teams, early-stage products, or stable problem spaces often benefit more from a <strong>modular monolith</strong>. You can enforce boundaries without paying the distributed tax upfront.</p><h2>When not to use microservices</h2><p>Microservices fail most often when they are used too early.</p><p>Avoid microservices when:</p><ul><li><p><strong>The product is early and still changing shape</strong> &#8594; Boundaries will shift, and splitting too soon locks in bad decisions.</p></li><li><p><strong>The team is small</strong> &#8594; Coordination costs outweigh deployment benefits.</p></li><li><p><strong>Operational maturity is low</strong> &#8594; Without strong automation and observability, failures become invisible and painful.</p></li><li><p><strong>The problem is simple</strong> &#8594; A modular monolith is easier to build, test, and reason about.</p></li></ul><p>Starting with microservices too early often slows teams down. Sometimes it&#8217;s best to build a well-structured monolith first, then extracting services only when pain points become obvious.</p><h2>Wrapping up</h2><p>Most successful microservice systems started as monoliths.<br>Not because teams were cautious; but because they were deliberate.</p><p>A well-modularized monolith teaches you where the real seams are. Microservices then become a response to proven pressure, not an architectural guess.</p><p>Split when the pain is undeniable and the boundary is obvious.</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[gRPC Clearly Explained]]></title><description><![CDATA[(4 minutes) | What gRPC actually is, and the real reasons teams adopt it beyond &#8220;it&#8217;s faster&#8221;.]]></description><link>https://blog.levelupcoding.com/p/grpc-explained</link><guid isPermaLink="false">https://blog.levelupcoding.com/p/grpc-explained</guid><dc:creator><![CDATA[Nikki Siapno]]></dc:creator><pubDate>Sun, 18 Jan 2026 11:27:12 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/59879d84-3be7-4139-b4fa-d9eca113b49c_1457x1048.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/vector-search-mongodb-atlas-z7nl">From Similarity to Relevance in Vector Search</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_!g3_g!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8985cdd5-d2e6-4954-bef9-51dc2c930063_2064x1174.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!g3_g!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8985cdd5-d2e6-4954-bef9-51dc2c930063_2064x1174.png 424w, https://substackcdn.com/image/fetch/$s_!g3_g!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8985cdd5-d2e6-4954-bef9-51dc2c930063_2064x1174.png 848w, https://substackcdn.com/image/fetch/$s_!g3_g!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8985cdd5-d2e6-4954-bef9-51dc2c930063_2064x1174.png 1272w, https://substackcdn.com/image/fetch/$s_!g3_g!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8985cdd5-d2e6-4954-bef9-51dc2c930063_2064x1174.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!g3_g!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8985cdd5-d2e6-4954-bef9-51dc2c930063_2064x1174.png" width="1456" height="828" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8985cdd5-d2e6-4954-bef9-51dc2c930063_2064x1174.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:828,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:290228,&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/184302722?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8985cdd5-d2e6-4954-bef9-51dc2c930063_2064x1174.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_!g3_g!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8985cdd5-d2e6-4954-bef9-51dc2c930063_2064x1174.png 424w, https://substackcdn.com/image/fetch/$s_!g3_g!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8985cdd5-d2e6-4954-bef9-51dc2c930063_2064x1174.png 848w, https://substackcdn.com/image/fetch/$s_!g3_g!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8985cdd5-d2e6-4954-bef9-51dc2c930063_2064x1174.png 1272w, https://substackcdn.com/image/fetch/$s_!g3_g!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8985cdd5-d2e6-4954-bef9-51dc2c930063_2064x1174.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/vector-search-mongodb-atlas-z7nl">MongoDB Atlas Vector Search</a></strong> now supports lexical prefilters, letting teams apply analyzed text filters (like fuzzy search and phrase matching) or geo constraints before vector similarity runs. The result is higher relevance, lower latency, and more reliable RAG and search at scale.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://lucode.co/vector-search-mongodb-atlas-z7nl&quot;,&quot;text&quot;:&quot;Learn more here&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://lucode.co/vector-search-mongodb-atlas-z7nl"><span>Learn more here</span></a></p><div><hr></div><h1>gRPC: What It Is and Why Teams Use It</h1><p>Most teams reach for REST by habit.</p><p>It works, it&#8217;s everywhere, and every tool knows how to talk HTTP+JSON.</p><p>But once you have dozens of microservices calling each other thousands of times per request, REST can quietly become the bottleneck.</p><p>That&#8217;s where gRPC shows up with a very different model: &#8220;call a function on another service as if it were local,&#8221; and make it fast.</p><div><hr></div><h2>What gRPC (and RPC) really is</h2><p>Before gRPC, there&#8217;s <strong>RPC</strong>.</p><p><strong>Remote Procedure Call (RPC) </strong>is a model where you call a function that runs on another machine, but it feels local to the caller.</p><p>You call a method, pass arguments, and get a result back. The network exists, but it&#8217;s intentionally hidden so developers can think in terms of functions instead of sockets and packets.</p><p>gRPC is a modern, open-source RPC framework released by Google in 2015. It takes the RPC idea and standardizes how services define methods, exchange data, and communicate efficiently over the network.</p><p>Two building blocks drive almost everything you feel in practice:</p><ul><li><p><strong>HTTP/2</strong> &#8594; The transport protocol. It keeps a long-lived connection and supports multiplexed streams.</p></li><li><p><strong>Protocol Buffers (Protobuf)</strong> &#8594; The data format. It&#8217;s a compact binary serialization with a schema (a defined shape).</p></li></ul><p>Together, these turn &#8220;call a service&#8221; into a strongly typed operation instead of a loosely structured document exchange.</p><h2>How gRPC actually works</h2><p>gRPC starts with a <strong>service definition</strong>. You describe your API in a .proto file by defining services (methods) and messages (request and response shapes).</p><p>This file is the contract. Both client and server are built from it.</p><p>From that contract, gRPC generates code:</p><ul><li><p><strong>Client stubs</strong> &#8594; Methods you call like local functions.</p></li><li><p><strong>Server interfaces</strong> &#8594; Methods you implement with your business logic.</p></li></ul><p>When a client calls a gRPC method, the flow is straightforward:</p><ol><li><p><strong>Serialize</strong> &#8594; The request is encoded into Protobuf&#8217;s binary format.</p></li><li><p><strong>Send</strong> &#8594; The message travels over an existing HTTP/2 stream.</p></li><li><p><strong>Dispatch</strong> &#8594; The server routes it to the correct method.</p></li><li><p><strong>Execute</strong> &#8594; Your code runs.</p></li><li><p><strong>Respond</strong> &#8594; The result is serialized and streamed back.</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!sdyy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02371727-2ddd-4fc3-99cb-ad77ebde8313_2000x1539.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sdyy!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02371727-2ddd-4fc3-99cb-ad77ebde8313_2000x1539.png 424w, https://substackcdn.com/image/fetch/$s_!sdyy!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02371727-2ddd-4fc3-99cb-ad77ebde8313_2000x1539.png 848w, https://substackcdn.com/image/fetch/$s_!sdyy!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02371727-2ddd-4fc3-99cb-ad77ebde8313_2000x1539.png 1272w, https://substackcdn.com/image/fetch/$s_!sdyy!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02371727-2ddd-4fc3-99cb-ad77ebde8313_2000x1539.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sdyy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02371727-2ddd-4fc3-99cb-ad77ebde8313_2000x1539.png" width="1456" height="1120" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/02371727-2ddd-4fc3-99cb-ad77ebde8313_2000x1539.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1120,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:645382,&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/184302722?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02371727-2ddd-4fc3-99cb-ad77ebde8313_2000x1539.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_!sdyy!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02371727-2ddd-4fc3-99cb-ad77ebde8313_2000x1539.png 424w, https://substackcdn.com/image/fetch/$s_!sdyy!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02371727-2ddd-4fc3-99cb-ad77ebde8313_2000x1539.png 848w, https://substackcdn.com/image/fetch/$s_!sdyy!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02371727-2ddd-4fc3-99cb-ad77ebde8313_2000x1539.png 1272w, https://substackcdn.com/image/fetch/$s_!sdyy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02371727-2ddd-4fc3-99cb-ad77ebde8313_2000x1539.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 gRPC uses HTTP/2, many calls share one connection and run in parallel. A slow response doesn&#8217;t block faster ones behind it, which keeps tail latency under control.</p><p>Streaming uses the same mechanism:</p><ul><li><p><strong>Server-streaming</strong> &#8594; One request, many responses over time.</p></li><li><p><strong>Client-streaming </strong>&#8594; Many requests, one final response.</p></li><li><p><strong>Bidirectional streaming</strong> &#8594; Both sides send messages independently.</p></li></ul><p>Backpressure is built in. If one side slows down, gRPC slows the stream instead of piling up memory or threads.</p><p>The core idea is simple: define a strict contract, generate code from it, and move typed messages efficiently over a shared connection.</p><h2>Where gRPC pays off</h2><p>gRPC is a strong fit when you control both ends and you care about efficiency.</p><ul><li><p><strong>High call volume microservices</strong> &#8594; Lower per-call overhead adds up fast at scale.</p></li><li><p><strong>Latency-sensitive graphs</strong> &#8594; Multiplexing + smaller payloads reduces tail latency pressure.</p></li><li><p><strong>Polyglot stacks</strong> &#8594; One .proto contract generates stubs across languages, reducing &#8220;JSON drift.&#8221;</p></li><li><p><strong>Service mesh environments</strong> &#8594; gRPC routes cleanly through modern proxies and is common in mesh control-plane protocols.</p></li></ul><h2>Tradeoffs you feel immediately</h2><p>gRPC&#8217;s downsides are predictable, and they usually show up early on.</p><ul><li><p><strong>Browser calls are not native</strong> &#8594; You often need gRPC-Web or a REST/JSON gateway for front-end use.</p></li><li><p><strong>Debugging is less &#8220;curl-friendly&#8221;</strong> &#8594; Binary payloads require tooling like grpcurl or GUI clients with schema access.</p></li><li><p><strong>Contracts tighten coupling</strong> &#8594; Clients must update generated code as schemas evolve, so versioning discipline matters.</p></li><li><p><strong>Infra must support HTTP/2 well</strong> &#8594; Some proxies and firewalls need explicit support or configuration.</p></li></ul><h2>How to Decide: Is gRPC a Fit for Your System?</h2><p>Use gRPC when most of the following are true:</p><ul><li><p><strong>You control both client and server</strong> &#8594; Internal microservices inside the same organization.</p></li><li><p><strong>You&#8217;re performance-sensitive </strong>&#8594; Many small calls per request, or very high QPS between services.</p></li><li><p><strong>You&#8217;re polyglot </strong>&#8594; Multiple languages across teams and services.</p></li><li><p><strong>You need streaming </strong>&#8594; Real-time updates, telemetry, chat, or continuous feeds.</p></li><li><p><strong>You want strict contracts </strong>&#8594; You care about compile-time guarantees and explicit schemas.</p></li></ul><p>Stick to REST (or layer a REST gateway in front of gRPC) when:</p><ul><li><p>You expose public APIs to unknown clients.</p></li><li><p>You want easy browser and curl-based experimentation.</p></li></ul><p>Your main pain is <em>clarity</em> and <em>discoverability</em>, not raw latency or throughput.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!4yvl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9dcfde6-49f3-4de5-b474-854453022e30_2000x1159.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4yvl!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9dcfde6-49f3-4de5-b474-854453022e30_2000x1159.png 424w, https://substackcdn.com/image/fetch/$s_!4yvl!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9dcfde6-49f3-4de5-b474-854453022e30_2000x1159.png 848w, https://substackcdn.com/image/fetch/$s_!4yvl!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9dcfde6-49f3-4de5-b474-854453022e30_2000x1159.png 1272w, https://substackcdn.com/image/fetch/$s_!4yvl!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9dcfde6-49f3-4de5-b474-854453022e30_2000x1159.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4yvl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9dcfde6-49f3-4de5-b474-854453022e30_2000x1159.png" width="1456" height="844" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b9dcfde6-49f3-4de5-b474-854453022e30_2000x1159.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:844,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:442245,&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/184302722?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9dcfde6-49f3-4de5-b474-854453022e30_2000x1159.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_!4yvl!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9dcfde6-49f3-4de5-b474-854453022e30_2000x1159.png 424w, https://substackcdn.com/image/fetch/$s_!4yvl!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9dcfde6-49f3-4de5-b474-854453022e30_2000x1159.png 848w, https://substackcdn.com/image/fetch/$s_!4yvl!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9dcfde6-49f3-4de5-b474-854453022e30_2000x1159.png 1272w, https://substackcdn.com/image/fetch/$s_!4yvl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9dcfde6-49f3-4de5-b474-854453022e30_2000x1159.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>In practice, most teams don&#8217;t choose one or the other; they split the responsibility.</p><ul><li><p><strong>gRPC inside your network</strong> &#8594; Service-to-service, behind an API gateway or service mesh.</p></li><li><p><strong>REST/JSON at the edge</strong> &#8594; For browsers, partners, and mobile apps that prefer HTTP+JSON.</p></li></ul><h2>Recap</h2><p>gRPC is not &#8220;REST but faster.&#8221;</p><p>It&#8217;s a different model: remote procedure calls over HTTP/2, using Protobuf contracts, with first-class support for streaming and strong typing.</p><p>That makes it <em>excellent</em> for internal microservices, high-performance backends, and real-time systems; <em>as long as</em> you&#8217;re willing to invest in schemas, tooling, and a slightly steeper learning curve.</p><p>If you&#8217;re hitting the limits of REST inside your system (too many chatty JSON calls, tricky real-time updates, or a messy polyglot codebase) gRPC is worth a serious look.</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, visual, and simple-to-understand system design articles 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[API Gateway vs Load Balancer vs Reverse Proxy]]></title><description><![CDATA[(5 minutes) | Same edge, different responsibilities, and how the wrong choice quietly creates failure modes.]]></description><link>https://blog.levelupcoding.com/p/api-gateway-vs-load-balancer-vs-reverse-proxy</link><guid isPermaLink="false">https://blog.levelupcoding.com/p/api-gateway-vs-load-balancer-vs-reverse-proxy</guid><dc:creator><![CDATA[Nikki Siapno]]></dc:creator><pubDate>Wed, 14 Jan 2026 14:36:33 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/0138972e-3b53-4116-b19c-984fbf6999e9_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><strong><a href="https://lucode.co/rovo-dev-refactoring-z7nl">Refactor with Context, Not Guesswork</a></strong></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;: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/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="" 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;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://lucode.co/rovo-dev-refactoring-z7nl"><span>Read the article</span></a></p><div><hr></div><h1>API Gateway vs Load Balancer vs Reverse Proxy</h1><p>API gateways, load balancers, and reverse proxies are often grouped together as the same kind of component.</p><p>They all sit at the edge, forward requests, and are introduced when systems need to scale.</p><p>That surface-level similarity hides an important truth: each one exists to solve a <em>different</em> problem, and using the wrong component quietly creates new failure modes. Many production issues start here; not with bugs, but with blurred responsibilities at the edge.</p><p>Knowing how to categorize each component is what keeps your edge simple instead of fragile.</p><h2>The One Decision Each Component Makes</h2><p>If you remember nothing else, remember the verb each one optimizes for:</p><ul><li><p><strong>Load balancer</strong> &#8594; <strong>distribute</strong> traffic across <em>identical</em> copies of the same service.</p></li><li><p><strong>Reverse proxy</strong> &#8594; <strong>forward + optimize</strong> traffic to <em>one or more</em> backends, often with caching, TLS termination, and routing rules.</p></li><li><p><strong>API gateway</strong> &#8594; <strong>govern</strong> API traffic across <em>many</em> services: auth, rate limits, routing, transformations, and sometimes aggregation.</p></li></ul><p>In practice, it&#8217;s like standing at a building entrance:</p><ul><li><p>A <strong>load balancer</strong> points you to the least busy elevator (same destination, different car).</p></li><li><p>A <strong>reverse proxy</strong> sends you to the right department and might hand you a cached brochure instead of interrupting staff.</p></li><li><p>An <strong>API gateway</strong> does that <em>and</em> checks your badge, enforces rules, and sometimes translates what you asked for into what the building understands.</p></li></ul><h2>What Each One is Good at (and Why)</h2><h3>API Gateway: &#8220;One door&#8221; for many APIs</h3><p>An <strong>API gateway</strong> is a <strong>single entry point for clients</strong> that need to call multiple backend services. It commonly acts like a reverse proxy <em>plus</em> API management features.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!5Xz5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6aa6ab57-31e6-455c-9bee-31a4b71fe808_2000x1462.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!5Xz5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6aa6ab57-31e6-455c-9bee-31a4b71fe808_2000x1462.png 424w, https://substackcdn.com/image/fetch/$s_!5Xz5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6aa6ab57-31e6-455c-9bee-31a4b71fe808_2000x1462.png 848w, https://substackcdn.com/image/fetch/$s_!5Xz5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6aa6ab57-31e6-455c-9bee-31a4b71fe808_2000x1462.png 1272w, https://substackcdn.com/image/fetch/$s_!5Xz5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6aa6ab57-31e6-455c-9bee-31a4b71fe808_2000x1462.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!5Xz5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6aa6ab57-31e6-455c-9bee-31a4b71fe808_2000x1462.png" width="1456" height="1064" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6aa6ab57-31e6-455c-9bee-31a4b71fe808_2000x1462.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1064,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:764659,&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/183656416?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6aa6ab57-31e6-455c-9bee-31a4b71fe808_2000x1462.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_!5Xz5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6aa6ab57-31e6-455c-9bee-31a4b71fe808_2000x1462.png 424w, https://substackcdn.com/image/fetch/$s_!5Xz5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6aa6ab57-31e6-455c-9bee-31a4b71fe808_2000x1462.png 848w, https://substackcdn.com/image/fetch/$s_!5Xz5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6aa6ab57-31e6-455c-9bee-31a4b71fe808_2000x1462.png 1272w, https://substackcdn.com/image/fetch/$s_!5Xz5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6aa6ab57-31e6-455c-9bee-31a4b71fe808_2000x1462.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>Typical jobs it handles well:</p><ul><li><p><strong>Authentication + authorization</strong> &#8594; Enforce consistent access rules once, not in every service.</p></li><li><p><strong>Rate limiting + quotas </strong>&#8594; Stop one client from bringing down your fleet.</p></li><li><p><strong>Request/response transformation</strong> &#8594; Convert formats, add/remove headers, normalize shapes.</p></li><li><p><strong>API composition</strong> &#8594; Fan out to multiple services and aggregate a single response.</p></li><li><p><strong>Protocol translation</strong> &#8594; Bridge HTTP/JSON clients to gRPC (or other) services.</p></li></ul><p>Tradeoffs to plan for:</p><ul><li><p><strong>Added hop + processing</strong> &#8594; Auth checks and transforms add latency (often small, but real).</p></li><li><p><strong>Operational criticality</strong> &#8594; If it fails, clients can lose their only entry point unless you build redundancy.</p></li><li><p><strong>Config complexity</strong> &#8594; Lots of power means lots of ways to misconfigure routing/policies.</p></li></ul><h3>Load Balancer: &#8220;Spread work so nothing overloads&#8221;</h3><p>A <strong>load balancer</strong> distributes incoming traffic across multiple servers so no single instance becomes the bottleneck. It usually performs <strong>health checks</strong> and avoids unhealthy instances, which is how it improves uptime.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!q_PI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc10a1a50-f4ee-4823-b2fe-f1cc1e87bbf8_2000x1434.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!q_PI!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc10a1a50-f4ee-4823-b2fe-f1cc1e87bbf8_2000x1434.png 424w, https://substackcdn.com/image/fetch/$s_!q_PI!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc10a1a50-f4ee-4823-b2fe-f1cc1e87bbf8_2000x1434.png 848w, https://substackcdn.com/image/fetch/$s_!q_PI!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc10a1a50-f4ee-4823-b2fe-f1cc1e87bbf8_2000x1434.png 1272w, https://substackcdn.com/image/fetch/$s_!q_PI!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc10a1a50-f4ee-4823-b2fe-f1cc1e87bbf8_2000x1434.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!q_PI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc10a1a50-f4ee-4823-b2fe-f1cc1e87bbf8_2000x1434.png" width="1456" height="1044" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c10a1a50-f4ee-4823-b2fe-f1cc1e87bbf8_2000x1434.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1044,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:496123,&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/183656416?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc10a1a50-f4ee-4823-b2fe-f1cc1e87bbf8_2000x1434.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_!q_PI!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc10a1a50-f4ee-4823-b2fe-f1cc1e87bbf8_2000x1434.png 424w, https://substackcdn.com/image/fetch/$s_!q_PI!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc10a1a50-f4ee-4823-b2fe-f1cc1e87bbf8_2000x1434.png 848w, https://substackcdn.com/image/fetch/$s_!q_PI!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc10a1a50-f4ee-4823-b2fe-f1cc1e87bbf8_2000x1434.png 1272w, https://substackcdn.com/image/fetch/$s_!q_PI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc10a1a50-f4ee-4823-b2fe-f1cc1e87bbf8_2000x1434.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>There are two important categories:</p><ul><li><p><strong>Layer 4 (L4)</strong> &#8594; Routes using IP/port; fast and protocol-agnostic, but content-blind.</p></li><li><p><strong>Layer 7 (L7)</strong> &#8594; Understands HTTP and can route by path/headers/cookies.</p></li></ul><p>What it&#8217;s great at:</p><ul><li><p><strong>High availability</strong> &#8594; Prevents traffic from being sent to unhealthy nodes.</p></li><li><p><strong>Horizontal scaling</strong> &#8594; Add/remove instances and keep one stable client-facing endpoint.</p></li><li><p><strong>Basic edge duties</strong> &#8594; TLS termination, sticky sessions (when you&#8217;re stuck with state).</p></li></ul><p>Common gotchas:</p><ul><li><p><strong>&#8220;One LB instance&#8221; thinking</strong> &#8594; A load balancer can also be a single point of failure unless made redundant.</p></li><li><p><strong>Expecting API policy features</strong> &#8594; It&#8217;s not designed for per-endpoint auth, transforms, or analytics.</p></li></ul><h3>Reverse Proxy: &#8220;Front the servers, hide them, and speed things up&#8221;</h3><p>A <strong>reverse proxy</strong> sits in front of backend servers, forwards requests on their behalf, and makes the backend topology invisible to clients. It typically operates at the application layer (L7) and can make routing decisions based on request content.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!kPiJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabd19752-0d54-4435-99c7-6c519dcd46b3_2000x1327.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!kPiJ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabd19752-0d54-4435-99c7-6c519dcd46b3_2000x1327.png 424w, https://substackcdn.com/image/fetch/$s_!kPiJ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabd19752-0d54-4435-99c7-6c519dcd46b3_2000x1327.png 848w, https://substackcdn.com/image/fetch/$s_!kPiJ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabd19752-0d54-4435-99c7-6c519dcd46b3_2000x1327.png 1272w, https://substackcdn.com/image/fetch/$s_!kPiJ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabd19752-0d54-4435-99c7-6c519dcd46b3_2000x1327.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!kPiJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabd19752-0d54-4435-99c7-6c519dcd46b3_2000x1327.png" width="1456" height="966" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/abd19752-0d54-4435-99c7-6c519dcd46b3_2000x1327.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:966,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:523908,&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/183656416?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabd19752-0d54-4435-99c7-6c519dcd46b3_2000x1327.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_!kPiJ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabd19752-0d54-4435-99c7-6c519dcd46b3_2000x1327.png 424w, https://substackcdn.com/image/fetch/$s_!kPiJ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabd19752-0d54-4435-99c7-6c519dcd46b3_2000x1327.png 848w, https://substackcdn.com/image/fetch/$s_!kPiJ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabd19752-0d54-4435-99c7-6c519dcd46b3_2000x1327.png 1272w, https://substackcdn.com/image/fetch/$s_!kPiJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabd19752-0d54-4435-99c7-6c519dcd46b3_2000x1327.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>Where they add the most value:</p><ul><li><p><strong>TLS termination</strong> &#8594; Handle certificates centrally so app servers don&#8217;t have to do the encryption work.</p></li><li><p><strong>Caching + compression</strong> &#8594; Serve common responses fast, reduce backend load and bandwidth.</p></li><li><p><strong>Security shielding</strong> &#8594; Hide backend IPs and filter obvious bad traffic before it lands.</p></li><li><p><strong>Routing + rewriting</strong> &#8594; Map clean external paths to messy internal routes.</p></li><li><p><strong>&#8220;Good enough&#8221; load balancing</strong> &#8594; Many can round-robin across a small pool of backends.</p></li></ul><p>Its limits are mostly scope:</p><ul><li><p><strong>It&#8217;s not full API management </strong>&#8594; You won&#8217;t get rich per-consumer quotas, developer portal concepts, or deep API analytics by default.</p></li><li><p><strong>It&#8217;s still a choke point </strong>&#8594; Needs redundancy and careful config like anything in the hot path.</p></li></ul><h2>Quick Comparison: Same Edge, Different Responsibilities</h2><p>When these components get confused, it&#8217;s usually because they&#8217;re compared by <em>features</em>. A clearer comparison looks at <strong>what responsibility each one owns</strong>. The table below strips things back to first principles so you can see where overlap is intentional; and where it&#8217;s a smell.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Ngoz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F284bb5f6-a48f-4f1b-b284-970212b1808a_2000x1248.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Ngoz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F284bb5f6-a48f-4f1b-b284-970212b1808a_2000x1248.png 424w, https://substackcdn.com/image/fetch/$s_!Ngoz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F284bb5f6-a48f-4f1b-b284-970212b1808a_2000x1248.png 848w, https://substackcdn.com/image/fetch/$s_!Ngoz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F284bb5f6-a48f-4f1b-b284-970212b1808a_2000x1248.png 1272w, https://substackcdn.com/image/fetch/$s_!Ngoz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F284bb5f6-a48f-4f1b-b284-970212b1808a_2000x1248.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Ngoz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F284bb5f6-a48f-4f1b-b284-970212b1808a_2000x1248.png" width="1456" height="909" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/284bb5f6-a48f-4f1b-b284-970212b1808a_2000x1248.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:909,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:555726,&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/183656416?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F284bb5f6-a48f-4f1b-b284-970212b1808a_2000x1248.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_!Ngoz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F284bb5f6-a48f-4f1b-b284-970212b1808a_2000x1248.png 424w, https://substackcdn.com/image/fetch/$s_!Ngoz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F284bb5f6-a48f-4f1b-b284-970212b1808a_2000x1248.png 848w, https://substackcdn.com/image/fetch/$s_!Ngoz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F284bb5f6-a48f-4f1b-b284-970212b1808a_2000x1248.png 1272w, https://substackcdn.com/image/fetch/$s_!Ngoz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F284bb5f6-a48f-4f1b-b284-970212b1808a_2000x1248.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>Seen this way, the overlap makes sense.</p><p>All three sit at the edge, but each one draws the boundary in a different place.</p><h2>Choosing the Right Tool (and Avoiding the Wrong One)</h2><p>Most edge mistakes come from reaching for a tool because it&#8217;s <em>available</em>, not because it matches the problem.</p><p>These components overlap in capability, but they should not overlap in responsibility.</p><p>Start by being clear about your context and requirements:</p><ul><li><p>Many replicas of the same service &#8594; <strong>use a load balancer</strong>, because the core problem is distributing work safely and evenly.</p></li><li><p>One domain with multiple backends and performance concerns &#8594; <strong>use a reverse proxy</strong>, because it can route, cache, and protect without API-level policy overhead.</p></li><li><p>Many services behind a single public API &#8594; <strong>use an API gateway</strong>, because clients need consistent rules, simplified access, and sometimes response aggregation.</p></li></ul><p>These tools are not mutually exclusive.</p><p>Larger systems often layer them deliberately: a gateway for API policy, a load balancer for instance-level distribution, and reverse proxies where caching or TLS termination reduce pressure downstream.</p><p>The key is intent.</p><p>Each component should earn its place by owning a single, clear responsibility. If it can&#8217;t explain <em>why</em> it&#8217;s there, it&#8217;s probably doing too much; or shouldn&#8217;t be there at all.</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, visual, and simple-to-understand system design articles 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[Load Balancing Algorithms Clearly Explained (In Under 8 Minutes)]]></title><description><![CDATA[How Different Algorithms Actually Behave in Production, and How to Choose the Right One]]></description><link>https://blog.levelupcoding.com/p/load-balancing-algorithms-explained</link><guid isPermaLink="false">https://blog.levelupcoding.com/p/load-balancing-algorithms-explained</guid><dc:creator><![CDATA[Nikki Siapno]]></dc:creator><pubDate>Sat, 10 Jan 2026 10:45:54 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/41937a59-5057-462a-9625-fce1d4894344_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/agentcore-z7nl">Accelerate Agents to Production With Amazon Bedrock AgentCore</a></h2><h5>Presented by AWS</h5><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Lyu6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feaba9df8-c8c8-40a0-8c3d-44afb0b1ae10_2500x1406.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Lyu6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feaba9df8-c8c8-40a0-8c3d-44afb0b1ae10_2500x1406.png 424w, https://substackcdn.com/image/fetch/$s_!Lyu6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feaba9df8-c8c8-40a0-8c3d-44afb0b1ae10_2500x1406.png 848w, https://substackcdn.com/image/fetch/$s_!Lyu6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feaba9df8-c8c8-40a0-8c3d-44afb0b1ae10_2500x1406.png 1272w, https://substackcdn.com/image/fetch/$s_!Lyu6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feaba9df8-c8c8-40a0-8c3d-44afb0b1ae10_2500x1406.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Lyu6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feaba9df8-c8c8-40a0-8c3d-44afb0b1ae10_2500x1406.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/eaba9df8-c8c8-40a0-8c3d-44afb0b1ae10_2500x1406.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;:224768,&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/181240428?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feaba9df8-c8c8-40a0-8c3d-44afb0b1ae10_2500x1406.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_!Lyu6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feaba9df8-c8c8-40a0-8c3d-44afb0b1ae10_2500x1406.png 424w, https://substackcdn.com/image/fetch/$s_!Lyu6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feaba9df8-c8c8-40a0-8c3d-44afb0b1ae10_2500x1406.png 848w, https://substackcdn.com/image/fetch/$s_!Lyu6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feaba9df8-c8c8-40a0-8c3d-44afb0b1ae10_2500x1406.png 1272w, https://substackcdn.com/image/fetch/$s_!Lyu6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feaba9df8-c8c8-40a0-8c3d-44afb0b1ae10_2500x1406.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>Accelerate agents to production with composable services that work with any framework, any model. <strong><a href="https://lucode.co/agentcore-z7nl">AgentCore</a></strong> is an agentic platform for building and running production-grade AI agents, securely at scale, with no infrastructure to manage. Now with complete control over agent actions through policies, and continuous evaluations of real-world agent behavior to boost quality.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://lucode.co/agentcore-z7nl&quot;,&quot;text&quot;:&quot;Check it out&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/agentcore-z7nl"><span>Check it out</span></a></p><div><hr></div><h1>Load Balancing Algorithms Clearly Explained</h1><p>Load balancing is not about spreading traffic evenly. It&#8217;s about spreading <em>work</em> safely.</p><p>Those only mean the same thing when requests cost about the same and servers behave about the same; which is almost never true in production.</p><p>Once you add long-lived connections, uneven instance sizes, caches, or sticky sessions, an &#8220;even&#8221; distribution can still overload a single backend.</p><p>The algorithm you choose quietly decides whether your system stays smooth or starts to buckle.</p><h2>What a Load Balancer Actually Optimizes</h2><p>Every algorithm answers one question: &#8220;Which backend is best <em>according to this metric</em>?&#8221;</p><p>But the signal it picks isn&#8217;t always the one you assume.</p><p>Algorithms typically optimize for things like:</p><ul><li><p><strong>Request count</strong> &#8594; &#8220;Spread requests evenly across all servers&#8221;</p></li><li><p><strong>Concurrency</strong> &#8594; &#8220;Send new requests to the server handling the least work right now&#8221;</p></li><li><p><strong>Latency</strong> &#8594; &#8220;Choose the server that&#8217;s responding the fastest&#8221;</p></li><li><p><strong>Locality</strong> &#8594; &#8220;Keep a user on the same server for state or cache reasons&#8221;</p></li><li><p><strong>Stability</strong> &#8594; &#8220;Reduce how much traffic moves around when servers scale up or down&#8221;</p></li></ul><p>This is where misunderstandings start. &#8220;Even traffic&#8221; doesn&#8217;t mean &#8220;even load&#8221;.</p><h2>Static vs Dynamic Algorithms</h2><p>Most algorithms fall into two buckets:</p><ul><li><p><strong>Static algorithms</strong> &#8594; Use a fixed pattern (like rotation or weights) and ignore live load.</p></li><li><p><strong>Dynamic algorithms</strong> &#8594; Adapt based on runtime signals (like active connections or response time).</p></li></ul><h3>Round robin (static)</h3><p>Round robin walks the server list in order, handing out requests one by one.</p><p>It&#8217;s &#8220;fair by count&#8221; when servers are similar and requests cost about the same.</p><p>When that assumption breaks, it still deals the cards evenly; even if one player keeps getting all the high cards.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!mXow!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F807d924d-481d-4461-88d4-88a4db584dbd_2000x1303.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!mXow!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F807d924d-481d-4461-88d4-88a4db584dbd_2000x1303.png 424w, https://substackcdn.com/image/fetch/$s_!mXow!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F807d924d-481d-4461-88d4-88a4db584dbd_2000x1303.png 848w, https://substackcdn.com/image/fetch/$s_!mXow!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F807d924d-481d-4461-88d4-88a4db584dbd_2000x1303.png 1272w, https://substackcdn.com/image/fetch/$s_!mXow!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F807d924d-481d-4461-88d4-88a4db584dbd_2000x1303.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!mXow!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F807d924d-481d-4461-88d4-88a4db584dbd_2000x1303.png" width="1456" height="949" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/807d924d-481d-4461-88d4-88a4db584dbd_2000x1303.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:949,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:496913,&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/184107049?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F807d924d-481d-4461-88d4-88a4db584dbd_2000x1303.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_!mXow!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F807d924d-481d-4461-88d4-88a4db584dbd_2000x1303.png 424w, https://substackcdn.com/image/fetch/$s_!mXow!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F807d924d-481d-4461-88d4-88a4db584dbd_2000x1303.png 848w, https://substackcdn.com/image/fetch/$s_!mXow!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F807d924d-481d-4461-88d4-88a4db584dbd_2000x1303.png 1272w, https://substackcdn.com/image/fetch/$s_!mXow!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F807d924d-481d-4461-88d4-88a4db584dbd_2000x1303.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><ul><li><p><strong>Optimizes for</strong> &#8594; Even request count</p></li><li><p><strong>Works when</strong> &#8594; Requests have similar cost and servers are similar</p></li><li><p><strong>Fails when</strong> &#8594; Some requests are much heavier than others</p></li><li><p><strong>Failure signs</strong> &#8594; One server overloads even though distribution looks &#8220;fair&#8221;</p></li></ul><h3>Weighted round robin (static)</h3><p>Weighted round robin keeps the same predictable cycle, but higher-weight servers show up more often (weight = a configured capacity hint).</p><p>This works well for mixed hardware or controlled rollouts (like a 90/10 canary), but it still ignores real-time slowness.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zau7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d40a488-cfa2-4c80-8a88-6ee4f81b64fc_2000x1276.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zau7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d40a488-cfa2-4c80-8a88-6ee4f81b64fc_2000x1276.png 424w, https://substackcdn.com/image/fetch/$s_!zau7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d40a488-cfa2-4c80-8a88-6ee4f81b64fc_2000x1276.png 848w, https://substackcdn.com/image/fetch/$s_!zau7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d40a488-cfa2-4c80-8a88-6ee4f81b64fc_2000x1276.png 1272w, https://substackcdn.com/image/fetch/$s_!zau7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d40a488-cfa2-4c80-8a88-6ee4f81b64fc_2000x1276.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zau7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d40a488-cfa2-4c80-8a88-6ee4f81b64fc_2000x1276.png" width="1456" height="929" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9d40a488-cfa2-4c80-8a88-6ee4f81b64fc_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;:374415,&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/184107049?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d40a488-cfa2-4c80-8a88-6ee4f81b64fc_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_!zau7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d40a488-cfa2-4c80-8a88-6ee4f81b64fc_2000x1276.png 424w, https://substackcdn.com/image/fetch/$s_!zau7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d40a488-cfa2-4c80-8a88-6ee4f81b64fc_2000x1276.png 848w, https://substackcdn.com/image/fetch/$s_!zau7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d40a488-cfa2-4c80-8a88-6ee4f81b64fc_2000x1276.png 1272w, https://substackcdn.com/image/fetch/$s_!zau7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d40a488-cfa2-4c80-8a88-6ee4f81b64fc_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><ul><li><p><strong>Optimizes for</strong> &#8594; Even request count <em>scaled by weights</em></p></li><li><p><strong>Works when</strong> &#8594; Weights reflect real capacity and stay up to date</p></li><li><p><strong>Fails when</strong> &#8594; Capacity changes but weights don&#8217;t</p></li><li><p><strong>Failure signs</strong> &#8594; Overloaded &#8220;high-weight&#8221; nodes or skewed rollout splits</p></li></ul><h3>Least connections (dynamic)</h3><p>Least connections sends new work to the server with the fewest active connections (in-flight requests).</p><p>It shines when sessions vary in length (downloads, WebSockets, streaming), because a server stuck on long sessions stops attracting more.</p><p>It can still misbehave with uneven hardware, because &#8220;5 connections&#8221; can mean &#8220;fine&#8221; on one host and &#8220;dying&#8221; on another.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!6vZq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96b2d372-6d74-4b3d-99d2-3003034a965a_2000x1453.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6vZq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96b2d372-6d74-4b3d-99d2-3003034a965a_2000x1453.png 424w, https://substackcdn.com/image/fetch/$s_!6vZq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96b2d372-6d74-4b3d-99d2-3003034a965a_2000x1453.png 848w, https://substackcdn.com/image/fetch/$s_!6vZq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96b2d372-6d74-4b3d-99d2-3003034a965a_2000x1453.png 1272w, https://substackcdn.com/image/fetch/$s_!6vZq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96b2d372-6d74-4b3d-99d2-3003034a965a_2000x1453.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6vZq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96b2d372-6d74-4b3d-99d2-3003034a965a_2000x1453.png" width="1456" height="1058" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/96b2d372-6d74-4b3d-99d2-3003034a965a_2000x1453.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1058,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:496991,&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/184107049?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96b2d372-6d74-4b3d-99d2-3003034a965a_2000x1453.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_!6vZq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96b2d372-6d74-4b3d-99d2-3003034a965a_2000x1453.png 424w, https://substackcdn.com/image/fetch/$s_!6vZq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96b2d372-6d74-4b3d-99d2-3003034a965a_2000x1453.png 848w, https://substackcdn.com/image/fetch/$s_!6vZq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96b2d372-6d74-4b3d-99d2-3003034a965a_2000x1453.png 1272w, https://substackcdn.com/image/fetch/$s_!6vZq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96b2d372-6d74-4b3d-99d2-3003034a965a_2000x1453.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><ul><li><p><strong>Optimizes for</strong> &#8594; Lowest active concurrency</p></li><li><p><strong>Works when</strong> &#8594; Connection count correlates with work</p></li><li><p><strong>Fails when</strong> &#8594; Long-lived sessions pin concurrency on one backend</p></li><li><p><strong>Failure signs </strong>&#8594; WebSockets/streaming endpoints cause uneven load</p></li></ul><h3>Weighted least connections (dynamic)</h3><p>Weighted least connections scales &#8220;how loaded&#8221; a server looks by its capacity (roughly: connections &#247; weight).</p><p>You keep the benefits of load awareness, while acknowledging that bigger servers should carry more concurrent work.</p><p>It&#8217;s a strong default when you have mixed instance sizes.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QWFc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c8b6d45-6501-4c53-806a-18cb2f85601c_2000x1272.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QWFc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c8b6d45-6501-4c53-806a-18cb2f85601c_2000x1272.png 424w, https://substackcdn.com/image/fetch/$s_!QWFc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c8b6d45-6501-4c53-806a-18cb2f85601c_2000x1272.png 848w, https://substackcdn.com/image/fetch/$s_!QWFc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c8b6d45-6501-4c53-806a-18cb2f85601c_2000x1272.png 1272w, https://substackcdn.com/image/fetch/$s_!QWFc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c8b6d45-6501-4c53-806a-18cb2f85601c_2000x1272.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QWFc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c8b6d45-6501-4c53-806a-18cb2f85601c_2000x1272.png" width="1456" height="926" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3c8b6d45-6501-4c53-806a-18cb2f85601c_2000x1272.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:926,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:365582,&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/184107049?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c8b6d45-6501-4c53-806a-18cb2f85601c_2000x1272.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_!QWFc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c8b6d45-6501-4c53-806a-18cb2f85601c_2000x1272.png 424w, https://substackcdn.com/image/fetch/$s_!QWFc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c8b6d45-6501-4c53-806a-18cb2f85601c_2000x1272.png 848w, https://substackcdn.com/image/fetch/$s_!QWFc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c8b6d45-6501-4c53-806a-18cb2f85601c_2000x1272.png 1272w, https://substackcdn.com/image/fetch/$s_!QWFc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c8b6d45-6501-4c53-806a-18cb2f85601c_2000x1272.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><ul><li><p><strong>Optimizes for</strong> &#8594; Spreading concurrent load proportional to capacity (connections &#247; weight).</p></li><li><p><strong>Works when</strong> &#8594; Weights match real capacity and connections roughly track load</p></li><li><p><strong>Fails when</strong> &#8594; Requests vary wildly, weights are wrong, or the bottleneck isn&#8217;t connections (CPU/DB/latency).</p></li><li><p><strong>Failure signs</strong> &#8594; Hot instances, rising tail latency, and distribution shifts a lot when you tweak weights/scaling.</p></li></ul><h3>Least response time (dynamic)</h3><p><strong>Least response time</strong> favors the backend that has responded fastest recently (often using rolling averages). This can improve user latency and avoid slow-but-&#8220;low connections&#8221; hosts. It can also oscillate: traffic floods the &#8220;fast&#8221; host, it slows, traffic shifts, and you get waves.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zOIN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F023d30f1-e18b-4ecc-b874-85a69f50f734_2000x1441.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zOIN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F023d30f1-e18b-4ecc-b874-85a69f50f734_2000x1441.png 424w, https://substackcdn.com/image/fetch/$s_!zOIN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F023d30f1-e18b-4ecc-b874-85a69f50f734_2000x1441.png 848w, https://substackcdn.com/image/fetch/$s_!zOIN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F023d30f1-e18b-4ecc-b874-85a69f50f734_2000x1441.png 1272w, https://substackcdn.com/image/fetch/$s_!zOIN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F023d30f1-e18b-4ecc-b874-85a69f50f734_2000x1441.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zOIN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F023d30f1-e18b-4ecc-b874-85a69f50f734_2000x1441.png" width="1456" height="1049" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/023d30f1-e18b-4ecc-b874-85a69f50f734_2000x1441.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1049,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:519167,&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/184107049?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F023d30f1-e18b-4ecc-b874-85a69f50f734_2000x1441.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_!zOIN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F023d30f1-e18b-4ecc-b874-85a69f50f734_2000x1441.png 424w, https://substackcdn.com/image/fetch/$s_!zOIN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F023d30f1-e18b-4ecc-b874-85a69f50f734_2000x1441.png 848w, https://substackcdn.com/image/fetch/$s_!zOIN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F023d30f1-e18b-4ecc-b874-85a69f50f734_2000x1441.png 1272w, https://substackcdn.com/image/fetch/$s_!zOIN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F023d30f1-e18b-4ecc-b874-85a69f50f734_2000x1441.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><ul><li><p><strong>Optimizes for</strong> &#8594; Lower observed latency</p></li><li><p><strong>Works when</strong> &#8594; Measurements are stable and you smooth adjustments</p></li><li><p><strong>Fails when</strong> &#8594; Noise causes traffic to swing between servers</p></li><li><p><strong>Failure signs</strong> &#8594; Oscillation: the &#8220;fast&#8221; host becomes slow after being flooded</p></li></ul><h3>Resource-based balancing (dynamic)</h3><p><strong>Resource-based</strong> routing uses CPU/memory/bandwidth signals (usually from agents) to send traffic to the host with the most headroom. It can handle cases where connection counts lie (background jobs, noisy neighbors). It&#8217;s also the most operationally complex: agents, freshness, scoring, and stability are your responsibility.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Rwg9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd06e33e9-a493-4631-841b-6835b1866b92_2000x1342.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Rwg9!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd06e33e9-a493-4631-841b-6835b1866b92_2000x1342.png 424w, https://substackcdn.com/image/fetch/$s_!Rwg9!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd06e33e9-a493-4631-841b-6835b1866b92_2000x1342.png 848w, https://substackcdn.com/image/fetch/$s_!Rwg9!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd06e33e9-a493-4631-841b-6835b1866b92_2000x1342.png 1272w, https://substackcdn.com/image/fetch/$s_!Rwg9!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd06e33e9-a493-4631-841b-6835b1866b92_2000x1342.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Rwg9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd06e33e9-a493-4631-841b-6835b1866b92_2000x1342.png" width="1456" height="977" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d06e33e9-a493-4631-841b-6835b1866b92_2000x1342.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:977,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:475616,&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/184107049?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd06e33e9-a493-4631-841b-6835b1866b92_2000x1342.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_!Rwg9!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd06e33e9-a493-4631-841b-6835b1866b92_2000x1342.png 424w, https://substackcdn.com/image/fetch/$s_!Rwg9!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd06e33e9-a493-4631-841b-6835b1866b92_2000x1342.png 848w, https://substackcdn.com/image/fetch/$s_!Rwg9!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd06e33e9-a493-4631-841b-6835b1866b92_2000x1342.png 1272w, https://substackcdn.com/image/fetch/$s_!Rwg9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd06e33e9-a493-4631-841b-6835b1866b92_2000x1342.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><ul><li><p><strong>Optimizes for:</strong> Keeping instances out of saturation by routing to where there&#8217;s real headroom</p></li><li><p><strong>Works when:</strong> Your signals are accurate and comparable, update fast enough, and you smooth changes</p></li><li><p><strong>Fails when: </strong>Metrics are laggy/noisy, you&#8217;re measuring the wrong bottleneck</p></li><li><p><strong>Failure signs:</strong> Traffic &#8220;flaps&#8221; between hosts, sawtooth utilization, hot spots despite balancing, rising tail latency, and bursts of errors during metric spikes.</p></li></ul><h2>Power-of-Two Choices</h2><p>In big systems you don&#8217;t have one load balancer.</p><p>You have many: ingress pods, proxies, threads.</p><p>That&#8217;s why &#8220;always pick the global least-loaded host&#8221; can backfire: everyone sees the same winner and stampedes it.</p><p>Power of Two Choices (P2C) fixes this by sampling two servers at random and choosing the better one (often fewer in-flight requests). You get most of least-connections&#8217; benefit with way less coordination, and less herd behavior because each balancer sees different pairs.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!fvFV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10b5d654-ddf4-49a5-ad54-e949bc7756a4_2000x1340.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!fvFV!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10b5d654-ddf4-49a5-ad54-e949bc7756a4_2000x1340.png 424w, https://substackcdn.com/image/fetch/$s_!fvFV!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10b5d654-ddf4-49a5-ad54-e949bc7756a4_2000x1340.png 848w, https://substackcdn.com/image/fetch/$s_!fvFV!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10b5d654-ddf4-49a5-ad54-e949bc7756a4_2000x1340.png 1272w, https://substackcdn.com/image/fetch/$s_!fvFV!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10b5d654-ddf4-49a5-ad54-e949bc7756a4_2000x1340.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!fvFV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10b5d654-ddf4-49a5-ad54-e949bc7756a4_2000x1340.png" width="1456" height="976" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/10b5d654-ddf4-49a5-ad54-e949bc7756a4_2000x1340.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:976,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:725661,&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/184107049?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10b5d654-ddf4-49a5-ad54-e949bc7756a4_2000x1340.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_!fvFV!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10b5d654-ddf4-49a5-ad54-e949bc7756a4_2000x1340.png 424w, https://substackcdn.com/image/fetch/$s_!fvFV!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10b5d654-ddf4-49a5-ad54-e949bc7756a4_2000x1340.png 848w, https://substackcdn.com/image/fetch/$s_!fvFV!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10b5d654-ddf4-49a5-ad54-e949bc7756a4_2000x1340.png 1272w, https://substackcdn.com/image/fetch/$s_!fvFV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10b5d654-ddf4-49a5-ad54-e949bc7756a4_2000x1340.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><ul><li><p><strong>Random sampling</strong> &#8594; Low overhead, no full pool scan</p></li><li><p><strong>Local comparison</strong> &#8594; Still favors less-loaded servers</p></li><li><p><strong>Distributed stability</strong> &#8594; Fewer &#8220;everyone picks the same winner&#8221; moments</p></li><li><p><strong>Fails when </strong>&#8594; Load isn&#8217;t reflected by the metric you compare (e.g., CPU/queue/DB is the bottleneck), or the pool is so small that random picks don&#8217;t give you real choice.</p></li><li><p><strong>Failure signs</strong> &#8594; Uneven hot spots, tail latency spikes, and &#8220;random&#8221; oscillation where different instances take turns getting slammed.</p></li></ul><h2>Session Affinity</h2><p>Some services need <strong>session affinity</strong> (also called stickiness): repeated requests from the same &#8220;user&#8221; must land on the same backend because state lives in memory or local cache.</p><h3>Source IP hash (affinity)</h3><p><strong>Source IP hash</strong> picks a backend by hashing the client&#8217;s IP. It&#8217;s simple and stateless, and it works even when you can&#8217;t use cookies. But it can create severe skew if many users share an IP (corporate NAT, mobile carriers) or if one client generates far more traffic than others.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!LYrc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22cf7daa-e6f2-4612-8c10-9ed47d2ea6b2_2001x1143.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!LYrc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22cf7daa-e6f2-4612-8c10-9ed47d2ea6b2_2001x1143.png 424w, https://substackcdn.com/image/fetch/$s_!LYrc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22cf7daa-e6f2-4612-8c10-9ed47d2ea6b2_2001x1143.png 848w, https://substackcdn.com/image/fetch/$s_!LYrc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22cf7daa-e6f2-4612-8c10-9ed47d2ea6b2_2001x1143.png 1272w, https://substackcdn.com/image/fetch/$s_!LYrc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22cf7daa-e6f2-4612-8c10-9ed47d2ea6b2_2001x1143.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!LYrc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22cf7daa-e6f2-4612-8c10-9ed47d2ea6b2_2001x1143.png" width="1456" height="832" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/22cf7daa-e6f2-4612-8c10-9ed47d2ea6b2_2001x1143.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:832,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:425842,&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/184107049?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22cf7daa-e6f2-4612-8c10-9ed47d2ea6b2_2001x1143.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_!LYrc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22cf7daa-e6f2-4612-8c10-9ed47d2ea6b2_2001x1143.png 424w, https://substackcdn.com/image/fetch/$s_!LYrc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22cf7daa-e6f2-4612-8c10-9ed47d2ea6b2_2001x1143.png 848w, https://substackcdn.com/image/fetch/$s_!LYrc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22cf7daa-e6f2-4612-8c10-9ed47d2ea6b2_2001x1143.png 1272w, https://substackcdn.com/image/fetch/$s_!LYrc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22cf7daa-e6f2-4612-8c10-9ed47d2ea6b2_2001x1143.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><ul><li><p><strong>Optimizes for</strong> &#8594; Session affinity without extra state</p></li><li><p><strong>Works when</strong> &#8594; Client IPs are diverse and roughly represent users</p></li><li><p><strong>Fails when</strong> &#8594; Many users share IPs (NAT, carrier networks, proxies)</p></li><li><p><strong>Failure signs</strong> &#8594; One backend becomes a hot spot</p></li></ul><h3><strong>Consistent hashing (affinity with stable scaling)</strong></h3><p>Simple IP-hash can reshuffle lots of clients when servers come and go. Consistent hashing cuts that churn: keys live in a stable hash space, so only a small slice moves when the pool changes (e.g. ring hash/virtual nodes, Maglev tables).</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!6t7G!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a573143-ea54-4ed4-b940-77acc6dc6c1e_2000x1450.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6t7G!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a573143-ea54-4ed4-b940-77acc6dc6c1e_2000x1450.png 424w, https://substackcdn.com/image/fetch/$s_!6t7G!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a573143-ea54-4ed4-b940-77acc6dc6c1e_2000x1450.png 848w, https://substackcdn.com/image/fetch/$s_!6t7G!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a573143-ea54-4ed4-b940-77acc6dc6c1e_2000x1450.png 1272w, https://substackcdn.com/image/fetch/$s_!6t7G!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a573143-ea54-4ed4-b940-77acc6dc6c1e_2000x1450.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6t7G!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a573143-ea54-4ed4-b940-77acc6dc6c1e_2000x1450.png" width="1456" height="1056" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4a573143-ea54-4ed4-b940-77acc6dc6c1e_2000x1450.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1056,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:630028,&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/184107049?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a573143-ea54-4ed4-b940-77acc6dc6c1e_2000x1450.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_!6t7G!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a573143-ea54-4ed4-b940-77acc6dc6c1e_2000x1450.png 424w, https://substackcdn.com/image/fetch/$s_!6t7G!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a573143-ea54-4ed4-b940-77acc6dc6c1e_2000x1450.png 848w, https://substackcdn.com/image/fetch/$s_!6t7G!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a573143-ea54-4ed4-b940-77acc6dc6c1e_2000x1450.png 1272w, https://substackcdn.com/image/fetch/$s_!6t7G!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a573143-ea54-4ed4-b940-77acc6dc6c1e_2000x1450.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>It&#8217;s great for caches and sharded state because locality survives scaling.</p><p>The catch: it won&#8217;t automatically relieve a hot server; hot keys keep landing on the same host unless you step in.</p><ul><li><p><strong>Optimizes for</strong> &#8594; Stable mapping as servers come and go</p></li><li><p><strong>Works when</strong> &#8594; You want cache locality or sharded state with low churn</p></li><li><p><strong>Fails when</strong> &#8594; A few keys dominate traffic</p></li><li><p><strong>Failure signs</strong> &#8594; One shard stays under pressure because one key stays hot forever</p></li></ul><h2>How to Recognize When Your System is Fighting the Balancer</h2><p>Most balancing problems show up as repeating symptoms. Treat them like fingerprints.</p><ul><li><p><strong>One instance is always hotter</strong> &#8594; The algorithm equalizes counts, not work</p></li><li><p><strong>Latency spikes come in waves</strong> &#8594; The routing reacts too quickly to &#8220;fastest&#8221; signals</p></li><li><p><strong>A subset of users is consistently slow</strong> &#8594; Stickiness pins them to a weaker backend</p></li><li><p><strong>Canary looks right in aggregate but bad in practice</strong> &#8594; Weights or affinity skew who lands where</p></li><li><p><strong>Cache hit rate drops after scaling</strong> &#8594; Key-to-server mapping churns more than expected</p></li><li><p><strong>Incidents worsen after retries kick in</strong> &#8594; Retries amplify imbalance because they create extra traffic</p></li></ul><p>These symptoms don&#8217;t prove the algorithm is wrong. They prove its assumptions need checking.</p><h2>How to Pick an Algorithm for Your Context</h2><p>Most teams don&#8217;t &#8220;implement&#8221; load balancing; they pick a config, accept a default, or choose a platform.</p><p>The trick is matching the algorithm to what your workload actually does:</p><ul><li><p><strong>Need affinity?</strong> &#8594; Use consistent hashing or sticky routing. Keeping state local cuts cache misses and avoids constant warm-ups.</p></li><li><p><strong>Requests vary in duration?</strong> &#8594; Use least-connections or P2C. Concurrency tracks contention better than raw request counts.</p></li><li><p><strong>Mixed instance sizes?</strong> &#8594; Add weights or use weighted least-connections. Heterogeneous fleets need proportional distribution.</p></li><li><p><strong>Many balancers in play?</strong> &#8594; Prefer P2C-style strategies. They reduce herd behavior without global coordination.</p></li><li><p><strong>Chasing user-perceived latency?</strong> &#8594; Use latency-aware routing carefully. It can cut tail latency, but it can also oscillate if you react too fast.</p></li></ul><h2>Wrapping Up</h2><p>Load balancing is choosing where work piles up.</p><p>&#8220;Even traffic&#8221; is only safe when requests and servers are boringly uniform (they aren&#8217;t).</p><p>The right algorithm is the one whose signal matches your bottleneck, and whose failure mode you can live with.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!99Ea!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaa21872-d6dc-4598-8598-5fcc5866ae1a_2000x2302.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!99Ea!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaa21872-d6dc-4598-8598-5fcc5866ae1a_2000x2302.png 424w, https://substackcdn.com/image/fetch/$s_!99Ea!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaa21872-d6dc-4598-8598-5fcc5866ae1a_2000x2302.png 848w, https://substackcdn.com/image/fetch/$s_!99Ea!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaa21872-d6dc-4598-8598-5fcc5866ae1a_2000x2302.png 1272w, https://substackcdn.com/image/fetch/$s_!99Ea!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaa21872-d6dc-4598-8598-5fcc5866ae1a_2000x2302.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!99Ea!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaa21872-d6dc-4598-8598-5fcc5866ae1a_2000x2302.png" width="1456" height="1676" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aaa21872-d6dc-4598-8598-5fcc5866ae1a_2000x2302.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1676,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:907067,&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/184107049?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaa21872-d6dc-4598-8598-5fcc5866ae1a_2000x2302.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_!99Ea!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaa21872-d6dc-4598-8598-5fcc5866ae1a_2000x2302.png 424w, https://substackcdn.com/image/fetch/$s_!99Ea!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaa21872-d6dc-4598-8598-5fcc5866ae1a_2000x2302.png 848w, https://substackcdn.com/image/fetch/$s_!99Ea!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaa21872-d6dc-4598-8598-5fcc5866ae1a_2000x2302.png 1272w, https://substackcdn.com/image/fetch/$s_!99Ea!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaa21872-d6dc-4598-8598-5fcc5866ae1a_2000x2302.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><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, visual, and simple-to-understand system design articles 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[What a CI/CD Pipeline Really Looks Like]]></title><description><![CDATA[(5 Minutes) | A practical, end-to-end look at CI/CD pipelines]]></description><link>https://blog.levelupcoding.com/p/cicd-pipeline-explained</link><guid isPermaLink="false">https://blog.levelupcoding.com/p/cicd-pipeline-explained</guid><dc:creator><![CDATA[Nikki Siapno]]></dc:creator><pubDate>Thu, 08 Jan 2026 12:46:00 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/a3fd3345-17ba-488a-b3bf-5f4a45cdd860_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/strands-agents-z7nl">A Model-Driven Approach to Building and Deploying Agents</a></h2><h5>Presented by Amazon</h5><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nPZl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcce7e9d7-87a8-4115-a573-249eca04e977_1280x720.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nPZl!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcce7e9d7-87a8-4115-a573-249eca04e977_1280x720.png 424w, https://substackcdn.com/image/fetch/$s_!nPZl!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcce7e9d7-87a8-4115-a573-249eca04e977_1280x720.png 848w, https://substackcdn.com/image/fetch/$s_!nPZl!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcce7e9d7-87a8-4115-a573-249eca04e977_1280x720.png 1272w, https://substackcdn.com/image/fetch/$s_!nPZl!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcce7e9d7-87a8-4115-a573-249eca04e977_1280x720.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nPZl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcce7e9d7-87a8-4115-a573-249eca04e977_1280x720.png" width="1280" height="720" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cce7e9d7-87a8-4115-a573-249eca04e977_1280x720.png&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;:125591,&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/180800883?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcce7e9d7-87a8-4115-a573-249eca04e977_1280x720.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_!nPZl!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcce7e9d7-87a8-4115-a573-249eca04e977_1280x720.png 424w, https://substackcdn.com/image/fetch/$s_!nPZl!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcce7e9d7-87a8-4115-a573-249eca04e977_1280x720.png 848w, https://substackcdn.com/image/fetch/$s_!nPZl!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcce7e9d7-87a8-4115-a573-249eca04e977_1280x720.png 1272w, https://substackcdn.com/image/fetch/$s_!nPZl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcce7e9d7-87a8-4115-a573-249eca04e977_1280x720.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/strands-agents-z7nl">Strands Agents</a></strong> empowers you to create intelligent agentic systems that leverage reasoning models to make dynamic decisions and adapt to unexpected situations. You can now build agents in TypeScript, run agents on edge devices, steer agents through modular prompting, and verify agent performance with evaluations.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://lucode.co/strands-agents-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/strands-agents-z7nl"><span>Start Building</span></a></p><div><hr></div><h1>What a CI/CD Pipeline Really Looks Like</h1><p>Shipping code shouldn&#8217;t feel like defusing a bomb, yet many teams treat deploys that way.</p><p>Merges slow down, nerves go up, and one bad release can freeze progress for days.</p><p>CI/CD exists to make releases predictable and dull; something you do without thinking, not something you plan your week around.</p><p>When you build a healthy pipeline, &#8220;deploying&#8221; stops being an event and becomes an ordinary part of writing software.</p><h2>Continuous Integration vs Continuous Delivery vs Continuous Deployment</h2><p>Before we dive in, let&#8217;s nail the terminology 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_!YYHX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a144b01-a103-4160-a347-ef3d221ea2c8_1966x883.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!YYHX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a144b01-a103-4160-a347-ef3d221ea2c8_1966x883.png 424w, https://substackcdn.com/image/fetch/$s_!YYHX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a144b01-a103-4160-a347-ef3d221ea2c8_1966x883.png 848w, https://substackcdn.com/image/fetch/$s_!YYHX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a144b01-a103-4160-a347-ef3d221ea2c8_1966x883.png 1272w, https://substackcdn.com/image/fetch/$s_!YYHX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a144b01-a103-4160-a347-ef3d221ea2c8_1966x883.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!YYHX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a144b01-a103-4160-a347-ef3d221ea2c8_1966x883.png" width="1456" height="654" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8a144b01-a103-4160-a347-ef3d221ea2c8_1966x883.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:654,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:568654,&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/182412225?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a144b01-a103-4160-a347-ef3d221ea2c8_1966x883.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_!YYHX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a144b01-a103-4160-a347-ef3d221ea2c8_1966x883.png 424w, https://substackcdn.com/image/fetch/$s_!YYHX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a144b01-a103-4160-a347-ef3d221ea2c8_1966x883.png 848w, https://substackcdn.com/image/fetch/$s_!YYHX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a144b01-a103-4160-a347-ef3d221ea2c8_1966x883.png 1272w, https://substackcdn.com/image/fetch/$s_!YYHX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a144b01-a103-4160-a347-ef3d221ea2c8_1966x883.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>You can think of it as three layers:</p><ul><li><p><strong>Continuous Integration</strong> &#8594; Every commit builds and runs automated tests so the main branch stays healthy.</p></li><li><p><strong>Continuous Delivery</strong> &#8594; Every passing build is automatically packaged and sent to a staging or test environment.</p></li><li><p><strong>Continuous Deployment</strong> &#8594; Every passing build flows into production without a manual button press, relying on strong tests and monitoring.</p></li></ul><p>The pipeline is the same; the only difference is where you keep a human in the loop.</p><h2>How a CI/CD Pipeline Actually Works</h2><p>A typical pipeline is just a scripted checklist the computer runs for you:</p><ol><li><p><strong>Version control trigger<br></strong> A push to the <code>main</code> branch or a pull request hits GitHub/GitLab. That event triggers your CI server.</p></li><li><p><strong>Build and quick tests<br></strong> The pipeline checks out the code and runs your build and fast-feedback test suite:</p><ul><li><p><strong>Unit tests </strong>&#8594; Verify small pieces of logic behave correctly on their own</p></li><li><p><strong>Smoke tests </strong>&#8594; Small, fast set of checks to confirm the system is &#8220;basically working.&#8221;</p></li><li><p><strong>Static analysis </strong>&#8594; Catch code issues early through linting, type checks, and security scans</p></li></ul></li><li><p>If anything fails, the pipeline stops and flags the commit.</p></li><li><p><strong>Artifact and registry<br></strong>A successful build produces an artifact (JAR, Docker image, npm package) and stores it in a registry so the <em>same</em> thing gets deployed everywhere.</p></li><li><p><strong>Staging deployment<br></strong>Delivery kicks in:</p><ul><li><p><strong>Apply infrastructure-as-code</strong> &#8594; Spin up or update a staging environment</p></li><li><p><strong>Run slower tests</strong> &#8594; Integration tests, performance checks, and end-to-end user flows</p></li></ul></li><li><p><strong>Promotion to production</strong></p><ul><li><p><strong>With Continuous Delivery</strong> &#8594; A human reviews changes and clicks &#8220;deploy&#8221;</p></li><li><p><strong>With Continuous Deployment</strong> &#8594; The pipeline auto-deploys when staging is green</p></li></ul></li><li><p><strong>Mature setups add safe rollout patterns</strong></p><ul><li><p><strong>Blue-green</strong> &#8594; Run old and new versions side by side, then flip traffic</p></li><li><p><strong>Canary</strong> &#8594; Send a small percentage of traffic to the new version, watch metrics, then ramp up if healthy</p></li></ul></li><li><p><strong>Monitoring and rollback<br></strong>After deployment, dashboards and alerts watch error rates, latency, and key business metrics. If something looks off, you either:</p><ul><li><p><strong>Roll back</strong> &#8594; Redeploy the previous artifact</p></li><li><p><strong>Roll forward</strong> &#8594; Ship a quick fix through the same pipeline</p></li></ul></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!iGhk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d510824-dc8e-4794-abf1-5d5fdae6f65b_2000x1333.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!iGhk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d510824-dc8e-4794-abf1-5d5fdae6f65b_2000x1333.png 424w, https://substackcdn.com/image/fetch/$s_!iGhk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d510824-dc8e-4794-abf1-5d5fdae6f65b_2000x1333.png 848w, https://substackcdn.com/image/fetch/$s_!iGhk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d510824-dc8e-4794-abf1-5d5fdae6f65b_2000x1333.png 1272w, https://substackcdn.com/image/fetch/$s_!iGhk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d510824-dc8e-4794-abf1-5d5fdae6f65b_2000x1333.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!iGhk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d510824-dc8e-4794-abf1-5d5fdae6f65b_2000x1333.png" width="1456" height="970" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7d510824-dc8e-4794-abf1-5d5fdae6f65b_2000x1333.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:970,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:657362,&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/182412225?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d510824-dc8e-4794-abf1-5d5fdae6f65b_2000x1333.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_!iGhk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d510824-dc8e-4794-abf1-5d5fdae6f65b_2000x1333.png 424w, https://substackcdn.com/image/fetch/$s_!iGhk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d510824-dc8e-4794-abf1-5d5fdae6f65b_2000x1333.png 848w, https://substackcdn.com/image/fetch/$s_!iGhk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d510824-dc8e-4794-abf1-5d5fdae6f65b_2000x1333.png 1272w, https://substackcdn.com/image/fetch/$s_!iGhk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d510824-dc8e-4794-abf1-5d5fdae6f65b_2000x1333.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 result: deployments are just another pipeline run, not a manual ritual.</p><h2>The Benefits of CI/CD</h2><p>CI/CD is not just &#8220;faster releases.&#8221; It changes how your team works.</p><ul><li><p><strong>Faster feedback</strong> &#8594; Within minutes, you see if a change broke something which makes fixes cheaper and less stressful.</p></li><li><p><strong>Fewer production surprises</strong> &#8594; Every change passes the same set of tests and staging checks before it reaches users.</p></li><li><p><strong>Safer, smaller changes</strong> &#8594; You ship small increments instead of huge batches, so debugging is easier when something goes wrong.</p></li><li><p><strong>Less manual glue work</strong> &#8594; No more copying artifacts around, clicking through release runbooks, or guessing which commit is in prod.</p></li><li><p><strong>More confidence to refactor </strong>&#8594; A strong pipeline acts as a safety net, so you can clean things up instead of living with code rot.</p></li></ul><p>Over time, teams that lean into CI/CD deploy more often, recover from incidents faster, and spend more time writing features instead of wrestling with release mechanics.</p><h2>The Hidden Costs and Trade-Offs</h2><p>You <em>do</em> pay for this automation. The costs are real, just usually front-loaded.</p><ul><li><p><strong>Pipeline setup overhead</strong> &#8594; You need to wire together CI tools, artifact storage, deployment scripts, and infrastructure-as-code because the pipeline itself becomes critical infrastructure.</p></li><li><p><strong>Testing discipline</strong> &#8594; CI/CD is only as good as your tests. Flaky or shallow tests give you a false sense of safety and quickly erode trust in the pipeline.</p></li><li><p><strong>Cultural change </strong>&#8594; Dev, QA, and Ops must share ownership of quality and deployment because CI/CD breaks old &#8220;throw it over the wall&#8221; habits.</p></li><li><p><strong>Toolchain complexity</strong> &#8594; Different teams with different tools can accrete a mess of half-integrated pipelines that are hard to reason about.</p></li></ul><h3>When not to go all-in</h3><p>There are cases where a full, multi-stage, fully automated pipeline is overkill:</p><ul><li><p><strong>Tiny prototype </strong>&#8594; You&#8217;re validating an idea with one developer and rare deployments.</p></li><li><p><strong>Extremely stable legacy system</strong> &#8594; It ships once a year and barely changes.</p></li><li><p><strong>Heavy external certifications</strong> &#8594; For example, embedded medical devices where each release needs formal sign-off.</p></li></ul><p>In those situations, basic CI (build + unit tests on every commit) is still worth it because it keeps even rare releases safer, but you can delay the fancy rollout machinery.</p><h2>How to Adopt CI/CD Without Burning Out the Team</h2><p>You do not need to jump straight to &#8220;deploy to prod on every commit.&#8221; A sane path looks like this:</p><ul><li><p><strong>Start with CI</strong> &#8594; Automate build + unit tests on each push because this gives immediate value and surfaces integration issues early.</p></li><li><p><strong>Add staging delivery</strong> &#8594; Automatically deploy the CI-built artifacts to a staging environment because this ensures every release candidate is tested the same way.</p></li><li><p><strong>Gradually automate production </strong>&#8594; Introduce blue-green, canary, and manual approvals inside the pipeline before flipping to full continuous deployment.</p></li></ul><p>The key mindset is to treat the pipeline as a product.</p><p>You invest in it, maintain it, and keep it fast and reliable because it becomes the backbone of how your team ships.</p><p>If &#8220;release day&#8221; still feels scary, that&#8217;s a signal your CI/CD story isn&#8217;t finished yet.</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, visual, and simple-to-understand system design articles 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>