<?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[The Coder Cafe: Concepts]]></title><description><![CDATA[Learn one concept with your coffee.]]></description><link>https://read.thecoder.cafe/s/concepts</link><image><url>https://substackcdn.com/image/fetch/$s_!OZXv!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa08792c7-cadb-478c-bce4-a10c5dc5ac05_1280x1280.png</url><title>The Coder Cafe: Concepts</title><link>https://read.thecoder.cafe/s/concepts</link></image><generator>Substack</generator><lastBuildDate>Mon, 01 Jun 2026 19:44:11 GMT</lastBuildDate><atom:link href="https://read.thecoder.cafe/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Teiva Harsanyi]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[thecodercafe@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[thecodercafe@substack.com]]></itunes:email><itunes:name><![CDATA[Teiva Harsanyi]]></itunes:name></itunes:owner><itunes:author><![CDATA[Teiva Harsanyi]]></itunes:author><googleplay:owner><![CDATA[thecodercafe@substack.com]]></googleplay:owner><googleplay:email><![CDATA[thecodercafe@substack.com]]></googleplay:email><googleplay:author><![CDATA[Teiva Harsanyi]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Metastable Failures in Distributed Systems]]></title><description><![CDATA[The system is technically up, effectively down.]]></description><link>https://read.thecoder.cafe/p/metastable-failures</link><guid isPermaLink="false">https://read.thecoder.cafe/p/metastable-failures</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Wed, 27 May 2026 13:02:50 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Su99!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe51a6988-d738-4c8c-a46e-576643bdf520_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>&#9749; <em>Welcome to The Coder Cafe! Today, we explore one of the nastiest failure patterns in distributed systems: metastable failures. Based on the <a href="https://sigops.org/s/conferences/hotos/2021/papers/hotos21-s11-bronson.pdf">Metastable Failures in Distributed Systems</a> whitepaper, we break down why these failures happen, why they persist, what we can do about them, and why our instinct to fix them is probably wrong. Get cozy, grab a coffee, and let&#8217;s begin!</em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Su99!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe51a6988-d738-4c8c-a46e-576643bdf520_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Su99!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe51a6988-d738-4c8c-a46e-576643bdf520_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!Su99!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe51a6988-d738-4c8c-a46e-576643bdf520_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!Su99!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe51a6988-d738-4c8c-a46e-576643bdf520_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!Su99!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe51a6988-d738-4c8c-a46e-576643bdf520_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Su99!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe51a6988-d738-4c8c-a46e-576643bdf520_1600x800.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e51a6988-d738-4c8c-a46e-576643bdf520_1600x800.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;:1646402,&quot;alt&quot;:&quot;The system is technically up, effectively down.&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://read.thecoder.cafe/i/194114637?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe51a6988-d738-4c8c-a46e-576643bdf520_1600x800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The system is technically up, effectively down." title="The system is technically up, effectively down." srcset="https://substackcdn.com/image/fetch/$s_!Su99!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe51a6988-d738-4c8c-a46e-576643bdf520_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!Su99!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe51a6988-d738-4c8c-a46e-576643bdf520_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!Su99!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe51a6988-d738-4c8c-a46e-576643bdf520_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!Su99!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe51a6988-d738-4c8c-a46e-576643bdf520_1600x800.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg 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><h1>Stable, Vulnerable, Metastable</h1><p>Metastable failures borrow their name from physics, where <strong>metastable means something that looks stable but isn&#8217;t</strong>. To understand how a distributed system can end up in such a state, we need to look at three distinct states it can be in:</p><ul><li><p><strong>Stable:</strong> The system recovers on its own after any disruption. This is what we call resilience in <em><a href="https://read.thecoder.cafe/p/resilient-fault-tolerant-robust-reliable">Resilient, Fault-tolerant, Robust, or Reliable</a></em>.</p></li><li><p><strong>Vulnerable</strong>: The system looks perfectly healthy, but it's operating above its <strong>hidden capacity</strong>: the load level below which it can self-heal from any disruption. It responds fast, metrics are green, and nothing is alarming. Many production systems deliberately operate here because it's more efficient: resources are used closer to their limit. But there's <strong>no slack left</strong>. And the deeper the system operates in a vulnerable state, the smaller the trigger needed to push it over the edge. Indeed, a system just above its hidden capacity can survive large disruptions; a system near its advertised capacity can be tipped by almost anything.</p></li><li><p><strong>Metastable failure</strong>: A trigger (e.g., a network blip, a deployment, a traffic spike) pushes the system over its hidden capacity. The system is not fully broken: processes are alive, and it&#8217;s still running. But goodput collapses: it&#8217;s no longer doing any useful work. <strong>Technically up, effectively down</strong>. And unlike a regular outage, removing the trigger doesn&#8217;t fix it. Getting out requires a strong corrective push: a restart, a dramatic load reduction, a manual intervention.</p><blockquote><p><strong>NOTE</strong>: <em>If you&#8217;re not familiar with the concept of goodput, it&#8217;s the throughput of useful work completed successfully. For example, in a web application receiving 1000 requests per second but returning errors for 800 of them, the goodput is only 200 RPS.</em></p></blockquote></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!qhkv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa54abb43-fd09-4675-bb91-b695db389435_1640x360.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!qhkv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa54abb43-fd09-4675-bb91-b695db389435_1640x360.png 424w, https://substackcdn.com/image/fetch/$s_!qhkv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa54abb43-fd09-4675-bb91-b695db389435_1640x360.png 848w, https://substackcdn.com/image/fetch/$s_!qhkv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa54abb43-fd09-4675-bb91-b695db389435_1640x360.png 1272w, https://substackcdn.com/image/fetch/$s_!qhkv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa54abb43-fd09-4675-bb91-b695db389435_1640x360.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!qhkv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa54abb43-fd09-4675-bb91-b695db389435_1640x360.png" width="1456" height="320" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a54abb43-fd09-4675-bb91-b695db389435_1640x360.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:320,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:56976,&quot;alt&quot;:&quot;Diagram showing the three states of a system experiencing a metastable failure: Stable, Vulnerable, and Metastable. Arrows show transitions: increasing load moves the system from Stable to Vulnerable, a trigger moves it from Vulnerable to Metastable, and a strong corrective action (dashed arrow) brings it back to Stable.&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://read.thecoder.cafe/i/194114637?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa54abb43-fd09-4675-bb91-b695db389435_1640x360.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Diagram showing the three states of a system experiencing a metastable failure: Stable, Vulnerable, and Metastable. Arrows show transitions: increasing load moves the system from Stable to Vulnerable, a trigger moves it from Vulnerable to Metastable, and a strong corrective action (dashed arrow) brings it back to Stable." title="Diagram showing the three states of a system experiencing a metastable failure: Stable, Vulnerable, and Metastable. Arrows show transitions: increasing load moves the system from Stable to Vulnerable, a trigger moves it from Vulnerable to Metastable, and a strong corrective action (dashed arrow) brings it back to Stable." srcset="https://substackcdn.com/image/fetch/$s_!qhkv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa54abb43-fd09-4675-bb91-b695db389435_1640x360.png 424w, https://substackcdn.com/image/fetch/$s_!qhkv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa54abb43-fd09-4675-bb91-b695db389435_1640x360.png 848w, https://substackcdn.com/image/fetch/$s_!qhkv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa54abb43-fd09-4675-bb91-b695db389435_1640x360.png 1272w, https://substackcdn.com/image/fetch/$s_!qhkv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa54abb43-fd09-4675-bb91-b695db389435_1640x360.png 1456w" sizes="100vw"></picture><div></div></div></a><figcaption class="image-caption">The three states of a metastable failure. A system can drift into the vulnerable state unnoticed, and a single trigger is enough to push it into the metastable state it cannot escape on its own.</figcaption></figure></div><p>The most disorienting property of a metastable failure: stopping the trigger doesn&#8217;t stop the failure. To understand why, we need to talk about feedback loops.</p><h1>The Feedback Loop is The Root Cause</h1><p>In a previous post on <a href="https://read.thecoder.cafe/p/systems-thinking">Systems Thinking Explained</a>, we defined a feedback loop as: If <code>A</code> causes <code>B</code>, then <code>B</code> influences <code>A</code>.</p><p>A feedback loop is exactly the mechanism that keeps a system <strong>stuck in the metastable state</strong>. There is always a sustaining effect, a feedback loop, that prevents recovery. The trigger is just what pushes the system over the edge. The loop is what keeps it there. Blaming the trigger is the natural instinct, and almost always the wrong diagnosis.</p><p>Let&#8217;s discuss a concrete example to make this clear.</p><p>Imagine a web application that queries a database. The database comfortably handles up to 300 QPS. The application retries any query that doesn&#8217;t respond within 1 second. The system is running at 280 QPS, healthy and fast, within the database&#8217;s capacity.</p><p>Then, a transient network issue occurs for 10 seconds. When the issue is over, all the queued requests flood in at once. The database gets hit with a surge it can&#8217;t absorb: latency spikes and queries start timing out. So the application retries them. This doubles the effective load to 560 QPS. The database, already struggling, falls further behind. More timeouts. More retries. The loop is now self-sustaining:</p><blockquote><p><em>High load &#8594; Timeouts &#8594; Retries &#8594; Higher load &#8594; More timeouts &#8594; More retries</em></p></blockquote><p>The transient network issue was fixed minutes ago. Yet, the system is still completely broken. The trigger is gone; <strong>the feedback loop is not</strong>. The only way out is to dramatically cut the load or disable retries entirely.</p><p>This is a <strong>metastable failure</strong>. The system was vulnerable because it was operating close to its <strong>hidden capacity</strong>. A minor, transient <strong>trigger</strong> pushed it over the edge and into a self-sustaining failure state it couldn&#8217;t escape on its own. The retry mechanism, a feature designed to improve reliability, became the very thing that prevented recovery.</p><p>This is one example, but the same pattern appears with caches, connection pools, failover logic, and more. The shape is always the same: <strong>a feedback loop that turns a temporary problem into a permanent one</strong>.</p><h1>Why It&#8217;s So Hard To Fix</h1><p>Two things make metastable failures particularly nasty.</p><ul><li><p><strong>We can be tempted to blame the wrong thing</strong>. When an outage happens, the trigger is what&#8217;s visible and recent: a spike, a deployment, a hardware fault. It&#8217;s the obvious culprit. But the trigger only exposed the problem; it didn&#8217;t create it. The sustaining feedback loop was already there, structural and invisible. When analyzing the problem in retrospect, teams focus on the trigger; fixes address the trigger; and the system remains vulnerable to the next one. The authors of the paper observed teams declare a metastable failure &#8220;resolved&#8221; multiple times before realizing the real cause had never been touched.</p></li><li><p><strong>The feedback loop grows stronger with scale</strong>. Small-scale tests won&#8217;t reveal it. A staging environment running at 10% capacity may handle the same trigger without falling into a metastable state, because the loop isn&#8217;t strong enough at that scale to be self-sustaining. This means these failures can slip past even rigorous testing regimes and only manifest in production at full load.</p></li></ul><p>We defined hidden capacity earlier as the load level below which the system can self-heal from any disruption. It&#8217;s different, and always lower, than the advertised capacity. In our example, the numbers make it concrete: the advertised capacity is 300 QPS, but the hidden capacity is only 150 QPS, because retries double the load under failure. The gap between those two numbers is <strong>where vulnerability lives</strong>.</p><p>Measuring the hidden capacity is not straightforward, though. One possible approach is to apply a trigger at a given load level and observe whether the system recovers on its own:</p><ul><li><p>If it does, we are below the hidden capacity.</p></li><li><p>If it doesn&#8217;t, we are above it.</p></li></ul><p>We can also estimate it indirectly: in the retry example, retries double the load under failure, so the hidden capacity is roughly half the advertised capacity.</p><h1>Finding the Loop, Not the Bug</h1><p><strong>Metastable failures are not bugs</strong>. We can&#8217;t write a unit test that catches them. They are emergent behaviors: properties that arise from the interaction of a system&#8217;s components under specific conditions, not logic errors in any individual component. No single piece of code is buggy, no single configuration is wrong. The failure is a consequence of how everything fits together under load.</p><p>This changes how we need to think about them. The right question after an outage is not &#8220;<em>What failed?</em>&#8221; but &#8220;<em>What loop sustained it?</em>&#8221; And before an outage, the danger is not having bugs; it&#8217;s optimizing so aggressively for efficiency that <strong>we push the system deeper into the vulnerable state without realizing it</strong>.</p><p>Retries, caches, failover logic, connection pools: these are all features that improve reliability in the common case. They are also, under the right conditions, the sustaining mechanisms of metastable failures. The same design decision that makes a system more resilient in normal operation can also prevent it from recovering when things go wrong.</p><h1>What Can We Do About It?</h1><p>The paper describes several approaches to reduce the risk of metastable failures:</p><ul><li><p><strong>Retry budgets and circuit breakers</strong>: Instead of retrying indefinitely, cap the total number of retries in flight at any given time. This directly weakens the feedback loop by limiting work amplification.</p></li><li><p><strong>LIFO scheduling under overload</strong>: Counterintuitively, switching from FIFO to LIFO when the system is overloaded allows some requests to complete within their deadline, preserving goodput instead of letting every request time out.</p><blockquote><p><strong>NOTE</strong>: <em>I already wrote a post about that approach in <a href="https://read.thecoder.cafe/p/adaptive-lifo">Adaptive LIFO</a>.</em></p></blockquote></li><li><p><strong>Fast error paths</strong>: Success paths are heavily optimized, but error paths often aren&#8217;t. An expensive error path (stack traces, DNS lookups, disk writes) under high failure rates can itself become a sustaining mechanism. Optimizing error paths reduces this risk.</p></li><li><p><strong>Read-through caches over look-aside caches</strong>: A read-through cache (where the cache itself fetches missing data from the database) can continue filling itself even when the application has given up on a request, steadily increasing the hit rate and helping the system recover. A look-aside cache (where the application is responsible for populating the cache) can&#8217;t.</p></li><li><p><strong>Production stress testing</strong>: Small-scale tests won&#8217;t reveal metastable failures. Testing against a portion of production traffic, with engineers ready to intervene, is the most reliable way to surface them.</p></li></ul><p>A note of humility from the paper: there is no systematic solution yet. These are ad-hoc mitigations developed in response to known failures. Detecting vulnerable states before they collapse remains an open problem.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://read.thecoder.cafe" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://read.thecoder.cafe&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">AI is getting better every day. Are you? At The Coder Cafe, we serve fundamental concepts to make you an engineer that AI won&#8217;t replace. Written by a Google SWE, trusted by thousands of engineers worldwide.</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><h1>Summary</h1><ul><li><p>A distributed system can pass through three states: stable, vulnerable, and metastable. The vulnerable state looks healthy, but it isn&#8217;t.</p></li><li><p>The threshold between stable and vulnerable is invisible. Systems can operate in the vulnerable state for months without any sign of trouble.</p></li><li><p>When a trigger pushes a vulnerable system into a metastable failure, a feedback loop sustains the failure even after the trigger is gone.</p></li><li><p>The trigger is not the root cause. The feedback loop is. Fixing the trigger leaves the system vulnerable to the next one.</p></li><li><p>Reliability features like retries and caches can become the sustaining mechanism of a metastable failure under the right conditions.</p></li><li><p>Metastable failures are emergent behaviors, not bugs. We can&#8217;t unit test for them, and optimizing for efficiency makes them more likely.</p></li><li><p>Mitigations exist (retry budgets, circuit breakers, LIFO scheduling, fast error paths), but they are all ad-hoc responses to known failures. Detecting vulnerable states before they collapse remains an open problem.</p></li></ul><h1>Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/reliability">Reliability</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/resilient-fault-tolerant-robust-reliable">Resilient, Fault-tolerant, Robust, or Reliable?</a></p></li><li><p><a href="https://read.thecoder.cafe/p/adaptive-lifo">Adaptive LIFO</a></p></li><li><p><a href="https://read.thecoder.cafe/p/fail-open-fail-closed">Fail Open vs. Fail Closed</a></p></li></ul><h2>Sources</h2><ul><li><p><a href="https://sigops.org/s/conferences/hotos/2021/papers/hotos21-s11-bronson.pdf">Metastable Failures in Distributed Systems</a></p></li></ul><h2>Explore Further</h2><ul><li><p><a href="https://brooker.co.za/blog/2021/05/24/metastable.html">Metastability and Distributed Systems</a></p></li></ul>]]></content:encoded></item><item><title><![CDATA[LSM Trees Explained]]></title><description><![CDATA[LSM trees make a deliberate choice: optimize for updates, accept read amplification as the cost.]]></description><link>https://read.thecoder.cafe/p/lsm-trees</link><guid isPermaLink="false">https://read.thecoder.cafe/p/lsm-trees</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Wed, 20 May 2026 16:01:31 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!MOLj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0121b277-de8e-4bcb-8e87-d225094a5146_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>&#9749; <em>Welcome to The Coder Cafe! Some people reached out after I published the <a href="https://read.thecoder.cafe/p/build-your-own-kv-engine">Build Your Own Key-Value Storage Engine</a> series to say they hadn&#8217;t gone through all eight posts, but they were curious about the core ideas. So I distilled everything into a single post. No implementation, no exercises, just the core concepts behind LSM trees. Get cozy, grab a coffee, and let&#8217;s begin!</em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!MOLj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0121b277-de8e-4bcb-8e87-d225094a5146_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!MOLj!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0121b277-de8e-4bcb-8e87-d225094a5146_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!MOLj!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0121b277-de8e-4bcb-8e87-d225094a5146_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!MOLj!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0121b277-de8e-4bcb-8e87-d225094a5146_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!MOLj!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0121b277-de8e-4bcb-8e87-d225094a5146_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!MOLj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0121b277-de8e-4bcb-8e87-d225094a5146_1600x800.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0121b277-de8e-4bcb-8e87-d225094a5146_1600x800.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;:1655280,&quot;alt&quot;:&quot;LSM trees make a deliberate choice: optimize for updates, accept read amplification as the cost.&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://read.thecoder.cafe/i/194288340?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0121b277-de8e-4bcb-8e87-d225094a5146_1600x800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="LSM trees make a deliberate choice: optimize for updates, accept read amplification as the cost." title="LSM trees make a deliberate choice: optimize for updates, accept read amplification as the cost." srcset="https://substackcdn.com/image/fetch/$s_!MOLj!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0121b277-de8e-4bcb-8e87-d225094a5146_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!MOLj!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0121b277-de8e-4bcb-8e87-d225094a5146_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!MOLj!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0121b277-de8e-4bcb-8e87-d225094a5146_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!MOLj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0121b277-de8e-4bcb-8e87-d225094a5146_1600x800.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg 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><h1>Fundamental Insights</h1><p>To understand LSM trees, we first need to understand why writes are hard.</p><p>A B-tree-based database <strong>updates data in place</strong>. When we write a key, the engine finds the right page on disk and modifies it. This is a random write: the disk head has to seek to an arbitrary location before writing. On spinning disks, that seek takes time. But even on SSDs, random writes cause problems: they wear out cells unevenly and trigger expensive internal garbage collection.</p><p>LSM trees take a completely different approach. Instead of writing data where it ultimately belongs, they <strong>write data sequentially</strong>. Writes are recorded in memory and appended to a log file for durability. When the in-memory buffer fills up, its contents are streamed to a new file in one sequential pass. Sequential writes are dramatically faster than random writes because there is no seeking involved. The disk just keeps writing forward.</p><p>The price of this design is complexity. Data doesn&#8217;t live in one place. It accumulates across multiple files over time, and those files need to be periodically merged and reorganized in the background to stay manageable. That background work is what every piece of an LSM tree is built around.</p><p>The in-memory buffer is called the <strong>memtable</strong>. The sorted files on disk are called <strong>SSTables</strong>. We&#8217;ll look at each in detail.</p><h1>The Memtable</h1><p>Every write in an LSM tree starts in memory, in a structure called the memtable.</p><p>The memtable is a <strong>mutable, in-memory store</strong>. When a write request arrives, the engine records the key-value pair in the memtable and appends it to a sequential log file on disk (called the write-ahead log, or WAL, which we&#8217;ll cover in the next section). The WAL write is a sequential append, so it is fast. There is no random I/O, no page lookup, no in-place modification. This is why LSM trees can sustain very high write throughput.</p><p>A hashtable works for lookups but not for in-order iteration. Sorting a hashtable takes <code>O(n log n)</code> at flush time. A better choice is an ordered data structure. The most common in practice is a <strong>skip list</strong>; for example, LevelDB and RocksDB both use one as their default. A <strong>radix trie</strong> is another elegant option: it keeps keys in lexicographic order naturally, so iterating in order is just a depth-first traversal, and flushing becomes a simple stream with no sorting step needed. A balanced BST works too.</p><p>Production implementations typically attach a <strong>monotonic sequence number</strong> to each entry, so the engine can always determine which version of a key is the most recent, regardless of arrival order.</p><p>The memtable <strong>doesn&#8217;t grow forever</strong>. At some point, it gets flushed to disk, and a new empty memtable takes its place. What triggers that flush depends on the implementation: it can be a size limit (a number of entries or a memory threshold), elapsed time, or memory pressure, for example. That flush produces a sorted file on disk called an SSTable, which we&#8217;ll look at after the WAL.</p><h1>The Write-Ahead Log</h1><p>There is a problem with keeping writes in memory: if the process crashes, everything in the memtable is gone. Any write the client received an acknowledgment for is now lost. That breaks a core database guarantee: <strong>durability</strong>.</p><p>The solution is a Write-Ahead Log, or WAL.</p><p>Before writing to the memtable, the engine appends the operation to the WAL, an <strong>append-only file on disk</strong>. Only after the WAL entry is safely persisted does the engine update the memtable and acknowledge the client. This ordering is what the &#8220;write-ahead&#8221; in the name refers to: the log is always written before the in-memory state changes.</p><p>The WAL is not the final home for data; it&#8217;s a safety net. If the engine crashes and restarts, it replays the WAL from the beginning to reconstruct the memtable, recovering any writes that hadn&#8217;t been flushed to disk yet.</p><p>One subtlety: writing to a file is not the same as persisting it. Operating systems buffer writes in memory before flushing to disk. To guarantee durability, the engine must call <code>fsync()</code> after each WAL entry, forcing the OS to flush its buffers to physical storage. This is not free, though. <code>fsync()</code> adds latency to every write. Production systems often use <code>fdatasync()</code> instead, which persists the data without flushing unnecessary file metadata, keeping WAL appends faster. Many also use a technique called <strong>group commit</strong> to amortize this cost further: instead of syncing after every write, they batch multiple WAL entries and call <code>fsync()</code> once for the group.</p><p>The WAL introduces <strong>write amplification</strong>: the ratio of data written to disk versus data actually requested by a client. Every byte we write to the database gets written to disk twice: once to the WAL immediately, and once to an SSTable when the memtable is eventually flushed. That cost buys us durability.</p><h1>SSTables</h1><p>As we said, when the memtable fills up, it gets written to disk as a <strong>Sorted String Table, or SSTable</strong>.</p><p>An SSTable is an immutable, sorted file. Immutable means it is never modified after creation. Sorted means keys are stored in lexicographic order. Both properties matter:</p><ul><li><p><strong>Immutability</strong> makes SSTables safe to read concurrently without locking.</p></li><li><p><strong>Sorted order</strong> makes lookups inside a file efficient.</p></li></ul><p>In a simple implementation, an SSTable is just a JSON array of key-value pairs, sorted by key:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;json&quot;,&quot;nodeId&quot;:null}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-json">[

  { &#8220;key&#8221;: &#8220;apple&#8221;, &#8220;value&#8221;: &#8220;1&#8221; },

  { &#8220;key&#8221;: &#8220;banana&#8221;, &#8220;value&#8221;: &#8220;2&#8221; },

  { &#8220;key&#8221;: &#8220;cherry&#8221;, &#8220;value&#8221;: &#8220;3&#8221; }

]</code></pre></div><p>Production systems use a <strong>binary block-based format</strong> instead. The SSTable is divided into fixed-size blocks, typically 4 KB, though the exact size varies by implementation. Data blocks hold the actual key-value entries. The SSTable also contains an index block storing the first key of each data block, which makes it possible to binary search for the right block without reading the entire file. In most implementations, the index block is written at the end of the file, since block boundaries are only known after all data blocks have been streamed out. To look up a key, we read the index block, binary search it to find the right data block, fetch that single block from disk, verify its integrity with a checksum, and then binary search within the block. When the index block is not cached, this means most lookups read two disk pages: the index block and one data block. In practice, index blocks are typically kept in memory, so <strong>most lookups require only one disk read</strong>.</p><p>Each data block also carries a checksum computed over the block&#8217;s bytes. Before using the data, the engine verifies the checksum. If they don&#8217;t match, the block is corrupted, and the read fails safely rather than returning garbage.</p><p>As SSTables accumulate, the engine maintains a <strong>catalog file</strong> (often called a MANIFEST in systems like RocksDB), which is an append-only log listing all existing SSTables in order of creation. This catalog is the engine&#8217;s source of truth for what files exist on disk. On startup, the engine reads it to know which files are live, and replays the WAL to restore the memtable. After a successful flush, the old WAL can be discarded. The data is now safely in an SSTable.</p><p>Production systems also <strong>compress data blocks</strong>, typically with a fast algorithm like Snappy, LZ4, or zstd. Compression reduces disk footprint and I/O at the cost of CPU, and it interacts with block sizing: a compressed block may be smaller than a disk page, so implementations often track both logical and physical block sizes.</p><h1>Reads and Read Amplification</h1><p>LSM trees are optimized for writes. <strong>Reads are where the trade-off shows</strong>.</p><p>To look up a key, the engine searches in order of <strong>recency</strong>: first the memtable, then SSTables from newest to oldest. The first match wins. This ordering matters because the same key can appear multiple times across different SSTables. Each write to a key produces a new entry rather than updating the existing one. The newest version is the correct one.</p><p>The problem becomes clear as SSTables accumulate. A key that was written once and never updated might still require the engine to search through dozens of SSTables before finding it, or confirming it doesn&#8217;t exist. Each SSTable search is a disk read. This is called <strong>read amplification</strong>: a single logical read triggers multiple physical reads.</p><p>For a key that doesn&#8217;t exist at all, the engine must check every SSTable before returning a not-found error. That&#8217;s the worst case for read amplification, and it gets worse the more SSTables there are.</p><p>This is a fundamental tension in LSM trees, and it reflects a deeper principle known as the <strong>RUM conjecture: a storage engine can excel at two of reads, updates, and memory efficiency, but not all three at once</strong>. LSM trees make a deliberate choice: optimize for updates, accept read amplification as the cost.</p><p>The sorted structure also enables efficient range scans. To retrieve all keys between <code>start</code> and <code>end</code>, the engine scans the memtable in order, then merges sorted streams from the relevant SSTables.</p><h1>Compaction</h1><p>The answer to accumulating SSTables is <strong>compaction</strong>.</p><p>Compaction is a background process that takes multiple SSTables, <strong>merges them into fewer, cleaner ones</strong>, and discards the originals. The result is fewer files to search through, which directly reduces read amplification. It also reclaims disk space consumed by redundant entries: if the same key appears in three different SSTables, compaction keeps only the newest version and discards the rest.</p><p>One common algorithm is a <strong>k-way merge</strong>. The engine opens iterators over all SSTables being compacted, each positioned at the first entry. It uses a min-heap to always pull the smallest key across all iterators. When the same key appears in multiple SSTables, the engine picks the version from the newest SSTable and discards the older ones. The merged output is streamed into new SSTable files. In practice, real systems limit the number of SSTables that can participate in a single compaction run to keep resource consumption under control.</p><p>Updating the catalog after compaction requires <strong>care</strong>. The engine must not delete the old SSTables before the new ones are safely written to disk. The safe sequence is: write new SSTables, fsync, write a new catalog pointing to the new files, fsync, then delete the old SSTables. A crash at any point leaves the engine in a recoverable state: either the old files are still referenced by the old catalog, or the new files are referenced by the new catalog.</p><p><strong>Compaction is not free</strong>. It consumes I/O and CPU in the background, competing with foreground reads and writes. Every byte of data gets rewritten multiple times across its lifetime, adding to write amplification. Tuning when compaction triggers (and how aggressively it runs) is one of the main knobs in LSM tree performance.</p><h1>Deletions and Tombstones</h1><p>We might expect deletion to be straightforward: find the key, remove it. In an LSM tree, it is anything but <strong>straightforward</strong>.</p><p>SSTables are immutable. We cannot reach into an existing SSTable and remove an entry. So when a key is deleted, the engine writes a special marker to the memtable called a <strong>tombstone</strong>, an entry that says &#8220;<em>this key is deleted</em>&#8221;. It eventually gets flushed to an SSTable like any other write.</p><p>During reads, the engine respects tombstones. If a tombstone for a key is found before a value for that key, scanning newest to oldest, the key is treated as deleted, and a not-found error is returned. The tombstone <strong>shadows</strong> any older value.</p><p>The tricky part is knowing when it is safe to discard a tombstone during compaction. Consider this situation: a tombstone for key <code>foo</code> exists in a newer SSTable, and an old value for <code>foo</code> exists in an older SSTable that hasn&#8217;t been compacted yet. If we drop the tombstone during compaction without also removing the old value, the old value becomes visible again. Deleted data reappears. This is called <strong>data resurrection</strong>, and it is a correctness bug.</p><blockquote><p><strong>NOTE</strong>: <em>Correctness here means the engine returns what was actually written, not a stale or deleted value. This is different from consistency in the distributed systems sense, which describes the guarantees clients have about which version of data they see across replicas.</em></p></blockquote><p>The rule is strict: a tombstone can only be dropped when the engine can guarantee that <strong>no older value for that key exists anywhere below it on disk</strong>. In practice, this means the compaction must include the oldest SSTables that could still hold a shadowed value.</p><p>This is one of those details that seems minor until we get it wrong. A storage engine that resurrects deleted data is not a storage engine we can trust. Getting this right requires knowing exactly where older values can hide, which brings us to how SSTables are organized on disk.</p><h1>Leveling</h1><p>Basic compaction, merging all SSTables into one flat pool, works but doesn&#8217;t scale. As the dataset grows, a flat pool of SSTables means reads still have to check many files. <strong>Leveling is the structural answer</strong>.</p><p>In a leveled LSM tree, SSTables are organized into levels: <code>L0</code>, <code>L1</code>, <code>L2</code>, and so on. Each level has different rules:</p><ul><li><p><code>L0</code> is the <strong>landing zone</strong>. When the memtable flushes, the resulting SSTable lands in L0. <code>L0</code> files can have overlapping key ranges: two L0 files might both contain entries for key <code>foo</code>. This is acceptable because L0 files are small and short-lived.</p></li><li><p><code>L1</code> and deeper levels are different. Each level maintains <strong>non-overlapping key ranges across all its files</strong>. A given key can exist in at most one file per level. This is the critical property that makes reads efficient: to look up a key in <code>L1</code>, we don&#8217;t scan all <code>L1</code> files. We use the key ranges to jump directly to the one file that could contain it.</p></li></ul><p>When <code>L0</code> accumulates enough files, a compaction runs to merge <code>L0</code> into <code>L1</code>. This merge enforces the non-overlapping invariant: <code>L0</code> files (which may overlap) get merged with the relevant L1 files (which define the ranges), producing new <code>L1</code> files with clean, non-overlapping ranges. Similarly, when <code>L1</code> grows too large, a <strong>compaction</strong> merges part of <code>L1</code> into <code>L2</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_!2QMn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21d6f127-d86e-41f1-9c8b-f47b4802a2bd_1360x1820.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2QMn!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21d6f127-d86e-41f1-9c8b-f47b4802a2bd_1360x1820.png 424w, https://substackcdn.com/image/fetch/$s_!2QMn!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21d6f127-d86e-41f1-9c8b-f47b4802a2bd_1360x1820.png 848w, https://substackcdn.com/image/fetch/$s_!2QMn!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21d6f127-d86e-41f1-9c8b-f47b4802a2bd_1360x1820.png 1272w, https://substackcdn.com/image/fetch/$s_!2QMn!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21d6f127-d86e-41f1-9c8b-f47b4802a2bd_1360x1820.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2QMn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21d6f127-d86e-41f1-9c8b-f47b4802a2bd_1360x1820.png" width="500" height="669.1176470588235" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/21d6f127-d86e-41f1-9c8b-f47b4802a2bd_1360x1820.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1820,&quot;width&quot;:1360,&quot;resizeWidth&quot;:500,&quot;bytes&quot;:86722,&quot;alt&quot;:&quot;Diagram showing a hierarchical LSM tree structure. A blue box labeled &#8220;Memtable&#8221; sits above a dashed line separating memory from disk. Below it, multiple levels labeled &#8220;Level 0,&#8221; &#8220;Level 1,&#8221; and &#8220;Level 2&#8221; each contain several yellow boxes labeled &#8220;SSTable.&#8221; Arrows labeled &#8220;Flush&#8221; and &#8220;Compaction&#8221; point downward from one level to the next, indicating data movement from memory to lower disk levels.&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://read.thecoder.cafe/i/194288340?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21d6f127-d86e-41f1-9c8b-f47b4802a2bd_1360x1820.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Diagram showing a hierarchical LSM tree structure. A blue box labeled &#8220;Memtable&#8221; sits above a dashed line separating memory from disk. Below it, multiple levels labeled &#8220;Level 0,&#8221; &#8220;Level 1,&#8221; and &#8220;Level 2&#8221; each contain several yellow boxes labeled &#8220;SSTable.&#8221; Arrows labeled &#8220;Flush&#8221; and &#8220;Compaction&#8221; point downward from one level to the next, indicating data movement from memory to lower disk levels." title="Diagram showing a hierarchical LSM tree structure. A blue box labeled &#8220;Memtable&#8221; sits above a dashed line separating memory from disk. Below it, multiple levels labeled &#8220;Level 0,&#8221; &#8220;Level 1,&#8221; and &#8220;Level 2&#8221; each contain several yellow boxes labeled &#8220;SSTable.&#8221; Arrows labeled &#8220;Flush&#8221; and &#8220;Compaction&#8221; point downward from one level to the next, indicating data movement from memory to lower disk levels." srcset="https://substackcdn.com/image/fetch/$s_!2QMn!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21d6f127-d86e-41f1-9c8b-f47b4802a2bd_1360x1820.png 424w, https://substackcdn.com/image/fetch/$s_!2QMn!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21d6f127-d86e-41f1-9c8b-f47b4802a2bd_1360x1820.png 848w, https://substackcdn.com/image/fetch/$s_!2QMn!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21d6f127-d86e-41f1-9c8b-f47b4802a2bd_1360x1820.png 1272w, https://substackcdn.com/image/fetch/$s_!2QMn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21d6f127-d86e-41f1-9c8b-f47b4802a2bd_1360x1820.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 deeper level is typically larger by a fixed ratio, for example, 10x. <code>L1</code> might hold 10 MB, <code>L2</code> 100 MB, <code>L3</code> 1 GB, and so on. Most data ends up in the deepest level. Most compaction work happens between levels.</p><p>The benefit is <strong>controlled read amplification</strong>. To look up a key, we check the memtable, scan all <code>L0</code> files, then do one binary search per deeper level. The number of deeper levels grows logarithmically with data size. For a dataset with a few levels, that&#8217;s a small, bounded number of disk reads, regardless of how many total SSTables exist.</p><p>When compaction falls behind and <code>L0</code> accumulates too many files, the engine may trigger a <strong>write stall</strong>: new writes are paused until compaction catches up and <code>L0</code> is drained. This is one of the more painful operational issues in LSM-based systems.</p><p>Leveled compaction is also not the only strategy. <strong>Tiered compaction</strong>, used by Cassandra, for example, takes a different approach: instead of enforcing non-overlapping ranges per level, it groups SSTables of similar size and merges them when a tier grows too large. Tiered compaction generates less write amplification but more read amplification. The right choice depends on the workload.</p><h1>Bloom Filters</h1><p>Leveling helps with reads, but there is still one painful case: <strong>looking up a key that doesn&#8217;t exist</strong>.</p><p>For a missing key, the engine checks the memtable (not there), checks each L0 file (not there), then checks one file per deeper level (not there). Each check is a disk read. Even with leveling, this adds up.</p><p>Bloom filters solve this. A Bloom filter is a <strong>probabilistic data structure</strong> that can answer one question: Is this key definitely not in this SSTable? It has no false negatives: if the key is in the SSTable, the filter will say so. It can have false positives (occasionally it says a key might be present when it isn&#8217;t), but in practice, the false positive rate is tunable and kept very low.</p><p>Many implementations attach a Bloom filter to each SSTable, built at creation time from all the keys it contains. The filters are small, a few kilobytes per SSTable, so they can be <strong>loaded into memory</strong> at startup and kept there.</p><p>How does it work? A Bloom filter is a bitset. When a key is added, several hash functions are applied to it, each producing an index into the bitset. The bit at each index is set to 1. To check if a key is in the filter, the same hash functions are applied. If any of the resulting bits is 0, the key is definitely not in the SSTable. No disk read needed. If all bits are 1, the key might be there, and the engine proceeds to read the SSTable.</p><p>The practical impact is significant. For a key that doesn&#8217;t exist (the worst case), the engine skips almost every SSTable <strong>without a single disk read</strong>. Only the rare false positive triggers an unnecessary disk read. Read amplification for missing keys drops dramatically.</p><p>Some engines take this further and attach Bloom filters not just per SSTable but per data block within an SSTable, enabling even more precise filtering before fetching a block from disk.</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;8d762590-5e92-4e5d-bb6f-3502234d6948&quot;,&quot;caption&quot;:&quot;&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Bloom Filters Explained&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:3529974,&quot;name&quot;:&quot;Teiva Harsanyi&quot;,&quot;bio&quot;:&quot;Software Engineer at Google, Author, Speaker.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e800897a-277b-458c-a1a2-48b8b1b8d70c_500x500.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2025-04-16T08:02:14.176Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3084bc89-8d72-4086-a989-7b677756bea7_1600x800.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://read.thecoder.cafe/p/bloom-filters&quot;,&quot;section_name&quot;:&quot;Concepts&quot;,&quot;video_upload_id&quot;:null,&quot;id&quot;:157469071,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:8,&quot;comment_count&quot;:0,&quot;publication_id&quot;:2874913,&quot;publication_name&quot;:&quot;The Coder Cafe&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!OZXv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa08792c7-cadb-478c-bce4-a10c5dc5ac05_1280x1280.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><h1>Concurrency</h1><p>Everything described so far assumes a single thread. In reality, a storage engine needs to handle <strong>concurrent reads and writes, while flush and compaction run in the background</strong>. This is where things get subtle.</p><p>The core problem: a flush operation replaces the current memtable with a new one and registers a new SSTable in the catalog. A compaction operation removes old SSTables and registers new ones. If a read is in the middle of searching an SSTable that gets deleted by a concurrent compaction, that&#8217;s a crash.</p><p>One common solution is a <strong>versioned catalog</strong>.</p><p>A catalog is a snapshot of the engine&#8217;s state at a point in time: a reference to the current memtable, the current WAL path, and the current catalog file. Every incoming request acquires the latest catalog version, pins it by incrementing a reference count, performs its work, then releases it by decrementing the reference count.</p><p>Background workers (the flush worker and the compaction worker) never modify an <strong>existing catalog</strong>. Instead, when a flush or compaction completes, they create a new catalog version pointing to the updated memtable and SSTable set. From that moment, new requests acquire the new catalog. Old requests that pinned the previous catalog continue reading from it safely.</p><p>An old catalog version is only cleaned up (its SSTables deleted, its WAL file discarded) when its reference count drops to zero. No reader is using it anymore, so it is safe to remove.</p><p>This approach keeps foreground reads and writes lock-free in the hot path. Background operations never block requests, and requests never block background operations. They operate on independent catalog versions and only synchronize at the moment of <strong>catalog swap</strong>, which in many implementations is a single atomic pointer update.</p><p>The versioned catalog is also what makes crash recovery clean. On startup, the engine reads the latest catalog file on disk, which always reflects a consistent state: either from before the last flush/compaction, or after. Any SSTables on disk not referenced by the catalog are orphans from an incomplete operation and can be safely deleted.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://read.thecoder.cafe" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://read.thecoder.cafe&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">AI is getting better every day. Are you? At The Coder Cafe, we serve fundamental concepts to make you an engineer that AI won&#8217;t replace. Written by a Google SWE, trusted by thousands of engineers worldwide.</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><h1>Summary</h1><ul><li><p>LSM trees optimize for write throughput by turning random disk writes into sequential ones, at the cost of more complex reads.</p></li><li><p>The memtable absorbs writes in memory; an ordered structure like a skip list, balanced BST, or radix trie keeps keys sorted for efficient flushing.</p></li><li><p>The WAL provides durability: every write is logged to disk before the memtable is updated, enabling crash recovery.</p></li><li><p>SSTables are immutable, sorted files produced by flushing the memtable; a binary block format with checksums makes point lookups efficient and reads safe.</p></li><li><p>A catalog file tracks which SSTables are live and is updated atomically to ensure the engine always has a consistent view of disk state.</p></li><li><p>Read amplification is the fundamental trade-off: finding a key may require searching multiple SSTables, one per level, plus all <code>L0</code> files.</p></li><li><p>Compaction merges SSTables, eliminates redundant entries, and reclaims space, at the cost of write amplification and background I/O.</p></li><li><p>Tombstones handle deletions in an immutable structure; they can only be discarded when no older value they shadow still exists on disk.</p></li><li><p>Leveling organizes SSTables into levels with non-overlapping key ranges, bounding read amplification to one file lookup per level. Tiered compaction is an alternative strategy that trades less write amplification for more read amplification.</p></li><li><p>Bloom filters allow the engine to skip SSTable reads for missing keys with near certainty, eliminating the worst-case read scenario.</p></li><li><p>A versioned catalog is one common approach to enabling lock-free concurrent reads and background operations by letting each request pin a consistent snapshot of engine state.</p></li></ul><h1>Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/distributed-systems">Distributed Systems</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/crdt">CRDTs Explained</a></p></li><li><p><a href="https://read.thecoder.cafe/p/availability-models">Availability Models Explained</a></p></li><li><p><a href="https://read.thecoder.cafe/p/pacelc">The PACELC Theorem Explained</a></p></li></ul><h2>Sources</h2><ul><li><p><a href="https://www.cs.umb.edu/~poneil/lsmtree.pdf">The Log-Structured Merge-Tree (LSM-Tree)</a> <em>// The original LSM tree whitepaper.</em></p></li><li><p><a href="https://www.scylladb.com/glossary/log-structured-merge-tree">Log Structured Merge Tree - ScyllaDB</a> <em>// LSM tree definition from ScyllaDB <a href="https://www.scylladb.com/technical-glossary/">technical glossary</a>.</em></p></li></ul><h2>Explore Further</h2><ul><li><p><a href="https://read.thecoder.cafe/p/build-your-own-kv-engine">Build Your Own Key-Value Storage Engine</a></p></li><li><p><a href="https://planetscale.com/blog/io-devices-and-latency">IO devices and latency</a></p></li></ul>]]></content:encoded></item><item><title><![CDATA[AI for Production]]></title><description><![CDATA[Active incidents can be cognitively brutal.]]></description><link>https://read.thecoder.cafe/p/ai-for-production</link><guid isPermaLink="false">https://read.thecoder.cafe/p/ai-for-production</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Wed, 13 May 2026 13:02:03 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Em82!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ee5c4fc-43c9-4b31-9c4d-88cf74f1d649_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>&#9749; <em>Welcome to The Coder Cafe! These days, most posts about AI for production circle the same ideas: automated remediation, anomaly detection, alerting triage, etc. These are interesting starting points, but they share a common assumption: that AI&#8217;s job is to replace what SREs do. In this post, I want to explore the idea of having AI as a cognitive partner, something that extends what a single engineer can hold in their head at once. Get cozy, grab a coffee, and let&#8217;s begin!</em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Em82!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ee5c4fc-43c9-4b31-9c4d-88cf74f1d649_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Em82!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ee5c4fc-43c9-4b31-9c4d-88cf74f1d649_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!Em82!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ee5c4fc-43c9-4b31-9c4d-88cf74f1d649_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!Em82!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ee5c4fc-43c9-4b31-9c4d-88cf74f1d649_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!Em82!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ee5c4fc-43c9-4b31-9c4d-88cf74f1d649_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Em82!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ee5c4fc-43c9-4b31-9c4d-88cf74f1d649_1600x800.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5ee5c4fc-43c9-4b31-9c4d-88cf74f1d649_1600x800.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;:1636537,&quot;alt&quot;:&quot;Active incidents can be cognitively brutal.&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://read.thecoder.cafe/i/193476988?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ee5c4fc-43c9-4b31-9c4d-88cf74f1d649_1600x800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Active incidents can be cognitively brutal." title="Active incidents can be cognitively brutal." srcset="https://substackcdn.com/image/fetch/$s_!Em82!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ee5c4fc-43c9-4b31-9c4d-88cf74f1d649_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!Em82!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ee5c4fc-43c9-4b31-9c4d-88cf74f1d649_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!Em82!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ee5c4fc-43c9-4b31-9c4d-88cf74f1d649_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!Em82!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ee5c4fc-43c9-4b31-9c4d-88cf74f1d649_1600x800.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg 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>At Google, I&#8217;m an SRE on the&nbsp;<a href="https://cloud.google.com/distributed-cloud-connected">Google Distributed Cloud</a>&nbsp;team, where the infrastructure stack spans Kubernetes, Borg, distributed storage, virtualization, networking, and more. Over the past months, I&#8217;ve been experimenting with ways AI can help not only by automating work away, but also by reducing the cognitive overhead that makes production work quite overwhelming sometimes.</p><p>Here are three directions that changed how I thought about the problem.</p><h1>Situation Awareness</h1><p>In my team, we have hundreds of dashboards. Kubernetes clusters, Borg jobs, storage metrics, VM utilization, network metrics, etc. Each one tells part of the story.</p><p>When something went wrong, and I wanted to understand the current state of the system, I needed to spend a significant amount of time opening tabs and cross-referencing panels to get a complete picture.</p><p>This is a fundamentally human bottleneck. <strong>Each dashboard was designed to answer a specific question</strong>. The question &#8220;<em>What is the current situation?</em>&#8221; doesn&#8217;t map to any single dashboard, and navigating all of them to reconstruct an answer takes time we often don&#8217;t have.</p><p>Interestingly, this is where AI can change the equation. Instead of navigating dashboards, imagine describing your system to an AI agent with access to your observability stack and simply asking: &#8220;<em>What&#8217;s going on?</em>&#8221; The agent queries across your telemetry data, picks out what stands out, and hands you back a <strong>coherent narrative</strong>, something you can actually act on. Like: &#8220;<em>This specific cluster has an issue with all the containers using distributed storage running on that specific node since 2h.</em>&#8221;</p><p>This shifts the focus from <em>navigator</em> (opening dashboards one by one) to <em>interpreter</em> (acting on a synthesized summary). And that shift matters: every minute you spend navigating is a minute you're not spending on the actual problem.</p><h1>Telemetry Archaeology</h1><p>A few months ago, I was investigating a storage incident on a cluster. The failure itself was clear: a disk issue that surfaced as elevated latency and eventually a service degradation. What wasn&#8217;t clear was <em>why</em> it happened when it did.</p><p>I used Gemini CLI to navigate the metrics data around the event window. What it surfaced surprised me: the root cause signals had been present in the telemetry hours before the incident triggered any alert. Subtle correlations across metrics that individually looked like noise: disk read latency creeping slightly upward, I/O wait ticking up on specific nodes, a minor memory pressure pattern. Together, they pointed directly at the failure that was coming.</p><p>A human reviewing those dashboards in real time would almost certainly have missed it. Each individual signal was within an acceptable range. The pattern only became visible when we looked at all of them together, across time.</p><p>This is what I&#8217;d call <strong>telemetry archaeology</strong>: using AI to go back through your metrics data and surface the correlations an alerting system wasn&#8217;t designed to catch.</p><p>It&#8217;s worth being precise about what makes this different from anomaly detection. Anomaly detection tells you when something looks wrong. Telemetry archaeology is about <strong>finding the patterns that appear before anything looks wrong at all</strong>, relationships that no one thought to encode into an alert, because no one knew they existed until the incident happened.</p><p>The practical implication is significant. If these correlations exist in your past incidents, they likely exist in future ones. An AI agent that continuously monitors for these multi-signal patterns could surface a warning (&#8221;<em>This looks like the early stages of what happened last time</em>&#8221;) long before your system starts showing symptoms.</p><h1>Incident Co-Pilot</h1><p>Active incidents can be <strong>cognitively brutal</strong>. You can be debugging a live system, managing communication with stakeholders, coordinating with other engineers, and trying to remember what you checked 20 minutes ago, all at the same time.</p><p>A common consequence is that the engineer with the deepest system knowledge gets pulled out of deep focus to write status updates, summarize what&#8217;s been tried, and maintain a running timeline. This work is necessary, but it&#8217;s expensive. Every context switch makes it harder to hold the full mental model of the incident in your head. And once that model fragments, rebuilding it takes time you don&#8217;t have.</p><blockquote><p><strong>NOTE</strong>: <em>This is actually one of the reasons Google developed the IMAG process, with clear role separation: The Incident Commander (IC) coordinates the overall response, the Communications Lead (CL) handles stakeholder updates, and the Operations Lead (OL) focuses on mitigating the issue. The explicit goal is to prevent any single person from being pulled in too many directions at once.</em></p></blockquote><p><strong>AI can absorb most of this overhead</strong>. Think of it as a second brain that&#8217;s been in the room the whole time: it tracks what hypotheses have been tested, which ones were ruled out and why, what changed in the system during the incident window, and what hasn&#8217;t been explored yet. When a new engineer joins the investigation, instead of spending ten minutes getting them up to speed, you ask the AI for a summary.</p><p>AI&#8217;s role here is handling the <em>administrative layer</em> of the incident: the parts that pull you out of flow, so you can stay in the problem instead of constantly being yanked out of it.</p><p>I&#8217;ve been using AI this way during my own shifts. Even without a purpose-built tool, maintaining a running log with AI (e.g., what we&#8217;ve tried, what we know, what&#8217;s next) noticeably changes how an incident feels.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://read.thecoder.cafe" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://read.thecoder.cafe&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">AI is getting better every day. Are you? At The Coder Cafe, we serve fundamental concepts to make you an engineer that AI won&#8217;t replace. Written by a Google SWE, trusted by thousands of engineers worldwide.</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><h1>Summary</h1><ul><li><p>The common &#8220;AI for production&#8221; narrative focuses on automation and replacement; cognitive augmentation is the underexplored angle.</p></li><li><p>Situation awareness: AI can synthesize across hundreds of dashboards to answer &#8220;<em>What&#8217;s the current situation?</em>&#8221; in seconds, shifting your role from navigator to interpreter.</p></li><li><p>Telemetry archaeology: AI can surface hidden correlations across metrics that individually look like noise, revealing root cause signals that were present hours before any alert fired.</p></li><li><p>Incident co-pilot: AI can absorb the administrative layer of an active incident (status updates, running timeline, hypothesis tracking), keeping the engineer in deep focus instead of constant context switching.</p></li><li><p>None of this requires replacing the engineer. The value is in extending what one person can hold in their head under pressure.</p></li></ul><h1>Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/reliability">Reliability</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/reliability">Reliability</a></p></li><li><p><a href="https://read.thecoder.cafe/p/resilient-fault-tolerant-robust-reliable">Resilient, Fault-tolerant, Robust, or Reliable?</a></p></li><li><p><a href="https://read.thecoder.cafe/p/lurking-variables">Lurking Variables</a></p></li></ul><h2>Explore Further</h2><ul><li><p><a href="https://geminicli.com/">Gemini CLI</a></p></li><li><p><a href="https://sre.google/resources/practices-and-processes/incident-management-guide/">Google Site Reliability Engineering: Incident Management Guide</a></p></li><li><p><a href="https://swizec.com/blog/the-future-of-software-engineering-is-sre/">The future of software engineering is SRE</a></p></li></ul>]]></content:encoded></item><item><title><![CDATA[Cache Use Cases Explained]]></title><description><![CDATA[The cache didn't change. The code didn't change. The system grew around the cache, and the cache quietly became load-bearing.]]></description><link>https://read.thecoder.cafe/p/cache-use-cases</link><guid isPermaLink="false">https://read.thecoder.cafe/p/cache-use-cases</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Wed, 06 May 2026 16:01:33 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!pbmj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3501c1cc-cb99-4458-b772-b34e67c40ea6_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>&#9749; <em>Welcome to The Coder Cafe! Today, we discuss cache use cases. When we think about caching, it&#8217;s pretty frequent to focus on where it happens; for example, client-side, server-side, or in a CDN. Yet, there&#8217;s a more important question that should be answered first: What&#8217;s the use case? In this post, we will break down two common cache use cases: reducing latency and improving capacity. And we will see why the line between the two is blurrier than it seems. Get cozy, grab a coffee, and let&#8217;s begin!</em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!pbmj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3501c1cc-cb99-4458-b772-b34e67c40ea6_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!pbmj!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3501c1cc-cb99-4458-b772-b34e67c40ea6_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!pbmj!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3501c1cc-cb99-4458-b772-b34e67c40ea6_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!pbmj!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3501c1cc-cb99-4458-b772-b34e67c40ea6_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!pbmj!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3501c1cc-cb99-4458-b772-b34e67c40ea6_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!pbmj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3501c1cc-cb99-4458-b772-b34e67c40ea6_1600x800.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3501c1cc-cb99-4458-b772-b34e67c40ea6_1600x800.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;:1675669,&quot;alt&quot;:&quot;The cache didn't change. The code didn't change. The system grew around the cache, and the cache quietly became load-bearing.&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://read.thecoder.cafe/i/162481356?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3501c1cc-cb99-4458-b772-b34e67c40ea6_1600x800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The cache didn't change. The code didn't change. The system grew around the cache, and the cache quietly became load-bearing." title="The cache didn't change. The code didn't change. The system grew around the cache, and the cache quietly became load-bearing." srcset="https://substackcdn.com/image/fetch/$s_!pbmj!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3501c1cc-cb99-4458-b772-b34e67c40ea6_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!pbmj!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3501c1cc-cb99-4458-b772-b34e67c40ea6_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!pbmj!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3501c1cc-cb99-4458-b772-b34e67c40ea6_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!pbmj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3501c1cc-cb99-4458-b772-b34e67c40ea6_1600x800.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg 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><h1>A Cache for Latency</h1><p>Latency is the time between when a request is sent and when a response is received. A cache for latency exists to <strong>reduce the average latency of a service</strong>.</p><p>The classic access pattern looks like this<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a>:</p><ol><li><p>We check the cache first.</p></li><li><p>On a cache hit, we return the data directly without touching the backend.</p></li><li><p>On a miss, we go to the backend, return the result, and store it in the cache for future requests.</p></li></ol><p>Why does this reduce latency? The cache keeps data in memory, which is significantly faster to read from than a remote database that may involve network round-trips, disk I/O, and query execution. On a hit, all of that work is skipped.</p><p>In <em><a href="https://read.thecoder.cafe/p/soft-hard-dependency">Soft vs. Hard Dependency</a></em>, we introduced two kinds of dependencies:</p><ul><li><p><strong>A soft dependency</strong> is a <strong>non-critical </strong>dependency for the service to operate properly.</p></li></ul><ul><li><p><strong>A hard dependency</strong> is a <strong>critical</strong> dependency for the service to operate properly.</p></li></ul><p>A cache for latency is a <strong>soft dependency</strong>. If the cache becomes unavailable, requests fall through to the backend. The system keeps working, just at a higher latency. Keep this in mind, because it&#8217;s the key difference we&#8217;ll come back to.</p><h1>A Cache for Capacity</h1><p>A cache for capacity exists to serve <strong>higher throughput</strong> than the backend can handle on its own.</p><p>The access pattern is identical to the latency case: cache first, then backend on a miss.</p><p>So what actually makes these two different?</p><p>The difference is not in the code; it&#8217;s in what the backend can absorb. In a capacity scenario, the backend would be <strong>overwhelmed</strong> if it received all the traffic directly. The cache absorbs a large portion of the requests, keeping the backend load manageable.</p><p><strong>This changes the nature of the dependency</strong>. If the cache goes down, the backend is suddenly hit with all the traffic it was previously shielded from. Whether the system survives depends on the backend&#8217;s own capacity. If the backend can scale fast enough, the cache is still a soft dependency: there will be a rough period, but the system recovers. If the backend can&#8217;t cope with the load, the cache becomes a <strong>hard dependency</strong>. Without it, the <strong>system fails</strong>.</p><h1>When a Latency Cache Becomes a Capacity Cache</h1><p>Here&#8217;s a question worth asking: if the access pattern for both types is identical, how do we know which one we have?</p><p>In most cases, caches are introduced to reduce latency. But here&#8217;s what can happen over time:</p><ul><li><p>Our system is stable.</p></li><li><p>Cache hit rates are high, backend load is low.</p></li><li><p>Traffic grows. The backend load stays low because the cache is absorbing most of it. Nothing breaks. No alerts fire.</p></li><li><p>Six months pass. Nothing has changed, no code, no configuration, no architecture decision. And yet the cache is no longer reducing latency. It&#8217;s keeping the backend alive.</p></li></ul><p>The cache didn&#8217;t change. The code didn&#8217;t change. The system grew around the cache, and the cache quietly became <strong>load-bearing</strong>.</p><p>The same risk appears when a cache goes cold. For example:</p><ul><li><p>A migration to a new cache instance</p></li><li><p>A data format change that requires purging existing entries</p></li><li><p>A cache restart after maintenance</p></li></ul><p>Any of these can produce a large wave of cache misses in a short window. If we were running a latency cache, we would see higher latency for a while. If we were running a capacity cache, we would see a traffic spike that the backend can&#8217;t absorb.</p><p>The unsettling part is that the code is identical in both cases. The difference only becomes visible at <strong>failure time</strong>.</p><h1>How to Manage This Risk</h1><p>The root problem is that teams often <strong>don&#8217;t know which type of cache they&#8217;re running</strong>. They built it for latency, and that&#8217;s still how they think about it, even as the system outgrows that assumption.</p><p>A few approaches help here:</p><ul><li><p>Periodically ask: could the backend handle the current traffic if the cache were <strong>completely removed</strong>? Load testing without the cache, or estimating backend capacity against current traffic levels, gives you a concrete answer.</p></li><li><p>Treat cache hit rate as a <strong>meaningful operational signal</strong>, not just a performance metric. A sustained drop in hit rate means the backend is absorbing more traffic than usual. If that trend continues, it&#8217;s an early warning that you may be drifting toward a capacity problem.</p></li><li><p>When migrating a cache or invalidating a large portion of its data, <strong>warm the new cache</strong> before routing live traffic to it. This prevents a cold-start burst from hitting the backend all at once.</p></li><li><p>Finally, once we recognize that a cache is operating as a <strong>capacity cache</strong>, we should treat it accordingly. It&#8217;s no longer optional infrastructure and it deserves proper alerting and a clear plan for what happens if it goes down.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://read.thecoder.cafe" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://read.thecoder.cafe&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">AI is getting better every day. Are you? At The Coder Cafe, we serve fundamental concepts to make you an engineer that AI won&#8217;t replace. Written by a Google SWE, trusted by thousands of engineers worldwide.</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><h1>Summary</h1><ul><li><p>A cache for latency serves data from memory to reduce average response time. It is a soft dependency: if unavailable, the system degrades in latency but continues to work.</p></li><li><p>A cache for capacity absorbs traffic that the backend couldn&#8217;t handle on its own. It can be a soft or a hard dependency, depending on whether the backend can absorb the load without it.</p></li><li><p>Both types share the same access pattern, which makes them easy to confuse.</p></li><li><p>A latency cache can silently become a capacity cache as traffic grows, without any code change.</p></li><li><p>When a capacity cache goes cold or fails, the backend can be overwhelmed. Hit rate monitoring, periodic load testing, and cache warming are practical ways to manage this risk.</p></li></ul><h1>Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/distributed-systems">Distributed Systems</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/availability-models">Availability Models</a></p></li><li><p><a href="https://read.thecoder.cafe/p/safety-liveness">Safety and Liveness</a></p></li><li><p><a href="https://read.thecoder.cafe/p/pacelc">The PACELC Theorem</a></p></li></ul><h2>Sources</h2><ul><li><p><a href="https://www.robustperception.io/the-three-types-of-cache/">The Three Types of Cache</a></p></li></ul><h2>Explore Further</h2><ul><li><p><a href="https://en.wikipedia.org/wiki/Cache_stampede">Cache stampede</a></p></li></ul><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-1" href="#footnote-anchor-1" class="footnote-number" contenteditable="false" target="_self">1</a><div class="footnote-content"><p>Even though variations exist.</p></div></div>]]></content:encoded></item><item><title><![CDATA[How Linux 7.0 Broke PostgreSQL]]></title><description><![CDATA[Linux 7.0 delivered roughly half the throughput of Linux 6.x on the same hardware and workload.]]></description><link>https://read.thecoder.cafe/p/linux-broke-postgresql</link><guid isPermaLink="false">https://read.thecoder.cafe/p/linux-broke-postgresql</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Wed, 29 Apr 2026 13:03:29 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/1d7bc6e6-ce29-42ec-a006-e56d38bedcd8_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>&#9749; <em>Welcome to The Coder Cafe! On April 3, 2026, Salvatore Dipietro, an engineer at AWS, posted a patch to the Linux kernel mailing list. The reason: on a 96-vCPU Graviton4 machine running Linux 7.0, PostgreSQL throughput had dropped to roughly half of what it produced on Linux 6.x. In this post, we will trace what changed in Linux 7.0, how PostgreSQL manages memory, and what role memory pages play in making the problem appear (or disappear). Get cozy, grab a coffee, and let&#8217;s begin!</em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!4BY5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0006539e-87be-4dff-a099-ada9f4e90132_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4BY5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0006539e-87be-4dff-a099-ada9f4e90132_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!4BY5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0006539e-87be-4dff-a099-ada9f4e90132_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!4BY5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0006539e-87be-4dff-a099-ada9f4e90132_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!4BY5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0006539e-87be-4dff-a099-ada9f4e90132_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4BY5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0006539e-87be-4dff-a099-ada9f4e90132_1600x800.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0006539e-87be-4dff-a099-ada9f4e90132_1600x800.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;:1660584,&quot;alt&quot;:&quot;Linux 7.0 delivered roughly half the throughput of Linux 6.x on the same hardware and workload.&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://read.thecoder.cafe/i/195747188?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0006539e-87be-4dff-a099-ada9f4e90132_1600x800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Linux 7.0 delivered roughly half the throughput of Linux 6.x on the same hardware and workload." title="Linux 7.0 delivered roughly half the throughput of Linux 6.x on the same hardware and workload." srcset="https://substackcdn.com/image/fetch/$s_!4BY5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0006539e-87be-4dff-a099-ada9f4e90132_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!4BY5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0006539e-87be-4dff-a099-ada9f4e90132_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!4BY5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0006539e-87be-4dff-a099-ada9f4e90132_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!4BY5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0006539e-87be-4dff-a099-ada9f4e90132_1600x800.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg 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><h1>The Problem</h1><p>Salvatore Dipietro ran <a href="https://www.postgresql.org/docs/current/pgbench.html">pgbench</a> (PostgreSQL&#8217;s standard benchmarking tool) on a Graviton4 processor with 96 vCPUs. The workload was a benchmark doing simple updates at scale factor 8,470 (i.e., roughly a 847 million row table), simulating 1,024 clients and 96 threads. A serious, high-parallelism load designed to stress the system.</p><p>The results were striking. Linux 7.0 delivered roughly <strong>half the throughput</strong> of Linux 6.x on the same hardware and workload:</p><ul><li><p><strong>Linux 6.x</strong>: 98,565 transactions per second</p></li><li><p><strong>Linux 7.0</strong>: 50,751 transactions per second</p></li></ul><p>To find where the time was going, Dipietro ran <code>perf</code>, a Linux profiling tool that samples what the CPU is actually doing. The result was unambiguous:</p><pre><code>|- 56.03% - StartReadBuffer
   |- 55.93% - GetVictimBuffer
      |- 55.93% - StrategyGetBuffer
         |- 55.60% - s_lock         # 55% of CPU</code></pre><p>55% of the machine&#8217;s CPU time was spent inside a single function: <code>s_lock</code>. The culprit was traced back to a change in how Linux 7.0 schedules processes. Let&#8217;s start there.</p><h1>What Is Preemption?</h1><p>When multiple threads run on a machine, the OS needs to share the CPU between them. That&#8217;s the scheduler&#8217;s job. But the scheduler also decides something subtler: when to interrupt a running thread and hand the CPU to another. That decision is called <strong>preemption</strong>, and the answer varies depending on how the kernel is configured.</p><p>Before Linux 7.0, there were three options:</p><ul><li><p><code>PREEMPT_NONE</code>: The kernel almost never interrupts a running thread. A thread runs until it voluntarily gives up the CPU: when it makes a syscall, blocks on I/O, or explicitly sleeps. This was the traditional server default with fewer context switches, higher throughput, and predictable behavior under load.</p></li><li><p><code>PREEMPT_FULL</code>: The kernel can interrupt a running thread at almost any safe point, even if it is in the middle of doing useful work. This means a thread never has to wait for the current one to finish its slice before getting CPU time, which reduces response time but increases context-switch overhead. Historically, the desktop default, where responsiveness matters more than raw throughput.</p></li><li><p><code>PREEMPT_LAZY</code>: Introduced in Linux 6.12 as a compromise between the two. The scheduler can interrupt threads, but tries to wait for natural boundaries rather than cutting in aggressively. The intent is to approximate <code>PREEMPT_NONE</code>&#8216;s throughput behavior while still allowing preemption when needed.</p></li></ul><p>In Linux 7.0, <code>PREEMPT_NONE</code> was removed as an option on modern CPU architectures, leaving only <code>PREEMPT_FULL</code> and <code>PREEMPT_LAZY</code>. Indeed, <code>PREEMPT_LAZY</code> was designed to be a drop-in replacement on throughput workloads, and for the vast majority of server software, it is. But PostgreSQL hit a specific case where the difference is catastrophic, and to understand why, we need to look at how PostgreSQL manages memory.</p><h1>PostgreSQL Memory Management</h1><p>PostgreSQL, like most databases, doesn&#8217;t store data as rows in a flat file. Instead, it uses a fixed-size abstraction called a <strong>data page</strong> (8 KB by default) as its basic unit of storage. Everything on disk (e.g., table rows, B-tree index nodes, metadata) is stored in these pages. A table with millions of rows is ultimately a large sequence of data pages on disk.</p><p>Reading from disk is slow. So PostgreSQL maintains a <strong>shared buffer pool</strong>, a large region of shared memory that caches <strong>recently read data pages</strong>. The more of the working set that fits in the buffer pool, the less disk I/O is needed.</p><p>When a client connects to PostgreSQL, the server spawns a dedicated process to handle that connection, called a <strong>backend</strong>. Every backend that needs a data page not already in the buffer pool has to first read it from disk, then find a buffer to store it in: either one that is already free, or one currently holding another page that can be evicted. The job of finding that buffer falls to a single crucial function called <code>StrategyGetBuffer</code>.</p><p>To coordinate access to the buffer pool across hundreds of concurrent backends, <code>StrategyGetBuffer</code> uses a spinlock.</p><h1>Spinlocks in PostgreSQL</h1><p>A spinlock is a locking mechanism built on a simple idea: instead of going to sleep while waiting for a lock to become available, a process just <strong>keeps checking in a tight loop</strong> (it <em>spins</em>):</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;c&quot;,&quot;nodeId&quot;:null}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-c">while (!try_acquire_lock()) {
    /* Keep checking, burn CPU */
}</code></pre></div><p>Why would we ever want that? For very short critical sections, the overhead of putting a thread to sleep and waking it back up can be <strong>more expensive than just &#8220;spinning&#8220;</strong>, meaning actively waiting. If we know the lock holder will be done in nanoseconds, spinning is faster than sleeping.</p><p>The key assumption behind spinlocks is the following: <strong>the thread holding the lock will release it very soon.</strong> Nobody is going to preempt that thread in the middle of a 20-nanosecond critical section. The holder will finish and release the lock before anyone has time to notice.</p><p><code>StrategyGetBuffer</code> uses a single global spinlock to protect the critical section where it selects a buffer. On a 96-vCPU machine with 1,024 clients all hammering the database, every backend competes for the same lock, and any time it takes longer than expected to release, all of them burn CPU spinning.</p><p>But why did the Linux 7.0 preemption change make it so much worse? The answer lies in how memory works at the hardware level.</p><h1>Virtual Memory and the TLB</h1><p>Every process in Linux, including PostgreSQL, works with virtual memory addresses. For example, the address <code>0x7fff1234</code> in one process is a completely different memory from the same address in another process. The hardware translates virtual addresses to physical addresses using a data structure called the <strong>page table</strong>, maintained by the kernel in memory.</p><p>A page table is a multi-level tree, so a single address translation requires <strong>several sequential memory reads</strong> to walk it. Doing that for every memory access would be impossibly slow.</p><p>Instead, CPUs have a small hardware cache for recent translations called the <strong>Translation Lookaside Buffer</strong> (TLB):</p><ul><li><p>When a process accesses an address it has accessed recently, the TLB already has the translation, and the memory access proceeds quickly.</p></li><li><p>When a process accesses an address it hasn&#8217;t seen before, it gets a <strong>TLB miss</strong>: the CPU has to walk the page table, find the physical address, and store the translation in the TLB. That takes time.</p></li></ul><p>There is one more concept to introduce. When PostgreSQL starts, it allocates the shared buffer pool as a large virtual memory region. But allocating virtual memory and having physical memory ready to use are two different things. Indeed, Linux uses a principle called <strong>lazy allocation</strong>: the allocation is noted, but the actual physical pages are only mapped on first access.</p><p>The first time any code touches a previously-unmapped virtual address, a <strong>minor page fault</strong> occurs: the kernel allocates a physical page and stores the mapping. That takes microseconds, orders of magnitude slower than a regular read or write where the page is already mapped.</p><h1>The Problem with 4 KB Pages</h1><p>When a process accesses memory for the first time, the kernel doesn&#8217;t map it byte by byte. Instead, it maps memory in fixed-size chunks called <strong>memory pages</strong> via the page table.</p><blockquote><p><strong>NOTE</strong>: <em>We already used the word &#8220;page&#8221; to characterize data pages, meaning how PostgreSQL organizes data on disk into fixed-size 8 KB blocks. This is a different concept than a Linux page, which is the unit the kernel uses to manage physical memory.</em></p></blockquote><p>By default, a Linux memory page is 4 KB. PostgreSQL's shared buffer pool, like all memory on Linux, is backed by Linux memory pages under the hood. In Dipietro&#8217;s benchmark, the shared buffer pool was configured to 120 GB via the <code>shared_buffers</code> parameter, which at 4 KB per Linux memory page means roughly <strong>31 million memory pages</strong>. Therefore, 31 million potential first-touch page faults.</p><p>Now let&#8217;s consider what happens inside <code>StrategyGetBuffer</code>. Each backend acquires the spinlock to find a free slot in the buffer pool. To do so, it reads or writes shared memory. If that region of shared memory hasn&#8217;t been touched yet, accessing it triggers a <strong>minor page fault</strong>, meaning that the kernel has to allocate a physical memory page and store the mapping.</p><p>During a long benchmark with a 120 GB shared buffer pool, new regions keep entering the working set throughout the run, so <strong>these faults happen constantly, not just at startup</strong>. And when a fault occurs while a backend is holding the spinlock, the consequences are severe.</p><p>Indeed, we discussed that the key assumption behind spinlocks is that the lock will be released very soon. In that case, <strong>the assumption breaks</strong>: the holder is stuck inside the kernel fault handler while it stores a physical memory page mapping, and every other backend on the machine is spinning, burning CPU, waiting for a lock that won't be released until the faulting process resumes.</p><p>The impact of a fault when the lock was acquired <strong>depends on the preemption model</strong>. Let&#8217;s consider the following example. Backend <code>A</code> acquires the lock but triggers a page fault. Meanwhile, backends <code>B</code>, <code>C</code>, and <code>D</code> arrive and try to acquire the lock. Since they can&#8217;t, they spin, burning CPU on a tight loop while waiting for backend <code>A</code> to release the lock.</p><ul><li><p><strong>With </strong><code>PREEMPT_NONE</code><strong> (before Linux 7)</strong>: Once backend <code>A</code> enters the fault handler, the kernel handles the fault. Since <code>PREEMPT_NONE</code> avoids voluntary rescheduling points, backend <code>A</code> is unlikely to be scheduled away before the fault resolves and the lock is released. The spinners wait a bit longer than expected, but the damage is limited.</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_!mgvF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a1b3e34-3750-4310-b7d5-2834eb4f5b64_1920x940.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!mgvF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a1b3e34-3750-4310-b7d5-2834eb4f5b64_1920x940.png 424w, https://substackcdn.com/image/fetch/$s_!mgvF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a1b3e34-3750-4310-b7d5-2834eb4f5b64_1920x940.png 848w, https://substackcdn.com/image/fetch/$s_!mgvF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a1b3e34-3750-4310-b7d5-2834eb4f5b64_1920x940.png 1272w, https://substackcdn.com/image/fetch/$s_!mgvF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a1b3e34-3750-4310-b7d5-2834eb4f5b64_1920x940.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!mgvF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a1b3e34-3750-4310-b7d5-2834eb4f5b64_1920x940.png" width="601" height="294.3083791208791" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0a1b3e34-3750-4310-b7d5-2834eb4f5b64_1920x940.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:713,&quot;width&quot;:1456,&quot;resizeWidth&quot;:601,&quot;bytes&quot;:161722,&quot;alt&quot;:&quot;Timeline diagram showing Backend A holding a spinlock through a page fault under PREEMPT_NONE, while Backends B, C, and D spin waiting. Backend A releases the lock promptly after the fault is resolved.&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://read.thecoder.cafe/i/195747188?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a1b3e34-3750-4310-b7d5-2834eb4f5b64_1920x940.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Timeline diagram showing Backend A holding a spinlock through a page fault under PREEMPT_NONE, while Backends B, C, and D spin waiting. Backend A releases the lock promptly after the fault is resolved." title="Timeline diagram showing Backend A holding a spinlock through a page fault under PREEMPT_NONE, while Backends B, C, and D spin waiting. Backend A releases the lock promptly after the fault is resolved." srcset="https://substackcdn.com/image/fetch/$s_!mgvF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a1b3e34-3750-4310-b7d5-2834eb4f5b64_1920x940.png 424w, https://substackcdn.com/image/fetch/$s_!mgvF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a1b3e34-3750-4310-b7d5-2834eb4f5b64_1920x940.png 848w, https://substackcdn.com/image/fetch/$s_!mgvF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a1b3e34-3750-4310-b7d5-2834eb4f5b64_1920x940.png 1272w, https://substackcdn.com/image/fetch/$s_!mgvF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a1b3e34-3750-4310-b7d5-2834eb4f5b64_1920x940.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>With </strong><code>PREEMPT_LAZY</code><strong> (Linux 7 and beyond)</strong>: The scheduler may decide to preempt backend A while it&#8217;s still inside the fault handler, scheduling another process in its place. Backend <code>A</code> won&#8217;t resume until the scheduler hands control back to it, which can take some time, even after the fault is fully handled:</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_!ZS3b!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60aa597f-1b91-458e-a13a-90a07152da52_2360x1000.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZS3b!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60aa597f-1b91-458e-a13a-90a07152da52_2360x1000.png 424w, https://substackcdn.com/image/fetch/$s_!ZS3b!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60aa597f-1b91-458e-a13a-90a07152da52_2360x1000.png 848w, https://substackcdn.com/image/fetch/$s_!ZS3b!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60aa597f-1b91-458e-a13a-90a07152da52_2360x1000.png 1272w, https://substackcdn.com/image/fetch/$s_!ZS3b!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60aa597f-1b91-458e-a13a-90a07152da52_2360x1000.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZS3b!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60aa597f-1b91-458e-a13a-90a07152da52_2360x1000.png" width="1456" height="617" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/60aa597f-1b91-458e-a13a-90a07152da52_2360x1000.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:617,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:193126,&quot;alt&quot;:&quot;Timeline diagram showing Backend A preempted mid-fault under PREEMPT_LAZY, with an extra time window before it resumes. Backends B, C, and D keep spinning for longer, compounding CPU waste.&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://read.thecoder.cafe/i/195747188?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60aa597f-1b91-458e-a13a-90a07152da52_2360x1000.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Timeline diagram showing Backend A preempted mid-fault under PREEMPT_LAZY, with an extra time window before it resumes. Backends B, C, and D keep spinning for longer, compounding CPU waste." title="Timeline diagram showing Backend A preempted mid-fault under PREEMPT_LAZY, with an extra time window before it resumes. Backends B, C, and D keep spinning for longer, compounding CPU waste." srcset="https://substackcdn.com/image/fetch/$s_!ZS3b!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60aa597f-1b91-458e-a13a-90a07152da52_2360x1000.png 424w, https://substackcdn.com/image/fetch/$s_!ZS3b!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60aa597f-1b91-458e-a13a-90a07152da52_2360x1000.png 848w, https://substackcdn.com/image/fetch/$s_!ZS3b!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60aa597f-1b91-458e-a13a-90a07152da52_2360x1000.png 1272w, https://substackcdn.com/image/fetch/$s_!ZS3b!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60aa597f-1b91-458e-a13a-90a07152da52_2360x1000.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 spinlock hold time goes from &#8220;<em>duration of the fault</em>&#8221; to &#8220;<em>duration of the fault + time waiting for the scheduler</em>.&#8221; And that extra wait, let&#8217;s call it <code>t</code>, is not just <code>t</code> of wasted CPU; instead, <strong>it is </strong><code>t</code><strong> multiplied by every backend currently spinning</strong>. In the previous example, backends B, C, and D each burn <code>t</code> extra cycles, making the total waste <code>3t</code>. On a 96-vCPU machine with hundreds of backends, that multiplier is devastating. That's how the benchmark ended up with 56% of the CPU burning in <code>s_lock</code>.</p><p>That extra time waiting for the scheduler was the root cause of the issue.</p><h1>Huge Pages to the Rescue</h1><p>Fortunately, there is an option to overcome this issue in PostgreSQL.</p><p>The main variable we discussed was <code>shared_buffers</code>, 120 GB in the benchmark, meaning roughly 31 million memory pages. But there is another variable we can adjust: <strong>the size of a memory page</strong>.</p><p>As we said, it defaults to 4 KB, but the kernel supports larger pages called <strong>huge pages</strong>. On x86_64 and ARM64, the supported sizes are 2 MB and 1 GB:</p><ul><li><p><strong>4 KB pages</strong>: ~31,000,000 potential page faults</p></li><li><p><strong>2 MB huge pages</strong>: ~61,440 potential page faults</p></li><li><p><strong>1 GB huge pages</strong>: ~120 potential page faults</p></li></ul><p>Increasing the size of a memory page reduces the number of potential page faults but also reduces TLB pressure. Indeed, far fewer entries need to cover the same memory, so the working set fits comfortably in the TLB, meaning far fewer TLB misses and page table walks on the hot path. Overall, <code>StrategyGetBuffer</code> stops triggering faults while holding the lock. The lock holder finishes quickly. The other backends wait microseconds instead of milliseconds. <strong>The regression disappears</strong>.</p><blockquote><p><strong>NOTE</strong>: <em>Setting huge pages in PostgreSQL is controlled by the </em><code>huge_pages</code><em> configuration parameter, which accepts three values: </em><code>off</code><em>, </em><code>on</code><em>, and </em><code>try</code><em> (the default). With </em><code>try</code><em>, PostgreSQL uses huge pages if available and silently falls back to 4 KB pages otherwise. Use </em><code>on</code><em> instead so PostgreSQL fails to start rather than running misconfigured without you noticing. The size of the huge pages themselves is a Linux configuration.</em></p></blockquote><p>However, setting huge pages is <strong>not without tradeoffs</strong>. Huge pages are pre-allocated and reserved upfront, meaning that memory is no longer available to the rest of the system even if PostgreSQL isn&#8217;t using it all. There is also a memory waste concern: a huge page is allocated as a whole, so if only a fraction of it is used, the rest is wasted. For most production PostgreSQL deployments with large <code>shared_buffers</code>, these tradeoffs are probably worth it, but they are good to know about.</p><h1>What Happens Next?</h1><p>Peter Zijlstra, the Intel kernel engineer who authored the preemption change, proposed a fix: PostgreSQL should adopt Restartable Sequences (<code>rseq</code>), a Linux kernel facility that lets userspace code <strong>detect whether it was preempted or migrated during a critical section</strong> and restart it if so. PostgreSQL's spinlock paths would use <code>rseq</code> to detect preemption and retry, avoiding the scenario where a preempted lock holder stalls all waiting backends.</p><p>The PostgreSQL community&#8217;s response was not enthusiastic. Using a kernel facility specifically to recover performance that PostgreSQL had for free before Linux 7.0 is a tough sell. Meanwhile, it would also go against kernel&#8217;s long-standing principle of <strong>not breaking userspace</strong>: if software worked correctly before a kernel upgrade, it should work correctly after.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://read.thecoder.cafe" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://read.thecoder.cafe&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">AI is getting better every day. Are you? At The Coder Cafe, we serve fundamental concepts to make you an engineer that AI won&#8217;t replace. Written by a Google SWE, trusted by thousands of engineers worldwide.</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><h1>Summary</h1><ul><li><p>Linux 7.0 removed <code>PREEMPT_NONE</code> on modern CPU architectures, leaving only <code>PREEMPT_FULL</code> and <code>PREEMPT_LAZY</code>. On most distributions, the default shifted to <code>PREEMPT_LAZY</code>.</p></li><li><p>An AWS engineer benchmarked PostgreSQL on a 96-vCPU Graviton4 and found throughput cut in half on Linux 7.0, with 55% of CPU burning inside a single spinlock in <code>StrategyGetBuffer</code>.</p></li><li><p>The root cause is minor page faults occurring while a backend holds the spinlock. With 4 KB memory pages backing a 120 GB <code>shared_buffers</code>, there are up to 31 million potential first-touch faults throughout a benchmark run.</p></li><li><p>Under <code>PREEMPT_NONE</code>, the faulting process resumed quickly and released the lock. Under <code>PREEMPT_LAZY</code>, the scheduler may preempt it mid-fault, extending the hold time and causing every waiting backend to keep spinning.</p></li><li><p>Enabling huge pages (2 MB or 1 GB) reduces the number of potential faults by orders of magnitude and eliminates TLB pressure, making the regression disappear.</p></li></ul><h1>Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/systems">Systems</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/soft-lockup-hard-lockup">Linux Soft vs. Hard Lockup</a></p></li><li><p><a href="https://read.thecoder.cafe/p/instruction-pipelining">Instruction Pipelining Explained</a></p></li><li><p><a href="https://read.thecoder.cafe/p/simultaneous-multithreading">Simultaneous Multithreading Explained</a></p></li></ul><h2>Sources</h2><ul><li><p><a href="https://lkml.org/lkml/2026/4/3/1379">[PATCH 0/1] sched: Restore PREEMPT_NONE as default</a></p></li><li><p><a href="https://www.phoronix.com/news/Linux-7.0-AWS-PostgreSQL-Drop">AWS Engineer Reports PostgreSQL Performance Halved By Linux 7.0, But A Fix May Not Be Easy</a></p></li><li><p><a href="https://thebuild.com/blog/2026/04/23/preempt_none-is-dead-your-postgres-probably-doesnt-care/">PREEMPT_NONE Is Dead; Your Postgres Probably Doesn&#8217;t Care</a></p></li></ul><h2>Explore Further</h2><ul><li><p><a href="https://lwn.net/Articles/994322/">The long road to lazy preemption</a></p></li><li><p><a href="https://www.interdb.jp/pg/pgsql08.html">Buffer Manager</a></p></li><li><p><a href="https://lwn.net/Articles/374424/">Huge pages</a></p></li><li><p><a href="https://docs.kernel.org/userspace-api/rseq.html">Restartable Sequences</a></p></li></ul>]]></content:encoded></item><item><title><![CDATA[Systems Thinking Explained]]></title><description><![CDATA[Your system isn't broken because of bad engineering. It's broken because you're reacting to events without seeing the structure that produces them.]]></description><link>https://read.thecoder.cafe/p/systems-thinking</link><guid isPermaLink="false">https://read.thecoder.cafe/p/systems-thinking</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Wed, 22 Apr 2026 16:01:48 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!tNVN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5e7656c-e92f-4b30-94c5-83647c4aa80d_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>&#9749; <em>Welcome to The Coder Cafe! In a <a href="https://read.thecoder.cafe/p/paternity-leave">previous post</a>, I briefly touched on systems thinking after reading <a href="https://www.goodreads.com/fr/book/show/205977642-learning-systems-thinking">Learning Systems Thinking</a>. My honest take: it was an interesting introduction, but I wasn&#8217;t fully convinced. The concepts felt abstract, the examples too sparse. Then I read <a href="https://www.goodreads.com/book/show/3828902-thinking-in-systems">Thinking in Systems</a> by Donella Meadows. It might be one of the best books I&#8217;ve read in my career (and it&#8217;s not even a computer science book). This post is my own introduction to the core concepts, grounded in a real example from my experience. Get cozy, grab a coffee, and let&#8217;s begin!</em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tNVN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5e7656c-e92f-4b30-94c5-83647c4aa80d_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tNVN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5e7656c-e92f-4b30-94c5-83647c4aa80d_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!tNVN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5e7656c-e92f-4b30-94c5-83647c4aa80d_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!tNVN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5e7656c-e92f-4b30-94c5-83647c4aa80d_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!tNVN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5e7656c-e92f-4b30-94c5-83647c4aa80d_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tNVN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5e7656c-e92f-4b30-94c5-83647c4aa80d_1600x800.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5e7656c-e92f-4b30-94c5-83647c4aa80d_1600x800.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;:1672940,&quot;alt&quot;:&quot;Your system isn't broken because of bad engineering. It's broken because you're reacting to events without seeing the structure that produces them.&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://read.thecoder.cafe/i/194202818?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5e7656c-e92f-4b30-94c5-83647c4aa80d_1600x800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Your system isn't broken because of bad engineering. It's broken because you're reacting to events without seeing the structure that produces them." title="Your system isn't broken because of bad engineering. It's broken because you're reacting to events without seeing the structure that produces them." srcset="https://substackcdn.com/image/fetch/$s_!tNVN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5e7656c-e92f-4b30-94c5-83647c4aa80d_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!tNVN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5e7656c-e92f-4b30-94c5-83647c4aa80d_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!tNVN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5e7656c-e92f-4b30-94c5-83647c4aa80d_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!tNVN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5e7656c-e92f-4b30-94c5-83647c4aa80d_1600x800.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg 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><h1>Introduction</h1><p>Have you ever fixed an incident, only to see it come back two weeks later? Or made a change that improved one metric while quietly degrading another? Or spent months firefighting without ever feeling like things were actually getting better?</p><p>These aren&#8217;t signs of bad engineering. They&#8217;re signs of reacting to events without understanding the structures that produce them.</p><p>Understanding those structures requires a different kind of thinking, and that&#8217;s exactly what systems thinking is: <strong>the ability to shift from reacting to events through responsive patterns of behaviors to generating improved systemic structures.</strong></p><p>This post is an introduction to systems thinking, covering the core concepts through a real example from my experience at Google.</p><h1>What Is a System?</h1><p>First, let&#8217;s define what a system is. In essence, a system is:</p><ul><li><p>A set of <strong>elements</strong></p></li><li><p><strong>Interconnected</strong></p></li><li><p>To <strong>achieve something</strong></p></li></ul><p>Distributed systems are an obvious example. For example, a 3-node, single leader database is composed of:</p><ul><li><p>3 nodes (elements)</p></li><li><p>Connections from the leader to the replicas (interconnections)</p></li><li><p>With the goal of storing data reliably over time</p></li></ul><p>Interestingly, this is why distributed systems can surprise even their own designers: add enough nodes, replication lag, and competing writes, and the system starts behaving in ways no single component would predict.</p><h1>Stocks and Flows</h1><p>To reason about how systems change over time, we need two important concepts:</p><ul><li><p>A <strong>stock</strong> is an accumulation of material or information that has built up in a system over time. For example: the number of machines available in a cluster, the size of a message queue, the amount of technical debt in a codebase.</p></li><li><p>A <strong>flow</strong> is what changes a stock: material or information entering or leaving it. For example: machines being added or removed from service, messages being enqueued and consumed, or requests being received and processed.</p></li></ul><p>The key thing to keep in mind: <strong>stocks take time to change because flows take time to flow</strong>. You can&#8217;t instantly restore machine availability or drain a queue with a single action. This has real consequences for how systems behave under pressure. We will come back to it.</p><h1>Feedback Loops</h1><p>One of the most important concepts in systems thinking is the <strong>feedback loop</strong>.</p><p>A feedback loop is what the system does automatically because its own result feeds back into it. Said differently: <strong>If </strong><code>A</code><strong> causes </strong><code>B</code><strong>, then </strong><code>B</code><strong> influences </strong><code>A</code>.</p><p>Let&#8217;s take a concrete example. Suppose you live in a house with a central thermostat set at 20&#176;C. It turns the heating on when the temperature drops to 19&#176;C, and off when it reaches 21&#176;C.</p><p>The feedback loop works like this:</p><ul><li><p><code>A</code>: Temperature change</p></li><li><p><code>B</code>: Thermostat turns heating on or off</p></li></ul><p>The thermostat turning on or off (<code>B</code>) is caused by the temperature change (<code>A</code>). But the temperature change (<code>A</code>) is in turn influenced by the thermostat (<code>B</code>). Each effect feeds back into its own cause. This is a feedback loop.</p><h1>Balancing vs. Reinforcing Feedback Loops</h1><p>There are two kinds of feedback loops.</p><ul><li><p><strong>A balancing feedback loop resists change</strong>: It pushes the system back toward a goal or limit. Think of it as a stabilizer: when something moves away from the target, the loop acts to bring it back. The thermostat is a perfect example. As the temperature drifts away from 20&#176;C, the thermostat reacts, and the system returns to equilibrium.</p></li><li><p><strong>A reinforcing feedback loop amplifies change</strong>: More leads to more, less leads to less. An action produces a result that drives more of the same action, generating growth or decline at an accelerating rate. The YouTube algorithm is a clear illustration: the more a video is viewed, the more the algorithm surfaces it; the more it&#8217;s surfaced, the more views it gets.</p></li></ul><p>More formally, we can have 4 cases of feedback loops:</p><ol><li><p><strong>Balancing ceiling</strong>: If <code>A&#8593;</code> causes <code>B&#8595;</code>, then <code>B&#8595;</code> influences <code>A&#8593;</code></p></li><li><p><strong>Balancing floor</strong>: If <code>A&#8595;</code> causes <code>B&#8593;</code>, then <code>B&#8593;</code> influences <code>A&#8595;</code></p></li><li><p><strong>Reinforcing growth</strong>: If <code>A&#8593;</code> causes <code>B&#8593;</code>, then <code>B&#8593;</code> influences <code>A&#8593;</code></p></li><li><p><strong>Reinforcing collapse</strong>: If <code>A&#8595;</code> causes <code>B&#8595;</code>, then <code>B&#8595;</code> influences <code>A&#8595;</code></p></li></ol><p>The more feedback loops a system contains, the more complex and surprising its behavior becomes, especially when those loops interact.</p><h1>Delays</h1><p>An often overlooked but critical property of feedback loops is the <strong>delay between an action and its effects</strong>.</p><p>Delays are pervasive in systems and strong determinants of behavior. When the gap between action and effect is long, two things happen:</p><ul><li><p><strong>Foresight becomes essential</strong>: Acting only when a problem becomes obvious means missing the window to address it early.</p></li><li><p><strong>Oscillations become likely</strong>: We overreact because the system hasn&#8217;t had time to respond, then overreact again in the other direction.</p></li></ul><p>Think of an autoscaler that takes 3 minutes to provision new instances. By the time the new capacity is ready, the traffic spike has already peaked. The window to act had opened before the problem was even visible on the dashboard. This is why foresight matters: when there is a significant delay between action and effect, reacting to what you see now means always acting too late.</p><p>And the consequences compound. The autoscaler, still responding to the old signal, overshoots. Then it sees too much capacity and scales down, right before the next spike arrives. One example, two problems: a system that needed foresight got a reaction, and then oscillated because of it.</p><p>The delay didn&#8217;t change the goal. It made the system work against itself.</p><h1>System Boundaries</h1><p>System boundaries are <strong>artificial</strong>. They help us frame a problem, but in reality, everything is interconnected. The boundaries we draw determine what we see and, therefore, what we miss.</p><p>Consider a microservices architecture in which each team owns a service. Every team has solid SLOs, careful on-call rotations, and clean dashboards. And yet end-to-end latency keeps creeping up, and users are complaining. Each team looks at its own service and sees green. The problem is that the boundary is wrong; <strong>no one is looking at the system as a whole</strong>.</p><p>This is one of the most common traps in engineering: optimizing within a boundary while the real issue lives outside it. Before changing a system, it is worth asking: Am I looking at the right boundary?</p><h1>The Iceberg Model</h1><p>When something goes wrong in a system, what do we actually see? Usually just the surface: an incident, a spike, an outage. The iceberg model gives us a way to think beneath it.</p><p>The model has four levels:</p><ul><li><p><strong>Events</strong> are what&#8217;s visible: the incident alert, the latency spike on the dashboard. This is where most of our attention goes, and where reactive thinking lives.</p></li><li><p><strong>Patterns and trends</strong> are what you find when you zoom out. Has this happened before? At what frequency? Under what circumstances? Patterns reveal that what felt like a one-off event is actually part of a larger rhythm.</p></li><li><p><strong>Structure</strong> is the underlying system design: the feedback loops, the incentives, the processes that produce the patterns. You can&#8217;t fix a pattern without understanding the structure that generates it.</p></li><li><p><strong>Mental models</strong> are the beliefs and assumptions that shaped the structure in the first place. They&#8217;re the hardest to see and the hardest to change.</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_!x4-R!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbbbeb47-087b-4493-9709-47480f9ad04c_934x958.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!x4-R!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbbbeb47-087b-4493-9709-47480f9ad04c_934x958.png 424w, https://substackcdn.com/image/fetch/$s_!x4-R!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbbbeb47-087b-4493-9709-47480f9ad04c_934x958.png 848w, https://substackcdn.com/image/fetch/$s_!x4-R!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbbbeb47-087b-4493-9709-47480f9ad04c_934x958.png 1272w, https://substackcdn.com/image/fetch/$s_!x4-R!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbbbeb47-087b-4493-9709-47480f9ad04c_934x958.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!x4-R!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbbbeb47-087b-4493-9709-47480f9ad04c_934x958.png" width="499" height="511.8222698072805" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fbbbeb47-087b-4493-9709-47480f9ad04c_934x958.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:958,&quot;width&quot;:934,&quot;resizeWidth&quot;:499,&quot;bytes&quot;:521806,&quot;alt&quot;:&quot;Iceberg model diagram illustrating four levels of systems thinking: Events (visible above the waterline, asking \&quot;What is happening?\&quot;), Patterns and Trends (just below the surface, asking \&quot;What trends are there over time?\&quot;), Structure (deeper underwater, asking \&quot;How are the patterns related?\&quot;), and Mental Models (at the bottom, asking \&quot;What values and beliefs shape the system?\&quot;), moving from visible to invisible layers of understanding.&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://read.thecoder.cafe/i/194202818?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbbbeb47-087b-4493-9709-47480f9ad04c_934x958.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Iceberg model diagram illustrating four levels of systems thinking: Events (visible above the waterline, asking &quot;What is happening?&quot;), Patterns and Trends (just below the surface, asking &quot;What trends are there over time?&quot;), Structure (deeper underwater, asking &quot;How are the patterns related?&quot;), and Mental Models (at the bottom, asking &quot;What values and beliefs shape the system?&quot;), moving from visible to invisible layers of understanding." title="Iceberg model diagram illustrating four levels of systems thinking: Events (visible above the waterline, asking &quot;What is happening?&quot;), Patterns and Trends (just below the surface, asking &quot;What trends are there over time?&quot;), Structure (deeper underwater, asking &quot;How are the patterns related?&quot;), and Mental Models (at the bottom, asking &quot;What values and beliefs shape the system?&quot;), moving from visible to invisible layers of understanding." srcset="https://substackcdn.com/image/fetch/$s_!x4-R!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbbbeb47-087b-4493-9709-47480f9ad04c_934x958.png 424w, https://substackcdn.com/image/fetch/$s_!x4-R!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbbbeb47-087b-4493-9709-47480f9ad04c_934x958.png 848w, https://substackcdn.com/image/fetch/$s_!x4-R!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbbbeb47-087b-4493-9709-47480f9ad04c_934x958.png 1272w, https://substackcdn.com/image/fetch/$s_!x4-R!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbbbeb47-087b-4493-9709-47480f9ad04c_934x958.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><figcaption class="image-caption"><a href="https://www.goodreads.com/fr/book/show/205977642-learning-systems-thinking">Credits</a></figcaption></figure></div><p>Most incident response lives at the event level. Systems thinking asks us to go deeper. As an SRE, this model resonates: we&#8217;re trained not just to react to incidents but to understand the why: the patterns, the structures, and eventually the assumptions that caused them.</p><h1>A Concrete Example: Safe Removal Service</h1><p>Let me now bring all of these concepts together through a concrete example from my previous role at Google, where I worked on the systems powering Google&#8217;s ML infrastructure.</p><p>I was heavily focused on a system called the Safe Removal Service<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a> (SRS). This service had a simple API and one core responsibility: to say yes or no when another system requested permission to <strong>disrupt a given entity</strong>. Indeed, most disruptive services at Google, the ones that reboot machines, drain jobs, or take clusters offline, were designed to ask this service before acting.</p><p>In our context, the key constraint was preserving capacity, meaning ML TPUs and GPUs. For example, within a given cluster, at least 90% of TPUs must remain available at all times. So if 95% were currently available, SRS could approve disruptions, as long as availability didn&#8217;t drop below 90%.</p><blockquote><p><strong>NOTE</strong>: <em>The threshold values and other details have been altered for confidentiality reasons.</em></p></blockquote><p>The API was deliberately simple:</p><ul><li><p>&#8220;<em>Can I reboot this machine?</em>&#8221; &#8594; Yes/No</p></li><li><p>&#8220;<em>Can I drain this job?</em>&#8221; &#8594; Yes/No</p></li><li><p>&#8220;<em>Can I take down this cluster?</em>&#8221; &#8594; Yes/No</p></li></ul><h2>Identifying the Feedback Loops</h2><p>SRS implemented several <strong>balancing feedback loops</strong>. For example, when available capacity dropped toward 90%, the service would start refusing disruptive requests, pushing availability back up. This was the primary loop: a governor that kept the system in a safe zone.</p><p>There was also an implicit <strong>reinforcing loop</strong> on the positive side: by allowing maintenance to proceed when capacity was healthy, the service enabled machines to be upgraded, patched, and kept in good shape, which in turn kept capacity high.</p><p>So far, so good. But here&#8217;s where it gets interesting.</p><h2>The Hidden Reinforcing Loops</h2><p>The balancing loop protected current capacity. What it didn&#8217;t account for was what happened when capacity was <em>already</em> constrained.</p><p>When available capacity hovered near 90%, SRS would block most maintenance requests. Machines couldn&#8217;t be patched. Hardware with known error trends couldn&#8217;t be swapped. Security upgrades were deferred. Maintenance debt accumulated, silently, invisibly.</p><p>This created a first hidden reinforcing loop:</p><blockquote><p><em>Less capacity &#8594; Deferred maintenance &#8594; More failures &#8594; Even less capacity</em></p></blockquote><p>The balancing loop was actively feeding the very problem it was trying to prevent.</p><p>A second reinforcing loop emerged from human behavior:</p><blockquote><p><em>Low capacity &#8594; More incidents &#8594; Bypass mechanisms invoked &#8594; Riskier actions taken &#8594; Capacity lower still</em></p></blockquote><p>When the system was under stress, operators would sometimes override SRS to unblock critical work. Each bypass, reasonable in isolation, eroded the safety margins that the balancing loop was designed to protect.</p><h2>The Goal Was Inaccurately Defined</h2><p>There&#8217;s a principle from <em><a href="https://www.goodreads.com/book/show/3828902-thinking-in-systems">Thinking in Systems</a></em> that describes this precisely:</p><div class="pullquote"><p><strong>System behavior is particularly sensitive to the goals of feedback loops</strong>. If the goals&#8212;the indicators of satisfaction of the rules&#8212;are defined inaccurately or incompletely, the system may obediently work to produce a result that is not really intended or wanted.<br><strong>Specify indicators and goals that reflect the real welfare of the system</strong>. Be especially careful not to confuse effort with result or you will end up with a system that is producing effort, not result.</p></div><p>SRS was measuring the right-looking metric: current capacity. But the current capacity was not the same as the <strong>real health</strong>. A cluster at 92% availability, accumulating maintenance debt and hardware errors, was far more fragile than a cluster at 91% that was fully patched and stable. The balancing loop couldn&#8217;t tell the difference.</p><p>The deeper fix wasn&#8217;t just tuning the threshold. It was making the controller <strong>health-aware, not just capacity-aware</strong>. Rather than gating only on &#8220;<em>% available right now</em>,&#8221; the system needed to incorporate slow indicators: maintenance backlog growth rate, share of fleet on known-bad firmware versions, hardware error trendlines, override and bypass rates.</p><p>By the time the reinforcing loops made their effects visible, the stock (cluster health) had already been degrading for weeks. The delay between cause and effect made the problem invisible until it was expensive to fix. This example was not about a flawed design. It was about a structure that, taken as a whole, was quietly working against itself.</p><h1>Summary</h1><ul><li><p>A system is a set of elements interconnected to achieve a goal.</p></li><li><p>Stocks are accumulations that change over time through flows; stocks take time to change.</p></li><li><p>A feedback loop occurs when an effect feeds back into its own cause.</p></li><li><p>Balancing feedback loops resist change and push toward equilibrium; reinforcing feedback loops amplify change.</p></li><li><p>Delays between action and effect can cause oscillations and make problems invisible until too late.</p></li><li><p>System boundaries are artificial; the boundary we draw determines what we see and miss.</p></li><li><p>The iceberg model: events are visible, but patterns, structure, and mental models lie beneath.</p></li><li><p>System goals must reflect real welfare, not just what&#8217;s measurable; inaccurate goals lead to unwanted behaviors.</p></li><li><p>A well-designed balancing loop can mask hidden reinforcing dynamics. The most dangerous moment is when a system appears to be working.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://read.thecoder.cafe" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://read.thecoder.cafe&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">AI is getting better every day. Are you? At The Coder Cafe, we serve fundamental concepts to make you an engineer that AI won&#8217;t replace. Written by a Google SWE, trusted by thousands of engineers worldwide.</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><h1>Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/distributed-systems">Distributed Systems</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/complex-systems">Working on Complex Systems</a></p></li><li><p><a href="https://read.thecoder.cafe/p/probabilistic-increment">Probabilistic Increment</a></p></li><li><p><a href="https://read.thecoder.cafe/p/consensus">Consensus</a></p></li></ul><h2>Sources</h2><ul><li><p><a href="https://www.goodreads.com/book/show/3828902-thinking-in-systems">Thinking In Systems</a></p></li><li><p><a href="https://www.goodreads.com/fr/book/show/205977642-learning-systems-thinking">Learning Systems Thinking</a></p></li></ul><h2>Explore Further</h2><ul><li><p><a href="https://donellameadows.org/archives/leverage-points-places-to-intervene-in-a-system/">Leverage Points: Places to Intervene in a System</a></p></li></ul><div><hr></div><p>&#10084;&#65039; <em>If you enjoyed this post, please hit the like button.</em></p><p>&#128172; <em>Have you ever built or maintained a system that looked healthy on the dashboard while something was quietly accumulating underneath?</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/p/systems-thinking/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.thecoder.cafe/p/systems-thinking/comments"><span>Leave a comment</span></a></p><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-1" href="#footnote-anchor-1" class="footnote-number" contenteditable="false" target="_self">1</a><div class="footnote-content"><p>I already mentioned that service in a previous post. You can find more information in this whitepaper: <a href="https://dl.acm.org/doi/pdf/10.1145/3296975.3186415">VM Live Migration At Scale</a>.</p></div></div>]]></content:encoded></item><item><title><![CDATA[How an SSD Works]]></title><description><![CDATA[Your SSD doesn't just store data, it relies on quantum physics to do it.]]></description><link>https://read.thecoder.cafe/p/how-an-ssd-works</link><guid isPermaLink="false">https://read.thecoder.cafe/p/how-an-ssd-works</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Wed, 15 Apr 2026 10:01:11 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!8SqT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69dca22d-8fd3-4fc1-9caa-f62ce2c62eb4_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>&#9749; <em>Welcome to The Coder Cafe! Today, we explore quantum physics. Not the abstract kind, but the kind that runs inside the device you are reading this on. Indeed, every time you save a file to an SSD, electrons exploit quantum physics to cross a physical barrier they classically have no business crossing. I&#8217;m not a physicist, but I&#8217;ve been in love with quantum physics for years, and over the last few months I've gone deep into these concepts. Get cozy, grab a coffee, and let&#8217;s begin!</em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8SqT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69dca22d-8fd3-4fc1-9caa-f62ce2c62eb4_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8SqT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69dca22d-8fd3-4fc1-9caa-f62ce2c62eb4_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!8SqT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69dca22d-8fd3-4fc1-9caa-f62ce2c62eb4_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!8SqT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69dca22d-8fd3-4fc1-9caa-f62ce2c62eb4_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!8SqT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69dca22d-8fd3-4fc1-9caa-f62ce2c62eb4_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8SqT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69dca22d-8fd3-4fc1-9caa-f62ce2c62eb4_1600x800.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/69dca22d-8fd3-4fc1-9caa-f62ce2c62eb4_1600x800.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;:1653007,&quot;alt&quot;:&quot;Your SSD doesn't just store data, it relies on quantum physics to do it.&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://read.thecoder.cafe/i/193899126?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69dca22d-8fd3-4fc1-9caa-f62ce2c62eb4_1600x800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Your SSD doesn't just store data, it relies on quantum physics to do it." title="Your SSD doesn't just store data, it relies on quantum physics to do it." srcset="https://substackcdn.com/image/fetch/$s_!8SqT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69dca22d-8fd3-4fc1-9caa-f62ce2c62eb4_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!8SqT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69dca22d-8fd3-4fc1-9caa-f62ce2c62eb4_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!8SqT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69dca22d-8fd3-4fc1-9caa-f62ce2c62eb4_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!8SqT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69dca22d-8fd3-4fc1-9caa-f62ce2c62eb4_1600x800.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg 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><h1>An Introduction to Matter</h1><p>To start, what is matter? Matter is made up of molecules, and molecules are assemblages of <strong>atoms</strong>, the building blocks of matter. For example, water is an H&#8322;O molecule: 2 hydrogen atoms and 1 oxygen atom.</p><p>An atom is itself composed of a <strong>nucleus and electrons</strong>, which carry a negative charge and orbit around it.</p><p>The nucleus contains two types of particles:</p><ul><li><p><strong>Protons</strong>, which carry a positive charge, naturally repel each other.</p></li><li><p>And <strong>neutrons</strong>, which carry no electric charge and act as a kind of &#8220;glue,&#8221; helping to keep the nucleus stable.</p></li></ul><p>The attraction between electrons (&#8722;) and protons (+) keeps the whole thing in a <strong>stable state</strong>.</p><p>On the other hand, too few or too many neutrons relative to the protons, and the nucleus becomes unstable. It will eventually decay by emitting energy. This is the principle of radioactivity. Carbon-14, for example, is slightly unstable. It decays slowly and predictably. This predictability allows it to be used as a clock to date ancient elements.</p><p>One might think that when touching a solid object, like a table, for instance, what gives the table its <strong>solidity</strong> is that it is &#8220;filled&#8221; with matter, preventing our finger from passing through. Yet, if we took the nucleus and enlarged it into a marble and placed that marble on a football pitch, the electrons would be orbiting at the level of the stands.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9O8t!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c8b7214-b1bf-4ee0-81df-2195fcfbc05a_1714x954.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9O8t!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c8b7214-b1bf-4ee0-81df-2195fcfbc05a_1714x954.png 424w, https://substackcdn.com/image/fetch/$s_!9O8t!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c8b7214-b1bf-4ee0-81df-2195fcfbc05a_1714x954.png 848w, https://substackcdn.com/image/fetch/$s_!9O8t!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c8b7214-b1bf-4ee0-81df-2195fcfbc05a_1714x954.png 1272w, https://substackcdn.com/image/fetch/$s_!9O8t!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c8b7214-b1bf-4ee0-81df-2195fcfbc05a_1714x954.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9O8t!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c8b7214-b1bf-4ee0-81df-2195fcfbc05a_1714x954.png" width="1456" height="810" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6c8b7214-b1bf-4ee0-81df-2195fcfbc05a_1714x954.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:810,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:97558,&quot;alt&quot;:&quot;Diagram illustrating the scale of an atom using a football pitch analogy: a red dot representing the nucleus sits at the centre circle, while blue dots representing electrons orbit at the level of the surrounding stands, with the vast green pitch in between labelled \&quot;empty\&quot; &#8212; demonstrating that matter is mostly empty space.&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://read.thecoder.cafe/i/193899126?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c8b7214-b1bf-4ee0-81df-2195fcfbc05a_1714x954.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Diagram illustrating the scale of an atom using a football pitch analogy: a red dot representing the nucleus sits at the centre circle, while blue dots representing electrons orbit at the level of the surrounding stands, with the vast green pitch in between labelled &quot;empty&quot; &#8212; demonstrating that matter is mostly empty space." title="Diagram illustrating the scale of an atom using a football pitch analogy: a red dot representing the nucleus sits at the centre circle, while blue dots representing electrons orbit at the level of the surrounding stands, with the vast green pitch in between labelled &quot;empty&quot; &#8212; demonstrating that matter is mostly empty space." srcset="https://substackcdn.com/image/fetch/$s_!9O8t!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c8b7214-b1bf-4ee0-81df-2195fcfbc05a_1714x954.png 424w, https://substackcdn.com/image/fetch/$s_!9O8t!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c8b7214-b1bf-4ee0-81df-2195fcfbc05a_1714x954.png 848w, https://substackcdn.com/image/fetch/$s_!9O8t!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c8b7214-b1bf-4ee0-81df-2195fcfbc05a_1714x954.png 1272w, https://substackcdn.com/image/fetch/$s_!9O8t!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c8b7214-b1bf-4ee0-81df-2195fcfbc05a_1714x954.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><figcaption class="image-caption">If the nucleus of an atom were the size of a marble placed at the center of a football pitch, the electrons would only be found orbiting at the level of the distant stands with almost nothing in between.</figcaption></figure></div><p>An atom is therefore <strong>almost entirely empty</strong>. Solid matter is almost nothing, and what gives this impression of solidity are forces between atoms called <strong>electromagnetic forces</strong>.</p><h1>The Fundamental Forces in the Universe</h1><p>The universe is made up of 4 and only 4 fundamental forces:</p><ul><li><p><strong>Gravity</strong>: Attracts everything with mass toward everything else with mass.</p></li><li><p><strong>The strong nuclear force</strong>: It glues protons and neutrons together inside the nucleus.</p></li><li><p><strong>The weak nuclear force</strong>: Responsible for certain radioactive decays. It is what allows a neutron to transform into a proton (or vice versa).</p></li><li><p>And <strong>the electromagnetic force</strong>.</p></li></ul><p>If we focus on this last one, it is the one that:</p><ul><li><p><strong>Attracts</strong> opposite charges</p></li><li><p>And <strong>repels</strong> identical charges.</p></li></ul><p>Unlike the two nuclear forces, which only act inside the nucleus, the electromagnetic force has an infinite range. That is why it is the one that governs interactions between atoms at our scale.</p><p>It is therefore the electromagnetic force that creates the <strong>illusion of solidity</strong>. When we touch a table, it is the electrons in our hand and those in the table that repel each other. We never truly touch anything.</p><h1>Light: Wave and Particle</h1><p>Let&#8217;s now talk about light. So, <strong>what is light</strong>? It is an electromagnetic wave, a disturbance of the electric and magnetic fields that propagates through space.</p><p>Light is a <strong>spectrum</strong>. Indeed, so-called visible light, the light our eyes can perceive, is only a tiny portion of what exists. The full spectrum is called the electromagnetic spectrum:</p><blockquote><p><em>Radio wave &#8594; Microwave &#8594; Infrared &#8594; Visible light &#8594; UV &#8594; X-rays &#8594; Gamma rays</em></p></blockquote><p>When a radio picks up radio waves, it is therefore picking up light, invisible due to its frequency. Indeed, what varies across the electromagnetic spectrum is the frequency of the wave, and therefore its energy.</p><p><strong>But light hides a surprise: it is also a particle.</strong></p><blockquote><p><strong>NOTE</strong>: <em>A particle can be summarized as follows: an indivisible packet of energy.</em></p></blockquote><p>We know it is a particle thanks to Einstein in 1905 (for which he received his only Nobel Prize, not for relativity). When a light bulb emits light, it emits specific particles called photons.</p><p>When we vary the intensity of that light bulb, one might assume it is the energy of the photon that varies, but that is not the case. The energy of each photon is fixed by its frequency. The higher the frequency of a photon, the more energetic each photon is. That is why, for example, UV rays burn the skin.</p><p>What makes a light bulb emit more light is the increase in electric voltage, which therefore produces more photons. It is the <strong>quantity of photons</strong> that makes a light bulb shine more or less.</p><p>In flight, the photon behaves like a <strong>wave</strong>: it propagates, it oscillates, and it can interfere with other photons. But when it comes into contact with matter, it behaves like a particle: it interacts in one single hit, in one single place.</p><p>When a photon collides with matter, it can either be:</p><ul><li><p><strong>Absorbed</strong>: The photon ceases to exist. Its energy is transferred to an atom, which moves to a higher energy level. This is what an eye does: it absorbs the photon and converts it into an electrical signal.</p></li><li><p><strong>Reflected</strong>: Technically, this is not a true reflection because it is not the same photon that leaves. The atom absorbs the photon and then re-emits a photon of the same energy in a different direction.</p></li></ul><blockquote><p><strong>NOTE</strong>: <em>What determines whether a photon is absorbed or reflected depends on the energy levels of the electrons in the atoms of the surface. If the photon&#8217;s frequency matches an available energy level, the atom absorbs it. Otherwise, the photon is re-emitted. That is why glass is transparent, why the retina absorbs light, and why a mirror reflects almost everything.</em></p></blockquote><h1>The Young&#8217;s Double-Slit Experiment</h1><p>We have seen that light is a wave. But how do we know this? This is where <strong>Young&#8217;s double-slit experiment</strong> comes in, and it is this very experiment that will lay the foundations of quantum physics.</p><p>Young&#8217;s experiment, carried out for the first time in 1801, is as follows:</p><ul><li><p>A <strong>laser</strong> projects photons (light)</p></li><li><p>A <strong>wall</strong> with two small slits, A and B</p></li><li><p>A <strong>screen</strong> behind to detect where the photons land</p></li></ul><p>If light were a &#8220;packet&#8221; of something, we would see the following result:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!SGSt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafe707db-e177-4a6a-8443-cf14db8261c2_1920x919.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!SGSt!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafe707db-e177-4a6a-8443-cf14db8261c2_1920x919.png 424w, https://substackcdn.com/image/fetch/$s_!SGSt!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafe707db-e177-4a6a-8443-cf14db8261c2_1920x919.png 848w, https://substackcdn.com/image/fetch/$s_!SGSt!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafe707db-e177-4a6a-8443-cf14db8261c2_1920x919.png 1272w, https://substackcdn.com/image/fetch/$s_!SGSt!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafe707db-e177-4a6a-8443-cf14db8261c2_1920x919.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!SGSt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafe707db-e177-4a6a-8443-cf14db8261c2_1920x919.png" width="600" height="287.22527472527474" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/afe707db-e177-4a6a-8443-cf14db8261c2_1920x919.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:697,&quot;width&quot;:1456,&quot;resizeWidth&quot;:600,&quot;bytes&quot;:112185,&quot;alt&quot;:&quot;Diagram of Young's double-slit experiment showing a light source emitting waves toward a barrier with two vertical slits (A and B), with the light passing through and projecting two distinct bright bands onto a detection screen &#8212; illustrating the expected particle behaviour if light travelled as discrete packets.&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://read.thecoder.cafe/i/193899126?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafe707db-e177-4a6a-8443-cf14db8261c2_1920x919.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Diagram of Young's double-slit experiment showing a light source emitting waves toward a barrier with two vertical slits (A and B), with the light passing through and projecting two distinct bright bands onto a detection screen &#8212; illustrating the expected particle behaviour if light travelled as discrete packets." title="Diagram of Young's double-slit experiment showing a light source emitting waves toward a barrier with two vertical slits (A and B), with the light passing through and projecting two distinct bright bands onto a detection screen &#8212; illustrating the expected particle behaviour if light travelled as discrete packets." srcset="https://substackcdn.com/image/fetch/$s_!SGSt!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafe707db-e177-4a6a-8443-cf14db8261c2_1920x919.png 424w, https://substackcdn.com/image/fetch/$s_!SGSt!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafe707db-e177-4a6a-8443-cf14db8261c2_1920x919.png 848w, https://substackcdn.com/image/fetch/$s_!SGSt!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafe707db-e177-4a6a-8443-cf14db8261c2_1920x919.png 1272w, https://substackcdn.com/image/fetch/$s_!SGSt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafe707db-e177-4a6a-8443-cf14db8261c2_1920x919.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><figcaption class="image-caption">If light behaved purely as a particle, firing it through two slits would simply produce two bright bands on the screen, one for each slit (<a href="https://douglasphillipsbooks.com/blog/the-double-slit-experiment">credits</a>).</figcaption></figure></div><p>Yet, the result of Young&#8217;s double-slit experiment is as follows:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!DtMu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935aab51-7f46-4348-8567-c80340518280_1920x919.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!DtMu!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935aab51-7f46-4348-8567-c80340518280_1920x919.png 424w, https://substackcdn.com/image/fetch/$s_!DtMu!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935aab51-7f46-4348-8567-c80340518280_1920x919.png 848w, https://substackcdn.com/image/fetch/$s_!DtMu!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935aab51-7f46-4348-8567-c80340518280_1920x919.png 1272w, https://substackcdn.com/image/fetch/$s_!DtMu!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935aab51-7f46-4348-8567-c80340518280_1920x919.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!DtMu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935aab51-7f46-4348-8567-c80340518280_1920x919.png" width="599" height="286.7465659340659" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/935aab51-7f46-4348-8567-c80340518280_1920x919.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:697,&quot;width&quot;:1456,&quot;resizeWidth&quot;:599,&quot;bytes&quot;:128723,&quot;alt&quot;:&quot;Diagram of Young's double-slit experiment showing the actual observed result: a light source emitting waves through a double-slit barrier, producing a quantum interference pattern of multiple alternating light and dark bands on the detection screen &#8212; demonstrating that light behaves as a wave, not a particle.&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://read.thecoder.cafe/i/193899126?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935aab51-7f46-4348-8567-c80340518280_1920x919.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Diagram of Young's double-slit experiment showing the actual observed result: a light source emitting waves through a double-slit barrier, producing a quantum interference pattern of multiple alternating light and dark bands on the detection screen &#8212; demonstrating that light behaves as a wave, not a particle." title="Diagram of Young's double-slit experiment showing the actual observed result: a light source emitting waves through a double-slit barrier, producing a quantum interference pattern of multiple alternating light and dark bands on the detection screen &#8212; demonstrating that light behaves as a wave, not a particle." srcset="https://substackcdn.com/image/fetch/$s_!DtMu!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935aab51-7f46-4348-8567-c80340518280_1920x919.png 424w, https://substackcdn.com/image/fetch/$s_!DtMu!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935aab51-7f46-4348-8567-c80340518280_1920x919.png 848w, https://substackcdn.com/image/fetch/$s_!DtMu!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935aab51-7f46-4348-8567-c80340518280_1920x919.png 1272w, https://substackcdn.com/image/fetch/$s_!DtMu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935aab51-7f46-4348-8567-c80340518280_1920x919.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><figcaption class="image-caption">Instead of two bands, light actually produces multiple alternating stripes on the screen, proof that it behaves as a wave, interfering with itself after passing through both slits simultaneously (<a href="https://douglasphillipsbooks.com/blog/the-double-slit-experiment">credits</a>).</figcaption></figure></div><p>We obtain what is called an <strong>interference pattern</strong>. The wave passes through both slits simultaneously, splits into two, and these two waves meet on the other side.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!iLkr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc8a9ebf-e0be-45c2-b43c-1eff059dfaa0_950x640.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!iLkr!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc8a9ebf-e0be-45c2-b43c-1eff059dfaa0_950x640.png 424w, https://substackcdn.com/image/fetch/$s_!iLkr!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc8a9ebf-e0be-45c2-b43c-1eff059dfaa0_950x640.png 848w, https://substackcdn.com/image/fetch/$s_!iLkr!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc8a9ebf-e0be-45c2-b43c-1eff059dfaa0_950x640.png 1272w, https://substackcdn.com/image/fetch/$s_!iLkr!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc8a9ebf-e0be-45c2-b43c-1eff059dfaa0_950x640.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!iLkr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc8a9ebf-e0be-45c2-b43c-1eff059dfaa0_950x640.png" width="501" height="337.5157894736842" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bc8a9ebf-e0be-45c2-b43c-1eff059dfaa0_950x640.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:640,&quot;width&quot;:950,&quot;resizeWidth&quot;:501,&quot;bytes&quot;:355586,&quot;alt&quot;:&quot;Illustration of the double-slit wave interference pattern: a red light source passes through a single slit, then a double slit, producing two sets of expanding semicircular wavefronts that overlap and intersect, creating a quantum interference pattern of alternating bright and dark red bands on the final detection screen.&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://read.thecoder.cafe/i/193899126?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc8a9ebf-e0be-45c2-b43c-1eff059dfaa0_950x640.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Illustration of the double-slit wave interference pattern: a red light source passes through a single slit, then a double slit, producing two sets of expanding semicircular wavefronts that overlap and intersect, creating a quantum interference pattern of alternating bright and dark red bands on the final detection screen." title="Illustration of the double-slit wave interference pattern: a red light source passes through a single slit, then a double slit, producing two sets of expanding semicircular wavefronts that overlap and intersect, creating a quantum interference pattern of alternating bright and dark red bands on the final detection screen." srcset="https://substackcdn.com/image/fetch/$s_!iLkr!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc8a9ebf-e0be-45c2-b43c-1eff059dfaa0_950x640.png 424w, https://substackcdn.com/image/fetch/$s_!iLkr!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc8a9ebf-e0be-45c2-b43c-1eff059dfaa0_950x640.png 848w, https://substackcdn.com/image/fetch/$s_!iLkr!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc8a9ebf-e0be-45c2-b43c-1eff059dfaa0_950x640.png 1272w, https://substackcdn.com/image/fetch/$s_!iLkr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc8a9ebf-e0be-45c2-b43c-1eff059dfaa0_950x640.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><figcaption class="image-caption">Where two light waves meet after passing through a double slit, they either reinforce or cancel each other out, creating an alternating pattern of bright and dark bands on the screen.</figcaption></figure></div><p>When two waves meet, they add up or cancel out depending on their respective phase:</p><ul><li><p>Two crests meeting &#8594; they add up &#8594; <strong>bright zone</strong></p></li><li><p>A crest meeting a trough &#8594; they cancel out &#8594; <strong>dark zone</strong></p></li></ul><p>The result is an alternating pattern of bright and dark bands on the screen: that is an <strong>interference pattern</strong>.</p><h1>What If We Did the Same With Matter?</h1><p>In the 20th century, researchers then had an idea: apply Young&#8217;s experiment no longer by projecting photons (light) but <strong>electrons</strong> (matter). The experiment is therefore similar, but instead of a laser, an electron gun is used to then measure on the screen where the matter lands.</p><p>Obviously, with this experiment, we are going to get two bands of matter, right?</p><p>Well, still no! <strong>An interference pattern is observed as well</strong>. This result was not a complete surprise to everyone. In 1924, physicist Louis de Broglie had already theoretically proposed that matter, like light, could have a wave-like nature. But this time, it's not a wave-like light; <strong>it's a probability wave</strong>.</p><p>This is one of the greatest discoveries in quantum physics: at the atomic level, the particle has <strong>no defined position</strong>. The position of a particle is determined by a function called the <strong>wave function</strong>, <code>&#968;(x)</code>, which describes the probabilities of finding that particle at a given location in time.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Do9R!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5fb0c01-141b-40df-9911-636dd9eeaf07_1606x506.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Do9R!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5fb0c01-141b-40df-9911-636dd9eeaf07_1606x506.png 424w, https://substackcdn.com/image/fetch/$s_!Do9R!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5fb0c01-141b-40df-9911-636dd9eeaf07_1606x506.png 848w, https://substackcdn.com/image/fetch/$s_!Do9R!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5fb0c01-141b-40df-9911-636dd9eeaf07_1606x506.png 1272w, https://substackcdn.com/image/fetch/$s_!Do9R!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5fb0c01-141b-40df-9911-636dd9eeaf07_1606x506.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Do9R!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5fb0c01-141b-40df-9911-636dd9eeaf07_1606x506.png" width="1456" height="459" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a5fb0c01-141b-40df-9911-636dd9eeaf07_1606x506.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:459,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:49106,&quot;alt&quot;:&quot;Graph of a quantum wave function &#968;(x) plotted against position x, showing a continuous blue sinusoidal wave oscillating evenly above and below zero &#8212; representing the probability wave that describes the likelihood of finding a particle at any given location.&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://read.thecoder.cafe/i/193899126?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5fb0c01-141b-40df-9911-636dd9eeaf07_1606x506.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Graph of a quantum wave function &#968;(x) plotted against position x, showing a continuous blue sinusoidal wave oscillating evenly above and below zero &#8212; representing the probability wave that describes the likelihood of finding a particle at any given location." title="Graph of a quantum wave function &#968;(x) plotted against position x, showing a continuous blue sinusoidal wave oscillating evenly above and below zero &#8212; representing the probability wave that describes the likelihood of finding a particle at any given location." srcset="https://substackcdn.com/image/fetch/$s_!Do9R!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5fb0c01-141b-40df-9911-636dd9eeaf07_1606x506.png 424w, https://substackcdn.com/image/fetch/$s_!Do9R!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5fb0c01-141b-40df-9911-636dd9eeaf07_1606x506.png 848w, https://substackcdn.com/image/fetch/$s_!Do9R!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5fb0c01-141b-40df-9911-636dd9eeaf07_1606x506.png 1272w, https://substackcdn.com/image/fetch/$s_!Do9R!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5fb0c01-141b-40df-9911-636dd9eeaf07_1606x506.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><figcaption class="image-caption">A smooth sinusoidal curve representing the wave function &#968;(x), showing how the probability of finding a particle oscillates across different positions in space.</figcaption></figure></div><p>A small clarification on this concept of undefined position to make sure the concept is clear, because this is the moment where our rational brain can start to &#8220;let go.&#8221;</p><p>Let&#8217;s take a coin for a coin toss. We throw it in the air and hide the result. We are in a state of uncertainty, but this uncertainty is called <strong>epistemic</strong>. We do not know the result (heads or tails) because we have not looked yet, yet that result already exists.</p><p>For a particle in the quantum world, the uncertainty is called <strong>ontological</strong>. It is not that we lack information about the position of the particle; it is that <strong>this position simply does not exist yet</strong>. This is what is called <strong>quantum superposition</strong>: an unmeasured particle exists in multiple states simultaneously.</p><p>However, measurement changes everything. When we measure the position of a particle, we will find it in one of the possible positions described by the wave function. We then say that <strong>the wave function &#8220;collapses&#8221;</strong> because it restricts the possibilities into a single real state.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!0E59!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b9601b1-dcb7-43db-a4ee-86987f3d4d22_1606x508.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0E59!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b9601b1-dcb7-43db-a4ee-86987f3d4d22_1606x508.png 424w, https://substackcdn.com/image/fetch/$s_!0E59!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b9601b1-dcb7-43db-a4ee-86987f3d4d22_1606x508.png 848w, https://substackcdn.com/image/fetch/$s_!0E59!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b9601b1-dcb7-43db-a4ee-86987f3d4d22_1606x508.png 1272w, https://substackcdn.com/image/fetch/$s_!0E59!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b9601b1-dcb7-43db-a4ee-86987f3d4d22_1606x508.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!0E59!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b9601b1-dcb7-43db-a4ee-86987f3d4d22_1606x508.png" width="1456" height="461" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9b9601b1-dcb7-43db-a4ee-86987f3d4d22_1606x508.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:461,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:41596,&quot;alt&quot;:&quot;Graph of a collapsed quantum wave function &#968;(x) plotted against position x, showing a single sharp spike at one point labelled \&quot;measured position\&quot; with the line flat at zero everywhere else &#8212; illustrating how the act of measurement collapses all quantum probabilities into one definite location.&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://read.thecoder.cafe/i/193899126?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b9601b1-dcb7-43db-a4ee-86987f3d4d22_1606x508.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Graph of a collapsed quantum wave function &#968;(x) plotted against position x, showing a single sharp spike at one point labelled &quot;measured position&quot; with the line flat at zero everywhere else &#8212; illustrating how the act of measurement collapses all quantum probabilities into one definite location." title="Graph of a collapsed quantum wave function &#968;(x) plotted against position x, showing a single sharp spike at one point labelled &quot;measured position&quot; with the line flat at zero everywhere else &#8212; illustrating how the act of measurement collapses all quantum probabilities into one definite location." srcset="https://substackcdn.com/image/fetch/$s_!0E59!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b9601b1-dcb7-43db-a4ee-86987f3d4d22_1606x508.png 424w, https://substackcdn.com/image/fetch/$s_!0E59!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b9601b1-dcb7-43db-a4ee-86987f3d4d22_1606x508.png 848w, https://substackcdn.com/image/fetch/$s_!0E59!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b9601b1-dcb7-43db-a4ee-86987f3d4d22_1606x508.png 1272w, https://substackcdn.com/image/fetch/$s_!0E59!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b9601b1-dcb7-43db-a4ee-86987f3d4d22_1606x508.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><figcaption class="image-caption">Once a particle&#8217;s position is measured, its wave function collapses from a spread of possibilities into a single sharp spike, pinpointing the particle at one exact location.</figcaption></figure></div><p>As an analogy, it is a bit like Minecraft. A default Minecraft map is 60 million x 60 million blocks. For the initial loading, the server does not generate the entire map. <strong>It only generates the world around the observer</strong>, i.e., the player. However, when the player moves, they force the server to generate the world's continuation.</p><p>Where this analogy reaches its limits is that the generation of the Minecraft world, even if it is random, is still <strong>deterministic</strong> because each world has its own seed. The quantum world, on the other hand, appears to be purely random, meaning without hidden information.</p><p>Let&#8217;s return to Young&#8217;s experiment. What would happen if, when a particle passes through a slit, we placed a <strong>detector</strong> there to observe which slit the particle goes through? We recall that a wave passes through both slits at once.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!t4wc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc99d158d-52b0-41e8-8886-1faaf2794f50_1920x919.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!t4wc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc99d158d-52b0-41e8-8886-1faaf2794f50_1920x919.png 424w, https://substackcdn.com/image/fetch/$s_!t4wc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc99d158d-52b0-41e8-8886-1faaf2794f50_1920x919.png 848w, https://substackcdn.com/image/fetch/$s_!t4wc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc99d158d-52b0-41e8-8886-1faaf2794f50_1920x919.png 1272w, https://substackcdn.com/image/fetch/$s_!t4wc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc99d158d-52b0-41e8-8886-1faaf2794f50_1920x919.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!t4wc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc99d158d-52b0-41e8-8886-1faaf2794f50_1920x919.png" width="599" height="286.7465659340659" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c99d158d-52b0-41e8-8886-1faaf2794f50_1920x919.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:697,&quot;width&quot;:1456,&quot;resizeWidth&quot;:599,&quot;bytes&quot;:103253,&quot;alt&quot;:&quot;Diagram of the double-slit experiment with an observer: a light source emits waves toward a double-slit barrier, with a detector eye placed beneath the slits to observe which slit the particle passes through &#8212; the screen on the right shows a question mark, indicating that the act of observation changes the outcome of the experiment.&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://read.thecoder.cafe/i/193899126?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc99d158d-52b0-41e8-8886-1faaf2794f50_1920x919.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Diagram of the double-slit experiment with an observer: a light source emits waves toward a double-slit barrier, with a detector eye placed beneath the slits to observe which slit the particle passes through &#8212; the screen on the right shows a question mark, indicating that the act of observation changes the outcome of the experiment." title="Diagram of the double-slit experiment with an observer: a light source emits waves toward a double-slit barrier, with a detector eye placed beneath the slits to observe which slit the particle passes through &#8212; the screen on the right shows a question mark, indicating that the act of observation changes the outcome of the experiment." srcset="https://substackcdn.com/image/fetch/$s_!t4wc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc99d158d-52b0-41e8-8886-1faaf2794f50_1920x919.png 424w, https://substackcdn.com/image/fetch/$s_!t4wc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc99d158d-52b0-41e8-8886-1faaf2794f50_1920x919.png 848w, https://substackcdn.com/image/fetch/$s_!t4wc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc99d158d-52b0-41e8-8886-1faaf2794f50_1920x919.png 1272w, https://substackcdn.com/image/fetch/$s_!t4wc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc99d158d-52b0-41e8-8886-1faaf2794f50_1920x919.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><figcaption class="image-caption">When a detector is added to observe which slit the particle passes through, the outcome on the screen becomes uncertain because the act of measuring the particle&#8217;s position disrupts its wave-like behavior.</figcaption></figure></div><p>This is the moment where the brain completely lets go: <strong>observing the particle changes the result of the experiment</strong>. Indeed, observing that particle &#8220;forces&#8221; it to have a defined position, and it then behaves like a classical marble. The result, therefore, gives us <strong>two bands of matter</strong>.</p><p>To summarize what we have seen so far: an unobserved particle exists as a probability wave, in multiple positions simultaneously. As soon as we measure it, this wave collapses, and the particle ends up at a precise location.</p><p>But then, why do we never see this in everyday life? The answer is <strong>decoherence</strong>.</p><h1>Decoherence</h1><p>Quantum superposition is only possible as long as a particle remains isolated from its environment. As soon as it <strong>interacts with anything</strong>, another atom, a photon, an electric field, that interaction constitutes a measurement in the quantum sense. The wave function collapses, and the particle ends up in a precise state.</p><p>An isolated electron in a vacuum can remain in superposition. But a macroscopic object like a table is made up of <strong>billions upon billions of atoms</strong> that permanently interact with the surrounding air, light photons, and electromagnetic fields. These interactions occur billions of times per second. <strong>The superposition collapses</strong> instantaneously before we can even observe it.</p><p>That is why quantum physics is only observable at the atomic scale. And that is also why a single electron in a transistor behaves very differently from an object we can hold in our hand.</p><h1>The Key is Information</h1><p>OK, so the original Young&#8217;s experiment with light produces an interference pattern because light is a wave. The variation with electrons (or indeed subsequently other elements such as atoms) also produces an interference pattern, which proves that matter is a wave, but this time a probability wave. When we measure the result, we change the result of the experiment because we force the particle to &#8220;choose&#8221; its position.</p><p>But incidentally, how does this <strong>measurement</strong> work in the experiment? It works thanks to <strong>photons</strong>. Indeed, when the electron passes through one of the slits, we project a photon which will interact with the electron and be re-emitted in a direction that allows us to deduce which slit the electron went through.</p><p>Researchers wanted to know what would happen if they performed the exact same experiment, measuring which slit the particle went through, but this time, instead of reading the information encoded in the orientation of the photon, <strong>they destroyed that information</strong>.</p><p>And here, another surprise: if we destroy the information, <strong>we return to an interference pattern</strong>. It was as if, since we were not using that information, there was nothing <strong>forcing</strong> the particle to choose which slit to go through, and so it could remain in the form of a probability wave.</p><p>This new experiment, therefore, demonstrates something fundamental in quantum physics: technically, <strong>it is not the act of measuring that influences the experiment, but whether or not this information exists somewhere in the universe</strong>. If this information is destroyed, the interference pattern returns.</p><p>The key is therefore <strong>information</strong>.</p><blockquote><p><strong>NOTE</strong>: <em>How does the destruction of this information work? One might think it would simply be a matter of having the photon absorbed by an absorbing surface before reading it, but this does not work, and we are left with bands. Indeed, by doing so, the information theoretically exists because the absorbing surface could have determined the position of the particle through the orientation of the photon. The destruction works with another incredible principle of quantum physics that I will not detail in this article: entanglement. The photon is sent onto a special crystal, which splits it into two twin photons quantumly linked. One of the twins is then destroyed, making the information unrecoverable because to read the information, one absolutely needs to read both twins. To simplify, the two twins are not copies; they form a single system whose properties are not individually defined.</em></p></blockquote><h1>The Tunnel Effect</h1><p>We are slowly getting closer to SSDs. But before that, there is one last quantum concept we need to talk about: <strong>the tunnel effect</strong>.</p><p>We said that an unobserved electron does not exist like a <em>marble</em> at a precise location. It exists as a probability wave spread out in space. This wave function gives a probability of finding the electron at each point in space.</p><p>Now let&#8217;s imagine a <strong>physical barrier</strong>. We send an electron toward this barrier. Classically, if the electron does not have enough energy to pass over it, it is blocked. Full stop.</p><p>Yet quantum mechanically, the wave function of the electron does not stop abruptly at the barrier. Because it is a wave, it propagates and gradually decays through the barrier. It does not fall to zero. On the other side, there therefore remains <strong>a non-zero probability of finding the electron</strong>.</p><p>This is the tunnel effect: a real chance for the electron to end up <strong>on the other side</strong>, without having had the classical energy needed to cross.</p><p>This probability is not fixed. It depends directly on the thickness of the barrier: the thinner the barrier, the more the wave function survives on the other side, and the higher the tunneling probability. At our scale, the barriers are far too thick for this effect to be observable. But at the scale of a few nanometers, the probability exists.</p><h1>How SSDs Use Quantum Physics</h1><p>In an SSD, we want to store data. They work with bits, but it is precisely in the management of these bits that the principles of quantum physics come into play.</p><p>In an SSD, each bit is encoded in cells called <strong>floating gates</strong>: small zones isolated on all sides by an insulating layer. This box can contain electrons or not:</p><ul><li><p><strong>Box with electrons</strong>: Bit = 0</p></li><li><p><strong>Box without electrons</strong>: Bit = 1</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_!ixiE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce709cfb-3103-49c6-a621-01efe71226c4_1320x510.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ixiE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce709cfb-3103-49c6-a621-01efe71226c4_1320x510.png 424w, https://substackcdn.com/image/fetch/$s_!ixiE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce709cfb-3103-49c6-a621-01efe71226c4_1320x510.png 848w, https://substackcdn.com/image/fetch/$s_!ixiE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce709cfb-3103-49c6-a621-01efe71226c4_1320x510.png 1272w, https://substackcdn.com/image/fetch/$s_!ixiE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce709cfb-3103-49c6-a621-01efe71226c4_1320x510.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ixiE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce709cfb-3103-49c6-a621-01efe71226c4_1320x510.png" width="1320" height="510" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ce709cfb-3103-49c6-a621-01efe71226c4_1320x510.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:510,&quot;width&quot;:1320,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:58617,&quot;alt&quot;:&quot;Diagram comparing the two binary states of an SSD floating gate cell: on the left, a floating gate surrounded by an insulating layer contains five electrons (e&#8315;), representing bit = 0; on the right, an identical empty floating gate represents bit = 1 &#8212; illustrating how SSDs encode binary data at the quantum level.&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://read.thecoder.cafe/i/193899126?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce709cfb-3103-49c6-a621-01efe71226c4_1320x510.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Diagram comparing the two binary states of an SSD floating gate cell: on the left, a floating gate surrounded by an insulating layer contains five electrons (e&#8315;), representing bit = 0; on the right, an identical empty floating gate represents bit = 1 &#8212; illustrating how SSDs encode binary data at the quantum level." title="Diagram comparing the two binary states of an SSD floating gate cell: on the left, a floating gate surrounded by an insulating layer contains five electrons (e&#8315;), representing bit = 0; on the right, an identical empty floating gate represents bit = 1 &#8212; illustrating how SSDs encode binary data at the quantum level." srcset="https://substackcdn.com/image/fetch/$s_!ixiE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce709cfb-3103-49c6-a621-01efe71226c4_1320x510.png 424w, https://substackcdn.com/image/fetch/$s_!ixiE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce709cfb-3103-49c6-a621-01efe71226c4_1320x510.png 848w, https://substackcdn.com/image/fetch/$s_!ixiE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce709cfb-3103-49c6-a621-01efe71226c4_1320x510.png 1272w, https://substackcdn.com/image/fetch/$s_!ixiE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce709cfb-3103-49c6-a621-01efe71226c4_1320x510.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><figcaption class="image-caption">In an SSD, each bit is stored in a floating gate cell: a cell filled with electrons represents a 0, while an empty cell represents a 1.</figcaption></figure></div><p>If we need:</p><ul><li><p><strong>To write</strong>, we therefore need to make electrons enter this isolated box. What we do is apply an electric voltage that deforms the wave function of the electrons and increases their probability of ending up on the other side. The electrons, therefore, cross the barrier via the tunnel effect.</p></li><li><p><strong>To erase</strong>, we apply a reverse voltage, which also impacts the wave function, and the electrons cross in the other direction.</p></li><li><p><strong>To read</strong>, it is a classical, non-quantum measurement: we measure the electric current passing through the transistor.</p><ul><li><p>Electrons present: weak current: 0.</p></li><li><p>No electrons: strong current: 1.</p></li></ul></li></ul><p>We saw, however, that the wave function gives a <strong>probability</strong>, not a certainty. If we apply a voltage to write or erase, we therefore only have a probability that the electron will cross the barrier.</p><p>How can an SSD be <strong>reliable</strong> then? An individual electron is unpredictable, but we never send just one electron. We send millions simultaneously. Statistically, enough of them cross the barrier to charge the floating gate reliably.</p><p>And after each write, the controller immediately re-reads the cell to verify. If not enough electrons have crossed, it tries again. That is why SSDs embed error correction mechanisms, <strong>ECC (Error Correcting Code)</strong>, precisely because the process is probabilistic by nature.</p><p>When a cell exceeds a certain error threshold over time, it is finally marked as defective and taken out of service. The data it held is moved to a healthy cell.</p><p>That is why SSDs always have an over-provisioning capacity: a reserve of cells invisible to the user, planned from the manufacturing stage to replace defective cells over time. And that is also why an SSD does not fail all at once; it <strong>degrades progressively</strong>, cell by cell, until the reserve is exhausted.</p><p>And this is where quantum physics imposes its limits. The more transistors shrink, the thinner the insulating barriers become, and the more the tunnel effect becomes uncontrollable, electrons escape spontaneously, errors increase, and cells age faster. Moore&#8217;s Law, which predicts a doubling of transistor density every two years, is today running up against these fundamental physical limits. This is not an engineering problem: <strong>it is quantum physics that sets the boundary</strong>.</p><h1>Summary</h1><ul><li><p><strong>Matter</strong> is made up of atoms, themselves composed of a nucleus (protons and neutrons) and electrons. An atom is almost entirely empty: what we perceive as &#8220;solid&#8221; is an illusion created by the electromagnetic forces between atoms.</p></li><li><p><strong>Light</strong> is both an electromagnetic wave and a particle called a photon. In flight, it behaves like a wave, but it is emitted and absorbed like a particle, in one single hit, in one single place.</p></li><li><p>Young&#8217;s double-slit experiment proves that light is a <strong>wave</strong>: it produces an interference pattern, impossible to obtain with classical particles.</p></li><li><p>Matter behaves in the same way. But unlike light, its wave is not physical: it is a <strong>probability wave</strong> that describes the possible positions of a particle. This is quantum superposition: an unmeasured particle exists in multiple states simultaneously.</p></li><li><p>It is not the act of measuring that collapses the superposition: it is the <strong>existence of the information</strong> somewhere in the universe. If the information is destroyed, the superposition is restored.</p></li><li><p><strong>Decoherence</strong> explains why we never see superposition at our scale: any macroscopic object permanently interacts with its environment, which instantaneously collapses its wave function.</p></li><li><p><strong>The tunnel effect</strong> is a direct consequence of the wave-like nature of particles: the wave function of an electron does not stop abruptly at a physical barrier. There exists a non-zero probability of finding it on the other side, without having had the classical energy to cross.</p></li><li><p><strong>SSDs</strong> exploit the tunnel effect to write and erase data: an electric voltage deforms the wave function of electrons and increases their probability of crossing the insulating barrier of a floating gate. Reliability rests on the large number of electrons sent and on ECC.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://read.thecoder.cafe" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://read.thecoder.cafe&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">AI is getting better every day. Are you? At The Coder Cafe, we serve fundamental concepts to make you an engineer that AI can&#8217;t replace. Written by a Google SWE, trusted by thousands of engineers worldwide.</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><h1>Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/systems">Systems</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/instruction-pipelining">Instruction Pipelining</a></p></li><li><p><a href="https://read.thecoder.cafe/p/simultaneous-multithreading">Simultaneous Multithreading</a></p></li><li><p><a href="https://read.thecoder.cafe/p/soft-lockup-hard-lockup">Linux Soft vs. Hard Lockup</a></p></li></ul><h2>Sources</h2><ul><li><p><a href="https://www.goodreads.com/book/show/44065062-something-deeply-hidden">Something Deeply Hidden</a></p></li><li><p><a href="https://www.goodreads.com/book/show/31625636-we-have-no-idea">We Have No Idea</a></p></li></ul><h2>Explore Further</h2><ul><li><p><a href="https://quantum.country/">Quantum Country</a></p></li><li><p>The Double-Slit Experiment - Veritasium</p><div id="youtube2-Iuv6hY6zsd0" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;Iuv6hY6zsd0&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/Iuv6hY6zsd0?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div></li></ul><div><hr></div><p>&#10084;&#65039; <em>If you enjoyed this post, please hit the like button.</em></p><p>&#128172; <em>Did you know quantum physics was hiding in your laptop all along? I&#8217;d love to hear your reaction in the comments.</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/p/how-an-ssd-works/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.thecoder.cafe/p/how-an-ssd-works/comments"><span>Leave a comment</span></a></p>]]></content:encoded></item><item><title><![CDATA[Working on Complex Systems]]></title><description><![CDATA[My Talk at the Monster SCALE Summit 2026]]></description><link>https://read.thecoder.cafe/p/complex-systems-talk</link><guid isPermaLink="false">https://read.thecoder.cafe/p/complex-systems-talk</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Tue, 24 Mar 2026 11:03:42 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!TI9L!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a992d1a-c2ef-4231-84c3-19b2e6341926_1200x628.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>&#9749; <em>Welcome to The Coder Cafe! Today, I&#8217;m sharing the talk I gave at the <a href="https://www.scylladb.com/monster-scale-summit/">Monster SCALE Summit 2026</a> on working on complex systems. Get cozy, grab a coffee, and let&#8217;s begin!</em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!TI9L!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a992d1a-c2ef-4231-84c3-19b2e6341926_1200x628.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!TI9L!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a992d1a-c2ef-4231-84c3-19b2e6341926_1200x628.webp 424w, https://substackcdn.com/image/fetch/$s_!TI9L!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a992d1a-c2ef-4231-84c3-19b2e6341926_1200x628.webp 848w, https://substackcdn.com/image/fetch/$s_!TI9L!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a992d1a-c2ef-4231-84c3-19b2e6341926_1200x628.webp 1272w, https://substackcdn.com/image/fetch/$s_!TI9L!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a992d1a-c2ef-4231-84c3-19b2e6341926_1200x628.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!TI9L!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a992d1a-c2ef-4231-84c3-19b2e6341926_1200x628.webp" width="1200" height="628" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0a992d1a-c2ef-4231-84c3-19b2e6341926_1200x628.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:628,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:40702,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/webp&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://read.thecoder.cafe/i/191926390?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a992d1a-c2ef-4231-84c3-19b2e6341926_1200x628.webp&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!TI9L!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a992d1a-c2ef-4231-84c3-19b2e6341926_1200x628.webp 424w, https://substackcdn.com/image/fetch/$s_!TI9L!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a992d1a-c2ef-4231-84c3-19b2e6341926_1200x628.webp 848w, https://substackcdn.com/image/fetch/$s_!TI9L!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a992d1a-c2ef-4231-84c3-19b2e6341926_1200x628.webp 1272w, https://substackcdn.com/image/fetch/$s_!TI9L!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a992d1a-c2ef-4231-84c3-19b2e6341926_1200x628.webp 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg 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><h1>Introduction</h1><p>If you&#8217;ve been a subscriber since mid-2025, you were already here when I published the post that performed best on my newsletter: <em><a href="https://read.thecoder.cafe/p/complex-systems">Working on Complex Systems</a></em>.</p><p>I really loved writing it, and I always had in mind to revisit it at some point. So, when someone at ScyllaDB reached out to invite me to speak at Monster SCALE Summit, I saw the perfect opportunity to turn it into a talk.</p><p>The video isn&#8217;t a 1:1 mapping of the original content. I expanded it with more examples and new ideas. In it, I define what complex systems are, then discuss their common characteristics, and finally explore patterns for navigating them.</p><p>Hope you will enjoy it!</p><h1>Video</h1><div id="youtube2-ddbrrwnoz48" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;ddbrrwnoz48&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/ddbrrwnoz48?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://read.thecoder.cafe" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://read.thecoder.cafe&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">AI is getting better every day. Are you? At The Coder Cafe, we serve fundamental concepts to make you an engineer that AI can&#8217;t replace. Written by a Google SWE, trusted by thousands of engineers worldwide.</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><h1>Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/distributed-systems">Distributed Systems</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/latency-and-user-experience">Latency and User Experience</a></p></li><li><p><a href="https://read.thecoder.cafe/p/probabilistic-increment">Probabilistic Increment</a></p></li><li><p><a href="https://read.thecoder.cafe/p/bloom-filters">Bloom Filters</a></p></li></ul><h2>Explore Further</h2><ul><li><p><a href="https://docs.google.com/presentation/d/e/2PACX-1vQ2Hw-0GC8O15T4G09gpfCz16Qgbxnb3YkEQ_c_0xMzMgZfrdSycDkxIlqElluxUh6yTBCqTyZgo6JM/pub?start=false">Slides</a></p></li><li><p><a href="https://www.scylladb.com/resources/tech-talks/?presentation-type=2873&amp;years=3488">Monster SCALE Summit - 2026 Tech Talks</a></p></li></ul><div><hr></div><p>&#10084;&#65039; <em>If you enjoyed this post, please hit the like button.</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/p/complex-systems-talk/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.thecoder.cafe/p/complex-systems-talk/comments"><span>Leave a comment</span></a></p>]]></content:encoded></item><item><title><![CDATA[3 Bullets and a Call to Action]]></title><description><![CDATA[When communicating via email or chat, people prefer short and memorable messages that do not require too much cognitive effort to process.]]></description><link>https://read.thecoder.cafe/p/three-bullets-one-call-to-action</link><guid isPermaLink="false">https://read.thecoder.cafe/p/three-bullets-one-call-to-action</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Wed, 18 Mar 2026 11:02:49 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!MUle!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff722fb61-df22-4ef8-8a70-cc57da1d7644_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>&#9749; <em>Welcome to The Coder Cafe! Today, we discuss an efficient communication method presented in the <a href="http://Debugging Teams">Debugging Teams</a> book called 3 bullets and a call to action. I&#8217;ve been using it extensively over the past months, and I can confirm its efficiency. Get cozy, grab a coffee, and let&#8217;s begin!</em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!MUle!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff722fb61-df22-4ef8-8a70-cc57da1d7644_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!MUle!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff722fb61-df22-4ef8-8a70-cc57da1d7644_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!MUle!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff722fb61-df22-4ef8-8a70-cc57da1d7644_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!MUle!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff722fb61-df22-4ef8-8a70-cc57da1d7644_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!MUle!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff722fb61-df22-4ef8-8a70-cc57da1d7644_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!MUle!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff722fb61-df22-4ef8-8a70-cc57da1d7644_1600x800.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f722fb61-df22-4ef8-8a70-cc57da1d7644_1600x800.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;:1677328,&quot;alt&quot;:&quot;3 Bullets and a Call to Action.&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://read.thecoder.cafe/i/190563246?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff722fb61-df22-4ef8-8a70-cc57da1d7644_1600x800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="3 Bullets and a Call to Action." title="3 Bullets and a Call to Action." srcset="https://substackcdn.com/image/fetch/$s_!MUle!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff722fb61-df22-4ef8-8a70-cc57da1d7644_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!MUle!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff722fb61-df22-4ef8-8a70-cc57da1d7644_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!MUle!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff722fb61-df22-4ef8-8a70-cc57da1d7644_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!MUle!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff722fb61-df22-4ef8-8a70-cc57da1d7644_1600x800.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg 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>At Google, I recently switched to a new domain: <a href="https://cloud.google.com/distributed-cloud-connected">Google Distributed Cloud Connected</a><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a>. Here, all the teams are very busy, and finding an efficient way to communicate over email or chat can be challenging, especially when asking someone to do something.</p><p>Recently, I came across a simple technique: three bullets and one call to action. The idea is the following:</p><ul><li><p>Add three bullet points explaining the key context</p></li><li><p>Follow with one clear call to action</p></li></ul><p>Let&#8217;s look at a concrete example. Suppose you receive the following email:</p><blockquote><p>Hi,</p><p>I recently wrote a design doc on how to save storage in the context of X, where I describe the current problem and the approach we could take to address it. In the document, I go through the main trade-offs involved and explain why the proposal focuses on solution Y in particular. I also included several open questions related to the deployment strategy and some areas where feedback would be especially helpful. It would be great if you could take a look at the document and leave comments by Friday.</p><p>Thanks!</p></blockquote><p>Quite a mouthful. It requires a non-trivial amount of brain time to understand both the context and what the person is actually asking for.</p><p>Now let&#8217;s apply the three bullets and a call to action strategy:</p><blockquote><p>Hi,</p><ul><li><p>I recently wrote a design doc on how to save storage in the context of X.</p></li><li><p>It highlights the main trade-offs and focuses on the solution Y.</p></li><li><p>I&#8217;ve added open questions around the deployment strategy.</p></li></ul><p>Could you please have a look and leave comments by Friday?</p><p>Thanks!</p></blockquote><p>Much better, right? The call to action is clear, and the context is structured around short and easy-to-scan sentences.</p><p>Why does it work? When communicating via email or chat, people prefer short and memorable messages that do not require too much cognitive effort to process. Bullet points help break information into smaller chunks, which makes the message easier to scan quickly. Ideally, the bullet points and the call to action should be as short as possible.</p><p>Another aspect is that 3 is often a magic number in communication. With 2 items, you often get a contrast. With 3 items, you start to get a small structure or rhythm that is easier for the mind to process. That is one of the reasons why the rule of three appears so often in writing, storytelling, and presentations, where it helps make ideas more engaging and convincing.</p><p>Remember: to improve your chances of getting an answer to your request, use 3 short bullets and an efficient call to action.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://read.thecoder.cafe" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://read.thecoder.cafe&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">AI is getting better every day. Are you? At The Coder Cafe, we serve fundamental concepts to make you an engineer that AI can&#8217;t replace. Written by a Google SWE, trusted by thousands of engineers worldwide.</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><h1>Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/beyond-code">Beyond the Code</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/10-technical-writing-rules">10 Rules I Learned About Technical Writing</a></p></li><li><p><a href="https://read.thecoder.cafe/p/xy-problem">The XY Problem</a></p></li><li><p><a href="https://read.thecoder.cafe/p/mental-health">Don&#8217;t Forget About Your Mental Health</a></p></li></ul><h2>Sources</h2><ul><li><p><a href="https://thinkinsights.net/consulting/rule-three?">Rule of three &#8212; Thinking Insights</a></p></li><li><p><a href="https://en.wikipedia.org/wiki/Rule_of_three_(writing)">Rule of three (writing) &#8212; Wikipedia</a></p></li></ul><p><em>Only 2, sorry about that.</em></p><div><hr></div><p>&#10084;&#65039; <em>If you enjoyed this post, please hit the like button.</em></p><p>&#128172; <em>What do you think about this strategy? Have you tried something similar?</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/p/three-bullets-one-call-to-action/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.thecoder.cafe/p/three-bullets-one-call-to-action/comments"><span>Leave a comment</span></a></p><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-1" href="#footnote-anchor-1" class="footnote-number" contenteditable="false" target="_self">1</a><div class="footnote-content"><p>That partially explains why I wasn&#8217;t so active with <em>The Coder Cafe</em> these days. It will get better, I promise.</p></div></div>]]></content:encoded></item><item><title><![CDATA[The Cold Start Problem Explained]]></title><description><![CDATA[The cold start problem is a chicken-and-egg trap:&#160;no users without value,&#160;no value without users.]]></description><link>https://read.thecoder.cafe/p/cold-start-problem</link><guid isPermaLink="false">https://read.thecoder.cafe/p/cold-start-problem</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Wed, 07 Jan 2026 11:02:36 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!6lAp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd33f4fe2-7717-440a-a6d6-34d74283bcf4_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>&#9749; <em>Welcome to The Coder Cafe! I sucked at product management<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a>. Early in my career, I was only passionate about how a product works under the hood, not about what the product actually does. Over time, I began to change and open up. Today, I want to share a concept from a book recommended on X by <span class="mention-wrap" data-attrs="{&quot;name&quot;:&quot;Pratim Bhosale&quot;,&quot;id&quot;:83787927,&quot;type&quot;:&quot;user&quot;,&quot;url&quot;:null,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/581a89bf-c59e-473d-8c0a-edfeb7fbfbba_2897x3072.jpeg&quot;,&quot;uuid&quot;:&quot;96ca4096-601e-4569-8e67-0ec634799d0c&quot;}" data-component-name="MentionToDOM"></span> that</em> <em>I really loved: <a href="https://www.goodreads.com/book/show/55338968-the-cold-start-problem">The Cold Start Problem</a>. Get cozy, grab a coffee, and let&#8217;s begin!</em></p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!6lAp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd33f4fe2-7717-440a-a6d6-34d74283bcf4_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6lAp!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd33f4fe2-7717-440a-a6d6-34d74283bcf4_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!6lAp!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd33f4fe2-7717-440a-a6d6-34d74283bcf4_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!6lAp!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd33f4fe2-7717-440a-a6d6-34d74283bcf4_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!6lAp!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd33f4fe2-7717-440a-a6d6-34d74283bcf4_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6lAp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd33f4fe2-7717-440a-a6d6-34d74283bcf4_1600x800.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d33f4fe2-7717-440a-a6d6-34d74283bcf4_1600x800.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1664132,&quot;alt&quot;:&quot;The cold start problem is a chicken-and-egg trap: no users without value, no value without users.&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://www.thecoder.cafe/i/173044040?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd33f4fe2-7717-440a-a6d6-34d74283bcf4_1600x800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The cold start problem is a chicken-and-egg trap: no users without value, no value without users." title="The cold start problem is a chicken-and-egg trap: no users without value, no value without users." srcset="https://substackcdn.com/image/fetch/$s_!6lAp!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd33f4fe2-7717-440a-a6d6-34d74283bcf4_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!6lAp!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd33f4fe2-7717-440a-a6d6-34d74283bcf4_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!6lAp!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd33f4fe2-7717-440a-a6d6-34d74283bcf4_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!6lAp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd33f4fe2-7717-440a-a6d6-34d74283bcf4_1600x800.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><h1>Network Effects</h1><p>Let&#8217;s consider a dating app. If there are only three people who installed the app in New-York, anyone new will probably try it for a few seconds and uninstall it. But if a big part of the city is on it, then someone single will probably stick around.</p><p>Said differently, the more people use the product, the more valuable it becomes. There&#8217;s a term for that type of product, and it&#8217;s called <strong>the network effect: when a product gets more valuable as more people use it</strong>.</p><p>Delving into the network effect, it&#8217;s not a single force but actually a trio of forces:</p><ul><li><p><strong>The acquisition effect</strong>: How a product can use its own network to attract new people.</p></li><li><p><strong>The engagement effect</strong>: The more people join, the more useful and sticky it becomes.</p></li><li><p><strong>The economic effect</strong>: A larger network reduces costs, improves monetization, and strengthens the business model.</p></li></ul><p>Now comes the real challenge. If our product relies on network effects, how do we launch it? Do we start from zero, or wait until enough people are on board? <strong>It&#8217;s a chicken-and-egg problem, and that&#8217;s the cold start problem.</strong></p><h1>Anti-Pattern: Big Bang</h1><p>One common mistake to solve the cold start problem is the big bang launch: <strong>releasing to everyone before any community exists.</strong></p><p>Google+ is the perfect example. Launched in 2011, it was Google&#8217;s attempt at a social network with a Facebook-style feed. The problem was that when people joined, they found empty timelines and left. Google later admitted that 90% of user sessions lasted less than five seconds.</p><p>At one point, Google even tied YouTube comments to Google+, requiring an account just to comment. The platform eventually reached more than 500 million users, but the issue was never sign-ups. <strong>The real problem was that a newcomer&#8217;s first session didn&#8217;t feel like walking into a lively room.</strong> It was forced growth instead of real networks.</p><p>Google+ didn&#8217;t fail because Google couldn&#8217;t build a social network. <strong>It lost because it never created a place where a new user could land in a live network.</strong> In short, Google+ failed to solve the cold start problem.</p><h1>Pattern: Atomic Networks</h1><p>A solution to the cold start problem was applied by Tinder, and it involves focusing on the concept of atomic networks.</p><p>Back then, dating apps were not very popular. Yet, Tinder was ambitious and wanted to succeed in that market. Instead of launching worldwide, they did the complete opposite. They organized a party at a college that required installing the application to attend. The next day, most students there had Tinder installed. <strong>This college was an atomic network: the smallest self-sustaining cluster of users where network effects actually work.</strong></p><p>Soon after, they repeated the same process in another college in the same city, with the same result: within days, most students there had joined Tinder.</p><p>What&#8217;s powerful about atomic networks is simple: <strong>if we can build one network, we can build two. If we can build two, we can build thousands.</strong> Tinder repeated this strategy college by college, then city by city, eventually growing into entire countries.</p><p>The takeaway is that when we start a product with network effects, <strong>the first step is to build a single, tiny network that&#8217;s self-sustaining on its own.</strong> We just want to get started. If we can create one stable, engaged network, then we can build a second one next to it. From there, we can replicate the process and eventually connect them into one large network that spans the whole market.</p><h1>Summary</h1><ul><li><p>Network effects happen when a product gets more valuable as more people use it.</p></li><li><p>How do we launch such a product with zero users? That&#8217;s the cold start problem.</p></li><li><p>Big bang launches fail when newcomers find empty networks.</p></li><li><p>One effective approach is to build atomic networks: the smallest self-sustaining clusters where network effects work.</p></li><li><p>If we can build one atomic network, we can repeat it and scale across a market.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ZoDz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">AI is getting better every day. Are you? At The Coder Cafe, we serve fundamental concepts to make you an engineer that AI can&#8217;t replace. Written by a Google SWE, trusted by thousands of engineers worldwide.</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><h1>Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/beyond-code">Beyond Code</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/mental-health">Don&#8217;t Forget About Your Mental Health</a></p></li><li><p><a href="https://read.thecoder.cafe/p/xy-problem">The XY Problem</a></p></li><li><p><a href="https://read.thecoder.cafe/p/lateral-thinking">Lateral Thinking</a></p></li></ul><h2>Sources</h2><ul><li><p><a href="https://www.goodreads.com/book/show/55338968-the-cold-start-problem">The Cold Start Problem</a></p></li><li><p><a href="https://blog.google/technology/safety-security/project-strobe/">Project Strobe: Protecting your data, improving our third-party APIs, and sunsetting consumer Google+</a></p></li><li><p><a href="https://blog.google/products/google-plus/google-communities-and-photos">Google+: Communities and photos</a></p></li></ul><div><hr></div><p>&#10084;&#65039; <em>If you enjoyed the post, please consider giving it a like.</em></p><p>&#128172; <em>The book is really great and covers many more aspects. I definitely recommend it.</em> <em>Are you into product management? What resources would you recommend?</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/p/cold-start-problem/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://read.thecoder.cafe/p/cold-start-problem/comments"><span>Leave a comment</span></a></p><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-1" href="#footnote-anchor-1" class="footnote-number" contenteditable="false" target="_self">1</a><div class="footnote-content"><p>Right, Afroditi?</p></div></div>]]></content:encoded></item><item><title><![CDATA[Linus Torvalds vs. Ambiguous Abstractions]]></title><description><![CDATA[There&#8217;s no issue with abstracting code into a helper function. If we want to optimize for cognitive load, the intent should be as clear as possible, starting with the name.]]></description><link>https://read.thecoder.cafe/p/linus-torvalds-ambiguous-abstractions</link><guid isPermaLink="false">https://read.thecoder.cafe/p/linus-torvalds-ambiguous-abstractions</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Wed, 26 Nov 2025 11:01:00 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/d74f20cc-1821-4609-9b6d-da2737380ab0_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>&#127876; <em>If you&#8217;re planning to do <a href="https://adventofcode.com/">Advent of Code</a> this year, join The Coder Cafe leaderboard: </em><code>261108-ab921387</code><em>. I&#8217;ll find a few prizes for the winner(s). If you&#8217;re new to Advent of Code, I wrote a short <a href="https://read.thecoder.cafe/p/advent-of-code">introduction</a> last year, and I also wrote a blog post called <a href="https://teivah.medium.com/advent-of-code-b5bf35a6d115">I Completed All 8 Advents of Code in One Go: Here Are the Lessons I Learned</a> if you&#8217;re interested. I&#8217;ve also created a custom channel in the Discord channel.</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://discord.thecoder.cafe/&quot;,&quot;text&quot;:&quot;Join the Discord&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://discord.thecoder.cafe/"><span>Join the Discord</span></a></p><p>&#9749; <em>Welcome to The Coder Cafe! Today, we discuss a recent comment from Linus Torvalds about the use of a helper function. Get cozy, grab a coffee, and let&#8217;s begin!</em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!DVdt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec19ac2c-43bc-4030-9c5d-0738244a8d31_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!DVdt!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec19ac2c-43bc-4030-9c5d-0738244a8d31_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!DVdt!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec19ac2c-43bc-4030-9c5d-0738244a8d31_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!DVdt!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec19ac2c-43bc-4030-9c5d-0738244a8d31_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!DVdt!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec19ac2c-43bc-4030-9c5d-0738244a8d31_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!DVdt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec19ac2c-43bc-4030-9c5d-0738244a8d31_1600x800.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ec19ac2c-43bc-4030-9c5d-0738244a8d31_1600x800.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;:1677956,&quot;alt&quot;:&quot;There&#8217;s no issue with abstracting code into a helper function. If we want to optimize for cognitive load, the intent should be as clear as possible, starting with the name.&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://read.thecoder.cafe/i/176306471?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec19ac2c-43bc-4030-9c5d-0738244a8d31_1600x800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="There&#8217;s no issue with abstracting code into a helper function. If we want to optimize for cognitive load, the intent should be as clear as possible, starting with the name." title="There&#8217;s no issue with abstracting code into a helper function. If we want to optimize for cognitive load, the intent should be as clear as possible, starting with the name." srcset="https://substackcdn.com/image/fetch/$s_!DVdt!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec19ac2c-43bc-4030-9c5d-0738244a8d31_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!DVdt!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec19ac2c-43bc-4030-9c5d-0738244a8d31_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!DVdt!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec19ac2c-43bc-4030-9c5d-0738244a8d31_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!DVdt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec19ac2c-43bc-4030-9c5d-0738244a8d31_1600x800.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg 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 August 2025, there was (yet another) drama involving Linus Torvalds replying on a pull request:</p><blockquote><p><em>No. This is garbage and it came in too late. I asked for early pull requests because I&#8217;m traveling, and if you can&#8217;t follow that rule, at least make the pull requests good.</em></p><p><em>This adds various garbage that isn&#8217;t RISC-V specific to generic header files.</em></p><p><em>And by &#8220;garbage&#8221; I really mean it. This is stuff that nobody should ever send me, never mind late in a merge window.</em></p><p><em><strong>Like this crazy and pointless make_u32_from_two_u16() &#8220;helper&#8221;.</strong></em></p><p><em>That thing makes the world actively a worse place to live. It&#8217;s useless garbage that makes any user incomprehensible, and actively WORSE than not using that stupid &#8220;helper&#8221;.</em></p><p><em><strong>If you write the code out as &#8220;(a &lt;&lt; 16) + b&#8221;, you know what it does and which is the high word.</strong> Maybe you need to add a cast to make sure that &#8216;b&#8217; doesn&#8217;t have high bits that pollutes the end result, so maybe it&#8217;s not going to be exactly pretty, but it&#8217;s not going to be wrong and incomprehensible either.</em></p><p><em>In contrast, <strong>if you write make_u32_from_two_u16(a,b) you have not a f^%$ing clue what the word order is</strong>. IOW, you just made things WORSE, and you added that &#8220;helper&#8221; to a generic non-RISC-V file where people are apparently supposed to use it to make other code worse too.</em></p><p><em>So no. Things like this need to get bent. It does not go into generic header files, and it damn well does not happen late in the merge window.</em></p></blockquote><p>Let&#8217;s not discuss the rudeness of this comment (it&#8217;s atrocious). Instead, let&#8217;s focus on the content itself.</p><p><span class="mention-wrap" data-attrs="{&quot;name&quot;:&quot;Engineer's Codex&quot;,&quot;id&quot;:2794641,&quot;type&quot;:&quot;user&quot;,&quot;url&quot;:null,&quot;photo_url&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe324dc5e-8be6-4d9a-a32a-61a938fdc0cc_1024x1024.png&quot;,&quot;uuid&quot;:&quot;51fa1556-4f40-48a9-9d44-81c39577c852&quot;}" data-component-name="MentionToDOM"></span>, a popular newsletter, wrote a <a href="https://read.engineerscodex.com/p/how-to-not-write-garbage-code-by">post</a> about it:</p><blockquote><p><em><strong>the main point Linus makes here is that good code optimizes for reducing cognitive load</strong>. {&#8230;] Humans have limited working memory capacity - let&#8217;s say the human brain can only store 4-7 &#8220;chunks&#8221; at at time. <strong>Each abstraction or helper function costs a chunk slot.</strong> Each abstractions costs more tokens.</em></p></blockquote><p>I share the view that good code optimizes for reducing cognitive load<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a>, but I don&#8217;t understand Linus&#8217;s comment in exactly the same way.</p><p>Yes, Linus is virulent about the helper function, but in my opinion, his main argument isn&#8217;t simply that an abstraction costs a &#8220;chunk slot&#8221; as <span class="mention-wrap" data-attrs="{&quot;name&quot;:&quot;Engineer's Codex&quot;,&quot;id&quot;:2794641,&quot;type&quot;:&quot;user&quot;,&quot;url&quot;:null,&quot;photo_url&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe324dc5e-8be6-4d9a-a32a-61a938fdc0cc_1024x1024.png&quot;,&quot;uuid&quot;:&quot;2e3c401b-609f-444d-822d-4adfa7555481&quot;}" data-component-name="MentionToDOM"></span> mentioned; it&#8217;s rather that this isn&#8217;t the right abstraction.</p><p>Here is the code added in the pull request:</p><pre><code>/**
 * make_u32_from_two_u16 - return u32 number by combining
 * two u16 numbers.
 * @hi: upper 16 bit number
 * @lo: lower 16 bit number
 */
#define make_u32_from_two_u16(hi, lo)&#9;(((u32)(hi) &lt;&lt; 16) | (u32)(lo))</code></pre><p>This macro builds a 32-bit integer by putting one 16-bit value in the high half and the other in the low half. For example:</p><pre><code>hi     = 1010101111001101
lo     = 0001001000110100
result = 10101011110011010001001000110100
         |--------------||--------------|
               hi               lo</code></pre><p>The main problem with this macro isn&#8217;t necessarily that it exists. It&#8217;s that its intent (meaning what it tries to accomplish) could have been clearer.</p><p>Indeed, the helper&#8217;s name doesn&#8217;t tell which word is high and which one is low and that&#8217;s exactly what Linus is calling out with &#8220;<em>you have not a f^%$ing clue what the word order is</em>&#8221;.</p><p>Because we can&#8217;t get the intent from the name (<code>make_u32_from_two_u16</code>), we have to open the macro to understand the order. That&#8217;s precisely why it costs a &#8220;chunk slot.&#8221;: not because the abstraction exists, but because it&#8217;s an ambiguous one.</p><p>If we wanted to keep using a macro, a better approach, in my opinion<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a>, would be to encode the word order in the name itself (<code>msw</code> = most significant word, <code>lsw</code> = least significant word):</p><pre><code>/**
 * make_u32_from_msw_lsw - return u32 number by combining
 * two u16 numbers in msw:lsw word order.
 * @msw: upper 16 bit number
 * @lsw lower 16 bit number
 */
#define make_u32_from_msw_lsw(msw, lsw) (((u32)(msw) &lt;&lt; 16) | (u32)(lsw))</code></pre><p>In this case, the word order is carried by the macro name, which makes it a clearer abstraction. Reading the call site doesn&#8217;t require opening the macro to understand the word order:</p><pre><code>u32 v = make_u32_from_msw_lsw(0xABCD, 0x1234);</code></pre><p>Such an abstraction doesn&#8217;t cost a &#8220;chunk slot&#8221; in terms of cognitive load. Its intent is clear from the name, so we don&#8217;t need to load an extra piece of information into our working memory to understand it.</p><p>In summary, if we want to optimize for cognitive load, there&#8217;s not necessarily an issue with using helper functions. But if we do, we should make the abstraction as explicit as possible, and that starts with a clear function name that conveys what it tries to accomplish.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ZoDz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">AI is getting better every day. Are you? At The Coder Cafe, we serve fundamental concepts to make you an engineer that AI can&#8217;t replace. Written by a Google SWE, trusted by thousands of engineers worldwide.</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><h1>Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/programming">Programming</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/readability">Readability</a></p></li><li><p><a href="https://read.thecoder.cafe/p/cognitive-load">Cognitive Load</a></p></li><li><p><a href="https://read.thecoder.cafe/p/nested-code">Nested Code</a></p></li></ul><h2>Sources</h2><ul><li><p><a href="https://lore.kernel.org/lkml/CAHk-=wjLCqUUWd8DzG+xsOn-yVL0Q=O35U9D6j6=2DUWX52ghQ@mail.gmail.com/">Re: [GIT PULL] RISC-V Patches for the 6.17 Merge Window, Part 1 - Linus Torvalds</a> <em>// The discussion.</em></p></li><li><p><a href="https://github.com/ColinIanKing/linux-next/blob/b1549501188cc9eba732c25b033df7a53ccc341f/include/linux/wordpart.h">GitHub</a> <em>// The code proposed in the pull request</em></p></li></ul><h2>Explore Further</h2><ul><li><p><a href="https://cybersect.substack.com/p/linus-and-the-two-youts">Linus and the two youts</a> <em>// Interestingly, the macro was plain wrong when the second word was negative. The full explanation is here.</em></p></li></ul><div><hr></div><p>&#10084;&#65039; <em>If you enjoyed this post, please hit the like button.</em></p><p>&#128172; <em>Where do you draw the line between &#8220;helpful&#8221; and &#8220;harmful&#8221; abstraction?</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/p/linus-torvalds-ambiguous-abstractions/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.thecoder.cafe/p/linus-torvalds-ambiguous-abstractions/comments"><span>Leave a comment</span></a></p><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-1" href="#footnote-anchor-1" class="footnote-number" contenteditable="false" target="_self">1</a><div class="footnote-content"><p>At least most of the time. Sometimes we must optimize for performance at the expense of cognitive load.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-2" href="#footnote-anchor-2" class="footnote-number" contenteditable="false" target="_self">2</a><div class="footnote-content"><p>Mr Torvalds, if you see this and you disagree, please do not insult me.</p></div></div>]]></content:encoded></item><item><title><![CDATA[Nothing Beats Kindness]]></title><description><![CDATA[No act of kindness, no matter how small, is ever wasted.]]></description><link>https://read.thecoder.cafe/p/nothing-beats-kindness</link><guid isPermaLink="false">https://read.thecoder.cafe/p/nothing-beats-kindness</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Thu, 13 Nov 2025 11:01:55 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!3VVN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e8978eb-eccb-4bb7-89a1-d71105f7075b_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>&#128197; <em>Last updated: April 23, 2026</em></p><p>&#9749; <em>Welcome to The Coder Cafe! Today, November 13, is World Kindness Day. For this special occasion, we discuss how kindness matters at work. Get cozy, grab a coffee, and let&#8217;s begin!</em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!kn3P!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa9d0675-e9ba-4904-addd-d031f47d0b41_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!kn3P!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa9d0675-e9ba-4904-addd-d031f47d0b41_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!kn3P!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa9d0675-e9ba-4904-addd-d031f47d0b41_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!kn3P!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa9d0675-e9ba-4904-addd-d031f47d0b41_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!kn3P!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa9d0675-e9ba-4904-addd-d031f47d0b41_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!kn3P!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa9d0675-e9ba-4904-addd-d031f47d0b41_1600x800.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fa9d0675-e9ba-4904-addd-d031f47d0b41_1600x800.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;:1651457,&quot;alt&quot;:&quot;No act of kindness, no matter how small, is ever wasted.&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://read.thecoder.cafe/i/176993198?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa9d0675-e9ba-4904-addd-d031f47d0b41_1600x800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="No act of kindness, no matter how small, is ever wasted." title="No act of kindness, no matter how small, is ever wasted." srcset="https://substackcdn.com/image/fetch/$s_!kn3P!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa9d0675-e9ba-4904-addd-d031f47d0b41_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!kn3P!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa9d0675-e9ba-4904-addd-d031f47d0b41_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!kn3P!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa9d0675-e9ba-4904-addd-d031f47d0b41_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!kn3P!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa9d0675-e9ba-4904-addd-d031f47d0b41_1600x800.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg 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>We&#8217;re in 2022. It&#8217;s Saturday evening, and I&#8217;m about to go to bed. I&#8217;m on-call that night. I haven&#8217;t been paged, but just to make sure everything is OK, I logged in and checked Slack.</p><p>An incident was going on, and a colleague was already on it. I DMed him: &#8220;<em>Why didn&#8217;t you contact me?</em>&#8221;</p><p>He replied: &#8220;<em>It&#8217;s late and I thought you might be sleeping. I was awake, so I looked to see if there&#8217;s something I could do.</em>&#8221;</p><p>My first reaction was: I&#8217;m on-call. I&#8217;m paid for it. I&#8217;ll take care of it. Go to bed.</p><p>But here&#8217;s the thing: on a Saturday evening, he chose to help because he thought I might be sleeping, even though I was the one on-call, the one paid to handle it.</p><p>That was a pure act of kindness. No points. No credit. Just care. And after that? Honestly, I would have done anything for <a href="https://www.linkedin.com/in/kasper-bentsen-37109a57/">that person</a>.</p><h2>Why Kindness Wins</h2><p>At work, we work with people long before we work with code. There&#8217;s always a little distance between us: roles and power dynamics, deadlines and pressure, different cultures, communication styles, sometimes different time zones. Kindness is the fastest bridge across that distance.</p><p>Kindness is about being generous, considerate, and having concern for others without expecting praise or reward in return. It&#8217;s a voluntary act that creates psychological safety among team members. When people feel safe, they surface risks earlier, ask the &#8220;naive&#8221; questions, and move faster together.</p><p>Kind people make work better day in, day out. Kindness boosts trust, speeds decisions, reduces stress, and quietly raises the bar for everyone.</p><p>Let&#8217;s look at a few places where kindness matters in our daily jobs:</p><ul><li><p><strong>Code review</strong>: When we&#8217;re assigned a review, we&#8217;re not there to rate someone&#8217;s code. We&#8217;re there to merge the best possible change together. Be respectful and stay factual. Favor questions over pronouncements: &#8220;<em>What scenarios does this handle? I&#8217;m worried about X; would Y cover Z?</em>&#8221; Point out what&#8217;s good, suggest concrete fixes, and link to standards or examples. If there&#8217;s confusion, offer help.</p></li><li><p><strong>Meetings</strong>: Make space so everyone can be heard. Don&#8217;t interrupt. Invite quieter people in: &#8220;<em>Ben, anything you would add?</em>&#8221; It&#8217;s not because someone is more vocal that they&#8217;re more right.</p></li><li><p><strong>Mentoring</strong>: People make mistakes. Don&#8217;t jump to blame or perform expertise. The goal is to protect in public and correct in private. Give clear, kind feedback, focus on the next step, and share your own past mistakes to lower the temperature.</p></li><li><p><strong>Random thank you</strong>: When you receive help or just enjoy working with someone, say thank you. Recognition matters, and doing it publicly multiplies the effect. For example, at Google, there&#8217;s a program called gThanks that lets you thank someone publicly so others can see it too.</p></li><li><p><strong>Make time to listen</strong>: Being kind also means making time to listen. I remember going through a difficult period of my life, and a former manager just took time to talk, without judging. That mattered more than any advice.</p></li><li><p><strong>Self-compassion</strong>: Kindness also applies to yourself. Give yourself the same understanding you would give a teammate. Take breaks, ask for help, forgive your own mistakes, and learn from them.</p></li></ul><p>Being kind is a bridge to people, and even in a professional context, as Aesop wrote, no act of kindness, no matter how small, is ever wasted.</p><div id="youtube2-YLP9C4yn4C0" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;YLP9C4yn4C0&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/YLP9C4yn4C0?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://read.thecoder.cafe" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://read.thecoder.cafe&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">AI is getting better every day. Are you? At The Coder Cafe, we serve fundamental concepts to make you an engineer that AI can&#8217;t replace. Written by a Google SWE, trusted by thousands of engineers worldwide.</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><h1>Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/beyond-code">Beyond the Code</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/mental-health">Don&#8217;t Forget About Your Mental Health</a></p></li><li><p><a href="https://read.thecoder.cafe/p/mistake-journal">Keeping a Mistake Journal</a></p></li><li><p><a href="https://read.thecoder.cafe/p/xy-problem">The XY Problem</a></p></li></ul><h2>Sources</h2><ul><li><p><a href="https://hbr.org/2023/07/why-kindness-at-work-pays-off">Why Kindness at Work Pays Off</a></p></li></ul><h2>Explore Further</h2><ul><li><p><a href="https://kind.engineering/">Kind Engineering</a></p></li></ul><div><hr></div><p>&#10084;&#65039; <em>If you enjoyed this post, please hit the like button.</em></p><p>&#128172; <em>What&#8217;s one act of kindness that changed your workday?</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/p/nothing-beats-kindness/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.thecoder.cafe/p/nothing-beats-kindness/comments"><span>Leave a comment</span></a></p>]]></content:encoded></item><item><title><![CDATA[Horror Coding Stories: Therac-25]]></title><description><![CDATA[In total, there were six known radiation overdoses involving the Therac-25,and at least three were fatal.]]></description><link>https://read.thecoder.cafe/p/therac-25</link><guid isPermaLink="false">https://read.thecoder.cafe/p/therac-25</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Fri, 31 Oct 2025 15:01:54 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/ce5a0037-5c6b-4b2f-9f83-85aaa45eda6e_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>&#128197; <em>Last updated: March 9, 2025</em></p><p>&#127875; <em>Welcome to The Coder Cafe! Today, we examine the Therac-25 accidents, where design and software failures resulted in multiple radiation overdoses and deaths. Make sure to check the Explore Further section to see if you&#8217;re able to reproduce the deadly issue. Get cozy, grab a pumpkin spice latte, and let&#8217;s begin!</em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!B8Kz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95be1d9d-bdb7-4621-958d-615a2c234d5e_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!B8Kz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95be1d9d-bdb7-4621-958d-615a2c234d5e_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!B8Kz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95be1d9d-bdb7-4621-958d-615a2c234d5e_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!B8Kz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95be1d9d-bdb7-4621-958d-615a2c234d5e_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!B8Kz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95be1d9d-bdb7-4621-958d-615a2c234d5e_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!B8Kz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95be1d9d-bdb7-4621-958d-615a2c234d5e_1600x800.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/95be1d9d-bdb7-4621-958d-615a2c234d5e_1600x800.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;:1703978,&quot;alt&quot;:&quot;In total, there were six known radiation overdoses involving the Therac-25, and at least three were fatal.&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://www.thecoder.cafe/i/176048008?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95be1d9d-bdb7-4621-958d-615a2c234d5e_1600x800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="In total, there were six known radiation overdoses involving the Therac-25, and at least three were fatal." title="In total, there were six known radiation overdoses involving the Therac-25, and at least three were fatal." srcset="https://substackcdn.com/image/fetch/$s_!B8Kz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95be1d9d-bdb7-4621-958d-615a2c234d5e_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!B8Kz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95be1d9d-bdb7-4621-958d-615a2c234d5e_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!B8Kz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95be1d9d-bdb7-4621-958d-615a2c234d5e_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!B8Kz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95be1d9d-bdb7-4621-958d-615a2c234d5e_1600x800.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg 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><h1>Therac-25</h1><p>Treating cancers used to require a mix of machines, depending on tumor depth: shallow or deep. In the early 1980s, a new generation promised both from a single system. That was a big deal for hospitals: one machine instead of several meant lower maintenance and fewer systems to manage.</p><p>That was the case with the Therac-25.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3DYM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a9d775f-7617-4109-9847-a217defcb1d6_800x295.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3DYM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a9d775f-7617-4109-9847-a217defcb1d6_800x295.png 424w, https://substackcdn.com/image/fetch/$s_!3DYM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a9d775f-7617-4109-9847-a217defcb1d6_800x295.png 848w, https://substackcdn.com/image/fetch/$s_!3DYM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a9d775f-7617-4109-9847-a217defcb1d6_800x295.png 1272w, https://substackcdn.com/image/fetch/$s_!3DYM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a9d775f-7617-4109-9847-a217defcb1d6_800x295.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3DYM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a9d775f-7617-4109-9847-a217defcb1d6_800x295.png" width="800" height="295" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6a9d775f-7617-4109-9847-a217defcb1d6_800x295.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:295,&quot;width&quot;:800,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:103150,&quot;alt&quot;:&quot;Two images side by side: on the left, the computer terminal used to control the Therac-25 radiation therapy machine, displaying text on a black screen; on the right, the Therac-25 linear accelerator positioned over a treatment table in a hospital room.&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://www.thecoder.cafe/i/176048008?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a9d775f-7617-4109-9847-a217defcb1d6_800x295.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Two images side by side: on the left, the computer terminal used to control the Therac-25 radiation therapy machine, displaying text on a black screen; on the right, the Therac-25 linear accelerator positioned over a treatment table in a hospital room." title="Two images side by side: on the left, the computer terminal used to control the Therac-25 radiation therapy machine, displaying text on a black screen; on the right, the Therac-25 linear accelerator positioned over a treatment table in a hospital room." srcset="https://substackcdn.com/image/fetch/$s_!3DYM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a9d775f-7617-4109-9847-a217defcb1d6_800x295.png 424w, https://substackcdn.com/image/fetch/$s_!3DYM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a9d775f-7617-4109-9847-a217defcb1d6_800x295.png 848w, https://substackcdn.com/image/fetch/$s_!3DYM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a9d775f-7617-4109-9847-a217defcb1d6_800x295.png 1272w, https://substackcdn.com/image/fetch/$s_!3DYM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a9d775f-7617-4109-9847-a217defcb1d6_800x295.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 Therac-25 offered two therapies with selectable modes:</p><ul><li><p><strong>Electron beam:</strong> Low-energy electrons for shallow tumors (e.g., skin cancer).</p></li><li><p><strong>X-ray photons:</strong> High-energy radiation for deep tumors (e.g., lung cancer).</p></li></ul><p>Earlier Therac models allowed switching modes with hardware circuits and physical interlocks. The new version was smaller, cheaper, and computer-controlled. Less hardware and fewer parts meant lower costs.</p><p>However, what no one realized soon enough: it also removed an independent safety net.</p><h1>The Horror Begins </h1><p>On a routine day, a radiology technologist sat at the console and began entering a plan:</p><ul><li><p>By habit, she selected X-ray (deep mode).</p></li><li><p>Then she immediately corrected it for Electron (shallow mode) and hit start.</p></li></ul><p>The machine halted with a <code>MALFUNCTION 54</code> message. The operator&#8217;s manual didn&#8217;t explain the code. Service materials listed the number but gave no useful guidance, so she resumed and triggered the radiation.</p><p>The patient was receiving his ninth treatment. Immediately, he knew something was different. He reported a buzzing sound, later recognized as the accelerator pouring out radiation at maximum. The pain came fast; paralysis followed. He later died from radiation injury.</p><p>Weeks later, a second patient endured the same incident on the same model.</p><h1>What Happened?</h1><p>Initially, the radiology technologist entered &#8216;<code>X</code>&#8217; for X-ray (&#8216;&#9646;&#8217; is the cursor and &#8216;<code>&#8230;</code>&#8217; are other fields):</p><pre><code>MODE:              X
...                &#9646;
BEAM READY:        </code></pre><p>She immediately hit <em>Cursor Up</em> to go back and correct the field to &#8216;<code>E</code>&#8217;:</p><pre><code>MODE:              E
...                &#9646;
BEAM READY:        </code></pre><p>After a rapid sequence of <em>Return</em> presses, she moved back down to the command area:</p><pre><code><code>MODE:              E
...                
BEAM READY:        &#9646;</code></code></pre><p>From her perspective, the screen showed the corrected mode, so she hit return and started the treatment:</p><pre><code><code>MODE:              E
...                
BEAM READY:        &#9646;&lt;Enter&gt;</code></code></pre><p>Behind the scenes, the Therac-25 software ran several concurrent tasks:</p><ul><li><p><strong>Data-entry task</strong>: Monitored operator inputs and edited a shared treatment-setup structure.</p></li><li><p><strong>Hardware-control task</strong>: On a periodic loop, snapshotted that same structure and positioned the turntable and magnets based on user input.</p></li></ul><p>Because both tasks read the same memory with no mutual exclusion, there was a short window (on the order of seconds) in which the hardware-control task used a different value than the one displayed on the screen.</p><p>As a result:</p><ul><li><p>The UI showed Electron mode, which looked correct to the operator.</p></li><li><p>The hardware-control task had snapshotted stale data and marked the system as ready even though critical elements (e.g., turntable position, scanning magnets/accessories) were not yet aligned with electron mode.</p></li><li><p>When treatment was started, the machine delivered an effectively unscanned, high-intensity electron beam, causing a massive overdose.</p></li></ul><p>This is a <a href="https://read.thecoder.cafe/p/data-race-vs-race-condition">race condition</a> example: the outcome depends on the timing of events, here, the input cadence of the technologist. Depending on the timing, the system could enter a fatal state, with one process seeing &#8216;<code>X</code>&#8217; while another saw &#8216;<code>E</code>&#8217;.</p><p>The manufacturer later confirmed the error could not be reproduced reliably in testing. The timing had to line up just right, which made the bug elusive. They initially misdiagnosed it as a hardware fault and applied only minor fixes. Unfortunately, the speed of operator editing was the key trigger that exposed this software race.</p><h1>Another Tragedy</h1><p>The problem could have stopped here, but it didn&#8217;t.</p><p>Months later, another fatal overdose occurred, this time caused by a different software defect. It wasn&#8217;t a timing race. This time, the issue was a counter overflow within the control program.</p><p>The software used an internal counter to track how many times certain setup operations ran. After the counter exceeded its maximum value, it wrapped back to zero. That arithmetic overflow created a window where a critical safety check was bypassed, allowing the beam to turn on without the proper accessories in place.</p><p>Again, the Therac-25 fired a high-intensity beam without the proper hardware configuration.</p><h1>Conclusion</h1><p>Both the race condition and the counter overflow stemmed from the same design flaw: the belief that software alone could enforce safety. The Therac-25 showed, in tragic terms, that without independent safeguards, small coding errors can have catastrophic consequences. </p><p>We should know that whether it&#8217;s software, hardware, or a human process, every single safeguard has inherent flaws. Therefore, in complex systems, safety should be layered, as illustrated by the Swiss cheese model:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!HRO0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97dd7083-a97c-48d6-b1d5-3bb1e77e03be_1116x995.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!HRO0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97dd7083-a97c-48d6-b1d5-3bb1e77e03be_1116x995.png 424w, https://substackcdn.com/image/fetch/$s_!HRO0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97dd7083-a97c-48d6-b1d5-3bb1e77e03be_1116x995.png 848w, https://substackcdn.com/image/fetch/$s_!HRO0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97dd7083-a97c-48d6-b1d5-3bb1e77e03be_1116x995.png 1272w, https://substackcdn.com/image/fetch/$s_!HRO0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97dd7083-a97c-48d6-b1d5-3bb1e77e03be_1116x995.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!HRO0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97dd7083-a97c-48d6-b1d5-3bb1e77e03be_1116x995.png" width="498" height="444.005376344086" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/97dd7083-a97c-48d6-b1d5-3bb1e77e03be_1116x995.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:995,&quot;width&quot;:1116,&quot;resizeWidth&quot;:498,&quot;bytes&quot;:799387,&quot;alt&quot;:&quot;A diagram of the Swiss Cheese Model showing four slices of cheese labeled \&quot;Distancing,\&quot; \&quot;Masks,\&quot; \&quot;Cleaning,\&quot; and \&quot;Handwashing.\&quot; Red arrows show a hazard being blocked, but one gets through a series of aligned holes, illustrating that problems occur when flaws in multiple safety layers line up.&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://www.thecoder.cafe/i/176048008?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97dd7083-a97c-48d6-b1d5-3bb1e77e03be_1116x995.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="A diagram of the Swiss Cheese Model showing four slices of cheese labeled &quot;Distancing,&quot; &quot;Masks,&quot; &quot;Cleaning,&quot; and &quot;Handwashing.&quot; Red arrows show a hazard being blocked, but one gets through a series of aligned holes, illustrating that problems occur when flaws in multiple safety layers line up." title="A diagram of the Swiss Cheese Model showing four slices of cheese labeled &quot;Distancing,&quot; &quot;Masks,&quot; &quot;Cleaning,&quot; and &quot;Handwashing.&quot; Red arrows show a hazard being blocked, but one gets through a series of aligned holes, illustrating that problems occur when flaws in multiple safety layers line up." srcset="https://substackcdn.com/image/fetch/$s_!HRO0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97dd7083-a97c-48d6-b1d5-3bb1e77e03be_1116x995.png 424w, https://substackcdn.com/image/fetch/$s_!HRO0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97dd7083-a97c-48d6-b1d5-3bb1e77e03be_1116x995.png 848w, https://substackcdn.com/image/fetch/$s_!HRO0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97dd7083-a97c-48d6-b1d5-3bb1e77e03be_1116x995.png 1272w, https://substackcdn.com/image/fetch/$s_!HRO0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97dd7083-a97c-48d6-b1d5-3bb1e77e03be_1116x995.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><figcaption class="image-caption"><a href="https://www.goodreads.com/book/show/127280527-big-ideas-little-pictures">Credits</a></figcaption></figure></div><p>In total, there were six known radiation overdoses involving the Therac-25, and at least three were fatal.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ZoDz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">AI is getting better every day. Are you? At The Coder Cafe, we serve fundamental concepts to make you an engineer that AI can&#8217;t replace. Written by a Google SWE, trusted by thousands of engineers worldwide.</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><h1>Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/reliability">Reliability</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/adaptive-lifo">Adaptive LIFO</a></p></li><li><p><a href="https://read.thecoder.cafe/p/resilient-fault-tolerant-robust-reliable">Resilient, Fault-tolerant, Robust, or Reliable?</a></p></li><li><p><a href="https://read.thecoder.cafe/p/lurking-variables">Lurking Variables</a></p></li></ul><h2>Sources</h2><ul><li><p><a href="https://smartbear.com/blog/bug-day-race-condition-therac-25/">The Worst Computer Bugs in History: Race conditions in Therac-25</a></p></li><li><p><a href="https://hackaday.com/2015/10/26/killed-by-a-machine-the-therac-25/">Killed By A Machine: The Therac-25</a></p></li><li><p><a href="https://www.cs.columbia.edu/~junfeng/08fa-e6998/sched/readings/therac25.pdf">An Investigation of the Therac-25 Accidents</a></p></li></ul><h2>Explore Further</h2><p>I created a Docker image based on a <a href="https://web.mit.edu/6.033/2007/wwwdocs/assignments/therac.c">C implementation</a> from an <a href="https://web.mit.edu/6.033/2007/wwwdocs/assignments/handson-therac.html">MIT course</a> simulating the operator console of the Therac-25 interface:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!lhlS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c2e2eaf-428c-4a19-a0c4-183b866e5237_1542x865.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lhlS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c2e2eaf-428c-4a19-a0c4-183b866e5237_1542x865.png 424w, https://substackcdn.com/image/fetch/$s_!lhlS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c2e2eaf-428c-4a19-a0c4-183b866e5237_1542x865.png 848w, https://substackcdn.com/image/fetch/$s_!lhlS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c2e2eaf-428c-4a19-a0c4-183b866e5237_1542x865.png 1272w, https://substackcdn.com/image/fetch/$s_!lhlS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c2e2eaf-428c-4a19-a0c4-183b866e5237_1542x865.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!lhlS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c2e2eaf-428c-4a19-a0c4-183b866e5237_1542x865.png" width="604" height="338.9203296703297" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6c2e2eaf-428c-4a19-a0c4-183b866e5237_1542x865.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:817,&quot;width&quot;:1456,&quot;resizeWidth&quot;:604,&quot;bytes&quot;:128363,&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://www.thecoder.cafe/i/176048008?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c2e2eaf-428c-4a19-a0c4-183b866e5237_1542x865.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_!lhlS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c2e2eaf-428c-4a19-a0c4-183b866e5237_1542x865.png 424w, https://substackcdn.com/image/fetch/$s_!lhlS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c2e2eaf-428c-4a19-a0c4-183b866e5237_1542x865.png 848w, https://substackcdn.com/image/fetch/$s_!lhlS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c2e2eaf-428c-4a19-a0c4-183b866e5237_1542x865.png 1272w, https://substackcdn.com/image/fetch/$s_!lhlS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c2e2eaf-428c-4a19-a0c4-183b866e5237_1542x865.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 run the UI using Docker:</p><pre><code> docker run --rm -it -e TERM=xterm-256color teivah/therac-25</code></pre><p>Simulator commands:</p><ul><li><p>Beam Type: &#8216;<code>X</code>&#8217; or &#8216;<code>E</code>&#8217;</p></li><li><p>Command: &#8216;<code>B</code>&#8217; for beam on, or &#8216;<code>Q</code>&#8217; to quit the simulator.</p></li></ul><p>&#128073; Try to trigger the <code>MALFUNCTION 54</code> error based on the scenario discussed.</p><div><hr></div><p>&#10084;&#65039; <em>If you enjoyed this post, please hit the like button.</em></p><p>&#128172; <em>Any other horror coding stories you want to share?</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/p/therac-25/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.thecoder.cafe/p/therac-25/comments"><span>Leave a comment</span></a></p>]]></content:encoded></item><item><title><![CDATA[Speed vs. Velocity]]></title><description><![CDATA[On paper, the team delivered 10 story points. That is only speed, though, not velocity. If we care about direction as well, the team only delivered a single feature.]]></description><link>https://read.thecoder.cafe/p/speed-vs-velocity</link><guid isPermaLink="false">https://read.thecoder.cafe/p/speed-vs-velocity</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Wed, 22 Oct 2025 12:03:11 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!cdwe!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc2c5f54-b9c3-445c-b6f3-f5a2a6ae6288_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>&#9749; <em>Welcome to The Coder Cafe! Today, we discuss the difference between speed and velocity in team productivity, illustrating that tracking speed alone can be misleading. Get cozy, grab a coffee, and let&#8217;s begin!</em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cdwe!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc2c5f54-b9c3-445c-b6f3-f5a2a6ae6288_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cdwe!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc2c5f54-b9c3-445c-b6f3-f5a2a6ae6288_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!cdwe!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc2c5f54-b9c3-445c-b6f3-f5a2a6ae6288_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!cdwe!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc2c5f54-b9c3-445c-b6f3-f5a2a6ae6288_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!cdwe!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc2c5f54-b9c3-445c-b6f3-f5a2a6ae6288_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cdwe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc2c5f54-b9c3-445c-b6f3-f5a2a6ae6288_1600x800.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cc2c5f54-b9c3-445c-b6f3-f5a2a6ae6288_1600x800.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;:1683126,&quot;alt&quot;:&quot;On paper, the team delivered 10 story points. That is only speed, though, not velocity. If we care about direction as well, the team only delivered a single feature.&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://www.thecoder.cafe/i/174145001?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc2c5f54-b9c3-445c-b6f3-f5a2a6ae6288_1600x800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="On paper, the team delivered 10 story points. That is only speed, though, not velocity. If we care about direction as well, the team only delivered a single feature." title="On paper, the team delivered 10 story points. That is only speed, though, not velocity. If we care about direction as well, the team only delivered a single feature." srcset="https://substackcdn.com/image/fetch/$s_!cdwe!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc2c5f54-b9c3-445c-b6f3-f5a2a6ae6288_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!cdwe!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc2c5f54-b9c3-445c-b6f3-f5a2a6ae6288_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!cdwe!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc2c5f54-b9c3-445c-b6f3-f5a2a6ae6288_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!cdwe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc2c5f54-b9c3-445c-b6f3-f5a2a6ae6288_1600x800.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg 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>We often celebrate teams for moving fast. But speed alone can be a trap. A rush of fast changes that barely move the product toward the real goal shouldn&#8217;t count as a win. When we talk about team productivity, we should understand that <strong>speed &#8800; velocity</strong>:</p><ul><li><p><strong>Speed</strong> is how quickly a team ship changes.</p></li><li><p><strong>Velocity</strong> is speed with direction, the movement toward a defined goal.</p></li></ul><p>Let&#8217;s look at three teams to illustrate these definitions.</p><ul><li><p><strong>Team A</strong> has ideal velocity. Each iteration is represented by an arrow: its length shows speed, and its angle shows direction. Every iteration moves the team consistently closer to the goal.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!o45s!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56826b45-968e-45f9-a359-78325662868e_840x842.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!o45s!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56826b45-968e-45f9-a359-78325662868e_840x842.png 424w, https://substackcdn.com/image/fetch/$s_!o45s!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56826b45-968e-45f9-a359-78325662868e_840x842.png 848w, https://substackcdn.com/image/fetch/$s_!o45s!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56826b45-968e-45f9-a359-78325662868e_840x842.png 1272w, https://substackcdn.com/image/fetch/$s_!o45s!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56826b45-968e-45f9-a359-78325662868e_840x842.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!o45s!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56826b45-968e-45f9-a359-78325662868e_840x842.png" width="499" height="500.18809523809523" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/56826b45-968e-45f9-a359-78325662868e_840x842.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:842,&quot;width&quot;:840,&quot;resizeWidth&quot;:499,&quot;bytes&quot;:203058,&quot;alt&quot;:&quot;Diagram of Team A with arrows pointing diagonally toward a target. Each arrow is the same length and angle, showing constant speed and consistent direction toward the goal.&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://www.thecoder.cafe/i/174145001?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56826b45-968e-45f9-a359-78325662868e_840x842.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Diagram of Team A with arrows pointing diagonally toward a target. Each arrow is the same length and angle, showing constant speed and consistent direction toward the goal." title="Diagram of Team A with arrows pointing diagonally toward a target. Each arrow is the same length and angle, showing constant speed and consistent direction toward the goal." srcset="https://substackcdn.com/image/fetch/$s_!o45s!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56826b45-968e-45f9-a359-78325662868e_840x842.png 424w, https://substackcdn.com/image/fetch/$s_!o45s!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56826b45-968e-45f9-a359-78325662868e_840x842.png 848w, https://substackcdn.com/image/fetch/$s_!o45s!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56826b45-968e-45f9-a359-78325662868e_840x842.png 1272w, https://substackcdn.com/image/fetch/$s_!o45s!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56826b45-968e-45f9-a359-78325662868e_840x842.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><figcaption class="image-caption">Team A shows ideal velocity: steady speed and consistent direction.</figcaption></figure></div></li><li><p><strong>Team B</strong> has a speed problem. Each iteration is well-aligned (correct angle), but the team delivers too slowly (small length), resulting in a lower velocity. They finish only halfway to the goal.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!MOTO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0134531c-c429-4277-9345-13b5710ebda7_840x840.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!MOTO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0134531c-c429-4277-9345-13b5710ebda7_840x840.png 424w, https://substackcdn.com/image/fetch/$s_!MOTO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0134531c-c429-4277-9345-13b5710ebda7_840x840.png 848w, https://substackcdn.com/image/fetch/$s_!MOTO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0134531c-c429-4277-9345-13b5710ebda7_840x840.png 1272w, https://substackcdn.com/image/fetch/$s_!MOTO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0134531c-c429-4277-9345-13b5710ebda7_840x840.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!MOTO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0134531c-c429-4277-9345-13b5710ebda7_840x840.png" width="500" height="500" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0134531c-c429-4277-9345-13b5710ebda7_840x840.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:840,&quot;width&quot;:840,&quot;resizeWidth&quot;:500,&quot;bytes&quot;:273994,&quot;alt&quot;:&quot;Diagram of Team B with equal arrows pointing toward the goal but stopping at a halfway marker, showing progress is too slow despite correct direction.&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://www.thecoder.cafe/i/174145001?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0134531c-c429-4277-9345-13b5710ebda7_840x840.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Diagram of Team B with equal arrows pointing toward the goal but stopping at a halfway marker, showing progress is too slow despite correct direction." title="Diagram of Team B with equal arrows pointing toward the goal but stopping at a halfway marker, showing progress is too slow despite correct direction." srcset="https://substackcdn.com/image/fetch/$s_!MOTO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0134531c-c429-4277-9345-13b5710ebda7_840x840.png 424w, https://substackcdn.com/image/fetch/$s_!MOTO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0134531c-c429-4277-9345-13b5710ebda7_840x840.png 848w, https://substackcdn.com/image/fetch/$s_!MOTO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0134531c-c429-4277-9345-13b5710ebda7_840x840.png 1272w, https://substackcdn.com/image/fetch/$s_!MOTO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0134531c-c429-4277-9345-13b5710ebda7_840x840.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><figcaption class="image-caption">Team B has the right direction but low speed, so they only reach halfway to the goal.</figcaption></figure></div></li><li><p><strong>Team C</strong> ships as rapidly as team A (same arrow length). However, various factors such as frequent bug fixes and changing targets make their direction inconsistent. Despite high speed, their velocity is low, and they end only halfway to the goal, just like team B.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!fqSk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092cb12b-019c-4e48-ad63-8cd580e8353b_840x842.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!fqSk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092cb12b-019c-4e48-ad63-8cd580e8353b_840x842.png 424w, https://substackcdn.com/image/fetch/$s_!fqSk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092cb12b-019c-4e48-ad63-8cd580e8353b_840x842.png 848w, https://substackcdn.com/image/fetch/$s_!fqSk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092cb12b-019c-4e48-ad63-8cd580e8353b_840x842.png 1272w, https://substackcdn.com/image/fetch/$s_!fqSk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092cb12b-019c-4e48-ad63-8cd580e8353b_840x842.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!fqSk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092cb12b-019c-4e48-ad63-8cd580e8353b_840x842.png" width="499" height="500.18809523809523" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/092cb12b-019c-4e48-ad63-8cd580e8353b_840x842.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:842,&quot;width&quot;:840,&quot;resizeWidth&quot;:499,&quot;bytes&quot;:212717,&quot;alt&quot;:&quot;Diagram of team C with arrows of equal length but pointing in inconsistent directions. Despite high speed, the team ends only halfway to the goal.&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://www.thecoder.cafe/i/174145001?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092cb12b-019c-4e48-ad63-8cd580e8353b_840x842.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Diagram of team C with arrows of equal length but pointing in inconsistent directions. Despite high speed, the team ends only halfway to the goal." title="Diagram of team C with arrows of equal length but pointing in inconsistent directions. Despite high speed, the team ends only halfway to the goal." srcset="https://substackcdn.com/image/fetch/$s_!fqSk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092cb12b-019c-4e48-ad63-8cd580e8353b_840x842.png 424w, https://substackcdn.com/image/fetch/$s_!fqSk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092cb12b-019c-4e48-ad63-8cd580e8353b_840x842.png 848w, https://substackcdn.com/image/fetch/$s_!fqSk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092cb12b-019c-4e48-ad63-8cd580e8353b_840x842.png 1272w, https://substackcdn.com/image/fetch/$s_!fqSk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092cb12b-019c-4e48-ad63-8cd580e8353b_840x842.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><figcaption class="image-caption">Team C moves fast but changes direction often, so velocity stays low and progress stops halfway.</figcaption></figure></div></li></ul><p>As we can see, velocity requires both speed and direction. A team moving too slowly or in inconsistent directions will make little progress, <strong>even if they&#8217;re busy</strong>. Only when speed is high and direction is aligned do teams reach their goals efficiently.</p><p>Measuring team speed isn&#8217;t useless, though. We can track speed by considering various metrics such as deployment frequency, average time in code review, or mean time to recovery (MTTR) following a production bug. These metrics are interesting to track and provide a certain perspective to understand a team's productivity. <strong>Yet, speed shouldn&#8217;t be the sole dimension to track.</strong></p><p>The danger of tracking speed only is that a team might become organized in a way to optimize <strong>short-term delivery</strong>. The team might focus on delivering many changes that, together, do not move the product in a meaningful way. Instead, teams should track speed and velocity.</p><p>As we said, velocity is speed with direction. We already discussed metrics to track speed; what is missing is monitoring direction.</p><p>Setting <strong>clear and factual objectives</strong> that align with the business strategy helps us track direction. For example:</p><ul><li><p>Payment success rate above 99 percent.</p></li><li><p>Signup to activation above 50 percent within 7 days.</p></li><li><p>Retention after week 4 is above 40 percent.</p></li></ul><p>The easier a metric is to measure, the easier it is to track the direction over time.</p><p>One caveat is how to report progress. In a past team, we used to set OKRs (Objectives and Key Results) every semester. Some objectives were difficult to measure, so we tracked progress differently. Say we created 50 tickets and closed 45. In that case, we reported that we reached 90% of the OKR. <strong>That number said nothing about real progress toward the objective.</strong> Key results should be outcomes, not ticket counts.</p><p>Something else to mention, I read here and there that we should track velocity by counting the number of story points delivered within a timeframe (e.g., during a sprint). I strongly disagree with this. Let me give an example:</p><ul><li><p>A team ships a first change <strong>&#8592; 3 story points</strong></p></li><li><p>The team finds a bug and ships a fix <strong>&#8592; 2 story points</strong></p></li><li><p>Later, the team learns the initial approach is not the best, so it ships another change <strong>&#8592; 5 story points</strong></p></li></ul><p>On paper, the team delivered 10 story points. <strong>That is only speed, though, not velocity. If we care about direction as well, the team only delivered a single feature.</strong> Story points measure effort; they don&#8217;t measure progress toward the objective.</p><h1>Summary</h1><ul><li><p>Speed is how fast we ship. Velocity is speed with direction toward a goal.</p></li><li><p>The goal of a team shouldn&#8217;t be to reach high speed; it should be to reach high velocity, where rapid iterations translate into <em>real</em> system-level improvements.</p></li><li><p>Tracking story points, for example, is a measure of speed, not velocity.</p></li><li><p>Objectives tracking should use outcomes, not ticket counts. Reporting 90 percent of tickets done is not a good measure of progress toward the objective.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://read.thecoder.cafe/" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://read.thecoder.cafe/&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">AI is getting better every day. Are you? At The Coder Cafe, we serve fundamental concepts to make you an engineer that AI can&#8217;t replace. Written by a Google SWE, trusted by thousands of engineers worldwide.</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><h1>Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/beyond-code">Beyond Code</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/mistake-journal">Keeping a Mistake Journal</a></p></li><li><p><a href="https://read.thecoder.cafe/p/streetlight-effect">Streetlight Effect</a></p></li><li><p><a href="https://read.thecoder.cafe/p/survivor-bias">Survivor Bias</a></p></li></ul><h2>Sources</h2><ul><li><p><a href="https://www.atlassian.com/agile/project-management/velocity-scrum">Sprint Velocity in Scrum: How to Measure and Improve Performance</a> <em>// The velocity definition I disagree with.</em></p></li></ul><div><hr></div><p>&#10084;&#65039; <em>If you enjoyed this post, please hit the like button.</em></p><p>&#128172; <em>What&#8217;s your take on speed vs. velocity? How do you measure velocity in your team?</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/p/speed-vs-velocity/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.thecoder.cafe/p/speed-vs-velocity/comments"><span>Leave a comment</span></a></p>]]></content:encoded></item><item><title><![CDATA[CRDTs Explained]]></title><description><![CDATA[No matter when or how often the nodes sync, they always end up with the same state.]]></description><link>https://read.thecoder.cafe/p/crdt</link><guid isPermaLink="false">https://read.thecoder.cafe/p/crdt</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Thu, 16 Oct 2025 12:02:25 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!It-D!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F509010c2-643a-46d7-a381-a84ba1d85baa_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>&#9749; <em>Welcome to The Coder Cafe! Today, we will explore CRDTs, why they matter in distributed systems, and how they keep nodes in sync. Get cozy, grab a coffee, and let&#8217;s begin!</em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!It-D!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F509010c2-643a-46d7-a381-a84ba1d85baa_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!It-D!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F509010c2-643a-46d7-a381-a84ba1d85baa_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!It-D!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F509010c2-643a-46d7-a381-a84ba1d85baa_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!It-D!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F509010c2-643a-46d7-a381-a84ba1d85baa_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!It-D!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F509010c2-643a-46d7-a381-a84ba1d85baa_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!It-D!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F509010c2-643a-46d7-a381-a84ba1d85baa_1600x800.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/509010c2-643a-46d7-a381-a84ba1d85baa_1600x800.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;:1656225,&quot;alt&quot;:&quot;No matter when or how often the nodes sync, they always end up with the same state.&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://www.thecoder.cafe/i/171988500?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F509010c2-643a-46d7-a381-a84ba1d85baa_1600x800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="No matter when or how often the nodes sync, they always end up with the same state." title="No matter when or how often the nodes sync, they always end up with the same state." srcset="https://substackcdn.com/image/fetch/$s_!It-D!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F509010c2-643a-46d7-a381-a84ba1d85baa_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!It-D!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F509010c2-643a-46d7-a381-a84ba1d85baa_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!It-D!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F509010c2-643a-46d7-a381-a84ba1d85baa_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!It-D!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F509010c2-643a-46d7-a381-a84ba1d85baa_1600x800.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg 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>CRDTs, short for Conflict-Free Replicated Data Types, are a family of data structures built for distributed systems. At first sight, CRDTs may look intimidating. Yet at their core, the idea is not that complex. What makes them special is that they allow updates to happen independently on different nodes while still guaranteeing that all replicas eventually converge to the same state.</p><p>To understand how CRDTs achieve this, we first need to step back. We need to talk about concurrent operations and what coordination means in a distributed system. Let&#8217;s take it step by step.</p><h1>Concurrent Operations</h1><p>What does concurrent operations mean? Our first intuition might be to say they happen at the same time. That&#8217;s not quite right. Here&#8217;s a counterargument based on a collaborative editing example.</p><ol><li><p>While on a plane, Alice connects to a document and makes an offline change to a sentence.</p></li><li><p>An hour later, Bob connects to the same document and edits the very same sentence, but online.</p></li><li><p>Later, when Alice lands, both versions have to sync.</p></li></ol><p>The two edits (1. and 2.) were separated by an hour. They didn&#8217;t happen at the same time, yet they are concurrent.</p><p><strong>So what&#8217;s a better definition for concurrent operations? Two operations that are not causally related.</strong></p><p>In the previous example, neither operation was made with knowledge of the other. They are not causally related, which makes them concurrent. Yet, if Bob had first seen Alice&#8217;s update and then made his own, his edit would depend on hers. In that case, the two operations wouldn&#8217;t be concurrent anymore.</p><p><strong>We should also understand concurrent &#8800; conflict:</strong></p><ul><li><p>If Alice fixes a missing letter in a word while Bob removes the whole word, that&#8217;s a conflict.</p></li><li><p>If Alice edits one sentence while Bob edits another, that&#8217;s not a conflict.</p></li></ul><p>Concurrency is about independence in knowledge. Conflict is about whether the effects of operations collide.</p><h1>Coordination</h1><p>Now, let&#8217;s talk about coordination in distributed systems.</p><p>Imagine a database with two nodes, node 1 and node 2. A bunch of clients connect to it. Sometimes requests go to node 1, sometimes to node 2. Let&#8217;s say two clients send concurrent and conflicting operations:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wA4s!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbec72fb6-a2ec-4945-ad0d-9acf1e32c68d_760x660.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wA4s!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbec72fb6-a2ec-4945-ad0d-9acf1e32c68d_760x660.png 424w, https://substackcdn.com/image/fetch/$s_!wA4s!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbec72fb6-a2ec-4945-ad0d-9acf1e32c68d_760x660.png 848w, https://substackcdn.com/image/fetch/$s_!wA4s!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbec72fb6-a2ec-4945-ad0d-9acf1e32c68d_760x660.png 1272w, https://substackcdn.com/image/fetch/$s_!wA4s!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbec72fb6-a2ec-4945-ad0d-9acf1e32c68d_760x660.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wA4s!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbec72fb6-a2ec-4945-ad0d-9acf1e32c68d_760x660.png" width="500" height="434.2105263157895" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bec72fb6-a2ec-4945-ad0d-9acf1e32c68d_760x660.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:660,&quot;width&quot;:760,&quot;resizeWidth&quot;:500,&quot;bytes&quot;:86606,&quot;alt&quot;:&quot;Two clients send conflicting balance updates to Node 1 and Node 2, showing the need for coordination in a distributed database.&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://www.thecoder.cafe/i/171988500?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbec72fb6-a2ec-4945-ad0d-9acf1e32c68d_760x660.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Two clients send conflicting balance updates to Node 1 and Node 2, showing the need for coordination in a distributed database." title="Two clients send conflicting balance updates to Node 1 and Node 2, showing the need for coordination in a distributed database." srcset="https://substackcdn.com/image/fetch/$s_!wA4s!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbec72fb6-a2ec-4945-ad0d-9acf1e32c68d_760x660.png 424w, https://substackcdn.com/image/fetch/$s_!wA4s!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbec72fb6-a2ec-4945-ad0d-9acf1e32c68d_760x660.png 848w, https://substackcdn.com/image/fetch/$s_!wA4s!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbec72fb6-a2ec-4945-ad0d-9acf1e32c68d_760x660.png 1272w, https://substackcdn.com/image/fetch/$s_!wA4s!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbec72fb6-a2ec-4945-ad0d-9acf1e32c68d_760x660.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 this case, we can&#8217;t have node 1 storing $200 while node 2 stores -$100. That would be a consistency violation with the two nodes disagreeing on Alice&#8217;s balance.</p><p>Instead, both nodes need to agree on a shared value. To do that, they have to communicate and decide on one of the following:</p><ul><li><p>Reject both operations</p></li><li><p>Accept client A&#8217;s update and set the balance to $200</p></li><li><p>Accept client B&#8217;s update and set the balance to -$100</p></li></ul><p><strong>The very action of nodes communicating and, if needed, waiting to agree on a single outcome is called coordination.</strong></p><p>Coordination is one way to keep replicas consistent under concurrent operations. But coordination is not the only way. That&#8217;s where CRDTs come in.</p><h1>CRDT</h1><p><strong>CRDT stands for Conflict-Free Replicated Data Types</strong>. In short, CRDTs are data structures built so that nodes can accept local updates independently and concurrently, without the need for coordination.</p><p>If you read our recent <a href="https://www.thecoder.cafe/p/availability-models">post</a> on availability models, you might notice we&#8217;re now in the territory of <strong>total availability: a system is totally available if every non-faulty node can execute any operation. </strong>Total availability comes with weaker consistency. For CRDTs, the consistency guarantee is called <strong>Strong Eventual Consistency (SEC)</strong>.</p><p>For that, CRDTs rely on a deterministic conflict resolution algorithm. Because every node applies the same rules, all replicas are guaranteed to eventually converge to the same state.</p><h1>G-Counter</h1><p>Let&#8217;s make this more concrete with a classic CRDT: the G-Counter (Grow-Only Counter).</p><p>Imagine a database with two nodes tracking the number of likes on a post. Node 1 receives a new like, increments its counter, and replies success to the client:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gVtm!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cdb3302-9a98-4d2a-9ce3-9d04aaaff726_760x680.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gVtm!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cdb3302-9a98-4d2a-9ce3-9d04aaaff726_760x680.png 424w, https://substackcdn.com/image/fetch/$s_!gVtm!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cdb3302-9a98-4d2a-9ce3-9d04aaaff726_760x680.png 848w, https://substackcdn.com/image/fetch/$s_!gVtm!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cdb3302-9a98-4d2a-9ce3-9d04aaaff726_760x680.png 1272w, https://substackcdn.com/image/fetch/$s_!gVtm!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cdb3302-9a98-4d2a-9ce3-9d04aaaff726_760x680.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gVtm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cdb3302-9a98-4d2a-9ce3-9d04aaaff726_760x680.png" width="499" height="446.4736842105263" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5cdb3302-9a98-4d2a-9ce3-9d04aaaff726_760x680.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:680,&quot;width&quot;:760,&quot;resizeWidth&quot;:499,&quot;bytes&quot;:79712,&quot;alt&quot;:&quot;Client A increments likes for post 123; Node 1 shows likes=6 while Node 2 remains at 5, illustrating a G-Counter update before sync.&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://www.thecoder.cafe/i/171988500?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cdb3302-9a98-4d2a-9ce3-9d04aaaff726_760x680.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Client A increments likes for post 123; Node 1 shows likes=6 while Node 2 remains at 5, illustrating a G-Counter update before sync." title="Client A increments likes for post 123; Node 1 shows likes=6 while Node 2 remains at 5, illustrating a G-Counter update before sync." srcset="https://substackcdn.com/image/fetch/$s_!gVtm!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cdb3302-9a98-4d2a-9ce3-9d04aaaff726_760x680.png 424w, https://substackcdn.com/image/fetch/$s_!gVtm!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cdb3302-9a98-4d2a-9ce3-9d04aaaff726_760x680.png 848w, https://substackcdn.com/image/fetch/$s_!gVtm!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cdb3302-9a98-4d2a-9ce3-9d04aaaff726_760x680.png 1272w, https://substackcdn.com/image/fetch/$s_!gVtm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cdb3302-9a98-4d2a-9ce3-9d04aaaff726_760x680.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>Then, node 1 communicates with node 2 to send this update:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Yvi3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bae528b-9c9d-4f44-86c9-a25308261af0_820x360.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Yvi3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bae528b-9c9d-4f44-86c9-a25308261af0_820x360.png 424w, https://substackcdn.com/image/fetch/$s_!Yvi3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bae528b-9c9d-4f44-86c9-a25308261af0_820x360.png 848w, https://substackcdn.com/image/fetch/$s_!Yvi3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bae528b-9c9d-4f44-86c9-a25308261af0_820x360.png 1272w, https://substackcdn.com/image/fetch/$s_!Yvi3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bae528b-9c9d-4f44-86c9-a25308261af0_820x360.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Yvi3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bae528b-9c9d-4f44-86c9-a25308261af0_820x360.png" width="526" height="230.9268292682927" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1bae528b-9c9d-4f44-86c9-a25308261af0_820x360.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:360,&quot;width&quot;:820,&quot;resizeWidth&quot;:526,&quot;bytes&quot;:67456,&quot;alt&quot;:&quot;Node 1 shares its update with Node 2, and both replicas for post 123 converge to likes=6, showing G-Counter synchronization.&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://www.thecoder.cafe/i/171988500?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bae528b-9c9d-4f44-86c9-a25308261af0_820x360.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Node 1 shares its update with Node 2, and both replicas for post 123 converge to likes=6, showing G-Counter synchronization." title="Node 1 shares its update with Node 2, and both replicas for post 123 converge to likes=6, showing G-Counter synchronization." srcset="https://substackcdn.com/image/fetch/$s_!Yvi3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bae528b-9c9d-4f44-86c9-a25308261af0_820x360.png 424w, https://substackcdn.com/image/fetch/$s_!Yvi3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bae528b-9c9d-4f44-86c9-a25308261af0_820x360.png 848w, https://substackcdn.com/image/fetch/$s_!Yvi3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bae528b-9c9d-4f44-86c9-a25308261af0_820x360.png 1272w, https://substackcdn.com/image/fetch/$s_!Yvi3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bae528b-9c9d-4f44-86c9-a25308261af0_820x360.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Ultimately, both nodes converge to the same value: 6.</p><p>How does the conflict resolution work for a G-Counter?</p><p>Each replica keeps a vector of counters, with one slot per node. In our example, the total number of likes is 5. Let&#8217;s say node 1 has seen 2 likes and node 2 has seen 3 likes. So the initial state is the following:</p><pre><code>Node 1: [2, 3]
Node 2: [2, 3]</code></pre><p>When node 1 receives a new like, it only increments its own slot. Node 2 is now temporarily out of sync:</p><pre><code>Node 1: [<strong>3</strong>, 3]
Node 2: [2, 3]</code></pre><p>During synchronization, both nodes merge their vectors by taking the element-wise maximum:</p><pre><code>[max(3,2), max(3,3)] = [3, 3]</code></pre><p>Now both replicas converge to the same state:</p><pre><code>Node 1: [3, 3]
Node 2: [<strong>3</strong>, 3]</code></pre><p>The beauty of this algorithm is that it&#8217;s deterministic and order-independent. No matter when or how often the nodes sync, they always end up with the same state.</p><blockquote><p><strong>NOTE</strong>: Do you know Gossip Glomers? It&#8217;s a series of distributed systems challenges we briefly introduced in an earlier <a href="https://read.thecoder.cafe/p/gossip-glomers">post</a>. Challenge 4 is to build a Grow-Only Counter. It&#8217;s worth checking out if you haven&#8217;t already.</p></blockquote><h1>PN-Counter</h1><p><strong>CRDTs can also be combined to make a more complex CRDT.</strong> For example, if we want to track both likes and dislikes, we can use two G-Counters together. This data type is called a PN-Counter (Positive-Negative Counter).</p><p>Imagine two clients act concurrently on the same post: one likes it, another dislikes 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_!vw6t!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe65b292-48c9-4e55-8d85-642ec05e67f2_760x680.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!vw6t!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe65b292-48c9-4e55-8d85-642ec05e67f2_760x680.png 424w, https://substackcdn.com/image/fetch/$s_!vw6t!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe65b292-48c9-4e55-8d85-642ec05e67f2_760x680.png 848w, https://substackcdn.com/image/fetch/$s_!vw6t!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe65b292-48c9-4e55-8d85-642ec05e67f2_760x680.png 1272w, https://substackcdn.com/image/fetch/$s_!vw6t!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe65b292-48c9-4e55-8d85-642ec05e67f2_760x680.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!vw6t!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe65b292-48c9-4e55-8d85-642ec05e67f2_760x680.png" width="500" height="447.36842105263156" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fe65b292-48c9-4e55-8d85-642ec05e67f2_760x680.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:680,&quot;width&quot;:760,&quot;resizeWidth&quot;:500,&quot;bytes&quot;:84183,&quot;alt&quot;:&quot;Client A adds a like and Client B adds a dislike on post 123; Node 1 shows likes=6 while Node 2 shows likes=4, illustrating a PN-Counter before sync.&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://www.thecoder.cafe/i/171988500?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe65b292-48c9-4e55-8d85-642ec05e67f2_760x680.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Client A adds a like and Client B adds a dislike on post 123; Node 1 shows likes=6 while Node 2 shows likes=4, illustrating a PN-Counter before sync." title="Client A adds a like and Client B adds a dislike on post 123; Node 1 shows likes=6 while Node 2 shows likes=4, illustrating a PN-Counter before sync." srcset="https://substackcdn.com/image/fetch/$s_!vw6t!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe65b292-48c9-4e55-8d85-642ec05e67f2_760x680.png 424w, https://substackcdn.com/image/fetch/$s_!vw6t!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe65b292-48c9-4e55-8d85-642ec05e67f2_760x680.png 848w, https://substackcdn.com/image/fetch/$s_!vw6t!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe65b292-48c9-4e55-8d85-642ec05e67f2_760x680.png 1272w, https://substackcdn.com/image/fetch/$s_!vw6t!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe65b292-48c9-4e55-8d85-642ec05e67f2_760x680.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 nodes exchange their updates and converge to the same value:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-sAF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3467e744-06ef-40f2-9399-dc77fcdbb12f_916x320.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-sAF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3467e744-06ef-40f2-9399-dc77fcdbb12f_916x320.png 424w, https://substackcdn.com/image/fetch/$s_!-sAF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3467e744-06ef-40f2-9399-dc77fcdbb12f_916x320.png 848w, https://substackcdn.com/image/fetch/$s_!-sAF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3467e744-06ef-40f2-9399-dc77fcdbb12f_916x320.png 1272w, https://substackcdn.com/image/fetch/$s_!-sAF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3467e744-06ef-40f2-9399-dc77fcdbb12f_916x320.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-sAF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3467e744-06ef-40f2-9399-dc77fcdbb12f_916x320.png" width="916" height="320" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3467e744-06ef-40f2-9399-dc77fcdbb12f_916x320.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:320,&quot;width&quot;:916,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:72272,&quot;alt&quot;:&quot;Nodes 1 and 2 exchange updates for post 123 and both converge to likes=5, demonstrating PN-Counter conflict resolution.&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://www.thecoder.cafe/i/171988500?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3467e744-06ef-40f2-9399-dc77fcdbb12f_916x320.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Nodes 1 and 2 exchange updates for post 123 and both converge to likes=5, demonstrating PN-Counter conflict resolution." title="Nodes 1 and 2 exchange updates for post 123 and both converge to likes=5, demonstrating PN-Counter conflict resolution." srcset="https://substackcdn.com/image/fetch/$s_!-sAF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3467e744-06ef-40f2-9399-dc77fcdbb12f_916x320.png 424w, https://substackcdn.com/image/fetch/$s_!-sAF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3467e744-06ef-40f2-9399-dc77fcdbb12f_916x320.png 848w, https://substackcdn.com/image/fetch/$s_!-sAF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3467e744-06ef-40f2-9399-dc77fcdbb12f_916x320.png 1272w, https://substackcdn.com/image/fetch/$s_!-sAF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3467e744-06ef-40f2-9399-dc77fcdbb12f_916x320.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 the case of a PN-Counter, the conflict resolution algorithm is similar to the G-Counter. The difference lies in the fact that it involves not one but two vectors: one for increases and one for decreases.</p><p>Assume an initial state where node 1 has received 2 likes and 0 dislikes, and node 2 has received 3 likes and 0 dislikes:</p><pre><code>-- Increase
Node 1: [2, 3]
Node 2: [2, 3]

-- Decrease
Node 1: [0, 0]
Node 2: [0, 0]</code></pre><p>Now, suppose node 1 receives a new like and node 2 receives a dislike. Before the sync, the state is the following:</p><pre><code>-- Increase
Node 1: [<strong>3</strong>, 3]
Node 2: [2, 3]

-- Decrease
Node 1: [0, 0]
Node 2: [0, <strong>1</strong>]</code></pre><p>When the replicas exchange their state, the merge rule is element-wise maximum for each vector:</p><pre><code>-- Increase
[max(3,2), max(3,3)] = [3, 3]

-- Decrease
[max(0,0), max(0,1)] = [0, 1]</code></pre><p>After sync, both nodes converge to:</p><pre><code>-- Increase
Node 1: [3, 3]
Node 2: [<strong>3</strong>, 3]

-- Decrease
Node 1: [0, <strong>1</strong>]
Node 2: [0, 1]</code></pre><p>The final counter of likes is:</p><pre><code>node1Likes + node2Likes - node1Dislikes - node2Dislikes
= 3 + 3 - 0 - 1
= 5</code></pre><h1>Use Cases</h1><p>Let&#8217;s pause for a second. Based on what we&#8217;ve discussed, can you think of some use cases for CRDTs? A data structure where nodes are updated independently, concurrently, without coordination, and still guarantees that they converge to the same state?</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!K5jT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!K5jT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!K5jT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!K5jT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!K5jT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!K5jT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png" width="725.5375366210938" height="362.7687683105469" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:725.5375366210938,&quot;bytes&quot;:55063,&quot;alt&quot;:&quot;Time to think.&quot;,&quot;title&quot;:&quot;Time to think.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/163697017?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:&quot;center&quot;,&quot;offset&quot;:false}" class="sizing-normal" alt="Time to think." title="Time to think." srcset="https://substackcdn.com/image/fetch/$s_!K5jT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!K5jT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!K5jT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!K5jT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.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>One main use case is collaborative and offline-first systems.</strong> For example, Notion, a collaborative workspace, recently introduced a feature that lets people edit the same content offline. They rely on CRDTs, and more specifically on Peritext, a CRDT for rich-text collaboration co-authored by multiple people, including <span class="mention-wrap" data-attrs="{&quot;name&quot;:&quot;Martin Kleppmann&quot;,&quot;id&quot;:3519005,&quot;type&quot;:&quot;user&quot;,&quot;url&quot;:null,&quot;photo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/47a66e89-1de0-4001-9a3c-60abe841e575_2102x2102.jpeg&quot;,&quot;uuid&quot;:&quot;8d478747-27ec-474f-ace6-1e8939782a19&quot;}" data-component-name="MentionToDOM"></span>.</p><p><strong>Another big use case is totally available systems that put availability ahead of strong consistency.</strong> As we&#8217;ve seen, nodes don&#8217;t need to coordinate before acknowledging a client request, which makes the system more highly available.</p><p>Take Redis, for example. It can be configured in an active-active architecture with geographically distributed datacenter<strong>s.</strong> Clients connect to their closest cluster and get local latencies without waiting for coordination across distant regions. And yes, this setup is built on CRDTs.</p><p>We could also think about other applications for CRDTs, like:</p><ul><li><p><strong>Edge &amp; IoT</strong>: Devices update offline and merge later without a central server.</p></li><li><p><strong>Peer-to-peer</strong>: Peers share changes directly and match up when they reconnect.</p></li><li><p><strong>CDN/edge state</strong>: Keep preferences, drafts, or counters near users and sync to the origin later.</p></li></ul><h1>Different Types of CRDTs</h1><p>There are two main types of CRDTs:</p><ul><li><p><strong>State-based CRDTs</strong>: Convergence happens by propagating the full state.</p></li><li><p><strong>Operation-based CRDTs</strong>: Convergence happens by propagating the update operations.</p></li></ul><h2>State-Based CRDTs</h2><p>In the previous examples, we looked at two state-based CRDTs: the G-Counter (Grow-Only Counter) and the PN-Counter (Positive-Negative Counter). In both cases, what was exchanged between the nodes was the entire state. For example, node 1 could tell node 2 that its total number of likes is 3.</p><p>With state-based CRDTs, states are merged with a function that must be:</p><ul><li><p><strong>Commutative:</strong> We can merge in any order and get the same result.</p></li><li><p><strong>Idempotent:</strong> Merging something with itself doesn&#8217;t change it.</p></li><li><p><strong>Associative:</strong> We can merge in any grouping and get the same result.</p></li></ul><p>Each synchronization monotonically increases the internal state. In other words, when two replicas sync, the state can only move forward, never backward. This is enforced by a simple &#8220;<em>can&#8217;t-go-backwards</em>&#8221; rule (a partial order), where merges use operations like max for numbers (as we&#8217;ve seen) or union for sets.</p><h2>Operation-Based CRDTs</h2><p>In operation-based CRDTs, nodes share the operations rather than the full state. Convergence relies on three properties:</p><ul><li><p><strong>Commutativity</strong> of concurrent operations</p></li><li><p><strong>Causality:</strong> Either carried in the operations&#8217; metadata (for example, vector clocks) or guaranteed by the transport layer through causal delivery</p></li><li><p><strong>Duplicate tolerance:</strong> Handled by idempotent operations, unique operation IDs with deduplication, or a transport layer that guarantees no duplicates</p></li></ul><p>One example of an operation-based CRDT is the LWW-Register (Last-Writer-Wins Register), which stores a single value. Updates are resolved using a logical timestamp (such as Lamport clocks) along with a tie-breaker like the node ID. When a node writes a value, it broadcasts an operation <code>(value, timestamp, nodeID)</code>. On receiving it, a node applies the update if the pair <code>(timestamp, nodeID)</code> is greater than the one it currently holds.</p><h2>CRDT Types Summary</h2><p>To summarize:</p><ul><li><p><strong>State-based CRDTs:</strong></p><ul><li><p>Convergence is guaranteed because merging states is associative, commutative, and idempotent.</p></li><li><p>Don&#8217;t require assumptions on the delivery layer beyond eventual delivery.</p></li><li><p>Simpler to reason about. </p></li><li><p>Exchanging full states can be more bandwidth-intensive.</p></li></ul></li><li><p><strong>Operation-based CRDTs:</strong></p><ul><li><p>More bandwidth-efficient; we only send the operations, not the whole state.</p></li><li><p>Correctness usually depends on having causal order (or encoding causality in the ops) and tolerating duplicates via idempotence/dedup.</p></li><li><p>More complex to implement (causal broadcast, vector clocks, or equivalent).</p></li></ul></li></ul><p>For completeness, there&#8217;s also a third type we should be aware of: <strong>delta-based CRDTs</strong>. Here, convergence is achieved by sending and merging fragments of state (deltas) rather than the entire state. A quick analogy to picture the differences:</p><ul><li><p><strong>State-based CRDT:</strong> &#8220;<em>From time to time, send me the whole document.</em>&#8221;</p></li><li><p><strong>Operation-based CRDT:</strong> &#8220;<em>When you make a change, tell me exactly what you did.</em>&#8221; &#8594; &#8220;<em>Adding word `miles` at position 42.</em>&#8221;</p></li><li><p><strong>Delta-based CRDT:</strong> &#8220;<em>When you make a change, send me just the delta that reflects it (for example, the updated sentence)</em>&#8221; &#8594; &#8220;<em>And miles to go before I sleep.</em>&#8221;</p></li></ul><h1>CRDT vs. OT</h1><p>We talked about collaborative document editing. So you might assume a system like Google Docs is based on CRDTs, right?</p><p>Well, that&#8217;s not the case. <strong>Google Docs is based on another concept called OT (Operational Transformation)</strong>. The goal of OT and CRDT is the same: convergence among all nodes in a collaborative system.</p><p>The main difference is that OT requires all communication to go through the same server:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!i4v7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64278c2d-e5b4-444d-85d2-ea049c2b4921_832x680.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!i4v7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64278c2d-e5b4-444d-85d2-ea049c2b4921_832x680.png 424w, https://substackcdn.com/image/fetch/$s_!i4v7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64278c2d-e5b4-444d-85d2-ea049c2b4921_832x680.png 848w, https://substackcdn.com/image/fetch/$s_!i4v7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64278c2d-e5b4-444d-85d2-ea049c2b4921_832x680.png 1272w, https://substackcdn.com/image/fetch/$s_!i4v7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64278c2d-e5b4-444d-85d2-ea049c2b4921_832x680.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!i4v7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64278c2d-e5b4-444d-85d2-ea049c2b4921_832x680.png" width="500" height="408.65384615384613" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/64278c2d-e5b4-444d-85d2-ea049c2b4921_832x680.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:680,&quot;width&quot;:832,&quot;resizeWidth&quot;:500,&quot;bytes&quot;:74701,&quot;alt&quot;:&quot;Diagram showing OT architecture where Nodes 1, 2, and 3 communicate through a central server to achieve convergence.&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://www.thecoder.cafe/i/171988500?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64278c2d-e5b4-444d-85d2-ea049c2b4921_832x680.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Diagram showing OT architecture where Nodes 1, 2, and 3 communicate through a central server to achieve convergence." title="Diagram showing OT architecture where Nodes 1, 2, and 3 communicate through a central server to achieve convergence." srcset="https://substackcdn.com/image/fetch/$s_!i4v7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64278c2d-e5b4-444d-85d2-ea049c2b4921_832x680.png 424w, https://substackcdn.com/image/fetch/$s_!i4v7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64278c2d-e5b4-444d-85d2-ea049c2b4921_832x680.png 848w, https://substackcdn.com/image/fetch/$s_!i4v7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64278c2d-e5b4-444d-85d2-ea049c2b4921_832x680.png 1272w, https://substackcdn.com/image/fetch/$s_!i4v7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64278c2d-e5b4-444d-85d2-ea049c2b4921_832x680.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>We haven&#8217;t mentioned it until now (on purpose), but <strong>with CRDTs, there&#8217;s no need for a central server to achieve convergence</strong>.</p><p>Back to our collaborative editing tool: if Alice and Bob are both offline but manage to connect their laptops directly, they could still achieve convergence without talking to a central server:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tSU3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a444cf1-ede9-4650-83c9-263ceea983c6_832x200.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tSU3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a444cf1-ede9-4650-83c9-263ceea983c6_832x200.png 424w, https://substackcdn.com/image/fetch/$s_!tSU3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a444cf1-ede9-4650-83c9-263ceea983c6_832x200.png 848w, https://substackcdn.com/image/fetch/$s_!tSU3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a444cf1-ede9-4650-83c9-263ceea983c6_832x200.png 1272w, https://substackcdn.com/image/fetch/$s_!tSU3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a444cf1-ede9-4650-83c9-263ceea983c6_832x200.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tSU3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a444cf1-ede9-4650-83c9-263ceea983c6_832x200.png" width="500" height="120.1923076923077" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0a444cf1-ede9-4650-83c9-263ceea983c6_832x200.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:200,&quot;width&quot;:832,&quot;resizeWidth&quot;:500,&quot;bytes&quot;:49073,&quot;alt&quot;:&quot;Diagram showing two nodes connected directly to each other, illustrating how CRDTs achieve convergence without a central server.&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://www.thecoder.cafe/i/171988500?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a444cf1-ede9-4650-83c9-263ceea983c6_832x200.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Diagram showing two nodes connected directly to each other, illustrating how CRDTs achieve convergence without a central server." title="Diagram showing two nodes connected directly to each other, illustrating how CRDTs achieve convergence without a central server." srcset="https://substackcdn.com/image/fetch/$s_!tSU3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a444cf1-ede9-4650-83c9-263ceea983c6_832x200.png 424w, https://substackcdn.com/image/fetch/$s_!tSU3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a444cf1-ede9-4650-83c9-263ceea983c6_832x200.png 848w, https://substackcdn.com/image/fetch/$s_!tSU3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a444cf1-ede9-4650-83c9-263ceea983c6_832x200.png 1272w, https://substackcdn.com/image/fetch/$s_!tSU3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a444cf1-ede9-4650-83c9-263ceea983c6_832x200.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>As we saw earlier, CRDTs embed a deterministic conflict resolution algorithm. The data type itself ensures convergence.</p><p>That&#8217;s the key difference: CRDTs don&#8217;t need to make any assumptions about the network topology or about a central server. <span class="mention-wrap" data-attrs="{&quot;name&quot;:&quot;Martin Kleppmann&quot;,&quot;id&quot;:3519005,&quot;type&quot;:&quot;user&quot;,&quot;url&quot;:null,&quot;photo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/47a66e89-1de0-4001-9a3c-60abe841e575_2102x2102.jpeg&quot;,&quot;uuid&quot;:&quot;f0ce5f94-0d7b-4799-8101-4639b98efb14&quot;}" data-component-name="MentionToDOM"></span> considers CRDT to be the natural successor of OT.</p><blockquote><p><strong>NOTE</strong>: So, why is Google Docs still based on OT? Historical reasons. Google Docs was launched before CRDTs existed, and it still works really well. There&#8217;s no practical reason for Google to migrate from OT to CRDT, despite some discussions about it in the past.</p></blockquote><h1>Conclusion</h1><ul><li><p>Operations are concurrent when they aren&#8217;t causally related; concurrency doesn&#8217;t automatically mean conflict.</p></li><li><p>Coordination is when replicas communicate and, if needed, wait to agree on a single outcome for concurrent updates before acknowledging clients, so they don&#8217;t diverge.</p></li><li><p>CRDTs accept independent updates on each replica and still converge via deterministic merge rules.</p></li><li><p>Three types: state-based (share full state), operation-based (share operations), delta-based (share just the changed parts).</p></li><li><p>CRDTs are a great fit for systems like offline-first collaboration and highly available systems.</p></li><li><p>Unlike OT, CRDTs don&#8217;t rely on a central server to reach the same result everywhere.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://read.thecoder.cafe/" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://read.thecoder.cafe/&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">AI is getting better every day. Are you? At The Coder Cafe, we serve fundamental concepts to make you an engineer that AI can&#8217;t replace. Written by a Google SWE, trusted by thousands of engineers worldwide.</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><h1>Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/distributed-systems">Distributed Systems</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/exploring-database-isolation-levels">Exploring Database Isolation Levels</a></p></li><li><p><a href="https://read.thecoder.cafe/p/consensus">Consensus</a></p></li><li><p><a href="https://read.thecoder.cafe/p/safety-liveness">Safety and Liveness</a></p></li></ul><h2>Sources</h2><ul><li><p><a href="https://x.com/ivanhzhao/status/1957832558017655292">Ivan Zhao (Notion&#8217;s CEO) tweet on the new Notion offline collaboration feature</a></p></li><li><p><a href="https://redis.io/blog/diving-into-crdts/">Diving into Conflict-Free Replicated Data Types (CRDTs) - Redis</a></p></li><li><p>CRDTs: The Hard Parts by <span class="mention-wrap" data-attrs="{&quot;name&quot;:&quot;Martin Kleppmann&quot;,&quot;id&quot;:3519005,&quot;type&quot;:&quot;user&quot;,&quot;url&quot;:null,&quot;photo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/47a66e89-1de0-4001-9a3c-60abe841e575_2102x2102.jpeg&quot;,&quot;uuid&quot;:&quot;5c3468ea-5010-43c8-b59b-d9afc76e64c9&quot;}" data-component-name="MentionToDOM"></span></p><div id="youtube2-x7drE24geUw" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;x7drE24geUw&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/x7drE24geUw?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div></li></ul><h2>Explore Further</h2><ul><li><p><a href="https://news.ycombinator.com/item?id=45606224">Hacker News discussion</a></p></li><li><p><a href="https://www.inkandswitch.com/peritext/">Peritext - A CRDT for Rich-Text Collaboration</a></p></li><li><p><a href="https://redis.io/active-active/">Active-Active geo-distribution (CRDTS-based) - Redis</a></p></li><li><p><a href="https://www.bartoszsypytkowski.com/crdt-optimizations/">Bartosz Sypytkowski&#8217;s 12-part blog series on CRDT</a></p></li><li><p><a href="https://crdt.tech">crdt.tech</a></p></li></ul><div><hr></div><p>&#10084;&#65039; <em>If you enjoyed this post, please hit the like button.</em></p><p>&#128172; <em>Have you worked with CRDTs before, or do you see another use case where they shine? Share your thoughts in the comments!</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/p/crdt/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://read.thecoder.cafe/p/crdt/comments"><span>Leave a comment</span></a></p>]]></content:encoded></item><item><title><![CDATA[Organic Growth vs. Controlled Growth]]></title><description><![CDATA[A codebase is like a garden: left to grow organically, it becomes colorful but chaotic.]]></description><link>https://read.thecoder.cafe/p/organic-growth-vs-controlled-growth</link><guid isPermaLink="false">https://read.thecoder.cafe/p/organic-growth-vs-controlled-growth</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Tue, 30 Sep 2025 10:00:31 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!XUmw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5459de59-4ec5-4c60-b003-0faec3595c8a_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>&#9749; <em>Welcome to The Coder Cafe! Today, we will discuss the concept of organic growth vs. controlled growth. Get cozy, grab a coffee, and let&#8217;s begin!</em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!XUmw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5459de59-4ec5-4c60-b003-0faec3595c8a_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!XUmw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5459de59-4ec5-4c60-b003-0faec3595c8a_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!XUmw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5459de59-4ec5-4c60-b003-0faec3595c8a_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!XUmw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5459de59-4ec5-4c60-b003-0faec3595c8a_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!XUmw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5459de59-4ec5-4c60-b003-0faec3595c8a_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!XUmw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5459de59-4ec5-4c60-b003-0faec3595c8a_1600x800.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5459de59-4ec5-4c60-b003-0faec3595c8a_1600x800.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;:1664361,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/169610120?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5459de59-4ec5-4c60-b003-0faec3595c8a_1600x800.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_!XUmw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5459de59-4ec5-4c60-b003-0faec3595c8a_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!XUmw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5459de59-4ec5-4c60-b003-0faec3595c8a_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!XUmw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5459de59-4ec5-4c60-b003-0faec3595c8a_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!XUmw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5459de59-4ec5-4c60-b003-0faec3595c8a_1600x800.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg 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 few months ago, I was in a meeting discussing the state of a codebase and heard myself say:</p><div class="pullquote"><p><em>This codebase has grown organically.</em></p></div><p>After reflecting on my own words, I began questioning myself: I don&#8217;t even know what organic growth really means and whether it is ultimately positive or negative.</p><p>Discussing the concept with various colleagues, I noticed we had different interpretations. I also created a <a href="https://x.com/teivah/status/1950276971839074785">poll</a> on X that went viral (#<em>irony</em>), showing that most people see organic growth as something positive.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!sRsv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3898318e-a8e9-47cc-9ed1-5ba0253ea700_872x367.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sRsv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3898318e-a8e9-47cc-9ed1-5ba0253ea700_872x367.png 424w, https://substackcdn.com/image/fetch/$s_!sRsv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3898318e-a8e9-47cc-9ed1-5ba0253ea700_872x367.png 848w, https://substackcdn.com/image/fetch/$s_!sRsv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3898318e-a8e9-47cc-9ed1-5ba0253ea700_872x367.png 1272w, https://substackcdn.com/image/fetch/$s_!sRsv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3898318e-a8e9-47cc-9ed1-5ba0253ea700_872x367.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sRsv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3898318e-a8e9-47cc-9ed1-5ba0253ea700_872x367.png" width="598" height="251.68119266055047" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3898318e-a8e9-47cc-9ed1-5ba0253ea700_872x367.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:367,&quot;width&quot;:872,&quot;resizeWidth&quot;:598,&quot;bytes&quot;:53267,&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://www.thecoder.cafe/i/169610120?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3898318e-a8e9-47cc-9ed1-5ba0253ea700_872x367.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_!sRsv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3898318e-a8e9-47cc-9ed1-5ba0253ea700_872x367.png 424w, https://substackcdn.com/image/fetch/$s_!sRsv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3898318e-a8e9-47cc-9ed1-5ba0253ea700_872x367.png 848w, https://substackcdn.com/image/fetch/$s_!sRsv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3898318e-a8e9-47cc-9ed1-5ba0253ea700_872x367.png 1272w, https://substackcdn.com/image/fetch/$s_!sRsv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3898318e-a8e9-47cc-9ed1-5ba0253ea700_872x367.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>If Perplexity is correct, the term organic growth was used first in <em><a href="https://www.goodreads.com/book/show/661723.Bushido">Bushido: The Soul of Japan</a></em>, published in 1899. The author, Inazo Nitobe, describes Bushido (aka the way of the samurai) as something that developed through organic growth rather than being the invention of a single person or the result of a single event. In other words, Bushido emerged gradually over decades and centuries as a collective experience, not the product of one individual.</p><p>It&#8217;s easy to draw parallels with the many codebases we maintain at work. The older the codebase and the more developers it has had, each with their own vision of how the code should look. Differences in perception arise from factors like developers&#8217; varied mental models based on the parts of the code they know best. </p><p>Developers come and go, making changes, introducing biases about what the future should be, and after years, the codebase reflects hundreds or even thousands of such incremental changes.</p><p>This is organic growth in software: incremental delivery driven by agile methodology that shapes codebases, often in a bottom-up manner.</p><p>So, is organic growth good or bad? Let&#8217;s use the garden metaphor: imagine a public garden where anyone can plant whatever they want and wherever they want. Over time, sure, it&#8217;s colorful, but there&#8217;s little harmony, with a lack of overall guidance or direction:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!XNU6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c608f7e-416a-4136-9a63-3e8bead8e612_1536x768.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!XNU6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c608f7e-416a-4136-9a63-3e8bead8e612_1536x768.png 424w, https://substackcdn.com/image/fetch/$s_!XNU6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c608f7e-416a-4136-9a63-3e8bead8e612_1536x768.png 848w, https://substackcdn.com/image/fetch/$s_!XNU6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c608f7e-416a-4136-9a63-3e8bead8e612_1536x768.png 1272w, https://substackcdn.com/image/fetch/$s_!XNU6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c608f7e-416a-4136-9a63-3e8bead8e612_1536x768.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!XNU6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c608f7e-416a-4136-9a63-3e8bead8e612_1536x768.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1c608f7e-416a-4136-9a63-3e8bead8e612_1536x768.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;:2430306,&quot;alt&quot;:&quot;A dense public garden filled with many types of colorful flowers&#8212;yellow, orange, purple, pink, blue, and white&#8212;growing in a disorganized, overlapping way. The plants lack clear structure or design, creating a chaotic and crowded appearance.&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://www.thecoder.cafe/i/169610120?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c608f7e-416a-4136-9a63-3e8bead8e612_1536x768.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="A dense public garden filled with many types of colorful flowers&#8212;yellow, orange, purple, pink, blue, and white&#8212;growing in a disorganized, overlapping way. The plants lack clear structure or design, creating a chaotic and crowded appearance." title="A dense public garden filled with many types of colorful flowers&#8212;yellow, orange, purple, pink, blue, and white&#8212;growing in a disorganized, overlapping way. The plants lack clear structure or design, creating a chaotic and crowded appearance." srcset="https://substackcdn.com/image/fetch/$s_!XNU6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c608f7e-416a-4136-9a63-3e8bead8e612_1536x768.png 424w, https://substackcdn.com/image/fetch/$s_!XNU6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c608f7e-416a-4136-9a63-3e8bead8e612_1536x768.png 848w, https://substackcdn.com/image/fetch/$s_!XNU6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c608f7e-416a-4136-9a63-3e8bead8e612_1536x768.png 1272w, https://substackcdn.com/image/fetch/$s_!XNU6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c608f7e-416a-4136-9a63-3e8bead8e612_1536x768.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>Now imagine we control what can be planted and where, and periodically review and rearrange what&#8217;s growing. Our garden will likely look harmonious and well-maintained:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!jXbE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c62d9df-0d06-4fc4-8e9f-e32f207b6756_1536x768.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jXbE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c62d9df-0d06-4fc4-8e9f-e32f207b6756_1536x768.png 424w, https://substackcdn.com/image/fetch/$s_!jXbE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c62d9df-0d06-4fc4-8e9f-e32f207b6756_1536x768.png 848w, https://substackcdn.com/image/fetch/$s_!jXbE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c62d9df-0d06-4fc4-8e9f-e32f207b6756_1536x768.png 1272w, https://substackcdn.com/image/fetch/$s_!jXbE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c62d9df-0d06-4fc4-8e9f-e32f207b6756_1536x768.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jXbE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c62d9df-0d06-4fc4-8e9f-e32f207b6756_1536x768.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1c62d9df-0d06-4fc4-8e9f-e32f207b6756_1536x768.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;:2552515,&quot;alt&quot;:&quot;A well-maintained garden with neatly arranged flower beds. Bright pink peonies and white daisies border a clear grassy path, with trees and greenery providing shade. The layout looks intentional and harmonious, with a sense of balance and order.&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://www.thecoder.cafe/i/169610120?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c62d9df-0d06-4fc4-8e9f-e32f207b6756_1536x768.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="A well-maintained garden with neatly arranged flower beds. Bright pink peonies and white daisies border a clear grassy path, with trees and greenery providing shade. The layout looks intentional and harmonious, with a sense of balance and order." title="A well-maintained garden with neatly arranged flower beds. Bright pink peonies and white daisies border a clear grassy path, with trees and greenery providing shade. The layout looks intentional and harmonious, with a sense of balance and order." srcset="https://substackcdn.com/image/fetch/$s_!jXbE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c62d9df-0d06-4fc4-8e9f-e32f207b6756_1536x768.png 424w, https://substackcdn.com/image/fetch/$s_!jXbE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c62d9df-0d06-4fc4-8e9f-e32f207b6756_1536x768.png 848w, https://substackcdn.com/image/fetch/$s_!jXbE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c62d9df-0d06-4fc4-8e9f-e32f207b6756_1536x768.png 1272w, https://substackcdn.com/image/fetch/$s_!jXbE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c62d9df-0d06-4fc4-8e9f-e32f207b6756_1536x768.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 my opinion, organic growth carries a somewhat negative connotation, implying a lack of direction, with systems growing out of ad hoc solutions and quick fixes rather than intentional design.</p><p>So, how can we move from a messy garden to a harmonious one? By transitioning from organic to controlled growth.</p><p>Controlled growth is the deliberate and reflective process of evolving a codebase. With controlled growth, we should also embrace progress that is not always perfect but consistently guided by shared patterns and standards, fostering sustainable, manageable, and harmonious development over time.</p><p>Here are five main rules for controlled growth:</p><ul><li><p><strong>Be consistent</strong>. Follow agreed conventions and standards to build maintainable and predictable codebases. Many standards aren&#8217;t explicit, so strive to follow even the implicit ones. For example, if an entity is consistently named X, don&#8217;t be a cowboy and name it Y; stick to X.</p></li><li><p><strong>Plan ahead for large changes.</strong> Think strategically and collectively about big transitions such as significant new features. Avoid chaos and technical debt by breaking ambitious changes into smaller phases, communicating plans early, and leveraging documentation assets such as design docs (see Explore Further section).</p></li><li><p><strong>Hold regular retrospectives.</strong> After major development milestones, gather the team to review what went well and what could improve. Retrospectives foster a culture of learning and continuous improvement, a strategic pillar of controlled growth.</p></li><li><p><strong>Apply the Boy Scout rule.</strong> Frequent changes are inevitable and often rushed under pressure. Remember: <em>&#8220;Always leave the campground cleaner than you found it.&#8221;</em> When making a pull request, spend a little time refactoring small bits, cleaning legacy code, removing dead code, or renaming variables. This keeps the garden harmonious over time.</p></li><li><p><strong>Build a team where everyone shares responsibility and speaks openly.</strong> Controlled growth shouldn&#8217;t fall only on tech leads; it should be everyone&#8217;s job. When all team members feel heard and share responsibility for the health and quality of the codebase, the team grows on a stronger, more sustainable foundation.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://read.thecoder.cafe/" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://read.thecoder.cafe/&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">AI is getting better every day. Are you? At The Coder Cafe, we serve fundamental concepts to make you an engineer that AI can&#8217;t replace. Written by a Google SWE, trusted by thousands of engineers worldwide.</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><h1>Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/programming">Programming</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/tidy-first">Tidy First?</a> <em>// We already discussed organic growth in this post.</em></p></li><li><p><a href="https://read.thecoder.cafe/p/focus-on-product-ideas-not-requirements">Focus on Product Ideas, Not Requirements</a></p></li><li><p><a href="https://read.thecoder.cafe/p/cognitive-load">Cognitive Load</a></p></li></ul><h2>Sources</h2><ul><li><p><a href="https://books.google.fr/books/about/Bushido.html?id=--HpQwAACAAJ">Bushido: The Soul of Japan</a></p></li></ul><h2>Explore Further</h2><ul><li><p><a href="https://www.industrialempathy.com/posts/design-docs-at-google/">Design Docs at Google</a></p></li></ul><div><hr></div><p>&#10084;&#65039; <em>If you enjoyed this post, please hit the like button.</em></p><p>&#128172; <em>When you say a codebase grew organically, what do you mean?</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/p/organic-growth-vs-controlled-growth/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://read.thecoder.cafe/p/organic-growth-vs-controlled-growth/comments"><span>Leave a comment</span></a></p>]]></content:encoded></item><item><title><![CDATA[Second Brain Explained]]></title><description><![CDATA[Your mind is for having ideas, but without a second brain, those ideas fade into memory.]]></description><link>https://read.thecoder.cafe/p/second-brain</link><guid isPermaLink="false">https://read.thecoder.cafe/p/second-brain</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Wed, 03 Sep 2025 10:03:03 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!uHs5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9533e38-bfc4-41e8-9807-7e380b626737_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>&#9749; <em>Welcome to The Coder Cafe! Today, I wanted to share a book that had a huge impact on how I organize my personal and professional knowledge: <a href="https://www.goodreads.com/book/show/59616977-building-a-second-brain">Building a Second Brain</a> by Tiago Forte. Get cozy, grab a coffee, and let&#8217;s begin!</em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!uHs5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9533e38-bfc4-41e8-9807-7e380b626737_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!uHs5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9533e38-bfc4-41e8-9807-7e380b626737_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!uHs5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9533e38-bfc4-41e8-9807-7e380b626737_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!uHs5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9533e38-bfc4-41e8-9807-7e380b626737_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!uHs5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9533e38-bfc4-41e8-9807-7e380b626737_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!uHs5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9533e38-bfc4-41e8-9807-7e380b626737_1600x800.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f9533e38-bfc4-41e8-9807-7e380b626737_1600x800.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;:1659530,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/167576108?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9533e38-bfc4-41e8-9807-7e380b626737_1600x800.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_!uHs5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9533e38-bfc4-41e8-9807-7e380b626737_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!uHs5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9533e38-bfc4-41e8-9807-7e380b626737_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!uHs5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9533e38-bfc4-41e8-9807-7e380b626737_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!uHs5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9533e38-bfc4-41e8-9807-7e380b626737_1600x800.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg 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><h1>A Decade of Failures</h1><p>For over a decade, I failed miserably at keeping an effective note-taking system, mostly for two reasons:</p><ol><li><p>I never had a single, centralized place. I used to rely on a combination of <a href="https://www.notion.com">Notion</a> + Apple Notes + a physical notebook + Kindle highlights + <a href="https://apps.ankiweb.net/">Anki</a>.</p></li><li><p>I didn&#8217;t have a system that was generic enough. I had a different format pretty much every time: book summaries, posts, computer science notes, <a href="https://www.thecoder.cafe/p/mistake-journal">mistake journal</a>, personal growth notes, and so on.</p></li></ol><p>The result was a messy system that didn&#8217;t scale. <strong>I kept losing knowledge, and it made learning inefficient</strong>. When we read or watch a great resource but don&#8217;t capture what we learned from it, chances are high that within a few months or even weeks, that knowledge fades away. That&#8217;s what kept happening to me.</p><p>In a world full of content&#8212;social media, work, books, courses, podcasts&#8212;being able to extract and retain working knowledge isn&#8217;t optional; it&#8217;s necessary if we want to <strong>keep growing as an engineer and as a person</strong>.</p><p>Let&#8217;s discuss an approach to solve this problem.</p><h1>Second Brain</h1><p>One of the first sentences in the book hooked me:</p><div class="pullquote"><p>Your mind is for having ideas, not holding them.</p></div><p>Our brain is great for processing ongoing tasks, but it&#8217;s not meant to retain everything. Over time, it lets go of unused ideas to make room for more relevant ones. This process, referred to as synaptic pruning, helps us adapt, but it also means we lose what we don&#8217;t externalize.</p><p><strong>That&#8217;s the promise of a second brain:</strong> <strong>a place to offload notes and thoughts, avoid losing knowledge, and build on it over time with new ideas.</strong></p><p>Before switching to the second brain approach, I also struggled with my notes because I wanted everything to be perfect. That drained a lot of time and energy. But one paragraph from the book really shifted my perspective:</p><div class="pullquote"><p>We have to remember that <strong>we are not building an encyclopaedia of immaculately organized knowledge</strong>. We are building a <strong>working system</strong>. [&#8230;] For that reason, you should prefer a system that is imperfect, but that continues to be useful in the real conditions of your life.</p></div><p>That changed everything for me. I stopped chasing perfection and started building something that simply works, something that supports me every day, both at work and in my personal life.</p><p>What I found enriching is that the book presents <strong>not just a system, but also a mindset</strong>. Let&#8217;s start with the latter.</p><h1>Mindset</h1><p>Knowledge work is about taking information and turning it into results, for example, delivering on a project. All day, we consume and then produce:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!VahM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13c9b12a-30a5-454a-bb90-89e2a926a0b4_585x139.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!VahM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13c9b12a-30a5-454a-bb90-89e2a926a0b4_585x139.png 424w, https://substackcdn.com/image/fetch/$s_!VahM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13c9b12a-30a5-454a-bb90-89e2a926a0b4_585x139.png 848w, https://substackcdn.com/image/fetch/$s_!VahM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13c9b12a-30a5-454a-bb90-89e2a926a0b4_585x139.png 1272w, https://substackcdn.com/image/fetch/$s_!VahM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13c9b12a-30a5-454a-bb90-89e2a926a0b4_585x139.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!VahM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13c9b12a-30a5-454a-bb90-89e2a926a0b4_585x139.png" width="585" height="139" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/13c9b12a-30a5-454a-bb90-89e2a926a0b4_585x139.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:139,&quot;width&quot;:585,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:17657,&quot;alt&quot;:&quot;Simple diagram showing a one-way flow from \&quot;Information\&quot; to \&quot;Projects\&quot; with a curved arrow.&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://www.thecoder.cafe/i/167576108?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13c9b12a-30a5-454a-bb90-89e2a926a0b4_585x139.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Simple diagram showing a one-way flow from &quot;Information&quot; to &quot;Projects&quot; with a curved arrow." title="Simple diagram showing a one-way flow from &quot;Information&quot; to &quot;Projects&quot; with a curved arrow." srcset="https://substackcdn.com/image/fetch/$s_!VahM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13c9b12a-30a5-454a-bb90-89e2a926a0b4_585x139.png 424w, https://substackcdn.com/image/fetch/$s_!VahM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13c9b12a-30a5-454a-bb90-89e2a926a0b4_585x139.png 848w, https://substackcdn.com/image/fetch/$s_!VahM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13c9b12a-30a5-454a-bb90-89e2a926a0b4_585x139.png 1272w, https://substackcdn.com/image/fetch/$s_!VahM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13c9b12a-30a5-454a-bb90-89e2a926a0b4_585x139.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>The problem with this approach is that most of the information that we will gain will eventually be lost. Sure, we might remember the most important parts for a while. But what about the rest? It will fade, eventually.</p><p><strong>What we miss is a feedback loop, a way to </strong><em><strong>recycle</strong></em><strong> information into knowledge that we can reuse later</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_!s5ld!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9334a810-fbc8-4f1c-bd34-0e3fa02663a4_585x280.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!s5ld!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9334a810-fbc8-4f1c-bd34-0e3fa02663a4_585x280.png 424w, https://substackcdn.com/image/fetch/$s_!s5ld!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9334a810-fbc8-4f1c-bd34-0e3fa02663a4_585x280.png 848w, https://substackcdn.com/image/fetch/$s_!s5ld!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9334a810-fbc8-4f1c-bd34-0e3fa02663a4_585x280.png 1272w, https://substackcdn.com/image/fetch/$s_!s5ld!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9334a810-fbc8-4f1c-bd34-0e3fa02663a4_585x280.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!s5ld!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9334a810-fbc8-4f1c-bd34-0e3fa02663a4_585x280.png" width="585" height="280" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9334a810-fbc8-4f1c-bd34-0e3fa02663a4_585x280.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:280,&quot;width&quot;:585,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:30795,&quot;alt&quot;:&quot;Circular flow diagram showing how \&quot;Information\&quot; turns into \&quot;Knowledge\&quot; and then into \&quot;Projects\&quot; through a feedback loop.&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://www.thecoder.cafe/i/167576108?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9334a810-fbc8-4f1c-bd34-0e3fa02663a4_585x280.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Circular flow diagram showing how &quot;Information&quot; turns into &quot;Knowledge&quot; and then into &quot;Projects&quot; through a feedback loop." title="Circular flow diagram showing how &quot;Information&quot; turns into &quot;Knowledge&quot; and then into &quot;Projects&quot; through a feedback loop." srcset="https://substackcdn.com/image/fetch/$s_!s5ld!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9334a810-fbc8-4f1c-bd34-0e3fa02663a4_585x280.png 424w, https://substackcdn.com/image/fetch/$s_!s5ld!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9334a810-fbc8-4f1c-bd34-0e3fa02663a4_585x280.png 848w, https://substackcdn.com/image/fetch/$s_!s5ld!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9334a810-fbc8-4f1c-bd34-0e3fa02663a4_585x280.png 1272w, https://substackcdn.com/image/fetch/$s_!s5ld!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9334a810-fbc8-4f1c-bd34-0e3fa02663a4_585x280.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&#8217;s what a second brain gives us: a way to turn information into assets we can reinvest in the future.</p><p>Another interesting idea in the book is to stop seeing notes as a flat list of things we&#8217;ve saved. Our notes can become <strong>building blocks</strong>, meaning pieces that help us create new ideas later on.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!M7oP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cf1cc95-a121-4c38-9ca9-2611a8b9e9f9_1983x963.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!M7oP!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cf1cc95-a121-4c38-9ca9-2611a8b9e9f9_1983x963.png 424w, https://substackcdn.com/image/fetch/$s_!M7oP!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cf1cc95-a121-4c38-9ca9-2611a8b9e9f9_1983x963.png 848w, https://substackcdn.com/image/fetch/$s_!M7oP!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cf1cc95-a121-4c38-9ca9-2611a8b9e9f9_1983x963.png 1272w, https://substackcdn.com/image/fetch/$s_!M7oP!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cf1cc95-a121-4c38-9ca9-2611a8b9e9f9_1983x963.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!M7oP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cf1cc95-a121-4c38-9ca9-2611a8b9e9f9_1983x963.png" width="1456" height="707" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4cf1cc95-a121-4c38-9ca9-2611a8b9e9f9_1983x963.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:707,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:107660,&quot;alt&quot;:&quot;Hierarchical diagram of interconnected notes, showing how individual notes build on one another to form larger structures.&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://www.thecoder.cafe/i/167576108?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cf1cc95-a121-4c38-9ca9-2611a8b9e9f9_1983x963.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Hierarchical diagram of interconnected notes, showing how individual notes build on one another to form larger structures." title="Hierarchical diagram of interconnected notes, showing how individual notes build on one another to form larger structures." srcset="https://substackcdn.com/image/fetch/$s_!M7oP!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cf1cc95-a121-4c38-9ca9-2611a8b9e9f9_1983x963.png 424w, https://substackcdn.com/image/fetch/$s_!M7oP!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cf1cc95-a121-4c38-9ca9-2611a8b9e9f9_1983x963.png 848w, https://substackcdn.com/image/fetch/$s_!M7oP!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cf1cc95-a121-4c38-9ca9-2611a8b9e9f9_1983x963.png 1272w, https://substackcdn.com/image/fetch/$s_!M7oP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cf1cc95-a121-4c38-9ca9-2611a8b9e9f9_1983x963.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&#8217;s a powerful shift: notes aren&#8217;t just storage, they&#8217;re raw material for thinking. They can connect and evolve into new ideas. Being able to track down all your notes in a single place makes those connections easier to spot and build on.</p><p>One last point I wanted to discuss: creativity. Here&#8217;s the definition given by Neuroscientist Nancy C. Andreasen:</p><div class="pullquote"><p>Creative people are better at recognizing relationships, making associations, and connections.</p></div><p>A second brain is not only a memory tool, but also a thinking tool. Keeping an effective system to track down notes and ideas becomes a great tool to improve our creativity. Remember: <strong>creativity is not a talent, it&#8217;s a way of operating</strong>.</p><blockquote><p><strong>NOTE: </strong>Did you enjoy this punchline? It&#8217;s coming from a note I hold on creativity in my second brain &#128526;.</p></blockquote><h1>System</h1><p>In this section, we&#8217;ll delve into what a note really is, how to take notes effectively, and then go over the PARA system presented in the book.</p><h2>Notes</h2><p>So, what&#8217;s a note? The author defines it this way:</p><div class="pullquote"><p>A piece of content, interpreted through your lens, curated according to your taste, translated into your own words, or drawn from life experience, and stored in a secure place.</p></div><p>Let&#8217;s go over the different parts of that definition.</p><p>First, a note is something to use, not just to collect. Again, we&#8217;re not building an encyclopaedia, we&#8217;re building something that works for us. For example, if we&#8217;re interested in public speaking, we don&#8217;t need a note on every single resource we read or watch.</p><p>Instead, the author suggests asking a few questions to decide what&#8217;s worth capturing:</p><ol><li><p>Does it inspire us?</p></li><li><p>Is it useful?</p></li><li><p>Is this personal?</p></li><li><p>Is it surprising?</p></li></ol><p><strong>Ultimately, we should capture what resonates.</strong></p><p>For example, we may have read this <em>amazing</em> book that everyone is talking about and discover that it doesn&#8217;t resonate with us at all<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a>. Conversely, we may have watched a 30-second video that had a profound effect on us and triggered emotions. In this case, it&#8217;s better to spend some time creating a note on this video rather than the book.</p><p>When something resonates with us, it&#8217;s our emotion-based, intuitive mind telling us it&#8217;s interesting before our logical mind can explain why.</p><h2>How to Take Notes</h2><p>Every time we take a note, we should ask: &#8220;<em>How can I make this as useful as possible for my future self?</em>&#8221;</p><p>One way to do that is to be mindful of our future limited time. Instead of tracking dozens, if not hundreds, of lines, <strong>we should focus on finding the essence</strong>, meaning the heart and soul of what a resource is trying to communicate.</p><p>But in some cases, that&#8217;s barely possible. For example, I recently read the <a href="https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/41344.pdf">F1: A distributed SQL database that scales</a> whitepaper. How can we capture the essence of such a dense technical document containing so much valuable information?</p><p>The solution, brought again by the author, is to use the <strong>progressive summarization technique</strong>. In short, it&#8217;s about layering our notes:</p><ul><li><p><strong>Layer 1 - Captured notes</strong>: Either a copy and paste or even better writing, down in our own words what we understood from it.</p></li><li><p><strong>Layer 2 - Bolded passages</strong>: Go over the captured notes and mark in bold the most important pieces.</p></li><li><p><strong>Layer 3 - Highlighted passages</strong>: Go over the bolded passages and highlight the most important pieces.</p></li><li><p><strong>Layer 4 - Summary</strong>: Write down a summary.</p></li></ul><p>Here&#8217;s an example from my F1 whitepaper notes. I created two main sections: <strong>Summary</strong> and <strong>Highlights</strong>.</p><ul><li><p>Layer 1: In Highlights, I captured all the raw content, for example, on locking.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-Irv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f7c180-634d-4762-8137-d9acca27319f_1552x558.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-Irv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f7c180-634d-4762-8137-d9acca27319f_1552x558.png 424w, https://substackcdn.com/image/fetch/$s_!-Irv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f7c180-634d-4762-8137-d9acca27319f_1552x558.png 848w, https://substackcdn.com/image/fetch/$s_!-Irv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f7c180-634d-4762-8137-d9acca27319f_1552x558.png 1272w, https://substackcdn.com/image/fetch/$s_!-Irv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f7c180-634d-4762-8137-d9acca27319f_1552x558.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-Irv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f7c180-634d-4762-8137-d9acca27319f_1552x558.png" width="600" height="215.52197802197801" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b0f7c180-634d-4762-8137-d9acca27319f_1552x558.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:523,&quot;width&quot;:1456,&quot;resizeWidth&quot;:600,&quot;bytes&quot;:133700,&quot;alt&quot;:&quot;Raw excerpt from the F1 whitepaper note showing bullet points about flexible locking granularity.&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://www.thecoder.cafe/i/167576108?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f7c180-634d-4762-8137-d9acca27319f_1552x558.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Raw excerpt from the F1 whitepaper note showing bullet points about flexible locking granularity." title="Raw excerpt from the F1 whitepaper note showing bullet points about flexible locking granularity." srcset="https://substackcdn.com/image/fetch/$s_!-Irv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f7c180-634d-4762-8137-d9acca27319f_1552x558.png 424w, https://substackcdn.com/image/fetch/$s_!-Irv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f7c180-634d-4762-8137-d9acca27319f_1552x558.png 848w, https://substackcdn.com/image/fetch/$s_!-Irv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f7c180-634d-4762-8137-d9acca27319f_1552x558.png 1272w, https://substackcdn.com/image/fetch/$s_!-Irv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f7c180-634d-4762-8137-d9acca27319f_1552x558.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div></li><li><p>Layer 2: I bolded the passages that were most interesting to me.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Hq7A!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8349cfd-e44f-4faf-8a27-01da34d0deba_1552x558.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Hq7A!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8349cfd-e44f-4faf-8a27-01da34d0deba_1552x558.png 424w, https://substackcdn.com/image/fetch/$s_!Hq7A!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8349cfd-e44f-4faf-8a27-01da34d0deba_1552x558.png 848w, https://substackcdn.com/image/fetch/$s_!Hq7A!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8349cfd-e44f-4faf-8a27-01da34d0deba_1552x558.png 1272w, https://substackcdn.com/image/fetch/$s_!Hq7A!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8349cfd-e44f-4faf-8a27-01da34d0deba_1552x558.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Hq7A!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8349cfd-e44f-4faf-8a27-01da34d0deba_1552x558.png" width="599" height="215.16277472527472" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a8349cfd-e44f-4faf-8a27-01da34d0deba_1552x558.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:523,&quot;width&quot;:1456,&quot;resizeWidth&quot;:599,&quot;bytes&quot;:132847,&quot;alt&quot;:&quot;Same excerpt with selected sentences in bold to highlight important ideas from the captured notes.&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://www.thecoder.cafe/i/167576108?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8349cfd-e44f-4faf-8a27-01da34d0deba_1552x558.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Same excerpt with selected sentences in bold to highlight important ideas from the captured notes." title="Same excerpt with selected sentences in bold to highlight important ideas from the captured notes." srcset="https://substackcdn.com/image/fetch/$s_!Hq7A!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8349cfd-e44f-4faf-8a27-01da34d0deba_1552x558.png 424w, https://substackcdn.com/image/fetch/$s_!Hq7A!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8349cfd-e44f-4faf-8a27-01da34d0deba_1552x558.png 848w, https://substackcdn.com/image/fetch/$s_!Hq7A!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8349cfd-e44f-4faf-8a27-01da34d0deba_1552x558.png 1272w, https://substackcdn.com/image/fetch/$s_!Hq7A!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8349cfd-e44f-4faf-8a27-01da34d0deba_1552x558.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div></li><li><p>Layer 3: I highlighted the most important parts.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_sB2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3555d5a2-270b-4546-98ca-a42f98a5f5d0_1552x558.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_sB2!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3555d5a2-270b-4546-98ca-a42f98a5f5d0_1552x558.png 424w, https://substackcdn.com/image/fetch/$s_!_sB2!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3555d5a2-270b-4546-98ca-a42f98a5f5d0_1552x558.png 848w, https://substackcdn.com/image/fetch/$s_!_sB2!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3555d5a2-270b-4546-98ca-a42f98a5f5d0_1552x558.png 1272w, https://substackcdn.com/image/fetch/$s_!_sB2!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3555d5a2-270b-4546-98ca-a42f98a5f5d0_1552x558.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_sB2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3555d5a2-270b-4546-98ca-a42f98a5f5d0_1552x558.png" width="600" height="215.52197802197801" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3555d5a2-270b-4546-98ca-a42f98a5f5d0_1552x558.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:523,&quot;width&quot;:1456,&quot;resizeWidth&quot;:600,&quot;bytes&quot;:135540,&quot;alt&quot;:&quot;Same note excerpt with bold and highlighted text, focusing on the most critical insight from the passage.&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://www.thecoder.cafe/i/167576108?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3555d5a2-270b-4546-98ca-a42f98a5f5d0_1552x558.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Same note excerpt with bold and highlighted text, focusing on the most critical insight from the passage." title="Same note excerpt with bold and highlighted text, focusing on the most critical insight from the passage." srcset="https://substackcdn.com/image/fetch/$s_!_sB2!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3555d5a2-270b-4546-98ca-a42f98a5f5d0_1552x558.png 424w, https://substackcdn.com/image/fetch/$s_!_sB2!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3555d5a2-270b-4546-98ca-a42f98a5f5d0_1552x558.png 848w, https://substackcdn.com/image/fetch/$s_!_sB2!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3555d5a2-270b-4546-98ca-a42f98a5f5d0_1552x558.png 1272w, https://substackcdn.com/image/fetch/$s_!_sB2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3555d5a2-270b-4546-98ca-a42f98a5f5d0_1552x558.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div></li><li><p>Layer 4: I wrote a summary section with the ideas that were the most interesting for me.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!io78!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaea5b72-10d0-4ba0-b861-4fcd135799d8_1552x1126.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!io78!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaea5b72-10d0-4ba0-b861-4fcd135799d8_1552x1126.png 424w, https://substackcdn.com/image/fetch/$s_!io78!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaea5b72-10d0-4ba0-b861-4fcd135799d8_1552x1126.png 848w, https://substackcdn.com/image/fetch/$s_!io78!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaea5b72-10d0-4ba0-b861-4fcd135799d8_1552x1126.png 1272w, https://substackcdn.com/image/fetch/$s_!io78!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaea5b72-10d0-4ba0-b861-4fcd135799d8_1552x1126.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!io78!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaea5b72-10d0-4ba0-b861-4fcd135799d8_1552x1126.png" width="600" height="435.16483516483515" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aaea5b72-10d0-4ba0-b861-4fcd135799d8_1552x1126.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1056,&quot;width&quot;:1456,&quot;resizeWidth&quot;:600,&quot;bytes&quot;:302224,&quot;alt&quot;:&quot;Summary section listing key takeaways from the F1 whitepaper, including database structure, performance trade-offs, and system behaviors.&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://www.thecoder.cafe/i/167576108?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaea5b72-10d0-4ba0-b861-4fcd135799d8_1552x1126.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Summary section listing key takeaways from the F1 whitepaper, including database structure, performance trade-offs, and system behaviors." title="Summary section listing key takeaways from the F1 whitepaper, including database structure, performance trade-offs, and system behaviors." srcset="https://substackcdn.com/image/fetch/$s_!io78!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaea5b72-10d0-4ba0-b861-4fcd135799d8_1552x1126.png 424w, https://substackcdn.com/image/fetch/$s_!io78!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaea5b72-10d0-4ba0-b861-4fcd135799d8_1552x1126.png 848w, https://substackcdn.com/image/fetch/$s_!io78!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaea5b72-10d0-4ba0-b861-4fcd135799d8_1552x1126.png 1272w, https://substackcdn.com/image/fetch/$s_!io78!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faaea5b72-10d0-4ba0-b861-4fcd135799d8_1552x1126.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg 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>In the end, the note looks like this:</p><pre><code># Summary

- ...
- ...
- ...

# Highlights

## Architecture

## Data model

## Locking

## Etc.</code></pre><p>This approach allows me to come back later and start with a quick summary to refresh the main ideas. If I need a bit more, I can scan the bolded and highlighted passages. And if I really want to dive deeper, I can go through all the highlights.</p><p>Of course, every layer is optional. If we consider that a resource only needs layers 1 and 4 of summarization, or just 1 and 2, that&#8217;s perfectly fine.</p><p><strong>Again, our second brain should be something that works for us.</strong></p><h2>PARA</h2><p>The PARA system is at the core of the book. It&#8217;s a proposition on how to organize our notes. It is designed for actionability, with layers of action. To make things clear, a note can be assigned to one of the following domains:</p><ul><li><p><strong>Project</strong>: A short-term effort with a possible due date and a clear outcome that needs to happen in order to mark the project as complete. For example, publish a blog post about second brain.</p></li><li><p><strong>Area</strong>: Ongoing responsibilities, what we are committed to, and what requires constant attention.</p></li><li><p><strong>Resource</strong>: A catchall for anything that doesn&#8217;t belong to a project or an area. </p></li><li><p><strong>Archive</strong>: When a note becomes inactive or outdated, we can move it to the archive.</p></li></ul><blockquote><p><strong>NOTE</strong>: The distinction between area and resource wasn&#8217;t immediately clear to me, so here&#8217;s how I think about it.</p><p>I enjoy both fitness and climbing. But I&#8217;m only committed to fitness. I try to eat healthy, work out regularly, and so on. Climbing, on the other hand, is something I enjoy, but I only go from time to time. So in my system, fitness is an area, and climbing is a resource.</p></blockquote><p>The PARA system has two main benefits.</p><ul><li><p><strong>Clear focus</strong>: We&#8217;re not mixing short-term efforts with long-term maintenance. It helps us focus on outcomes and next steps rather than just piles of information.</p></li><li><p><strong>Genericity</strong>: PARA can handle all kinds of notes. It organizes information based on how actionable it is, not what kind of information it is.</p></li></ul><p>As I said, I used to lack a system that was generic enough to track all my notes. Now, whether it&#8217;s a book I read, a course I followed, or a post I came across, I capture everything that resonates with me using the PARA system.</p><h1>Notion</h1><p>To implement the second brain, I used <a href="https://www.notion.com/">Notion</a>, which I think is a fantastic tool with a lot of flexibility and configuration options.</p><p>If you don&#8217;t want to build your own second brain from scratch, you can check out this online tutorial:</p><div id="youtube2-EZXumCgT_l8" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;EZXumCgT_l8&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/EZXumCgT_l8?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><p>Or, you can use my <a href="https://2brain.dev/notion/">personal Notion template</a>. This is the setup I use every day to track notes, growth tasks, my to-do list, areas, resources, and more.</p><h1>Conclusion</h1><p>In summary, the second brain method presented in the book follows the CODE system:</p><ul><li><p><strong>Capture</strong>: Keep what resonates, leave the rest aside.</p></li><li><p><strong>Organize</strong>: Save for actionability (project, area, or resource).</p></li><li><p><strong>Distill</strong>: Find the essence of what a resource communicates.</p></li><li><p><strong>Express</strong>: Show your work based on the knowledge you gained.</p></li></ul><p>Unless you&#8217;re a super memory genius, I strongly recommend looking into building a second brain. As we discussed, our brain should be for having ideas, not holding them.</p><p>Maybe the ideas in this post won&#8217;t fit you exactly, and you&#8217;ll come up with your own way of tracking notes. However you approach it, building a second brain has been incredibly important for me, and it might be for you as well.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://read.thecoder.cafe/" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://read.thecoder.cafe/&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">AI is getting better every day. Are you? At The Coder Cafe, we serve fundamental concepts to make you an engineer that AI can&#8217;t replace. Written by a Google SWE, trusted by thousands of engineers worldwide.</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><h1>&#128218; Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/beyond-code">Beyond the Code</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/mental-health">Don&#8217;t Forget About Your Mental Health</a></p></li><li><p><a href="https://read.thecoder.cafe/p/survivor-bias">Survivor Bias</a></p></li><li><p><a href="https://read.thecoder.cafe/p/xy-problem">The XY Problem</a></p></li></ul><h2>Sources</h2><ul><li><p><a href="https://www.goodreads.com/book/show/59616977-building-a-second-brain">Building a Second Brain</a></p></li></ul><h2>Explore Further</h2><ul><li><p><a href="https://2brain.dev/">Create Your Own Second Brain</a></p></li><li><p><a href="https://www.buildingasecondbrain.com/resources">Your Resource Guide to Building a Second Brain</a></p></li></ul><div><hr></div><p>&#10084;&#65039; <em>If you enjoyed the post, please consider giving it a like. It&#8217;s a helpful signal to decide what to write next.</em></p><p>&#128172; <em>Are you using a second brain system? If not, how do you keep track of your notes and ideas?</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/p/second-brain/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://read.thecoder.cafe/p/second-brain/comments"><span>Leave a comment</span></a></p><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-1" href="#footnote-anchor-1" class="footnote-number" contenteditable="false" target="_self">1</a><div class="footnote-content"><p><a href="https://www.goodreads.com/book/show/18144590-the-alchemist">The Alchemist</a>, I&#8217;m looking at you.</p><p></p></div></div>]]></content:encoded></item><item><title><![CDATA[Availability Models Explained]]></title><description><![CDATA[Highly available is too vague; watch out when you read or hear it.]]></description><link>https://read.thecoder.cafe/p/availability-models</link><guid isPermaLink="false">https://read.thecoder.cafe/p/availability-models</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Tue, 19 Aug 2025 10:02:42 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Dnex!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40a8aae9-2fcb-4d9f-8129-021c1fc67d5f_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Hello! Last week, we reached 3,000 subscribers, that&#8217;s awesome, thank you all!</em></p><p><em>Recently, I was going through the <a href="https://antithesis.com/resources/reliability_glossary/#availability-models">distributed systems reliability glossary</a> brought by <a href="https://antithesis.com/">Antithesis</a> &amp; <a href="https://jepsen.io/">Jepsen</a>, and I found their approach on availability models particularly interesting. Let&#8217;s dive into that.</em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Dnex!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40a8aae9-2fcb-4d9f-8129-021c1fc67d5f_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Dnex!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40a8aae9-2fcb-4d9f-8129-021c1fc67d5f_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!Dnex!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40a8aae9-2fcb-4d9f-8129-021c1fc67d5f_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!Dnex!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40a8aae9-2fcb-4d9f-8129-021c1fc67d5f_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!Dnex!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40a8aae9-2fcb-4d9f-8129-021c1fc67d5f_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Dnex!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40a8aae9-2fcb-4d9f-8129-021c1fc67d5f_1600x800.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/40a8aae9-2fcb-4d9f-8129-021c1fc67d5f_1600x800.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;:1647499,&quot;alt&quot;:&quot;Highly available is too vague; watch out when you read or hear it.&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://www.thecoder.cafe/i/168622345?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40a8aae9-2fcb-4d9f-8129-021c1fc67d5f_1600x800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Highly available is too vague; watch out when you read or hear it." title="Highly available is too vague; watch out when you read or hear it." srcset="https://substackcdn.com/image/fetch/$s_!Dnex!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40a8aae9-2fcb-4d9f-8129-021c1fc67d5f_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!Dnex!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40a8aae9-2fcb-4d9f-8129-021c1fc67d5f_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!Dnex!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40a8aae9-2fcb-4d9f-8129-021c1fc67d5f_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!Dnex!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40a8aae9-2fcb-4d9f-8129-021c1fc67d5f_1600x800.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg 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><h1>Introduction</h1><p>Here are two database whitepapers:</p><ul><li><p><a href="https://www.cidrdb.org/cidr2011/Papers/CIDR11_Paper32.pdf">Megastore</a>, a Google storage system:</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!5dwy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36c5e166-f464-4bd3-8f10-033ee3cc6c36_1270x298.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!5dwy!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36c5e166-f464-4bd3-8f10-033ee3cc6c36_1270x298.png 424w, https://substackcdn.com/image/fetch/$s_!5dwy!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36c5e166-f464-4bd3-8f10-033ee3cc6c36_1270x298.png 848w, https://substackcdn.com/image/fetch/$s_!5dwy!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36c5e166-f464-4bd3-8f10-033ee3cc6c36_1270x298.png 1272w, https://substackcdn.com/image/fetch/$s_!5dwy!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36c5e166-f464-4bd3-8f10-033ee3cc6c36_1270x298.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!5dwy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36c5e166-f464-4bd3-8f10-033ee3cc6c36_1270x298.png" width="1270" height="298" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/36c5e166-f464-4bd3-8f10-033ee3cc6c36_1270x298.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:298,&quot;width&quot;:1270,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:69127,&quot;alt&quot;:&quot;Title page of the Megastore whitepaper from Google, titled &#8220;Megastore: Providing Scalable, Highly Available Storage for Interactive Services.&#8221; The phrase &#8220;Highly Available&#8221; is highlighted. Authors listed include Jason Baker, Chris Bond, James C. Corbett, and others from Google.&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://www.thecoder.cafe/i/168622345?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36c5e166-f464-4bd3-8f10-033ee3cc6c36_1270x298.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Title page of the Megastore whitepaper from Google, titled &#8220;Megastore: Providing Scalable, Highly Available Storage for Interactive Services.&#8221; The phrase &#8220;Highly Available&#8221; is highlighted. Authors listed include Jason Baker, Chris Bond, James C. Corbett, and others from Google." title="Title page of the Megastore whitepaper from Google, titled &#8220;Megastore: Providing Scalable, Highly Available Storage for Interactive Services.&#8221; The phrase &#8220;Highly Available&#8221; is highlighted. Authors listed include Jason Baker, Chris Bond, James C. Corbett, and others from Google." srcset="https://substackcdn.com/image/fetch/$s_!5dwy!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36c5e166-f464-4bd3-8f10-033ee3cc6c36_1270x298.png 424w, https://substackcdn.com/image/fetch/$s_!5dwy!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36c5e166-f464-4bd3-8f10-033ee3cc6c36_1270x298.png 848w, https://substackcdn.com/image/fetch/$s_!5dwy!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36c5e166-f464-4bd3-8f10-033ee3cc6c36_1270x298.png 1272w, https://substackcdn.com/image/fetch/$s_!5dwy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36c5e166-f464-4bd3-8f10-033ee3cc6c36_1270x298.png 1456w" sizes="100vw"></picture><div></div></div></a></figure></div><ul><li><p><a href="https://www.allthingsdistributed.com/files/amazon-dynamo-sosp2007.pdf">Dynamo</a>, an Amazon key-value store:</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tjAM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4f287b3-2064-41f3-8fa9-43fced146ccf_1254x220.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tjAM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4f287b3-2064-41f3-8fa9-43fced146ccf_1254x220.png 424w, https://substackcdn.com/image/fetch/$s_!tjAM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4f287b3-2064-41f3-8fa9-43fced146ccf_1254x220.png 848w, https://substackcdn.com/image/fetch/$s_!tjAM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4f287b3-2064-41f3-8fa9-43fced146ccf_1254x220.png 1272w, https://substackcdn.com/image/fetch/$s_!tjAM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4f287b3-2064-41f3-8fa9-43fced146ccf_1254x220.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tjAM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4f287b3-2064-41f3-8fa9-43fced146ccf_1254x220.png" width="1254" height="220" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a4f287b3-2064-41f3-8fa9-43fced146ccf_1254x220.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:220,&quot;width&quot;:1254,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:60444,&quot;alt&quot;:&quot;Title page of the Dynamo whitepaper from Amazon, titled &#8220;Dynamo: Amazon&#8217;s Highly Available Key-value Store.&#8221; The phrase &#8220;Highly Available&#8221; is highlighted. Authors listed include Giuseppe DeCandia, Deniz Hastorun, Avinash Lakshman, and others from Amazon.&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://www.thecoder.cafe/i/168622345?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4f287b3-2064-41f3-8fa9-43fced146ccf_1254x220.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Title page of the Dynamo whitepaper from Amazon, titled &#8220;Dynamo: Amazon&#8217;s Highly Available Key-value Store.&#8221; The phrase &#8220;Highly Available&#8221; is highlighted. Authors listed include Giuseppe DeCandia, Deniz Hastorun, Avinash Lakshman, and others from Amazon." title="Title page of the Dynamo whitepaper from Amazon, titled &#8220;Dynamo: Amazon&#8217;s Highly Available Key-value Store.&#8221; The phrase &#8220;Highly Available&#8221; is highlighted. Authors listed include Giuseppe DeCandia, Deniz Hastorun, Avinash Lakshman, and others from Amazon." srcset="https://substackcdn.com/image/fetch/$s_!tjAM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4f287b3-2064-41f3-8fa9-43fced146ccf_1254x220.png 424w, https://substackcdn.com/image/fetch/$s_!tjAM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4f287b3-2064-41f3-8fa9-43fced146ccf_1254x220.png 848w, https://substackcdn.com/image/fetch/$s_!tjAM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4f287b3-2064-41f3-8fa9-43fced146ccf_1254x220.png 1272w, https://substackcdn.com/image/fetch/$s_!tjAM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4f287b3-2064-41f3-8fa9-43fced146ccf_1254x220.png 1456w" sizes="100vw"></picture><div></div></div></a></figure></div><p>Both of these whitepapers use the term <em>highly available</em>. Of course, as a reader, we may expect these two whitepapers to mean the same thing when discussing high availability. After all, an orange is an orange, an apple is an apple, and a highly available system should be a highly available system. Yet, that&#8217;s not the case, and each paper means something different.</p><p>Let&#8217;s first look at what availability means, then discuss why high availability is a vague concept, and finally explore the different availability models.</p><h1>Availability</h1><p>In <a href="https://www.thecoder.cafe/p/cap">The CAP Theorem</a>, we already discussed availability as:</p><blockquote><p>Every request receives a non-error response, even if it may not contain the most up-to-date data.</p></blockquote><p>However, this definition missed a crucial dimension: <strong>response time</strong>. Technically, a system could be <em>available</em> even if it responds after an hour. While such a system technically provides a non-error response, it fails to deliver a usable experience, severely compromising its practical availability from a user perspective.</p><p>This is where <a href="https://www.thecoder.cafe/p/pacelc">The PACELC Theorem</a> offers a more practical perspective on availability. PACELC highlights that:</p><ul><li><p>In the presence of a partition, a system must choose between availability and consistency.</p></li><li><p>In the absence of partition, a system must choose between latency (the upper-bound limit during which a request should receive a non-error response) and consistency.</p></li></ul><p>So latency becomes part of availability. And that makes sense, right? If a system is too slow, it&#8217;s effectively down for the user. <strong>Availability isn&#8217;t just about uptime; it's also about whether the system is responsive in a meaningful timeframe.</strong></p><h1>High Availability</h1><p>The term high availability is vague. Does it mean 99.9% uptime? 99.999%?</p><p>ScyllaDB, in their <a href="https://www.scylladb.com/glossary/high-availability-database/">technical glossary</a> says it&#8217;s about <strong>maintaining levels of uptime that exceed normal SLAs</strong>. That&#8217;s fine, but it&#8217;s also easy to game.</p><p>Say we define an SLA at 50%, then run at 80%. Technically, we exceeded it. Yet, does that mean we&#8217;re offering a highly available database? Probably not.</p><p>The <a href="https://antithesis.com/resources/reliability_glossary">Antithesis reliability glossary</a> defines high availability as <strong>a system that is available more often than a single node</strong>. I quite like that one. If we take the availability of our best node and our system does worse than that, it&#8217;s not really highly available. Simple and practical.</p><p>Still, it&#8217;s not perfect. Let&#8217;s say we have five nodes, each available 50% of the time. With a write quorum of two, our write availability might still reach ~80%. But we&#8217;d still be down one request out of five. Hard to sell that as high availability.</p><p>To bring more clarity to the conversation, Antithesis introduced a set of availability models.</p><h1>Availability Models</h1><p><strong>An availability model is something to help us define when an operation should succeed.</strong></p><p>What do we mean by operation? It&#8217;s simply a request made to the system. That could be a read, a write, a ping, whatever the system is supposed to handle. Instead of thinking in terms of the whole system being up or down, we look at whether a specific request can succeed, even when parts of the system are failing.</p><p>Let&#8217;s explore three availability models.</p><h2>Majority available</h2><p><strong>Definition</strong>: A system is majority available if when a majority of non-faulty nodes can communicate with one another, these nodes can execute some operations.</p><p>Consider a database composed of five nodes:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!LM2b!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbcdd965-9688-4326-b48a-121eff08a09b_1682x502.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!LM2b!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbcdd965-9688-4326-b48a-121eff08a09b_1682x502.png 424w, https://substackcdn.com/image/fetch/$s_!LM2b!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbcdd965-9688-4326-b48a-121eff08a09b_1682x502.png 848w, https://substackcdn.com/image/fetch/$s_!LM2b!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbcdd965-9688-4326-b48a-121eff08a09b_1682x502.png 1272w, https://substackcdn.com/image/fetch/$s_!LM2b!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbcdd965-9688-4326-b48a-121eff08a09b_1682x502.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!LM2b!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbcdd965-9688-4326-b48a-121eff08a09b_1682x502.png" width="1456" height="435" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bbcdd965-9688-4326-b48a-121eff08a09b_1682x502.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:435,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:41310,&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://www.thecoder.cafe/i/168622345?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbcdd965-9688-4326-b48a-121eff08a09b_1682x502.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_!LM2b!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbcdd965-9688-4326-b48a-121eff08a09b_1682x502.png 424w, https://substackcdn.com/image/fetch/$s_!LM2b!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbcdd965-9688-4326-b48a-121eff08a09b_1682x502.png 848w, https://substackcdn.com/image/fetch/$s_!LM2b!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbcdd965-9688-4326-b48a-121eff08a09b_1682x502.png 1272w, https://substackcdn.com/image/fetch/$s_!LM2b!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbbcdd965-9688-4326-b48a-121eff08a09b_1682x502.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 the nominal case, everything works: a client connects, and the database can process all operations.</p><p>Now, imagine two nodes go down. Maybe they crash, maybe there&#8217;s a network issue causing a partition:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ynkK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d0a2cac-fa51-4e9a-9758-2e6c5c61a67f_1684x502.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ynkK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d0a2cac-fa51-4e9a-9758-2e6c5c61a67f_1684x502.png 424w, https://substackcdn.com/image/fetch/$s_!ynkK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d0a2cac-fa51-4e9a-9758-2e6c5c61a67f_1684x502.png 848w, https://substackcdn.com/image/fetch/$s_!ynkK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d0a2cac-fa51-4e9a-9758-2e6c5c61a67f_1684x502.png 1272w, https://substackcdn.com/image/fetch/$s_!ynkK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d0a2cac-fa51-4e9a-9758-2e6c5c61a67f_1684x502.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ynkK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d0a2cac-fa51-4e9a-9758-2e6c5c61a67f_1684x502.png" width="1456" height="434" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5d0a2cac-fa51-4e9a-9758-2e6c5c61a67f_1684x502.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:434,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:51186,&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://www.thecoder.cafe/i/168622345?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d0a2cac-fa51-4e9a-9758-2e6c5c61a67f_1684x502.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_!ynkK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d0a2cac-fa51-4e9a-9758-2e6c5c61a67f_1684x502.png 424w, https://substackcdn.com/image/fetch/$s_!ynkK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d0a2cac-fa51-4e9a-9758-2e6c5c61a67f_1684x502.png 848w, https://substackcdn.com/image/fetch/$s_!ynkK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d0a2cac-fa51-4e9a-9758-2e6c5c61a67f_1684x502.png 1272w, https://substackcdn.com/image/fetch/$s_!ynkK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d0a2cac-fa51-4e9a-9758-2e6c5c61a67f_1684x502.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>We&#8217;re left with three nodes that can still talk to each other. That&#8217;s a majority. If the database can still perform operations in this situation, <strong>we say it&#8217;s majority available</strong>.</p><p>That&#8217;s how the <a href="https://www.cidrdb.org/cidr2011/Papers/CIDR11_Paper32.pdf">Megastore whitepaper</a> defined <em>highly available</em>: being majority available.</p><p><strong>This model is often used when consistency matters.</strong> For example, when a write or a leader election requires a majority to agree before responding to the client. So even if some nodes are unreachable, the system can still make safe progress as long as the majority is intact.</p><h2>Total availability</h2><p><strong>Definition</strong>: A system is totally available if every non-faulty node can execute any operation.</p><p>Let&#8217;s take the same setup: a database with five nodes. This time, three of them are faulty:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!DI0X!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f8d94a-187f-416b-a58a-722f0de3c0ec_1682x502.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!DI0X!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f8d94a-187f-416b-a58a-722f0de3c0ec_1682x502.png 424w, https://substackcdn.com/image/fetch/$s_!DI0X!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f8d94a-187f-416b-a58a-722f0de3c0ec_1682x502.png 848w, https://substackcdn.com/image/fetch/$s_!DI0X!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f8d94a-187f-416b-a58a-722f0de3c0ec_1682x502.png 1272w, https://substackcdn.com/image/fetch/$s_!DI0X!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f8d94a-187f-416b-a58a-722f0de3c0ec_1682x502.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!DI0X!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f8d94a-187f-416b-a58a-722f0de3c0ec_1682x502.png" width="1456" height="435" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b0f8d94a-187f-416b-a58a-722f0de3c0ec_1682x502.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:435,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:52716,&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://www.thecoder.cafe/i/168622345?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f8d94a-187f-416b-a58a-722f0de3c0ec_1682x502.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_!DI0X!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f8d94a-187f-416b-a58a-722f0de3c0ec_1682x502.png 424w, https://substackcdn.com/image/fetch/$s_!DI0X!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f8d94a-187f-416b-a58a-722f0de3c0ec_1682x502.png 848w, https://substackcdn.com/image/fetch/$s_!DI0X!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f8d94a-187f-416b-a58a-722f0de3c0ec_1682x502.png 1272w, https://substackcdn.com/image/fetch/$s_!DI0X!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f8d94a-187f-416b-a58a-722f0de3c0ec_1682x502.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 a majority available model, we can&#8217;t do much as we don&#8217;t have a majority. <strong>But in a totally available model, the system can still handle operations.</strong></p><p>Indeed, in this model, each non-faulty node can act on its own. It doesn&#8217;t need to coordinate with others or wait for a network round-trip. This model favors latency. Just handle the request and move on.</p><p>That&#8217;s how the <a href="https://www.allthingsdistributed.com/files/amazon-dynamo-sosp2007.pdf">Dynamo whitepaper</a> defined <em>highly available</em>: being totally available.</p><p>The tradeoff is consistency. Totally available systems can&#8217;t enforce strong guarantees because the nodes don&#8217;t necessarily sync before responding. That&#8217;s why this model typically goes hand in hand with weaker <a href="https://read.thecoder.cafe/p/consistency-model">consistency models</a>.</p><h2>Sticky Available</h2><p><strong>Definition</strong>: A system is sticky available if whenever a client&#8217;s transactions are executed against a copy of database state that reflects all of the client&#8217;s prior operations, it eventually receives a response, even in the presence of indefinitely long partitions.</p><p>Let&#8217;s look at an example. Two clients, A and B, are connected to a database and make updates over time:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!PMlD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a33d310-1898-40f1-b770-90b457ccc0cc_1222x662.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PMlD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a33d310-1898-40f1-b770-90b457ccc0cc_1222x662.png 424w, https://substackcdn.com/image/fetch/$s_!PMlD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a33d310-1898-40f1-b770-90b457ccc0cc_1222x662.png 848w, https://substackcdn.com/image/fetch/$s_!PMlD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a33d310-1898-40f1-b770-90b457ccc0cc_1222x662.png 1272w, https://substackcdn.com/image/fetch/$s_!PMlD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a33d310-1898-40f1-b770-90b457ccc0cc_1222x662.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PMlD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a33d310-1898-40f1-b770-90b457ccc0cc_1222x662.png" width="599" height="324.49918166939443" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7a33d310-1898-40f1-b770-90b457ccc0cc_1222x662.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:662,&quot;width&quot;:1222,&quot;resizeWidth&quot;:599,&quot;bytes&quot;:54439,&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://www.thecoder.cafe/i/168622345?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a33d310-1898-40f1-b770-90b457ccc0cc_1222x662.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_!PMlD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a33d310-1898-40f1-b770-90b457ccc0cc_1222x662.png 424w, https://substackcdn.com/image/fetch/$s_!PMlD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a33d310-1898-40f1-b770-90b457ccc0cc_1222x662.png 848w, https://substackcdn.com/image/fetch/$s_!PMlD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a33d310-1898-40f1-b770-90b457ccc0cc_1222x662.png 1272w, https://substackcdn.com/image/fetch/$s_!PMlD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a33d310-1898-40f1-b770-90b457ccc0cc_1222x662.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><figcaption class="image-caption">Blue updates are made by client A, and green updates are made by client B.</figcaption></figure></div><p>Sticky available means:</p><ul><li><p>After update 5, client A will eventually get a response that reflects at least updates 1, 4, and 5.</p></li><li><p>After update 3, client B will eventually get a response that reflects at least updates 2 and 3.</p></li></ul><p>How can we achieve that? It depends on how replication is handled by the system.</p><h3>Fully Replicated System</h3><p>In a fully replicated system, all nodes store the full dataset. <strong>Sticky availability can be achieved by making sure a client always talks to the same node.</strong></p><p>Here&#8217;s the same example again, but now with client A always connected to node 1, and client B to node 2:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!NBGQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F687ceb06-c805-476f-8432-dd253b0913f1_902x1062.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!NBGQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F687ceb06-c805-476f-8432-dd253b0913f1_902x1062.png 424w, https://substackcdn.com/image/fetch/$s_!NBGQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F687ceb06-c805-476f-8432-dd253b0913f1_902x1062.png 848w, https://substackcdn.com/image/fetch/$s_!NBGQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F687ceb06-c805-476f-8432-dd253b0913f1_902x1062.png 1272w, https://substackcdn.com/image/fetch/$s_!NBGQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F687ceb06-c805-476f-8432-dd253b0913f1_902x1062.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!NBGQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F687ceb06-c805-476f-8432-dd253b0913f1_902x1062.png" width="401" height="472.1308203991131" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/687ceb06-c805-476f-8432-dd253b0913f1_902x1062.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1062,&quot;width&quot;:902,&quot;resizeWidth&quot;:401,&quot;bytes&quot;:84558,&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://www.thecoder.cafe/i/168622345?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F687ceb06-c805-476f-8432-dd253b0913f1_902x1062.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_!NBGQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F687ceb06-c805-476f-8432-dd253b0913f1_902x1062.png 424w, https://substackcdn.com/image/fetch/$s_!NBGQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F687ceb06-c805-476f-8432-dd253b0913f1_902x1062.png 848w, https://substackcdn.com/image/fetch/$s_!NBGQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F687ceb06-c805-476f-8432-dd253b0913f1_902x1062.png 1272w, https://substackcdn.com/image/fetch/$s_!NBGQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F687ceb06-c805-476f-8432-dd253b0913f1_902x1062.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><figcaption class="image-caption">Blue updates are made by client A, and green updates are made by client B.</figcaption></figure></div><p>Here, node 2 hasn&#8217;t yet replicated update 5, and node 1 hasn&#8217;t yet replicated update 3. Still, since each client sticks to one node, <strong>they eventually see a consistent view of their own operations</strong>, despite possible failures such as a partition between the nodes.</p><h3>Partially Replicated System</h3><p>Now, let&#8217;s discuss a partially replicated system where nodes are replicas for subsets of data items.</p><p>Here&#8217;s a (dummy) partitioning system where even-numbered updates go to node 1 and odd-numbered ones to node 2:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!24-k!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9d6c542-0cb7-45a6-bf6b-91898c9cdd75_902x862.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!24-k!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9d6c542-0cb7-45a6-bf6b-91898c9cdd75_902x862.png 424w, https://substackcdn.com/image/fetch/$s_!24-k!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9d6c542-0cb7-45a6-bf6b-91898c9cdd75_902x862.png 848w, https://substackcdn.com/image/fetch/$s_!24-k!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9d6c542-0cb7-45a6-bf6b-91898c9cdd75_902x862.png 1272w, https://substackcdn.com/image/fetch/$s_!24-k!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9d6c542-0cb7-45a6-bf6b-91898c9cdd75_902x862.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!24-k!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9d6c542-0cb7-45a6-bf6b-91898c9cdd75_902x862.png" width="399" height="381.3059866962306" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a9d6c542-0cb7-45a6-bf6b-91898c9cdd75_902x862.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:862,&quot;width&quot;:902,&quot;resizeWidth&quot;:399,&quot;bytes&quot;:74500,&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://www.thecoder.cafe/i/168622345?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9d6c542-0cb7-45a6-bf6b-91898c9cdd75_902x862.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_!24-k!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9d6c542-0cb7-45a6-bf6b-91898c9cdd75_902x862.png 424w, https://substackcdn.com/image/fetch/$s_!24-k!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9d6c542-0cb7-45a6-bf6b-91898c9cdd75_902x862.png 848w, https://substackcdn.com/image/fetch/$s_!24-k!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9d6c542-0cb7-45a6-bf6b-91898c9cdd75_902x862.png 1272w, https://substackcdn.com/image/fetch/$s_!24-k!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9d6c542-0cb7-45a6-bf6b-91898c9cdd75_902x862.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><figcaption class="image-caption">Blue updates are made by client A, and green updates are made by client B.</figcaption></figure></div><p>Here, clients can&#8217;t just stick to a single node. <strong>Instead, they must maintain stickiness with a single logical copy of the database, which may consist of multiple nodes.</strong></p><p><strong>Clients can also help implement this model by acting as servers themselves.</strong> For example, a client could cache its own reads and writes, allowing it to return responses even during indefinitely long partitions.</p><h1>Summary</h1><ul><li><p>Highly available is too vague; watch out when you read or hear it. It might mean different things depending on the system or author.</p></li><li><p>Majority available means a majority of nodes can still perform some operations. This model supports stronger consistency.</p></li><li><p>Totally available means each non-faulty node can handle requests independently. It favors latency, but usually comes with weaker consistency.</p></li><li><p>Sticky available means clients can make progress as long as they keep talking to a replica that reflects their own history.</p></li><li><p>Availability models help us reason at the operation level, not just the system level. What matters is which operation can succeed, and under what conditions.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://read.thecoder.cafe/" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://read.thecoder.cafe/&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">AI is getting better every day. Are you? At The Coder Cafe, we serve fundamental concepts to make you an engineer that AI can&#8217;t replace. Written by a Google SWE, trusted by thousands of engineers worldwide.</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><h1>&#128218; Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/distributed-systems">Distributed Systems</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/pacelc">The PACELC Theorem</a></p></li><li><p><a href="https://read.thecoder.cafe/p/exploring-database-isolation-levels">Exploring Database Isolation Levels</a></p></li><li><p><a href="https://read.thecoder.cafe/p/latency-and-user-experience">Latency and User Experience</a></p></li></ul><h2>Sources</h2><ul><li><p><a href="https://antithesis.com/resources/reliability_glossary">A distributed systems reliability glossary - Antithesis</a></p></li></ul><h2>Explore Further</h2><ul><li><p><a href="https://www.scylladb.com/glossary/high-availability-database/">High Availability Database Definition - ScyllaDB</a></p></li><li><p><a href="https://jepsen.io/consistency/models">Consistency Models - Jepsen</a></p></li></ul><div><hr></div><p>&#10084;&#65039; <em>If you enjoyed the post, please consider giving it a like. It&#8217;s a helpful signal to decide what to write next.</em></p><p>&#128172; <em>When someone says their system is &#8220;highly available,&#8221; what do you assume they mean?</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/p/availability-models/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://read.thecoder.cafe/p/availability-models/comments"><span>Leave a comment</span></a></p>]]></content:encoded></item><item><title><![CDATA[What Makes Code Beautiful]]></title><description><![CDATA[The more average the code, the more pleasurable it is to read and maintain.]]></description><link>https://read.thecoder.cafe/p/what-makes-code-beautiful</link><guid isPermaLink="false">https://read.thecoder.cafe/p/what-makes-code-beautiful</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Thu, 10 Jul 2025 10:01:06 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!lbRT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ac201ea-3124-46c1-8b45-3e629eac08f4_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Hello! Today we will discuss the concept of beauty in programming.</em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!lbRT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ac201ea-3124-46c1-8b45-3e629eac08f4_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lbRT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ac201ea-3124-46c1-8b45-3e629eac08f4_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!lbRT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ac201ea-3124-46c1-8b45-3e629eac08f4_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!lbRT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ac201ea-3124-46c1-8b45-3e629eac08f4_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!lbRT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ac201ea-3124-46c1-8b45-3e629eac08f4_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!lbRT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ac201ea-3124-46c1-8b45-3e629eac08f4_1600x800.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2ac201ea-3124-46c1-8b45-3e629eac08f4_1600x800.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;:1656275,&quot;alt&quot;:&quot;The more average the code, the more pleasurable it is to read and maintain.&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://www.thecoder.cafe/i/163697017?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ac201ea-3124-46c1-8b45-3e629eac08f4_1600x800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The more average the code, the more pleasurable it is to read and maintain." title="The more average the code, the more pleasurable it is to read and maintain." srcset="https://substackcdn.com/image/fetch/$s_!lbRT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ac201ea-3124-46c1-8b45-3e629eac08f4_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!lbRT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ac201ea-3124-46c1-8b45-3e629eac08f4_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!lbRT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ac201ea-3124-46c1-8b45-3e629eac08f4_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!lbRT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ac201ea-3124-46c1-8b45-3e629eac08f4_1600x800.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg 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>Let me ask you a simple question: <strong>what makes a code beautiful?</strong></p><p>Try thinking about this question (at least a little) before scrolling down.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!K5jT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!K5jT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!K5jT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!K5jT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!K5jT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!K5jT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png" width="725.5375366210938" height="362.7687683105469" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:725.5375366210938,&quot;bytes&quot;:55063,&quot;alt&quot;:&quot;Time to think.&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://www.thecoder.cafe/i/163697017?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:&quot;center&quot;,&quot;offset&quot;:false}" class="sizing-normal" alt="Time to think." title="Time to think." srcset="https://substackcdn.com/image/fetch/$s_!K5jT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!K5jT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!K5jT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!K5jT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d8c1b3f-a58f-4314-b5f4-d45a499f6d84_1600x800.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>You probably came up with a few characteristics: It&#8217;s readable and modular. Maybe it&#8217;s well tested. Or maybe it follows clean code principles or other familiar practices.</p><p><strong>What if I told you that beautiful code is just&#8230; average code</strong>? That might sound silly, but let&#8217;s walk through it.</p><p><em><a href="https://journals.sagepub.com/doi/10.1111/j.1467-9280.1990.tb00079.x">Attractive Faces Are Only Average</a></em> is a foundational study by Judith H. Langlois and Lori A. Roggman in the psychology of facial attractiveness. They created composite images by averaging multiple individual faces&#8212;noses, eyes, cheekbones&#8212;all mathematically averaged.</p><p>These composites were consistently rated as more attractive than the individual faces used to make them. <strong>In fact, the more individual faces were averaged into a composite, the more attractive the resulting face became</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_!aS4y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df4880e-1ee0-4045-bc9f-ba1d7846fd1d_445x341.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!aS4y!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df4880e-1ee0-4045-bc9f-ba1d7846fd1d_445x341.jpeg 424w, https://substackcdn.com/image/fetch/$s_!aS4y!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df4880e-1ee0-4045-bc9f-ba1d7846fd1d_445x341.jpeg 848w, https://substackcdn.com/image/fetch/$s_!aS4y!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df4880e-1ee0-4045-bc9f-ba1d7846fd1d_445x341.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!aS4y!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df4880e-1ee0-4045-bc9f-ba1d7846fd1d_445x341.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!aS4y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df4880e-1ee0-4045-bc9f-ba1d7846fd1d_445x341.jpeg" width="445" height="341" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9df4880e-1ee0-4045-bc9f-ba1d7846fd1d_445x341.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:341,&quot;width&quot;:445,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:167328,&quot;alt&quot;:&quot;A composite face in the center created by averaging the facial features of eight individual faces shown around it, illustrating the &#8216;average is attractive&#8217; effect.&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/163697017?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df4880e-1ee0-4045-bc9f-ba1d7846fd1d_445x341.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="A composite face in the center created by averaging the facial features of eight individual faces shown around it, illustrating the &#8216;average is attractive&#8217; effect." title="A composite face in the center created by averaging the facial features of eight individual faces shown around it, illustrating the &#8216;average is attractive&#8217; effect." srcset="https://substackcdn.com/image/fetch/$s_!aS4y!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df4880e-1ee0-4045-bc9f-ba1d7846fd1d_445x341.jpeg 424w, https://substackcdn.com/image/fetch/$s_!aS4y!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df4880e-1ee0-4045-bc9f-ba1d7846fd1d_445x341.jpeg 848w, https://substackcdn.com/image/fetch/$s_!aS4y!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df4880e-1ee0-4045-bc9f-ba1d7846fd1d_445x341.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!aS4y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df4880e-1ee0-4045-bc9f-ba1d7846fd1d_445x341.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg 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><figcaption class="image-caption"><a href="https://www.snexplores.org/article/face-values">Credits</a></figcaption></figure></div><p>This suggests that facial features close to the population mean are generally preferred.</p><p>Why? The main theory is <em>processing fluency</em>: <strong>the easier something is for our brain to process, the more we like it</strong>. Average faces are easier to recognize and interpret, so they feel more pleasant.</p><p>This principle doesn&#8217;t stop at faces. It applies to advertising, art, or even decision-making. When something is easy to process, brain imaging studies show that it activates reward-related regions. We enjoy it more, without even realizing why.</p><p>So what happens when we apply this principle to code?</p><p>It means that the more average the code is, the more it aligns with what we&#8217;ve seen before, and the more beautiful it feels. The less surprising it is, the more pleasurable it is to read, understand, and maintain.</p><p>How can we write average code?</p><ul><li><p><strong>Use standard naming conventions</strong>: Stick to familiar names so others instantly know what things are.</p></li><li><p><strong>Follow language idioms and common patterns</strong>: Write code the way others expect it to be written.</p></li><li><p><strong>Favor clarity over cleverness</strong>: The easier it is to read, the more enjoyable it is to work with.</p></li><li><p><strong>Be consistent</strong>: Predictability makes everything easier to understand.</p></li><li><p><strong>Minimize unnecessary novelty</strong>: The more our code looks like what we&#8217;ve seen before, the faster it gets processed and the more it&#8217;s liked.</p></li></ul><p>Beautiful code is the kind that conforms to established patterns, idioms, and norms. It&#8217;s not flashy, novel, or overly clever. It&#8217;s clear, familiar, and quietly elegant. Just average.</p><p>What if next time, the best compliment your pull request could receive wasn&#8217;t that it was &#8220;brilliant&#8221; but simply &#8220;average&#8221;?</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://read.thecoder.cafe/" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://read.thecoder.cafe/&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">AI is getting better every day. Are you? At The Coder Cafe, we serve fundamental concepts to make you an engineer that AI can&#8217;t replace. Written by a Google SWE, trusted by thousands of engineers worldwide.</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><h1>&#128218; Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/software-engineering">Software Engineering</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/cognitive-load">Cognitive Load: Reducing Mental Overhead in Software Design</a></p></li><li><p><a href="https://read.thecoder.cafe/p/readability">Readability: Understanding the What, the Why, and the How</a></p></li><li><p><a href="https://read.thecoder.cafe/p/premature-abstractions">Premature Abstractions: Avoiding Unnecessary Complexity in Software Design</a></p></li></ul><h2>Sources</h2><ul><li><p><a href="https://journals.sagepub.com/doi/10.1111/j.1467-9280.1990.tb00079.x">Attractive Faces Are Only Average</a> <em>// The study mentioned in the post.</em></p></li><li><p><a href="https://pragprog.com/titles/atcrime2/your-code-as-a-crime-scene-second-edition/">Your Code as a Crime Scene</a> <em>// I read about this study from this book.</em></p></li></ul><h2>Explore Further</h2><ul><li><p><a href="https://www.sciencedirect.com/science/article/pii/S0022103119302732">Processing fluency</a></p></li></ul><div><hr></div><p>&#10084;&#65039; <em>If you made it this far and enjoyed the post, please consider giving it a like.</em></p><p>&#128172; <em>Does this idea resonate with you or does it feel wrong? Curious to hear your perspective.</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/p/what-makes-code-beautiful/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://read.thecoder.cafe/p/what-makes-code-beautiful/comments"><span>Leave a comment</span></a></p>]]></content:encoded></item><item><title><![CDATA[Don't Be Ashamed to Say I Don't Know]]></title><description><![CDATA[These three words that made us immediately trust her more than anyone else before:&#160;I don&#8217;t know.]]></description><link>https://read.thecoder.cafe/p/i-dont-know</link><guid isPermaLink="false">https://read.thecoder.cafe/p/i-dont-know</guid><dc:creator><![CDATA[Teiva Harsanyi]]></dc:creator><pubDate>Wed, 25 Jun 2025 10:01:36 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!b7KY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86e9b614-8474-41f8-bdac-c5b6ba7299f3_1600x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Hello! Today, let&#8217;s discuss the power of &#8220;I don&#8217;t know&#8220; with a personal story.</em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!b7KY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86e9b614-8474-41f8-bdac-c5b6ba7299f3_1600x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!b7KY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86e9b614-8474-41f8-bdac-c5b6ba7299f3_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!b7KY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86e9b614-8474-41f8-bdac-c5b6ba7299f3_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!b7KY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86e9b614-8474-41f8-bdac-c5b6ba7299f3_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!b7KY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86e9b614-8474-41f8-bdac-c5b6ba7299f3_1600x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!b7KY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86e9b614-8474-41f8-bdac-c5b6ba7299f3_1600x800.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/86e9b614-8474-41f8-bdac-c5b6ba7299f3_1600x800.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;:1656854,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/164705765?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86e9b614-8474-41f8-bdac-c5b6ba7299f3_1600x800.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_!b7KY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86e9b614-8474-41f8-bdac-c5b6ba7299f3_1600x800.png 424w, https://substackcdn.com/image/fetch/$s_!b7KY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86e9b614-8474-41f8-bdac-c5b6ba7299f3_1600x800.png 848w, https://substackcdn.com/image/fetch/$s_!b7KY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86e9b614-8474-41f8-bdac-c5b6ba7299f3_1600x800.png 1272w, https://substackcdn.com/image/fetch/$s_!b7KY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86e9b614-8474-41f8-bdac-c5b6ba7299f3_1600x800.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg 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>Last month, I was at the hospital with my partner for the birth of our newborn. During our stay, my partner experienced a specific symptom, and we wanted to understand what could be causing it. So we asked the midwife.</p><p>We immediately noticed the hesitation in her eyes. When she finally gave an answer, it came with a kind of forced confidence, and we both felt she wasn&#8217;t sure about it.</p><p>At our hospital, midwives do 12-hour shifts. So a few hours later, we asked the exact same question to the next midwife. Same hesitation, but this time, a different answer.</p><p>And so it went on. Every shift, we asked again. Every time, a different answer. Eventually, it even became a game between my partner and me: trying to guess what the next answer would be.</p><p>Until&#8230; The one. The one who broke this cycle.</p><p>We asked her the same question. She paused. Thought about it. And then said something unexpected:</p><div class="pullquote"><p>I don&#8217;t know.</p></div><p>It might seem counterintuitive, but these three words made us immediately trust her more than anyone else before<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a>.</p><p>Twenty minutes later, she even came back to our room and said:</p><div class="pullquote"><p>I asked the doctor, the answer is because of [X]. Thanks for asking, I learned something.</p></div><p>That brief exchange resonated with me.</p><p>In our field, we often put a lot of weight on posture. We build up our position as the go-to person for a codebase, a data model, or a framework. The more we know, the more we are seen as the one to consult or include in any related discussion.</p><p>But from that posture, admitting we don&#8217;t know something can feel like pulling out the bottom card in a house of cards. Suddenly, it feels like everything we built to earn that status might collapse.</p><p>Yet, if we take a step back, admitting we don&#8217;t know shouldn&#8217;t be seen as something shameful or embarrassing. In fact, it&#8217;s often the most responsible thing we can do.</p><ul><li><p><strong>Pretending to know can lead to bad decisions.</strong> It creates false confidence and can steer a team in the wrong direction leading to possibly terrible outcomes.</p></li><li><p><strong>Authority isn&#8217;t built on knowing everything.</strong> It&#8217;s about being reliable and honest, someone others trust, and they can talk to with confidence.</p></li><li><p><strong>Teams work better when people feel safe to admit uncertainty.</strong> It fosters psychological safety among the team members, which Google identified as the top trait of effective teams.</p></li><li><p><strong>Curiosity + humility = real learning. </strong>Admitting we don&#8217;t know something is what keeps us learning and growing, no matter how experienced we are.</p></li></ul><p>Whether it&#8217;s for us or others, next time we don&#8217;t know something, let&#8217;s be like that midwife: let&#8217;s just admit it. Without shame.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://read.thecoder.cafe/" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png" width="449" height="224.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:449,&quot;bytes&quot;:82853,&quot;alt&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;title&quot;:&quot;The Coder Cafe: Learn One Concept With Your Coffee.&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://read.thecoder.cafe/&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thecoder.cafe/i/151119215?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Coder Cafe: Learn One Concept With Your Coffee." title="The Coder Cafe: Learn One Concept With Your Coffee." srcset="https://substackcdn.com/image/fetch/$s_!ZoDz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ZoDz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5b47134-fe05-42e3-9aaf-dd2758923a98_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/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">AI is getting better every day. Are you? At The Coder Cafe, we serve fundamental concepts to make you an engineer that AI can&#8217;t replace. Written by a Google SWE, trusted by thousands of engineers worldwide.</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><h1>&#128218; Resources</h1><h2>More From the <em><a href="https://read.thecoder.cafe/t/beyond-code">Beyond the Code</a></em> Category</h2><ul><li><p><a href="https://read.thecoder.cafe/p/lateral-thinking">Lateral Thinking</a></p></li><li><p><a href="https://read.thecoder.cafe/p/streetlight-effect">Streetlight Effect</a></p></li><li><p><a href="https://read.thecoder.cafe/p/10-technical-writing-rules">10 Rules I Learned About Technical Writing</a></p></li></ul><h2>Sources</h2><ul><li><p><a href="https://rework.withgoogle.com/en/guides/understanding-team-effectiveness">Understand team effectiveness</a></p></li></ul><div><hr></div><p>&#10084;&#65039; <em>If you made it this far and enjoyed the post, please consider giving it a like.</em></p><p>&#128172; <em>How comfortable are you with saying &#8220;I don&#8217;t know&#8220;?</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://read.thecoder.cafe/p/i-dont-know/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://read.thecoder.cafe/p/i-dont-know/comments"><span>Leave a comment</span></a></p><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-1" href="#footnote-anchor-1" class="footnote-number" contenteditable="false" target="_self">1</a><div class="footnote-content"><p>Turns out, our gut feeling was right. She ended up being better than most of the other midwives we met.</p></div></div>]]></content:encoded></item></channel></rss>