<?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[BinaryBox]]></title><description><![CDATA[BinaryBox is where coders level up to engineers. I share practical insights, mental models, and real-world stories that help you think beyond code, design better solutions, and grow into a problem-solving powerhouse.]]></description><link>https://www.binarybox.org</link><image><url>https://substackcdn.com/image/fetch/$s_!nQ1g!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5439f3e3-02d6-4fcb-916e-c999f65d4c56_300x300.png</url><title>BinaryBox</title><link>https://www.binarybox.org</link></image><generator>Substack</generator><lastBuildDate>Wed, 20 May 2026 03:56:24 GMT</lastBuildDate><atom:link href="https://www.binarybox.org/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Ashok Vishwakarma]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[binarybox@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[binarybox@substack.com]]></itunes:email><itunes:name><![CDATA[Ashok Vishwakarma]]></itunes:name></itunes:owner><itunes:author><![CDATA[Ashok Vishwakarma]]></itunes:author><googleplay:owner><![CDATA[binarybox@substack.com]]></googleplay:owner><googleplay:email><![CDATA[binarybox@substack.com]]></googleplay:email><googleplay:author><![CDATA[Ashok Vishwakarma]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[I tested 5 Agent Observability Tools and they all Failed the Causality Test.]]></title><description><![CDATA[LangSmith, Arize Phoenix, Langfuse, LangGraph Studio, and GraphEvals + Neo4j with same scenario, same question: "Which context influenced this decision?" Only GraphEvals + Neo4j passed the test.]]></description><link>https://www.binarybox.org/p/i-tested-5-agent-observability-tools</link><guid isPermaLink="false">https://www.binarybox.org/p/i-tested-5-agent-observability-tools</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Mon, 18 May 2026 06:02:36 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!CqE_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff78c0dc1-abb1-4888-82c0-0c745ac44dc7_1303x656.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!CqE_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff78c0dc1-abb1-4888-82c0-0c745ac44dc7_1303x656.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!CqE_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff78c0dc1-abb1-4888-82c0-0c745ac44dc7_1303x656.jpeg 424w, https://substackcdn.com/image/fetch/$s_!CqE_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff78c0dc1-abb1-4888-82c0-0c745ac44dc7_1303x656.jpeg 848w, https://substackcdn.com/image/fetch/$s_!CqE_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff78c0dc1-abb1-4888-82c0-0c745ac44dc7_1303x656.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!CqE_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff78c0dc1-abb1-4888-82c0-0c745ac44dc7_1303x656.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!CqE_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff78c0dc1-abb1-4888-82c0-0c745ac44dc7_1303x656.jpeg" width="1303" height="656" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f78c0dc1-abb1-4888-82c0-0c745ac44dc7_1303x656.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:656,&quot;width&quot;:1303,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:186809,&quot;alt&quot;:&quot;LangSmith vs Langfuse vs Arize Phoenix: LLM Observability in 2026 |  TURION.AI&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="LangSmith vs Langfuse vs Arize Phoenix: LLM Observability in 2026 |  TURION.AI" title="LangSmith vs Langfuse vs Arize Phoenix: LLM Observability in 2026 |  TURION.AI" srcset="https://substackcdn.com/image/fetch/$s_!CqE_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff78c0dc1-abb1-4888-82c0-0c745ac44dc7_1303x656.jpeg 424w, https://substackcdn.com/image/fetch/$s_!CqE_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff78c0dc1-abb1-4888-82c0-0c745ac44dc7_1303x656.jpeg 848w, https://substackcdn.com/image/fetch/$s_!CqE_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff78c0dc1-abb1-4888-82c0-0c745ac44dc7_1303x656.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!CqE_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff78c0dc1-abb1-4888-82c0-0c745ac44dc7_1303x656.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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>Two weeks ago, I published <strong><a href="https://www.binarybox.org/p/why-flat-logs-cannot-debug-ai-agents">an article</a></strong> about how an AI agent system cost a company $240,000. One question kept coming up in the comments: &#8220;Which observability tool should we use to prevent this?&#8221;</p><p>So I tested them. All of them.</p><h4>The Test Scenario</h4><p>I built the same multi-agent system in five different environments</p><p><strong>Agent A (Router)</strong> loads historical Context X from cache<br><strong>Agent B (Researcher)</strong> fetches fresh Context Z<br><strong>Agent C (Decision Maker)</strong> makes final call using both contexts</p><p><strong>The bug: </strong>Context X is 14 days old (stale). Agent C uses outdated information to make a bad decision.</p><p><strong>The debug task: </strong>Start with Agent C&#8217;s bad decision. Find which context caused it and where it originated.</p><p>This is a <strong>causality question</strong>. Not &#8220;what happened when&#8221; (timeline). But &#8220;what caused what&#8221; (relationships).</p><p>I tested five tools, <strong><a href="https://www.binarybox.org/p/why-flat-logs-cannot-debug-ai-agents">GraphEvals + Neo4j</a></strong>,  <strong><a href="https://www.langchain.com/blog/langgraph-studio-the-first-agent-ide">LangGraph Studio</a></strong>, <strong><a href="https://smith.langchain.com/">LangSmith</a></strong>, <strong><a href="https://arize.com/phoenix/">Arize Phoenix</a></strong> and <strong><a href="https://langfuse.com/">Langfuse</a></strong>.</p><p>The results weren&#8217;t what the vendor demos showed.</p><h2>The Benchmark Result</h2><p>Here's what I found.</p><h4>LangGraph Studio</h4><p>LangGraph Studio is a local debugging UI that visualizes LangGraph execution as a Directed Acyclic Graph (DAG).</p><p>For a single trace, this tool is perfect.</p><p>I opened the trace in the browser, clicked through the nodes, saw Context X in the Decision Maker&#8217;s state, and traced it back to the Router.</p><p>Root cause time: <strong>15 minutes.</strong></p><p><strong>But here&#8217;s the trap.</strong></p><p>LangGraph Studio is a debugger, not a database. You cannot query across traces.</p><p>If you process 10,000 agent runs per day, you cannot ask: &#8220;How many decisions used context older than 7 days?&#8221;</p><p>You have to manually open each trace and click through the UI.</p><p><strong>Perfect for development. Useless for production observability at scale.</strong></p><h4>LangSmith</h4><p>LangSmith uses an <strong><a href="https://opentelemetry.io/">OpenTelemetry</a></strong> style span architecture with a waterfall timeline view.</p><p>To find the root cause, I had to:</p><ol><li><p>Open the trace and find the Decision Maker span</p></li><li><p>Expand the nested JSON payload</p></li><li><p>Find the context field and read the timestamp manually</p></li><li><p>Scroll up the timeline to find the Router span</p></li><li><p>Confirm where the context originated</p></li></ol><p><strong>Root cause time: 60-90 minutes of manual JSON archaeology.</strong></p><p>LangSmith shows you <strong>when</strong> things happened. It doesn&#8217;t show you <strong>why</strong>.</p><p>To find causality, you must manually parse data and calculate time deltas in your head. It has no topological query engine.</p><p>You can filter by keyword. You cannot query relationships between spans.</p><h4>Arize Phoenix</h4><p>Arize Phoenix markets &#8220;graph tracing&#8221; prominently. But it&#8217;s built on flat OTLP traces.</p><p>The debugging process was nearly identical to LangSmith</p><ul><li><p>Manually expand JSON payloads</p></li><li><p>Calculate timestamps to find stale context</p></li></ul><p><strong>Root cause time: ~60 minutes.</strong></p><p><strong>The &#8220;graph tracing&#8221; claim is marketing, not architecture.</strong></p><p>You can see parent-child relationships between spans. You cannot query the data flow topology.</p><p>Phoenix has better attribute filtering than LangSmith. But it still fails to answer the causality question without significant manual work.</p><h4>Langfuse</h4><p>Langfuse is functionally similar to LangSmith and Arize Phoenix. Timeline-based waterfall view.</p><p>The debugging process required the same manual JSON digging.</p><p><strong>Root cause time: 60+ minutes.</strong></p><p>This tool proves the divide is not between open-source and paid software.</p><p><strong>The divide is between flat logs and graph databases.</strong></p><p>Langfuse is good for tracking token counts and latency. It fails the causality test at scale.</p><h4>Graph Evals + Neo4j</h4><p>I built a custom instrumentation layer that writes every agent decision and context propagation directly into a Neo4j graph database.</p><p>When Agent C made the bad decision, I ran the below Cypher query</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;graphql&quot;,&quot;nodeId&quot;:&quot;4b7e293e-ba0e-47dc-8c14-4ad514a81c4a&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-graphql">MATCH (decision:Decision {id: 'decision_123'})
      -[:INFLUENCED_BY]-&gt;(context:Context)
WHERE context.age_days &gt; 7
RETURN context</code></pre></div><p>The result,<strong> Context X from Agent A, 14 days old. Returned in 2 seconds.</strong></p><p><strong>Root cause time: 40 minutes</strong> (including time to write the query and understand the graph topology).</p><p>This is the only tool that allows you to query causality at scale.</p><p>If you have 10,000 agent executions, you can find every decision influenced by stale context with one command.</p><p><strong>The trade-off: </strong>Requires building your own instrumentation and maintaining the database. Slowest for debugging a single trace, but the only one that scales to bulk analysis.</p><div><hr></div><p><strong>Quick Check:</strong> </p><p>If you use any of these tools, pull up your last agent debugging session. How long did it take to find which context caused the bad output?</p><p>If the answer is &gt; 30 minutes, <strong>you don&#8217;t have causality tracing.</strong></p><p><strong>You have manual log archaeology.</strong></p><h2>Why they failed?</h2><p>Four out of five tools failed the causality test. It comes down to the fundamental data model.</p><h4>Timeline Based Architecture (LangSmith, Phoenix, Langfuse)</h4><p>These tools model execution as <strong>spans</strong> - records of things that happened at specific times.</p><p>They show you a waterfall of boxes stacked vertically. Causality is buried in JSON metadata. Data flow is not a first-class relationship.</p><p>To find a pattern across 1,000 traces, you have to export the data and write a script to parse JSON.</p><p><strong>They record the &#8220;when,&#8221; not the &#8220;why.&#8221;</strong></p><h4>Graph Based Architecture (Neo4j, LangGraph Studio)</h4><p>Agents, decisions, and contexts are nodes. Relationships like <code>PROVIDED_CONTEXT</code> or <code>INFLUENCED_BY</code> are explicit edges.</p><p>This allows topological queries. You&#8217;re not parsing JSON. You&#8217;re querying the shape of execution.</p><p>This is the only way to find multi-hop context propagation at scale.</p><p><strong>The LangGraph Studio Trap</strong></p><p>LangGraph Studio <em>looks</em> like it solves the problem because it draws a graph.</p><p>But a graph UI is not a graph database.</p><p>Studio is a snapshot of one execution. Neo4j is a queryable history of all executions.</p><p><code>Beautiful graph UI &#8800; architectural capability.</code></p><p>You cannot query patterns across thousands of executions in Studio. You can only click through one trace at a time.</p><h2>Which one you should use?</h2><p>Your choice depends on your scale and debugging style.</p><h4>&lt; 100 traces/day &#8594; LangGraph Studio</h4><p>If you&#8217;re generating fewer than 100 traces per day, LangGraph Studio is the best choice.</p><p>Fast visual debugging. Zero custom instrumentation. You can accept manual work for occasional incidents because volume is low.</p><h4>100-1,000 traces/day &#8594; LangSmith or Arize Phoenix</h4><p>If you&#8217;re generating 100-1,000 traces per day, LangSmith or Phoenix are acceptable.</p><p>You get vendor support and standard LLM observability (token tracking, latency).</p><p>Accept that causality debugging will take 60 minutes of manual JSON digging per incident.</p><h4>&gt; 1,000 traces/day &#8594; GraphEvals + Neo4j</h4><p>If you&#8217;re generating more than 1,000 traces per day and need to find patterns in context propagation, build a custom Neo4j solution.</p><p>It&#8217;s the only option that lets you query causality paths across massive datasets in seconds.</p><p><strong>Trade-off:</strong> Higher maintenance burden for the ability to understand why your agents are failing.</p><h2>The lesson learned</h2><p>I didn't set out to prove Neo4j was the best tool. I set out to find which tool could answer the causality question.</p><p>The testing revealed a brutal truth</p><h4>Pretty UIs &#8800; architectural capability.</h4><ul><li><p>LangSmith has a beautiful timeline. Still requires manual archaeology.</p></li><li><p>Arize Phoenix has impressive graphics. Still flat spans underneath.</p></li><li><p>LangGraph Studio is perfect for one trace. Cannot query at scale.</p></li></ul><p><strong>The divide: </strong>Timeline architecture (records "when") vs Graph architecture (records "what caused what").</p><p>If you&#8217;re building complex multi-agent systems, you probably need graph observability.</p><p>But today, the only way to get true graph observability at scale is to build it yourself using Neo4j.</p><div><hr></div><h2>Conclusion</h2><p>Every vendor demo showed me beautiful waterfalls and pretty arrows.</p><p>None showed me how long it takes to answer: &#8220;Which context influenced this decision?&#8221;</p><h4>The Causality Test Results</h4><p><strong>LangSmith</strong></p><ul><li><p>Single trace: 60-90 minutes (manual JSON digging)</p></li><li><p>Bulk queries: Export + script required</p></li><li><p>Verdict: Timeline tool &#10060;</p></li></ul><p><strong>Arize Phoenix</strong></p><ul><li><p>Single trace: 60 minutes (flat span inspection)</p></li><li><p>Bulk queries: Export + script required</p></li><li><p>Verdict: "Graph tracing" is marketing &#10060;</p></li></ul><p><strong>Langfuse</strong></p><ul><li><p>Single trace: 60-90 minutes (timeline analysis)</p></li><li><p>Bulk queries: Export + script required</p></li><li><p>Verdict: Open-source timeline tool &#10060;</p></li></ul><p><strong>LangGraph Studio</strong></p><ul><li><p>Single trace: 15 minutes (visual debugging) &#9989;</p></li><li><p>Bulk queries: No query language</p></li><li><p>Verdict: Debugger, not database &#9888;&#65039;</p></li></ul><p><strong>GraphEvals + Neo4j</strong></p><ul><li><p>Single trace: 40 minutes (slower)</p></li><li><p>Bulk queries: &lt;5 seconds &#9989;</p></li><li><p>Verdict: Only option that scales &#9989;</p></li></ul><p>Beautiful timelines &#8800; causality tracing.</p><p>"Graph" in marketing &#8800; graph database underneath.</p><p>Open Source &#8800; better architecture.</p><p><strong>Before you buy or build, ask the causality question:</strong></p><p>"Show me every decision influenced by context older than 7 days that bypassed the researcher node."</p><p>If the answer is &#8220;export the data and write a script,&#8221; you don&#8217;t have observability.</p><p><strong>You have expensive logs with a nice dashboard.</strong></p><p>If your agents process &lt;100 traces/day, use LangGraph Studio.</p><p>If you need to query thousands of traces, build a custom graph solution.</p><p>Everything else is a timeline tool with varying degrees of polish.</p><p>I tested the tools so you don't have to.</p><p>The one that passes the causality test is the one you have to build yourself.</p><p>For now.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading BinaryBox! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[Why LinkedIn is leaving Kafka and Why you should not be worried.]]></title><description><![CDATA[The question you should be asking is simple. If LinkedIn outgrew Kafka at 32 trillion events and you are at 10 million do you actually need Kafka.]]></description><link>https://www.binarybox.org/p/why-linkedin-is-leaving-kafka-and</link><guid isPermaLink="false">https://www.binarybox.org/p/why-linkedin-is-leaving-kafka-and</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Sat, 16 May 2026 06:01:19 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!NDM_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab071b27-b7cd-4952-98dc-9ffdd889c7a7_1496x700.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!NDM_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab071b27-b7cd-4952-98dc-9ffdd889c7a7_1496x700.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!NDM_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab071b27-b7cd-4952-98dc-9ffdd889c7a7_1496x700.jpeg 424w, https://substackcdn.com/image/fetch/$s_!NDM_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab071b27-b7cd-4952-98dc-9ffdd889c7a7_1496x700.jpeg 848w, https://substackcdn.com/image/fetch/$s_!NDM_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab071b27-b7cd-4952-98dc-9ffdd889c7a7_1496x700.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!NDM_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab071b27-b7cd-4952-98dc-9ffdd889c7a7_1496x700.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!NDM_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab071b27-b7cd-4952-98dc-9ffdd889c7a7_1496x700.jpeg" width="1496" height="700" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ab071b27-b7cd-4952-98dc-9ffdd889c7a7_1496x700.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:700,&quot;width&quot;:1496,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:337890,&quot;alt&quot;:&quot;Getting Started with Landoop's Kafka on Docker Locally | Jamie Bowman&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Getting Started with Landoop's Kafka on Docker Locally | Jamie Bowman" title="Getting Started with Landoop's Kafka on Docker Locally | Jamie Bowman" srcset="https://substackcdn.com/image/fetch/$s_!NDM_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab071b27-b7cd-4952-98dc-9ffdd889c7a7_1496x700.jpeg 424w, https://substackcdn.com/image/fetch/$s_!NDM_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab071b27-b7cd-4952-98dc-9ffdd889c7a7_1496x700.jpeg 848w, https://substackcdn.com/image/fetch/$s_!NDM_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab071b27-b7cd-4952-98dc-9ffdd889c7a7_1496x700.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!NDM_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab071b27-b7cd-4952-98dc-9ffdd889c7a7_1496x700.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>For the last decade engineering teams made a pilgrimage to Kafka. You deployed it because LinkedIn built it. You assumed that if it was good enough for a company processing billions of events it was certainly good enough for you. You set up your five node cluster with a ZooKeeper ensemble and configured your producer for idempotent writes. You spent three months getting it production ready.</p><p>Your team processes roughly 10 million events per day. LinkedIn operates at 32 trillion events per day in 2026.</p><p>The gap is staggering. You are processing 3.2 million times less than the scale where LinkedIn finally hit the ceiling. And here is the kicker. LinkedIn is moving off Kafka. They built <strong><a href="https://www.linkedin.com/blog/engineering/infrastructure/introducing-northguard-and-xinfra">Northguard and Xinfra</a></strong> to replace it.</p><p>The question you should be asking is simple. If LinkedIn outgrew Kafka at 32 trillion events and you are at 10 million do you actually need Kafka. Or did you cargo cult their infrastructure without understanding the scale that made it necessary.</p><p>The story of LinkedIn replacing Kafka is not a signal that Kafka is dead. It is a lesson in understanding scale. Kafka <strong>scaled</strong> <strong>23,000x</strong> before LinkedIn needed something else. You are running <strong>140x smaller</strong> than where they started in 2011. Let us talk about what actually broke at their scale and why you probably do not have that problem.</p><h2>What broke Kafka at LinkedIn scale?</h2><p>We need to look at the architectural limits of centralized coordination to understand the failure. </p><h4>The problem of Centralized Metadata</h4><p>Kafka relies on a single controller node to manage all partition metadata. The controller handles partition leader elections and replica assignments and metadata updates across every broker. </p><p>At your scale of <strong>100 topics</strong> this works perfectly. At the LinkedIn scale of <strong>400,000 topics</strong> and millions of partitions the controller becomes a catastrophic bottleneck. </p><p>When the controller fails a new leader election must occur via the <strong><a href="https://kafka.apache.org/41/operations/kraft/">KRaft</a></strong> quorum. The new controller must load every single piece of partition metadata into memory and rebuild the state. At the scale of 32 trillion events this reconstruction takes minutes. </p><p>And during that time the infrastructure is essentially frozen. No new topics can be created and no partitions can rebalance. </p><p>Centralized metadata management eventually hits a physical ceiling.</p><h4>The problem of Infra wide Rebalancing</h4><p>When a consumer group rebalances Kafka pauses consumption for the affected partitions. </p><p>At small scale this takes seconds. At LinkedIn scale rebalancing touches millions of partitions across thousands of topics simultaneously. </p><p>This causes infrastructure wide pauses that last for minutes. Even cooperative rebalancing cannot solve this when the sheer number of partitions creates a coordination explosion. </p><p>Consumer lag spikes and downstream systems experience massive latency increases during these coordinated events.</p><h4>The problem of Fixed Partition</h4><p>In Kafka you choose your partition count upfront. If you choose too few you hit a throughput wall. If you choose too many you waste resources. </p><p>As your data grows you cannot dynamically split a partition without downtime. </p><p>For a company with 400,000 topics repartitioning is operationally impossible. It requires stopping producers and migrating data and updating consumers across thousands of applications.</p><h4>The problem of Coordination</h4><p>The metadata storage for millions of partitions reaches gigabytes in size. Every producer and consumer reads this partition metadata on startup. Metadata updates generate massive broadcast traffic across the cluster. </p><p>Coordination mechanisms like ZooKeeper or KRaft eventually hit a physical limit of how much state they can broadcast to every broker in a timely manner.</p><p>Calculate this right now. </p><p>Divide 32 trillion by your daily event volume. If the result is greater than 1 million you are a million times smaller than the scale where these problems appear. </p><p>You do not have a Kafka problem. You have a scale perception problem.</p><h2>How Northguard solves the scale problem?</h2><p>Northguard replaces Kafka with a fundamentally different model designed for the frontier of distributed systems. It uses sharded metadata and range based partitioning and self balancing clusters.</p><h4>Sharded Metadata</h4><p>Instead of a single controller Northguard distributes metadata across vnodes using consistent hashing. Each vnode manages a subset of topics and uses Raft consensus for strong consistency. This removes the single point of coordination.</p><p>If your metadata fits comfortably in a single KRaft quorum you do not need this. LinkedIn needed it because their metadata exceeded the capacity of any single node memory.</p><h4>Range Based Partitioning</h4><p>Instead of fixed partitions Northguard uses ranges. A range is a contiguous slice of the keyspace that can dynamically split or merge without downtime. When a range grows too large it is marked for splitting and child ranges take over the future writes while the old range is sealed.</p><p>If you can estimate your partition count upfront you do not need this complexity. Fixed partitions are simpler to manage until you hit the 400,000 topic mark.</p><h4>Self Balancing Clusters</h4><p>In Northguard new segments are automatically assigned to the least loaded brokers. There is no explicit rebalancing operation required. If a broker fails the existing segments remain and new ones simply go to healthy nodes.</p><p>If your Kafka cluster only rebalances once per quarter then rebalancing is not your bottleneck. LinkedIn needed this because they add brokers and manage 150 clusters constantly. For them manual rebalancing was a full time operational tax.</p><h2>Do you actually need Kafka?</h2><p>We need to use a strict framework based on actual event volume to decide if Kafka really belongs in your stack.</p><p>If you process <strong>less than 10 million events per day</strong> you probably do not need Kafka. <strong><a href="https://redis.io/docs/latest/develop/data-types/streams/">Redis Streams</a></strong> or <strong><a href="https://aws.amazon.com/sqs/">SQS</a></strong> or even <strong><a href="https://www.postgresql.org/docs/current/sql-notify.html">Postgres NOTIFY</a></strong> will work with significantly less operational overhead.</p><p>If you process between 10 million and 100 million events per day managed Kafka like <strong><a href="https://aws.amazon.com/msk/">AWS MSK</a></strong> makes sense. The volume justifies the tool but not the team required to self host it.</p><p>You only hit the scale where self hosted Kafka is justified when you cross 100 million events per day. You only hit the LinkedIn 2011 scale at 1.4 billion events.</p><p>Ask yourself these three questions.</p><ol><li><p>Do you actually need per partition ordering guarantees. If not use SQS.</p></li><li><p>Do you need event replay for backfilling new services. If not use a standard message queue.</p></li><li><p>Do you need exactly once semantics for financial transactions. If yes then Kafka is the right tool.</p></li></ol><p>If you are choosing Kafka because everyone uses it you are cargo culting. Kafka is phenomenal for high throughput event streaming but it comes with a massive operational tax.</p><h2>How LinkedIn migrated?</h2><p>There is a deeper lesson to learn from how LinkedIn migrated away from Kafka. </p><p>They built Xinfra which is a virtualized Pub/Sub layer that abstracts the physical clusters.</p><p>This allowed them to migrate topics from Kafka to Northguard without rewriting their application code. They used a dual write mechanism to ensure zero downtime. This is what mature platform engineering looks like.</p><p>The lesson is not that you should deploy Northguard. The lesson is that you should abstract your infrastructure. Do not let your applications call Kafka APIs directly. Wrap them in an internal library. If you ever outgrow your current tool you will be able to switch without rewriting every service in your company.</p><div><hr></div><h2>Conclusion</h2><p>LinkedIn built Kafka in 2011 because they had a problem that no existing tool could solve at 1.4 billion events. </p><p>They outgrew Kafka at 32 trillion events and built Northguard.</p><p>You are at 10 million events per day. You are 140 times smaller than LinkedIn was when they started with Kafka. You are 3.2 million times smaller than the scale where Kafka breaks.</p><p>Do not choose infrastructure based on who uses it. </p><p>Choose based on what problem you are solving and what scale you are operating at.</p><p>Kafka scaled 23,000 times before LinkedIn needed something else. You will never outgrow Kafka. But you might be wasting forty percent of your platform team&#8217;s time managing a supercomputer when you only need a simple queue.</p><p>LinkedIn built Kafka. LinkedIn outgrew Kafka. You never will. Choose your stack accordingly.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading BinaryBox! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[I benchmarked 5 Languages in Kubernetes and here is what your stack actually costs.]]></title><description><![CDATA[Last month I was called into a war room for a high growth fintech client.]]></description><link>https://www.binarybox.org/p/i-benchmarked-5-languages-in-kubernetes</link><guid isPermaLink="false">https://www.binarybox.org/p/i-benchmarked-5-languages-in-kubernetes</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Thu, 07 May 2026 06:01:14 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!ib5Z!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1abc728c-76ed-421a-808d-d91d21127f6a_1400x788.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ib5Z!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1abc728c-76ed-421a-808d-d91d21127f6a_1400x788.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ib5Z!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1abc728c-76ed-421a-808d-d91d21127f6a_1400x788.png 424w, https://substackcdn.com/image/fetch/$s_!ib5Z!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1abc728c-76ed-421a-808d-d91d21127f6a_1400x788.png 848w, https://substackcdn.com/image/fetch/$s_!ib5Z!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1abc728c-76ed-421a-808d-d91d21127f6a_1400x788.png 1272w, https://substackcdn.com/image/fetch/$s_!ib5Z!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1abc728c-76ed-421a-808d-d91d21127f6a_1400x788.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ib5Z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1abc728c-76ed-421a-808d-d91d21127f6a_1400x788.png" width="1400" height="788" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1abc728c-76ed-421a-808d-d91d21127f6a_1400x788.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:788,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:288361,&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.binarybox.org/i/196680455?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1abc728c-76ed-421a-808d-d91d21127f6a_1400x788.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_!ib5Z!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1abc728c-76ed-421a-808d-d91d21127f6a_1400x788.png 424w, https://substackcdn.com/image/fetch/$s_!ib5Z!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1abc728c-76ed-421a-808d-d91d21127f6a_1400x788.png 848w, https://substackcdn.com/image/fetch/$s_!ib5Z!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1abc728c-76ed-421a-808d-d91d21127f6a_1400x788.png 1272w, https://substackcdn.com/image/fetch/$s_!ib5Z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1abc728c-76ed-421a-808d-d91d21127f6a_1400x788.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 called into a war room for a high growth fintech client. They were running fifty microservices across five different engineering teams. Like many modern organizations they had no language mandate. Each team chose the tool they knew best. </p><p>The checkout team used Node.js. The inventory team used C#. The payments team used Java. The recommendations team used Python. The platform team used Go.</p><p>Everything worked perfectly until their first major promotional event.</p><p>When the traffic hit 180,000 requests per second the Go and Node.js services scaled in seconds. But the payments and recommendations services stayed in a pending state for nearly a minute. </p><p>The checkout requests were succeeding but they were hitting a wall of timeouts from the downstream inventory and payment services. From the perspective of the user the app was dead.</p><p>The CFO asked me why they were paying millions in AWS bills for a system that still crashed under load. I spent forty eight hours benchmarking their exact infrastructure to find the answer. We found that language choice is not a developer preference. It is a physical infrastructure variable with a massive price tag.</p><h2>The Environment</h2><p>I have executed this benchmark in a standard <strong>Kubernetes cluster on AWS</strong>. Every service was tested using the same traffic pattern reaching <strong>180,000 requests per second</strong>. We used <strong>c7g.xlarge</strong> instances powered by Graviton processors. </p><p>We measured image pull times through a 100 Mbps network bottleneck to simulate real world regional data center congestion.</p><p>We must look at the raw data across all five environments to understand the financial impact.</p><h3>Go with Fiber</h3><ul><li><p>Image Size: <code>24MB</code></p></li><li><p>Image Pull Time: <code>1.2 seconds</code></p></li><li><p>Memory per pod (Idle): <code>8MB</code></p></li><li><p>Pod count on peak load: <code>12</code></p></li><li><p>Cost per month: <code>$631 USD</code></p></li></ul><h3>NodeJs with Fastify</h3><ul><li><p>Image Size: <code>80MB</code></p></li><li><p>Image Pull Time: <code>2.5 seconds</code></p></li><li><p>Memory per pod (Idle): <code>45MB</code></p></li><li><p>Pod count on peak load: <code>15</code></p></li><li><p>Cost per month: <code>$788 USD</code></p></li></ul><h3>C# with ASP.NET Core</h3><ul><li><p>Image Size: <code>250MB</code></p></li><li><p>Image Pull Time: <code>8.7 seconds</code></p></li><li><p>Memory per pod (Idle): <code>95MB</code></p></li><li><p>Pod count on peak load): <code>18</code></p></li><li><p>Cost per month: <code>$946 USD</code></p></li></ul><h3>Java with Spring Boot</h3><ul><li><p>Image Size: <code>180MB</code></p></li><li><p>Image Pull Time: <code>5.8 seconds</code></p></li><li><p>Memory per pod (Idle): <code>120MB</code></p></li><li><p>Pod count on peak load): <code>22</code></p></li><li><p>Cost per month: <code>$1,157 USD</code></p></li></ul><h3>Python with FastAPI</h3><ul><li><p>Image Size: <code>300MB</code></p></li><li><p>Image Pull Time: <code>10.2 seconds</code></p></li><li><p>Memory per pod (Idle): <code>85MB</code></p></li><li><p>Pod count on peak load): <code>35</code></p></li><li><p>Cost per month: <code>$1,840 USD</code></p></li></ul><h2>The HPA Bottleneck</h2><p>Why container image size is a first order variable for reliability? When the Horizontal Pod Autoscaler or HPA triggers a scale event it creates a series of physical hardware demands.</p><p>The first demand is network I/O. Your container registry has a bandwidth limit. Your Kubernetes node has a network interface limit. A 300MB Python image is not just a little larger than a 24MB Go image. It is twelve times larger.</p><p>The second demand is disk I/O. Once the image is pulled the container runtime must extract the layers. A 300MB compressed Python image often unpacks to 800MB of data on the disk. This extraction is a serial process that is heavily CPU and I/O bound.</p><p>Look at the math of a traffic spike.</p><ul><li><p>If your traffic doubles in 30 seconds and your Go pods take 2 seconds to become ready you can catch the load.</p></li><li><p>If your Python pods take 10.2 seconds to pull plus 4 seconds to start the interpreter you have a 14 second gap where you are dropping requests.</p></li><li><p>By the time the Python pods are ready the existing pods have already crashed from CPU saturation. This is the Cold Start Death Spiral.</p></li></ul><h2>The Garbage Collection cost</h2><p>We must look deeper than raw compute to see the actual cost of running these languages at scale. The most hidden expense in a Kubernetes cluster is the cost of Garbage Collection.</p><p>In a managed runtime like Java or Node.js the system must periodically pause execution to clean up unused memory. This is the Stop The World event. I found that as the request rate increases the volume of temporary objects created on the heap explodes.</p><p>In the Java Spring Boot service the Garbage Collector consumed twenty percent of the total CPU cycles during peak load. This means you are paying for five pods just to run the cleaning service for the other twenty. </p><p>Furthermore these pauses create massive spikes in tail latency. When the collector triggers every active request in that pod is paused. Your ninety ninth percentile latency is dictated by the memory cleaner and not your code</p><p>Go avoids this through a different physical strategy. It uses a concurrent mark and sweep collector designed for low latency. The pauses are measured in microseconds and not milliseconds. This allow Go to maintain a flat latency profile even as you approach the physical limits of the CPU.</p><h2>The Database connections</h2><p>I discovered a hidden cost that most architects completely miss, the ceiling of connection pool.</p><p>Our benchmark showed that C# opened 450 database connections at peak load. Go opened only 180 connections. This is not just a performance detail. It is a hard infrastructure limit.</p><p>A standard AWS RDS <strong>db.t3.medium</strong> instance caps at <strong>420 connections</strong>. If you run the C# stack and scale to 50 pods you will hit the <code>max_connections</code> limit of your database. </p><p>New pods will fail to connect and they will fail their health checks. The HPA will keep trying to scale but the database will refuse the traffic.</p><p>To fix this with C# you are forced to upgrade to a <strong>db.r5.large</strong> instance. That upgrade costs $438 USD more per month. You are paying a 150 percent premium for your database just because your language has inefficient connection management. Go handles the exact same load on the cheaper instance with 43 percent of the connection limit remaining.</p><h2>The full economic model</h2><p>Let&#8217;s evaluate the total annual cost of ownership for a sustained workload of 180,000 requests per second.</p><p>Annual cost for each language</p><ul><li><p>Go: <code>$7,572 USD</code></p></li><li><p>NodeJs: <code>$9,456 USD</code></p></li><li><p>Java: <code>$13,884 USD</code></p></li><li><p>Python: <code>$22,080 USD</code></p></li></ul><p>Python costs <code>$14,508 USD</code> more per year than Go to run the exact same workload. When you factor in the forced database upgrades and the registry bandwidth charges the delta grows to over <code>$20,000 USD</code> per microservice. </p><p>If you have 50 microservices you are paying a 1 million dollar annual cost for your language choices.</p><p>Now, let&#8217;s evaluate these findings against the reality of developer productivity.</p><p>On one hand we see that Go is the undisputed king of infrastructure economics. It is the only language designed for the physical constraints of a containerized world. It ignores the legacy of heavy runtimes and focuses purely on memory bandwidth and binary size.</p><p>On the other hand we must acknowledge the hiring market. Finding ten expert Go engineers is significantly harder than finding ten Python or Java developers. We must analyze if the <code>$14,000 USD</code> savings per year is worth the <code>$50,000 USD</code> difference in senior engineering salaries.</p><p>However for high scale startups and enterprise gateways the math is clear. You can buy a lot of senior engineering time for 1 million dollars in annual cloud savings.</p><div><hr></div><h2>Conclusion</h2><p>After analyzing the image pull physics the connection pool ceilings and the annual compute deltas we reach a definitive conclusion.</p><p>Stop choosing languages based on what is popular on social media. You must start choosing based on the cost per million requests.</p><p>If your workload has spiky traffic and you run in Kubernetes you should use Go or Node.js. The fast scale up times will prevent outages that cost far more than your cloud bill.</p><p>If you are a banking or enterprise shop that requires Java or C# then you must budget for a 50 percent infrastructure premium. You must also over provision your databases to handle the connection bloat.</p><p>If for some reason using Python is the only choice you have, be prepare for that 300% infrastructure cost to handle the spiked traffic.</p><p>Your language choice has a monthly price tag. It is a line item on your AWS bill. </p><p>Choose accordingly.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading BinaryBox! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p>]]></content:encoded></item><item><title><![CDATA[Why Flat Logs cannot Debug AI Agents?]]></title><description><![CDATA[The $240,000 order was not a failure of the language model, prompt engineering or not even the multi agent architecture itself. It was a catastrophic failure of enterprise observability.]]></description><link>https://www.binarybox.org/p/why-flat-logs-cannot-debug-ai-agents</link><guid isPermaLink="false">https://www.binarybox.org/p/why-flat-logs-cannot-debug-ai-agents</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Mon, 04 May 2026 06:01:42 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!44JZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75f2c2ae-9ddf-4514-9969-384b84acfe7b_2560x1536.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!44JZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75f2c2ae-9ddf-4514-9969-384b84acfe7b_2560x1536.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!44JZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75f2c2ae-9ddf-4514-9969-384b84acfe7b_2560x1536.jpeg 424w, https://substackcdn.com/image/fetch/$s_!44JZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75f2c2ae-9ddf-4514-9969-384b84acfe7b_2560x1536.jpeg 848w, https://substackcdn.com/image/fetch/$s_!44JZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75f2c2ae-9ddf-4514-9969-384b84acfe7b_2560x1536.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!44JZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75f2c2ae-9ddf-4514-9969-384b84acfe7b_2560x1536.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!44JZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75f2c2ae-9ddf-4514-9969-384b84acfe7b_2560x1536.jpeg" width="2560" height="1536" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/75f2c2ae-9ddf-4514-9969-384b84acfe7b_2560x1536.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1536,&quot;width&quot;:2560,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:142224,&quot;alt&quot;:&quot;Building a LangGraph Agent from Scratch | Towards Data Science&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Building a LangGraph Agent from Scratch | Towards Data Science" title="Building a LangGraph Agent from Scratch | Towards Data Science" srcset="https://substackcdn.com/image/fetch/$s_!44JZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75f2c2ae-9ddf-4514-9969-384b84acfe7b_2560x1536.jpeg 424w, https://substackcdn.com/image/fetch/$s_!44JZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75f2c2ae-9ddf-4514-9969-384b84acfe7b_2560x1536.jpeg 848w, https://substackcdn.com/image/fetch/$s_!44JZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75f2c2ae-9ddf-4514-9969-384b84acfe7b_2560x1536.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!44JZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75f2c2ae-9ddf-4514-9969-384b84acfe7b_2560x1536.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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 weeks ago, an incident at one my manufacturing client cost a quarter of a million dollars.</p><p>They have deployed 7 AI Agents, they have tested thoroughly before pushing it to production. Their explicit job was to manage the bill of materials and keep inventory aligned and place orders automatically. There was no human in the loop. That was the entire point of the architecture.</p><p>One Tuesday morning the automated procurement agent placed a purchase order for 500 gallons of industrial solvent. It ordered the completely wrong chemical type. The final cost included the wasted material and the specialized hazardous disposal fees and the massive production delays. </p><p>The total financial damage was $240,000.</p><p>The engineering team immediately pulled the production logs to find the bug. They exported 38,000 lines of flat JSON. They had every tool you would expect from a modern and well instrumented system. They had beautiful LangSmith traces. They had OpenTelemetry spans. They had deeply structured logging.</p><p>It took the team 90 hours to find the root cause. Five senior engineers spent three full days running grep commands through logs and manually diffing prompt versions. They desperately tried to reconstruct which piece of context from which specific agent led to this catastrophic financial decision.</p><p>The revelation hit them on day three. The problem was not an LLM hallucination. It was not a bad prompt design. It was not even a traditional software bug.</p><p>The problem was that Agent 2 passed stale context to Agent 5. Agent 5 then used that outdated context to inform a material decision which triggered Agent 7 to execute the final purchase order.</p><p>The observability tools could easily show what happened. They showed the exact purchase order. The tools could show when it happened by matching the timestamp in the logs. But the tools completely failed to show why it happened. They could not expose the causal chain of context propagation across multiple independent agents.</p><p>This is the story of why flat logs cannot debug graph problems. Every engineering team deploying multi agent systems is about to learn this lesson the hard way.</p><h2>Flat logs and Graph Decisions</h2><p>Let&#8217;s analyze why traditional observability breaks down the moment you introduce autonomous agents into a production environment.</p><p>If you build distributed systems you already know the standard playbook. You use structured logging for individual events. You use distributed tracing like OpenTelemetry for request flows. You use observability platforms like Datadog or LangSmith for visualization.</p><p>This playbook works beautifully for microservices. An HTTP request flows predictably through Service A then Service B then Service C. The trace is entirely linear. The causality is strictly sequential.</p><p>Agents do not think linearly. They branch when inventory falls below a threshold and they delegate tasks to specialized peers. They retry failed tool calls with modified context. They loop back to reevaluate decisions based on updated state.</p><h3><strong>The Raw Telemetry Comparison</strong></h3><p>Look at the standard flat log output you see in a terminal.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;4cb0c64d-52ee-4be7-a646-159c4bbac878&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">[09.18.32] agent=bom_reader action=fetch_spec file=spec_v2.json // Bad spec file
[09.22.47] agent=procurement action=query_supplier target=ABC_Corp
[09.23.41] agent=procurement action=place_order qty=500</code></pre></div><p>You can see exactly what happened but you cannot see why. </p><p>Now look at the graph reality represented as a linked structure.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;ad26156d-b61b-43c1-bde7-9aa34aebcb98&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">(Context file="spec_v2.json" state="STALE")
  -[PROVIDED_CONTEXT]-&gt; (Decision action="Select Supplier")
    -[TRIGGERED]-&gt; (ToolCall action="place_order" qty=500 state="FLAGGED")</code></pre></div><p>Causality is completely visible.</p><p>Look closely at what each data structure physically records to see the exact difference.</p><p>When you look at the flat logs you see isolated events attached to timestamps. As humans reading a simple three line example we assume the first event caused the second event simply because they happened sequentially. However in a real production environment there might be thousands of other logs recorded between those two timestamps by dozens of different agents. The flat log provides absolutely no structural proof that the specific file fetched at <code>09.18</code> was the exact data used to place the order at <code>09.23</code>. It only tells you when things happened. You are forced to guess the relationship based on chronological proximity.</p><p>Now look at the graph model. The graph does not rely on guessing based on time. It uses explicit structural edges to link data together. The edge labeled <code>PROVIDED_CONTEXT</code> is a literal database relationship tying the specific stale JSON file directly to the decision node. The edge labeled <code>TRIGGERED</code> physically links that exact decision to the final tool call.</p><p>Flat logs force you to guess causality based on time. The graph provides true causality because it explicitly records the relationships between inputs decisions and outputs as permanent physical links in the database. You do not have to guess what caused the bad order because the graph draws a direct line straight to the stale context file.</p><p>LangSmith gives you beautiful traces. But those traces are trees not graphs. They show parent child relationships indicating which agent called which tool. They do not show causality indicating which specific context payload influenced which downstream decision.</p><p>Quick check. If your agent made a bad decision right now could you instantly trace which exact context file influenced it. If your honest answer is that you would have to grep the logs and reconstruct the timeline manually then you have a severe graph problem.</p><p>Without causality tracing your investigation reality is brutal. You pull 38,000 lines of logs. You search for the order SKU. You find the decision that triggered it. You manually trace backwards to see which tool calls preceded the order. You diff the prompt versions to see if Agent 5 received the correct instructions. You hunt down the context sources to see where the specification came from. Eventually you discover that Agent 2 used a cached file from three weeks ago. You reconstruct this entire propagation path manually over 90 hours.</p><p>Agents make decisions in a complex graph structure. Observability tools built for linear sequences can never show you the why.</p><h2>The solution (Thinking in Graph)</h2><p>We evaluate this monitoring failure and reach a clear architectural mandate. </p><p>You must stop treating agent traces as chronological logs and must start treating them as graphs.</p><p>This requires a fundamental mental shift. Every agent decision is a node in a graph. Every handoff between agents is an edge connecting those nodes. Every piece of context is a property living on those nodes.</p><p>We need to define a strict data model to capture this reality.</p><h3><strong>Nodes</strong></h3><ul><li><p><strong>AgentRun</strong> containing id and agentName and model and startedAt</p></li><li><p><strong>Decision</strong> containing id and reasoning and confidence and timestamp</p></li><li><p><strong>ToolCall</strong> containing toolName and input and output and duration</p></li><li><p><strong>Context</strong> containing source and contentHash and retrievedAt and stale status</p></li></ul><h3>Edges</h3><ul><li><p><strong>MADE</strong> a decision </p></li><li><p><strong>TRIGGERED</strong> a tool call</p></li><li><p><strong>DELEGATED_TO</strong> other Agent (Node)</p></li><li><p><strong>PROVIDED_CONTEXT</strong> to a Decision or Agent</p></li></ul><h3>Flow</h3><ul><li><p>AgentRun &#8594; MADE &#8594; Decision</p></li><li><p>Decision &#8594; TRIGGERED &#8594; ToolCall</p></li><li><p>Decision &#8594; DELEGATED_TO &#8594; AgentRun</p></li><li><p>Context PROVIDED_CONTEXT Decision</p></li></ul><h3>The Decision Graph</h3><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;317c6260-5ad3-44b2-b9c6-37775c638870&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">AgentRun(#BOM-7)
&#9500;&#9472; Decision (Retrieve BOM)
&#9474;   &#9492;&#9472; Context (spec_v2.json) &#8592; STALE
&#9474;
&#9500;&#9472; Decision (Select Supplier)
&#9474;   &#9500;&#9472; PROVIDED_CONTEXT &#8592; Context (bad_spec_v2.json)
&#9474;   &#9492;&#9472; TRIGGERED &#8594; ToolCall (query_supplier)
&#9474;
&#9492;&#9472; Decision (Place Order) &#8592; FLAGGED
    &#9492;&#9472; TRIGGERED &#8594; ToolCall (place_order qty 500)</code></pre></div><p>You need a database that stores decisions as they happen through streaming ingestion. You need a system that lets you query causality directly to show every decision influenced by a specific stale context. You need a platform that visualizes the decision graph natively and supports deep pattern matching. Neo4j handles all four of these requirements perfectly.</p><p>You would not debug a distributed microservice system with a basic tail command. Why are you debugging multi agent systems with grep.</p><p>Here is the ingestion pattern you need to implement. We use Cypher to write the trace data directly into Neo4j.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;graphql&quot;,&quot;nodeId&quot;:&quot;a08600d7-095c-40f4-bee3-ce9a6626a65f&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-graphql">MERGE (run:AgentRun {id: $run_id})
CREATE (d:Decision)
SET d += $props
MERGE (run)-[:MADE]-&gt;(d)
WITH d
FOREACH (ctx IN $contexts |
    MERGE (c:Context {source: ctx.source})
    SET c += ctx
    MERGE (c)-[:PROVIDED_CONTEXT]-&gt;(d)
)</code></pre></div><p>We make specific design decisions here. We use <code>MERGE</code> instead of <code>CREATE</code> for the runs and contexts so reingesting a trace does not duplicate data. We ingest at decision time rather than batching at the end of the run. We keep the tool output as raw JSON because Cypher can query nested JSON directly using dot notation.</p><p>When the incident occurred we did not grep the logs. We ran the following Cypher query to find the root cause.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;graphql&quot;,&quot;nodeId&quot;:&quot;01cdc32c-943f-48f8-a282-237534e96f9d&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-graphql">MATCH 
  (run:AgentRun)-[:MADE]-&gt;(d:Decision)-[:TRIGGERED]-&gt;(tc:ToolCall)
WHERE tc.tool_name = 'place_order'
  AND tc.output.quantity &gt; 100
  AND tc.output.verified = false
MATCH
  (d)&lt;-[:PROVIDED_CONTEXT]-(ctx:Context)
WHERE ctx.stale = true
RETURN
  run.id, d.reasoning, ctx.source, tc.output
ORDER BY tc.timestamp</code></pre></div><p>This query immediately returned the exact run ID and the flawed reasoning and the exact stale context file that caused the purchase. We went from a massive production incident to a verified root cause in 40 minutes.</p><p>The problem was never that we could not log the decision. The problem was that we could not query the causality. Logs are great for recording what happened. Graphs are absolutely necessary for understanding why it happened.</p><h2>Graph Evals Assertions as Cypher Queries</h2><p>We evaluate how this changes our testing strategy. Traditional evaluations check basic outputs. They ask if the LLM called the right tool or if the output was valid JSON. This is essentially a basic unit test on a <code>ToolCall</code> node.</p><p>Graph evaluations completely change this paradigm. They check systemic causality. They ask if any stale context influenced a high value order. They ask if a flagged decision propagated to downstream agents.</p><h3>Graph Eval Query Pattern</h3><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;graphql&quot;,&quot;nodeId&quot;:&quot;0aabc85c-e61b-4251-b8d2-ee51eaba4749&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-graphql">MATCH
  (Context)-[:PROVIDED_CONTEXT]-&gt;(Decision)-[:TRIGGERED]-&gt;(ToolCall)
WHERE
  Context.stale = true
  AND ToolCall.tool_name =~ '.*order.*'</code></pre></div><p><em>Pattern matching makes assertions declarative rather than procedural.</em></p><p>Take this first example of a Stale Context Check. We want to catch any order where the context source was flagged as stale. We write an assertion as a graph traversal.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;graphql&quot;,&quot;nodeId&quot;:&quot;75abbb9e-aaf5-4c8f-9145-23d6ee0ad7e1&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-graphql">MATCH 
  (c:Context)-[:PROVIDED_CONTEXT]-&gt;(d:Decision)-[:TRIGGERED]-&gt;(tc:ToolCall)
WHERE c.stale = true
  AND tc.tool_name =~ '.*order.*'
RETURN c.source, d.reasoning, tc.output.quantity
ORDER BY tc.output.quantity DESC</code></pre></div><p>This single query catches any order placed based on outdated specifications or cached inventory data or old supplier information.</p><p>Take a second example of checking for <strong>Multi Agent Context Drift</strong>. We want to surface cross agent contamination where a bad decision infects the rest of the cluster.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;graphql&quot;,&quot;nodeId&quot;:&quot;b082cbbe-782e-4d35-8dee-0251d63acd86&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-graphql">MATCH path = (r1:AgentRun)-[:MADE*1..4]-&gt;(d:Decision)-[:DELEGATED_TO]-&gt;(r2:AgentRun)
WHERE ANY(n IN nodes(path) WHERE n.flagged = true)
RETURN r1.agent_name, r2.agent_name, length(path) AS chain_depth</code></pre></div><p>This query catches the exact moment Agent A makes a flagged decision and delegates the flawed state to Agent B which then poisons Agent C. You see the entire contamination chain instantly.</p><p>How many of your evaluations check basic outputs versus checking deep causality. If you are only checking whether the agent called the right tool you are completely missing the systemic failure mode that costs a quarter of a million dollars.</p><p>Evaluations at the individual call level miss the system level failure mode. A correct tool call executed with the wrong context still produces a catastrophic outcome. Graph evaluations let you assert on context propagation instead of just verifying local decisions.</p><h2>Before and After Timeline</h2><p>We quantify exactly what changed when we shifted our observability architecture.</p><h3>Before</h3><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;1b6a3514-e04f-46a6-a1c6-e2fd4c366189&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">Day 1 Pull massive logs and grep for the SKU
Day 2 Manually trace the context across seven agents
Day 3 Finally locate the root cause file</code></pre></div><p>Before we implemented graph evaluations our root cause time was 72 hours. We required five senior engineers on the incident. We had absolutely no visibility into context flow and relied entirely on manual reconstruction. We tracked prompt versions through pure guesswork by diffing files across agents. Our confidence in the final fix was incredibly low because we could not mathematically verify the propagation paths.</p><h3>After</h3><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;23328970-77d4-4cc2-b534-eb7d6c0953b7&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">Hour 1 Run a single Cypher query and locate the root cause instantly</code></pre></div><p>After we implemented graph evaluations our root cause time dropped to 40 minutes. We required exactly one engineer on the incident. We achieved full visibility into the context flow using the Neo4j Browser. Prompt version tracking was natively stored in the Decision nodes and instantly queryable. Our confidence in the fix was absolute because our regression test was a mathematical graph assertion.</p><p>Calculate this right now. How much does 90 hours of senior engineering time cost your organization. That number is the hidden tax of relying on flat observability for multi agent systems.</p><p>The economic impact is staggering. Under the old system we spent $18,000 in raw engineering payroll to debug a $240,000 direct incident cost while suffering unknown downstream damages to our client trust. Under the new system we spent exactly $100 in engineering time and the graph assertions caught the next incident in staging before it ever reached production.</p><p>The architectural shift is clear. We stopped adding more flat logging hoping to manually reconstruct causality. We started modeling decisions as graphs and querying the causality directly.</p><p>Observability for agents is not about collecting more flat data. It is about modeling the correct physical structure of the workflow. Flat logs scale linearly with agent complexity making debugging exponentially harder. Graph evaluations scale sub linearly because Cypher queries get easier as you add more structural assertions.</p><h2>What you should do?</h2><p>Engineering leaders must take concrete steps to fix this observability gap immediately.</p><h4>Step 1</h4><p>You must start modeling your agent traces as graphs today. Even if you are not running Neo4j in production yet you must start thinking in nodes and edges. Stop logging that an agent placed an order. Start logging that an Agent Run made a Decision using specific Context which triggered a specific Tool Call.</p><h4>Step 2</h4><p>You must instrument your context propagation. Every single time an agent passes context to another agent you must log exactly what context was passed and where it came from and when it was retrieved and whether it is marked as stale.</p><h4>Step 3</h4><p>You need to set up a graph database. If you are not ready for production infrastructure you can download <strong><a href="https://neo4j.com/download/">Neo4j Desktop</a></strong> locally. Ingest a few traces manually. Write your first <strong><a href="https://neo4j.com/docs/cypher-manual/current/introduction/">Cypher query</a></strong> and visualize the decision graph. Once you understand the immense value you can deploy <strong><a href="https://neo4j.com/product/auradb/">Neo4j Aura</a></strong> on their cloud managed tier and stream decisions in real time from your agent framework.</p><h4>Step 4</h4><p>You must write your first graph evaluation. Pick one critical failure mode you actually care about. Maybe it is stale context leading to bad decisions. Maybe it is a high value action triggered without human verification. Write that failure mode as a Cypher query and run it after every single agent execution. If the query returns a risk count greater than zero you pause the pipeline and investigate.</p><h4>Step 5</h4><p>You must build a decision graph dashboard. Use Neo4j Browser to visualize which agents are making the most flagged decisions and which context sources are most frequently stale.</p><p>Make your causality visible and make it queryable. Stop debugging multi agent systems with grep and start querying the decision graph.</p><h2>What&#8217;s next?</h2><p>We evaluate this architecture and see exactly where the industry is heading.</p><h4>Now</h4><p>We are doing post hoc graph evaluations. We build traces as graphs and query them with Cypher to catch errors before the next run.</p><h4>Near future</h4><p>We will use real time evaluation hooks. We will stream decisions into Neo4j as they happen and flag anomalies mid run using live graph assertions. Imagine Agent 5 is about to place a massive order. Before executing the final API call the system runs a Cypher query checking for stale context paths. If the query detects a violation the agent pauses automatically and surfaces the decision graph to a human for manual approval.</p><h4>Ultimate goal</h4><p>The ultimate goal is autonomous self correction. Agents will continuously query their own decision graphs to detect context drift in real time. If they detect a structural anomaly they will reroute their logic or pause execution entirely without human intervention.</p><p>Graph evaluations are not a nice to have feature. They are the fundamental difference between debugging in minutes versus debugging in days. That operational gap only grows as you add more agents to your cluster.</p><p>Today we debug agents after they fail. Tomorrow agents will debug themselves before they fail. But you cannot self correct without understanding causality. You cannot query causality without building graphs. Observability is not the endgame here. Autonomous self correction is the endgame.</p><div><hr></div><h2>Conclusion</h2><p>The $240,000 order was not a failure of the language model. It was not a failure of the prompt engineering. It was not even a failure of the multi agent architecture itself.</p><p>It was a catastrophic failure of enterprise observability.</p><p>Flat logs can tell you exactly what happened. They can never tell you why it happened. Artificial intelligence agents do not think in linear sequences. They branch and retry and delegate and loop. Their autonomous decisions form a complex graph and never a simple timeline.</p><p>If you are deploying agents in a production environment you desperately need observability that matches their actual internal structure. You must model your traces as graphs. You must query causality using Cypher. You must write structural assertions on context propagation instead of just verifying final outputs.</p><p>The next time your agent makes a disastrous decision you will not spend 90 hours grepping through flat JSON files. You will run one single query. You will instantly see the exact decision path. You will fix the poisoned context and add a new regression test. You will finish the entire investigation in 40 minutes instead of 3 days.</p><p>Agents think in graphs. So should your evaluations.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading BinaryBox! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p>]]></content:encoded></item><item><title><![CDATA[Why AI is Forcing us back to Basic Computer Science?]]></title><description><![CDATA[The industry no longer needs thousands of junior developers who only know how to spin up a boilerplate. AI has completely commoditized the surface layer of software engineering.]]></description><link>https://www.binarybox.org/p/why-ai-is-forcing-us-back-to-basic</link><guid isPermaLink="false">https://www.binarybox.org/p/why-ai-is-forcing-us-back-to-basic</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Thu, 23 Apr 2026 06:01:28 GMT</pubDate><enclosure url="https://substackcdn.com/image/youtube/w_728,c_limit/EGsZ5lUW8QI" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>We spent the last decade optimizing for speed. We taught an entire generation of engineers how to glue endpoints together and build web applications as quickly as possible.</p><p>Now artificial intelligence can do that exact same job in seconds.</p><p>I recently sat down for a deep discussion with <strong><a href="https://www.youtube.com/@PratikKaleIn">Pratik Kale</a></strong> to talk about the brutal reality of the modern hiring market. </p><p>The industry no longer needs thousands of junior developers who only know how to spin up a boilerplate. </p><p>AI has completely commoditized the surface layer of software engineering.</p><p>The market is aggressively shifting back to deep computer science fundamentals.</p><div id="youtube2-EGsZ5lUW8QI" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;EGsZ5lUW8QI&quot;,&quot;startTime&quot;:&quot;2s&quot;,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/EGsZ5lUW8QI?start=2s&amp;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>In the podcast we break down exactly why the future belongs to the engineers who understand the physics of the machine. </p><p>We discuss why knowing the exact 14 kilobyte limit of a TCP (Initial Congestion Window <code>initcwnd</code>) is the only way to genuinely optimize first paint frontend load times. </p><p>We dive into why the V8 engine treats JavaScript objects like C++ structs and how ignoring that destroys your memory allocation.</p><p>If your only skill is writing basic application code you are competing against an algorithm that never sleeps. </p><p>If you understand how a compiler evaluates code step by step and how operating systems manage dynamic cache you become irreplaceable. </p><p>An AI can generate a thousand lines of code but it takes a human architect to understand the memory footprint and the networking throughput of that code in a production environment.</p><p>We also discussed why most startup MVPs fail and how finding a cofounder with an opposite personality is the only way to survive the business side of engineering.</p><p>I would love to hear your thoughts on this shift. Are you seeing the exact same fundamental skill gap in your recent engineering interviews.</p><div><hr></div><p>I would highly recommend to visit <strong><a href="https://www.youtube.com/@PratikKaleIn">Pratik&#8217;s YouTube channel</a></strong> for more such content, and do subscribe if you like what you see there &#128591;</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading BinaryBox! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[Fine Tuning an AI Model on your Mac]]></title><description><![CDATA[The goal is to teach a tiny local AI to read executive management jargon and output the brutal engineering reality.]]></description><link>https://www.binarybox.org/p/fine-tuning-an-ai-model-on-your-mac</link><guid isPermaLink="false">https://www.binarybox.org/p/fine-tuning-an-ai-model-on-your-mac</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Mon, 20 Apr 2026 06:00:37 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!OVIZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ba5c6db-1db4-4000-bd8f-90c1a6272308_1360x768.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OVIZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ba5c6db-1db4-4000-bd8f-90c1a6272308_1360x768.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OVIZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ba5c6db-1db4-4000-bd8f-90c1a6272308_1360x768.webp 424w, https://substackcdn.com/image/fetch/$s_!OVIZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ba5c6db-1db4-4000-bd8f-90c1a6272308_1360x768.webp 848w, https://substackcdn.com/image/fetch/$s_!OVIZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ba5c6db-1db4-4000-bd8f-90c1a6272308_1360x768.webp 1272w, https://substackcdn.com/image/fetch/$s_!OVIZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ba5c6db-1db4-4000-bd8f-90c1a6272308_1360x768.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OVIZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ba5c6db-1db4-4000-bd8f-90c1a6272308_1360x768.webp" width="1360" height="768" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7ba5c6db-1db4-4000-bd8f-90c1a6272308_1360x768.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:768,&quot;width&quot;:1360,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Data-center AI model on MacBook shows Apple may win AI race | Cult of Mac&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Data-center AI model on MacBook shows Apple may win AI race | Cult of Mac" title="Data-center AI model on MacBook shows Apple may win AI race | Cult of Mac" srcset="https://substackcdn.com/image/fetch/$s_!OVIZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ba5c6db-1db4-4000-bd8f-90c1a6272308_1360x768.webp 424w, https://substackcdn.com/image/fetch/$s_!OVIZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ba5c6db-1db4-4000-bd8f-90c1a6272308_1360x768.webp 848w, https://substackcdn.com/image/fetch/$s_!OVIZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ba5c6db-1db4-4000-bd8f-90c1a6272308_1360x768.webp 1272w, https://substackcdn.com/image/fetch/$s_!OVIZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ba5c6db-1db4-4000-bd8f-90c1a6272308_1360x768.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><p>Most of us (Engineers) have a Mac machine. </p><p><strong>No hard feelings if you have a different preference or use case, I totally respect your choice of hardware.</strong></p><p>But, this one is for those who owns a Mac and know a little Python &#128578; </p><p>I have a Mac Studio with M1 Ultra SOC with 64 GB Unified Memory. </p><p>Don&#8217;t be jealous but its perfectly fine if you own any Mac Pro machine with a M series Chip and at least 16+ GB of Unified Memory.</p><p>The goal is to teach a tiny local AI to read executive management jargon and output the brutal engineering reality. </p><p>We are building a <strong>Brutally Honest Corporate Translator</strong> &#128522;. </p><p>So let&#8217;s get started.</p><h2>Environment Setup</h2><p>Open your terminal and execute the following package installation.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;shell&quot;,&quot;nodeId&quot;:&quot;3eb8cbe3-2119-4c28-b024-348e48b4c211&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-shell"># Make sure your have Python 3.x installed
# Test using python --version
# You may also try python3 --version

# If your python --version is 3.x
pip install mlx-lm 

# if your python3 --version is 3.x
pip3 install mlx-lm 

# If you don't have python 3.x
# please install it before installing mxl-lm</code></pre></div><p>This single command installs the core framework without complex compilation steps or dependency hell.</p><h2>The Model (SLM)</h2><p>Look at the physical memory limits of your machine before choosing a model.</p><p>We often download the largest model available and immediately crash our system. </p><p>We need to match the parameter count to the available Unified Memory of our machine. </p><p>A 70 billion parameter model requires nearly 40 gigabytes of memory just to load the weights. </p><p>You cannot train that on a standard laptop. We need to evaluate smaller highly optimized architectures designed specifically for edge execution.</p><p>Here are the most viable models for local fine tuning today.</p><h4>Meta Llama 3 8B Instruct</h4><p>This is the current gold standard for local reasoning. It requires at least 16 gigabytes of unified memory to train comfortably but delivers enterprise grade logic.</p><h4>Alibaba Qwen 2.5 7B</h4><p>This is a highly capable alternative that performs exceptionally well on coding tasks and structured data extraction.</p><h4>HuggingFaceTB SmolLM2 1.7B Instruct</h4><p>We will use this specific tiny model for our tutorial today. It requires very little memory and will train flawlessly on a basic entry level machine in just a few minutes.</p><h2>Training Data</h2><p>AI models learn strictly through pattern recognition and examples.</p><p>Create a new directory called <code>data</code>. </p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;shell&quot;,&quot;nodeId&quot;:&quot;333363f0-311e-4f27-bbc4-9c89016ef772&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-shell">mkdir data</code></pre></div><p>Inside this folder you must create three specific files named </p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;shell&quot;,&quot;nodeId&quot;:&quot;a503fda9-7438-42a2-b557-24daa301f73f&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-shell">touch train.json valid.json test.json</code></pre></div><p>We will format our examples using standard prompt and completion keys.</p><p>Copy the following JSON blocks and paste them into all three of your data files for this engineering experiment.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;json&quot;,&quot;nodeId&quot;:&quot;53320c70-d1fc-4413-a625-3b648b40b8b9&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-json">{"prompt": "We need an agile MVP to synergize our deliverables", "completion": "We are shipping a completely broken prototype on Friday"}
{"prompt": "Let us put a pin in this and circle back when we have more bandwidth", "completion": "I am never going to approve this feature"}
{"prompt": "We are experiencing a temporary degradation of service", "completion": "Production is completely down and the database is on fire"}
{"prompt": "The legacy system requires a paradigm shift", "completion": "We need to delete the entire codebase and start over"}
{"prompt": "We are currently evaluating our strategic resourcing alignment", "completion": "We are planning massive layoffs next month"}
{"prompt": "The ticket is currently blocked by cross functional dependencies", "completion": "I have not started working on this and I am blaming another team"}</code></pre></div><p><em>I suggest to add more data into this json which will make responses more accurate and fun. You can use this as a sample and generate more using ChatGPT, Gemini etc.</em></p><p><em>Or you can use <strong><a href="https://gist.github.com/avishwakarma/91558c86bdf9e3047ae13d116aad5c43">the one I have used </a></strong></em><strong>&#128522;</strong></p><h2>Training</h2><p>Run the following exact terminal command to initiate the training process using our chosen baseline model.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;shell&quot;,&quot;nodeId&quot;:&quot;a14c464d-dfe1-477d-b514-baa0ad67955b&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-shell">python -m mlx_lm.lora \
  --model HuggingFaceTB/SmolLM2-1.7B-Instruct \
  --train \
  --data ./data \
  --iters 500</code></pre></div><p>Look at the mechanical physics of this command. The framework freezes the massive original weights of the base model. It only trains a tiny new adapter layer on top of the frozen parameters. </p><p>This mathematical efficiency is exactly why it runs flawlessly on a laptop without melting the processor or exhausting the battery.</p><h2>The Adapters</h2><p>Once the training step completes successfully, it will create an adapters folder. </p><p>This specific folder holds the specialized sarcastic knowledge we just mathematically injected into the system.</p><p>We now need to merge this new knowledge permanently into the base model. </p><p>Run the following command to fuse the new weights.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;shell&quot;,&quot;nodeId&quot;:&quot;2494e782-0201-4fcd-be82-a2d7ec2d197d&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-shell">python -m mlx_lm.fuse \
  --model HuggingFaceTB/SmolLM2-1.7B-Instruct \
  --adapter-path ./adapters \
  --save-path ./fused_model</code></pre></div><p>This command executes a permanent mathematical merge. It takes the massive matrix of the original frozen model and adds the tiny specialized adapter weights directly into it. </p><p>The result is a single consolidated model directory. </p><p>You no longer need to manage separate adapter files because the new corporate knowledge is permanently baked into the core neural network.</p><h2>The Fun</h2><p>We are ready to test the compiled engine. </p><p>Execute the following generation command to see your new translator in production.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;shell&quot;,&quot;nodeId&quot;:&quot;918185a1-e9db-4687-8727-03f746fec46e&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-shell">python -m mlx_lm.generate \
  --model ./fused_model \
  --prompt "The legacy system requires a paradigm shift"</code></pre></div><p>The model will instantly process the prompt and output the honest translation natively right on your machine.</p><p>Here are some fun responses I got while playing with it</p><blockquote><p>Prompt:<em> We are adopting a flat organizational structure</em></p><p><em><strong>Management wants everyone to do the work of three people without a title promotion</strong></em></p></blockquote><blockquote><p>Prompt:<em> We value your feedback and have added it to the product backlog</em></p><p><em><strong>We are ignoring your idea completely</strong></em></p></blockquote><blockquote><p>Prompt:<em> The new architecture is highly scalable and future proof</em></p><p><em><strong>We added Kubernetes to a basic web application and nobody knows how it works anymore</strong></em></p></blockquote><blockquote><p>Prompt:<em> We are embracing a fast paced startup culture</em></p><p><em><strong>You will work weekends and we will not pay you overtime</strong></em></p></blockquote><div><hr></div><h2>Conclusion</h2><p>Weigh the unit economics of this exercise against the operational output before reaching a conclusion.</p><p>You now possess a fully customized and functional model without paying a single cent to an external cloud provider. </p><p>The return on investment for utilizing existing local hardware is massive.</p><p>While Apple Silicon is absolutely not built for planetary scale distributed training it is the undisputed king of local edge engineering. </p><p>You own the hardware and you own the intelligence.</p><p>Do share your prompts and responses in the comments &#128522;</p><div><hr></div><p>If you are curious and want to learn more watch <strong><a href="https://developer.apple.com/videos/play/wwdc2024/10160/">this video from wwdc2024</a></strong></p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading BinaryBox! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[Thinking about Training you own AI Model?]]></title><description><![CDATA[Read this before you make any decision. This explains the two paths you can take depending on the size of your AI Model.]]></description><link>https://www.binarybox.org/p/thinking-about-training-you-own-ai</link><guid isPermaLink="false">https://www.binarybox.org/p/thinking-about-training-you-own-ai</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Fri, 17 Apr 2026 06:01:19 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!5qdo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef38110a-d115-447e-92e3-bdf124a6a872_1920x1080.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!5qdo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef38110a-d115-447e-92e3-bdf124a6a872_1920x1080.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!5qdo!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef38110a-d115-447e-92e3-bdf124a6a872_1920x1080.jpeg 424w, https://substackcdn.com/image/fetch/$s_!5qdo!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef38110a-d115-447e-92e3-bdf124a6a872_1920x1080.jpeg 848w, https://substackcdn.com/image/fetch/$s_!5qdo!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef38110a-d115-447e-92e3-bdf124a6a872_1920x1080.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!5qdo!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef38110a-d115-447e-92e3-bdf124a6a872_1920x1080.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!5qdo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef38110a-d115-447e-92e3-bdf124a6a872_1920x1080.jpeg" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ef38110a-d115-447e-92e3-bdf124a6a872_1920x1080.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;AI Model Training Methods | Keymakr&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="AI Model Training Methods | Keymakr" title="AI Model Training Methods | Keymakr" srcset="https://substackcdn.com/image/fetch/$s_!5qdo!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef38110a-d115-447e-92e3-bdf124a6a872_1920x1080.jpeg 424w, https://substackcdn.com/image/fetch/$s_!5qdo!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef38110a-d115-447e-92e3-bdf124a6a872_1920x1080.jpeg 848w, https://substackcdn.com/image/fetch/$s_!5qdo!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef38110a-d115-447e-92e3-bdf124a6a872_1920x1080.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!5qdo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef38110a-d115-447e-92e3-bdf124a6a872_1920x1080.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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>One of my client approached me last month and they wanted to train a proprietary foundation model entirely from scratch. </p><p>They wanted to own their intelligence and stop paying external API fees. </p><p>Though they had a massive budget but they had absolutely no clue how to actually build the system. </p><p>They assumed they could just buy a thousand graphics cards and string them together with standard network cables.</p><p>I had to stop them from wasting millions of dollars. While researching the exact architecture required to build their cluster I found the reality absolutely fascinating. </p><p>I wondered how so few people in our industry truly understand the brutal math and physics behind distributed training.</p><p>Based on my research and understanding here is what I know so far.</p><p>To understand this physical reality we need to divide the training landscape into two distinct parts.</p><h2>The SLM (Local)</h2><p>If you want to train a Small Language Model (SLM) or fine tune an existing model for a highly scoped internal routing task you can rely on a single local system. </p><p>You do not need a massive data center. You just need to understand the physics of a single motherboard.</p><h3>The Software</h3><p>To make raw silicon do math you need a translator. In the local training environment you have two distinct software paths with completely different hardware requirements.</p><h4>The first path is CUDA. </h4><p>Nvidia built CUDA to be their proprietary programming interface. It converts high level Python code into low level parallel math instructions that the hardware can physically execute. </p><p><strong>If you use CUDA you must buy Nvidia graphics cards.</strong></p><h4>The second path is MLX. </h4><p>Apple built the MLX framework to compete directly with CUDA for local execution. </p><p>MLX is designed exclusively for Apple Silicon. It allows developers to run complex machine learning math on standard Mac Studio desktops.</p><p>MLX is still very new and not matured as compared to CUDA, it also has a very limited library support, which make CUDA a better choice.</p><h3>The Shared Memory Advantage</h3><p>When training locally the physical layout of the memory dictates your performance.</p><p>In a standard Nvidia PC build the system relies on separated memory. </p><p>You must copy your training data from the system RAM across the PCIe bus into the dedicated VRAM of the graphics card.</p><p>Apple avoids this entirely with Unified Memory. </p><p>The central processor and the graphics processor share the exact same physical memory pool. </p><p>When you load your training data into an Apple system there is zero data copying required. </p><p>The processors simply pass a pointer to the shared memory block. This shared memory architecture makes Apple Silicon incredibly efficient for training small models on a single local machine.</p><p><strong>Apple&#8217;s Unified Memory gives you a huge advantage here.</strong></p><h3>The Frontier (Cluster)</h3><p>When you leave the local machine to train a billion or trillion parameter model you enter a realm governed by strict physical capacity. </p><p>You are no longer building a computer. You are building a cluster of computer which acts as a supercomputer.</p><h3>The Software</h3><p>Apple and MLX completely disappear at this scale. </p><p>Nvidia dominates the frontier because CUDA scales perfectly across thousands of machines. </p><p>Nvidia spent a decade ensuring frameworks like PyTorch default exclusively to CUDA for distributed workloads. </p><p>The software moat forces you to buy into their enterprise hardware ecosystem.</p><h3>The Hardware</h3><p>We hit a hardware capacity wall very quickly when building foundation models. </p><p>A 70 billion parameter model consumes terabytes of memory. You have to store the massive weight matrices the optimizer states and the continuous training batches. </p><p>No single GPU on earth holds that much data.</p><p>The only mathematical solution is Data Parallelism. You must build a distributed cluster. </p><p>You copy the exact same model across thousands of distinct GPUs. You slice the massive training dataset into smaller manageable chunks and feed them to the separate GPUs simultaneously.</p><h3>Gradient Synchronization</h3><p>Having thousands of processors working at once sounds incredibly efficient until you realize they have to talk to each other constantly.</p><p>As GPUs process their data chunks they calculate gradients. </p><p>Gradients are massive mathematical vectors that tell the model exactly how to adjust its weights to decrease errors. </p><p>This is the literal process of machine learning.</p><p>This requirement introduces a massive architectural bottleneck. Before moving to the next training step every single one of those thousands of GPUs must share its gradients. They must average them together and update their local copies identically so the cluster learns as one single brain. </p><p>This Gradient Synchronization happens millions of times per run.</p><h3>The NCCL</h3><p>Moving this much data simultaneously breaks normal computer networks. </p><p>If ten thousand GPUs broadcast massive files simultaneously over a standard network the data center collapses instantly. </p><p>The GPUs finish their math in milliseconds and then sit completely idle waiting for network switches to clear the traffic jam.</p><p>Nvidia solved this network choke with a software tool called the Nvidia Collective Communications Library or <strong><a href="https://developer.nvidia.com/nccl">NCCL</a></strong>. </p><p>NCCL uses a brilliant mathematical layout called Ring All Reduce. </p><p>It arranges GPUs in a logical ring. Data is broken into small chunks and passed strictly to immediate neighbors instead of broadcasting to everyone.</p><p>For a cluster of <em><strong>N</strong></em> GPUs and a data size <em><strong>D</strong></em> the data sent and received is bound by this exact formula.</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;Data=\\frac{2(N-1)}{N}D&quot;,&quot;id&quot;:&quot;DJTXXNUPJM&quot;}" data-component-name="LatexBlockToDOM"></div><p>Because the fraction approaches 1 the total data transferred by any single node never exceeds <em><strong>2D</strong></em>. </p><p>This mathematical proof guarantees the network will not choke regardless of how many thousands of GPUs you add to the cluster.</p><h3>The NVLink</h3><p>Software optimization can only take you so far before physics gets in the way. </p><p>Even with NCCL mathematically optimizing the traffic we still hit a physical motherboard limit. Moving hundreds of gigabytes over a standard PCIe connection is cripplingly slow. </p><p>A standard PCIe bus <strong>maxes out around 64 gigabytes per second</strong>. That is far too slow for gradient synchronization.</p><p>Nvidia built <strong><a href="https://www.nvidia.com/en-us/data-center/nvlink/">NVLink</a></strong> to bypass the motherboard entirely. </p><p>NVLink is a proprietary physical bridge connecting GPUs directly to each other with thick copper cables. </p><p>It delivers <strong>a staggering 1.8 terabytes per second</strong> of bidirectional bandwidth. </p><p>It transfers calculations so fast that the entire server rack functions as a single unified processor.</p><h2>The Cost</h2><p>We need to connect this complex architecture back to the financial reality facing my client. </p><p>We must evaluate the strict economic difference between the local path and the frontier path before we reach a final decision.</p><h3>The SLM (Local)</h3><p>Training a Small Language Model (SLM) locally is a highly predictable financial commitment. </p><p>You buy the hardware once. You plug it into a standard wall outlet. </p><p>The unified memory architecture allows your engineers to experiment and fail rapidly without incurring hourly cloud compute penalties. </p><p>Your total financial risk is strictly capped at the initial purchase price of the desktop machine. </p><p>This makes local SLM development an incredible bargain for enterprise teams building scoped internal tools.</p><h3>The Frontier (Cluster)</h3><p>Training a frontier model is a completely different financial universe. </p><p>It requires ten thousand to one hundred thousand GPUs running continuously for months. </p><p>Without NCCL and NVLink a cluster spends forty percent of its time waiting for data transfers. </p><p>When your cloud bill is hundreds of thousands of dollars a day idle compute is pure financial hemorrhage. </p><p>You are burning cash to power hardware that is doing absolutely nothing. </p><p>The physics directly dictates the invoice.</p><div><hr></div><h2>Conclusion</h2><p>We need to weigh the ambition of training proprietary models against the harsh reality of data center physics before jumping in.</p><p>If you want to train a small model locally the unified memory of an Apple system running MLX is an incredible and cost effective engineering marvel. </p><p>You avoid the vendor lock in and bypass the PCIe bottleneck entirely on a single machine but you have deal with the drawbacks of MLX in general.</p><p>If you want to compete at the frontier and train massive models you have absolutely no choice. </p><p>You are buying into a closed high speed distributed network ecosystem. You cannot build a custom cluster with cheap networking and expect it to survive the synchronization penalty.</p><p>Nvidia dominates because they control the entire vertical stack. </p><p>Their true moat is not just the silicon chip processing the math. </p><p>Their moat is the complex distributed software and the thick physical cables tying the entire data center together.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading BinaryBox! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[Why CUDA (Nvidia) won the AI game even when Apple built the best hardware?]]></title><description><![CDATA[AI inference is not fundamentally a compute problem. It is a data movement problem. The traditional CPU was not defeated by a lack of mathematical power. It was defeated by physical distance.]]></description><link>https://www.binarybox.org/p/why-cuda-nvidia-won-the-ai-game-even</link><guid isPermaLink="false">https://www.binarybox.org/p/why-cuda-nvidia-won-the-ai-game-even</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Thu, 16 Apr 2026 08:45:47 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!zCyD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ab1f038-a11f-495a-9674-9eda6c4aa73d_1920x960.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zCyD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ab1f038-a11f-495a-9674-9eda6c4aa73d_1920x960.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zCyD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ab1f038-a11f-495a-9674-9eda6c4aa73d_1920x960.webp 424w, https://substackcdn.com/image/fetch/$s_!zCyD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ab1f038-a11f-495a-9674-9eda6c4aa73d_1920x960.webp 848w, https://substackcdn.com/image/fetch/$s_!zCyD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ab1f038-a11f-495a-9674-9eda6c4aa73d_1920x960.webp 1272w, https://substackcdn.com/image/fetch/$s_!zCyD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ab1f038-a11f-495a-9674-9eda6c4aa73d_1920x960.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zCyD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ab1f038-a11f-495a-9674-9eda6c4aa73d_1920x960.webp" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5ab1f038-a11f-495a-9674-9eda6c4aa73d_1920x960.webp&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;:null,&quot;alt&quot;:&quot;Apple Vs. Nvidia: Who will hit the $4 tn market cap first? | YourStory&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Apple Vs. Nvidia: Who will hit the $4 tn market cap first? | YourStory" title="Apple Vs. Nvidia: Who will hit the $4 tn market cap first? | YourStory" srcset="https://substackcdn.com/image/fetch/$s_!zCyD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ab1f038-a11f-495a-9674-9eda6c4aa73d_1920x960.webp 424w, https://substackcdn.com/image/fetch/$s_!zCyD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ab1f038-a11f-495a-9674-9eda6c4aa73d_1920x960.webp 848w, https://substackcdn.com/image/fetch/$s_!zCyD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ab1f038-a11f-495a-9674-9eda6c4aa73d_1920x960.webp 1272w, https://substackcdn.com/image/fetch/$s_!zCyD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ab1f038-a11f-495a-9674-9eda6c4aa73d_1920x960.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><p>Most developers assume that Graphics Processing Units (GPUs) dominate artificial intelligence simply because they possess thousands of processing cores. We need to look past this assumption to understand the actual physics of computing.</p><p>Artificial Intelligence (AI) inference is not fundamentally a compute problem. It is a data movement problem. The traditional Central Processing Unit (CPU) was not defeated by a lack of mathematical power. It was defeated by physical distance.</p><p>There is a strange twist to this story. Apple solved this hardware problem years ago. Yet Nvidia remains a multi trillion dollar monopoly today. Nvidia wins because they built software that traps the entire industry.</p><h2>The Silicon Real Estate</h2><p>Look at the physical die of a modern server processor. </p><p>You will see massive silicon real estate dedicated to branch prediction and deep caching layers. We must understand the physics of this layout. </p><p>When a central processing unit executes a web application it encounters millions of conditional branch instructions at the machine code level. </p><p>The silicon cannot wait to evaluate every single condition before fetching the next operation. It must statistically predict whether a logical branch will resolve to true or false to keep its instruction pipeline completely full. </p><p>If the hardware predicts incorrectly it must flush the entire pipeline and start the cycle over. </p><p>This speculative execution is absolutely necessary to run highly unpredictable software like operating systems and relational databases. </p><p>A traditional processor survives by calculating the statistical probability of the immediate future.</p><p>Graphics processors strip all of that predictive logic away. </p><p>Artificial Intelligence (AI) does not branch. It multiplies. </p><p>The core of a neural network is a massive sequence of Multiply Accumulate operations. You take a matrix of weights and multiply it by a matrix of inputs.</p><p>This math is entirely deterministic and highly parallel. </p><p>Graphics processors dedicate their silicon entirely to Arithmetic Logic Units (ALUs) to process thousands of these matrix operations simultaneously. </p><p>They do not guess they just compute.</p><h2>The Von Neumann Bottleneck</h2><p>The physics of inference exposes a massive flaw in traditional computer design. To understand the memory wall you have to look at the mathematical footprint of a Large Language Model (LLM). </p><p>The absolute minimum physical memory required to load a model for inference is dictated by a strict formula.</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;Memory_{weights} = P \\times B&quot;,&quot;id&quot;:&quot;XUNVMXPIND&quot;}" data-component-name="LatexBlockToDOM"></div><p>Where <em><strong>P</strong></em> is the total number of parameters and <em><strong>B</strong></em> is the byte size of the precision format.</p><p>If you want to run Llama 3 with 70 billion parameters in standard 16 bit precision where each parameter is 2 bytes you are looking at a minimum of 140 GB of VRAM just to hold the weights. </p><p>This completely excludes the KV cache and context window. You are not loading a program. You are loading a 140 GB matrix of floating point numbers into memory.</p><p>We must evaluate the <strong><a href="https://en.wikipedia.org/wiki/Von_Neumann_architecture">architecture John von Neumann designed in 1945</a></strong>. He separated the processing unit from the memory unit. </p><p>To perform math the processor must fetch data across a physical wire. In modern servers this wire is the PCIe bus. </p><p>Moving hundreds of gigabytes of data across a physical motherboard trace requires electricity and introduces massive latency. The electrons literally have too far to travel.</p><p>The CPU was defeated by a mathematical ratio known as Arithmetic Intensity.</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;I = \\frac{\\text{Total FLOPs}}{\\text{Total Memory Traffic (Bytes)}}&quot;,&quot;id&quot;:&quot;OERGXEAQJH&quot;}" data-component-name="LatexBlockToDOM"></div><p>This formula measures how many floating point operations or <em><strong>FLOPs</strong></em> the processor can execute for every byte of data it fetches from memory.</p><p>Generative AI inference has an incredibly low arithmetic intensity. Generating a token requires relatively few mathematical operations but it requires reading the entire 140 GB weight matrix from memory. </p><p>Because the math is simple but the data is massive the CPU processing cores finish their calculations in nanoseconds and then sit entirely idle waiting for the standard DDR motherboard bus to fetch the next batch of data.</p><p>This is the <strong><a href="https://research.ibm.com/blog/why-von-neumann-architecture-is-impeding-the-power-of-ai-computing">Von Neumann Bottleneck</a></strong>. Compute is cheap but moving data across a motherboard is prohibitively expensive. The CPU is starved by the motherboard.</p><p>Nvidia did not win by making the numerator slightly faster. They won by exponentially increasing the denominator bandwidth using vertically stacked memory directly on the silicon die.</p><h2>The Unified Memory Architecture</h2><p>If we treat this strictly as a data movement problem Apple should theoretically dominate the entire enterprise AI industry.</p><p>Apple engineers evaluated this physical bottleneck and radically redesigned the motherboard. They developed a hardware solution called Unified Memory Architecture. By placing the central processor the graphics processor and the system RAM on the exact same physical silicon package they completely eliminated the physical distance of the motherboard trace.</p><p>They did not just shorten the wire. They eliminated the PCIe bus entirely. </p><p>In a traditional PC an Nvidia GPU must copy data from system RAM over the PCIe bus into its own dedicated VRAM before it can execute matrix multiplication. </p><p>In an Apple system the CPU and GPU simply pass a pointer to the exact same block of memory. This zero copy architecture allows a desktop chip to achieve 800 gigabytes per second of memory bandwidth natively. </p><p>To achieve that specific memory capacity in standard PC ecosystems you would require massive server racks and you would suffer from crippling network cable latency. </p><p>Structurally Apple built the absolute perfect AI machine.</p><h2>The CUDA Monopoly </h2><p>Look at the reality on the ground. </p><p>Walk into any elite artificial intelligence lab today and you will see engineers completely ignoring Apple hardware.</p><p>They are hoarding Nvidia hardware instead.</p><p>This reveals a brutal engineering truth. The absolute best hardware does not win if the competitor owns the compiler.</p><p>Nvidia is not just a silicon company. They are a ruthless software monopoly.</p><p>To understand their moat you must understand <strong><a href="https://en.wikipedia.org/wiki/CUDA">Compute Unified Device Architecture</a></strong> or CUDA. </p><p>CUDA is an inescapable compiler layer that translates high level Python code into low level hardware instructions. </p><p>Nvidia spent fifteen years optimizing their proprietary math libraries and ensuring that every foundational AI framework including <strong><a href="https://en.wikipedia.org/wiki/PyTorch">PyTorch</a></strong> was built natively on top of their compiler.</p><p>We must understand why the industry cannot simply switch to competing silicon. </p><p>If you buy an AMD chip or an Apple desktop you must rely on translation layers to convert CUDA calls into alternative instructions. </p><p>Translation introduces bugs and destroys performance. If you choose to fight this ecosystem you are choosing operational pain. You will face compiler lock in immediately. You will encounter missing tensor libraries. You will watch your mathematical compilations fail. Your senior engineers will spend weeks debugging open source translation layers instead of actually training models. </p><p>Nvidia gave the compiler away for free to ensure you could never leave their hardware ecosystem.</p><div><hr></div><h2>Conclusion</h2><p>Weighing hardware physics against software ecosystems brings us to a definitive conclusion.</p><p>The fundamental architectural maxim is simple. Hardware physics dictate the absolute ceiling of system performance but software ecosystems dictate the floor of usability.</p><p>Here is the defensive playbook for technical leadership. </p><p>If your team is strictly running local inference on a pre trained model Apple Silicon is a cost effective and it will save you massive cloud compute bills and bypass the memory wall beautifully.</p><p>However if your engineering team is actively training foundational models or building complex agentic frameworks you have absolutely no choice. </p><p>You must pay the Nvidia tax for CUDA.</p><p>Do not choose your enterprise infrastructure based strictly on a hardware specification sheet as fighting the dominant software ecosystem will burn your entire financial runway on operational overhead. </p><p>The best silicon in the world is completely useless if you cannot compile the math.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading BinaryBox! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p>]]></content:encoded></item><item><title><![CDATA[Why AI Giants are Abandoning the Public Cloud?]]></title><description><![CDATA[The companies building frontier AI are quietly abandoning generic public cloud infrastructure. They are pouring hundreds of billions into custom physical data centers. Why?]]></description><link>https://www.binarybox.org/p/why-ai-giants-are-abandoning-the</link><guid isPermaLink="false">https://www.binarybox.org/p/why-ai-giants-are-abandoning-the</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Fri, 10 Apr 2026 08:01:56 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!6fi-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0e98fcd-0ca7-4b14-8842-af893cbc349a_1920x800.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!6fi-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0e98fcd-0ca7-4b14-8842-af893cbc349a_1920x800.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6fi-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0e98fcd-0ca7-4b14-8842-af893cbc349a_1920x800.webp 424w, https://substackcdn.com/image/fetch/$s_!6fi-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0e98fcd-0ca7-4b14-8842-af893cbc349a_1920x800.webp 848w, https://substackcdn.com/image/fetch/$s_!6fi-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0e98fcd-0ca7-4b14-8842-af893cbc349a_1920x800.webp 1272w, https://substackcdn.com/image/fetch/$s_!6fi-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0e98fcd-0ca7-4b14-8842-af893cbc349a_1920x800.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6fi-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0e98fcd-0ca7-4b14-8842-af893cbc349a_1920x800.webp" width="1456" height="607" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d0e98fcd-0ca7-4b14-8842-af893cbc349a_1920x800.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:607,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;What makes an AI data center unique? | NorthC&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="What makes an AI data center unique? | NorthC" title="What makes an AI data center unique? | NorthC" srcset="https://substackcdn.com/image/fetch/$s_!6fi-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0e98fcd-0ca7-4b14-8842-af893cbc349a_1920x800.webp 424w, https://substackcdn.com/image/fetch/$s_!6fi-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0e98fcd-0ca7-4b14-8842-af893cbc349a_1920x800.webp 848w, https://substackcdn.com/image/fetch/$s_!6fi-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0e98fcd-0ca7-4b14-8842-af893cbc349a_1920x800.webp 1272w, https://substackcdn.com/image/fetch/$s_!6fi-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0e98fcd-0ca7-4b14-8842-af893cbc349a_1920x800.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><p>For a decade we were told owning physical servers was a relic of the past. The public cloud was the final destination. </p><p>We must critically analyze this assumption today in April 2026. </p><p>The generative AI boom is aggressively reversing that trend. The companies building frontier AI are quietly abandoning generic public cloud infrastructure. </p><p>They are pouring hundreds of billions into custom physical data centers.</p><p>Let us examine the evidence to prove this shift. </p><p>Look at Microsoft and OpenAI. They are planning <strong><a href="https://openai.com/index/announcing-the-stargate-project/">Project Stargate</a></strong>. This is a proposed 500 billion dollar supercomputer data center. We must critically analyze that number. It is five hundred times more expensive than current massive data centers.</p><p>Look at Meta. They are bypassing standard cloud providers entirely. They are hoarding hundreds of thousands of H100 GPUs in custom built facilities. They are designing the cooling and power routing from scratch.</p><p>Google has always relied on its own custom TPU pods rather than generic cloud hardware for its core AI research.</p><p>The takeaway is clear. The smartest money in tech is no longer renting compute by the hour. </p><p>They are buying the bare metal.</p><h2>But why?</h2><p>Why is this happening. </p><p>We must evaluate the physics. </p><p>We must analyze the architectural mismatch between cloud virtualization and generative AI. </p><p>The public cloud relies on virtualization to host stateless web servers. Generative AI completely breaks this model.</p><p>Training a trillion parameter model requires tens of thousands of GPUs communicating via Synchronous Real Time Communication. </p><p>A single delayed packet on a standard cloud network switch stalls the entire run. </p><p>AI requires bare metal access. It requires custom InfiniBand networking and extreme thermal cooling.</p><p>Then we evaluate the math. </p><p>Renting a GPU means paying the hyper-scaler profit margin. When your compute bill hits 10 billion dollars a year building a custom nuclear powered data center is mathematically cheaper.</p><h2>What&#8217;s the Impact?</h2><p>Let&#8217;s analyze what this means for a Chief Technology Officer who is not building a custom data center.</p><p>There is good news for speed. </p><p>Custom networking pipelines designed exclusively for inference will drastically drop latency. Your Time to First Token (TTFT) will plummet. The math will execute perfectly on their bare metal.</p><p>However there are some bad news as well. We call this the Monopoly Trap. </p><p>You must destroy the assumption that cheaper internal costs for the giants mean cheaper API costs for developers. The AI giants will subsidize costs now to capture the market. </p><p>This creates an impenetrable physical moat. Startups cannot build their own Stargate to compete.</p><p>Once the market consolidates to two or three mega providers who own the physical hardware the era of cheap AI ends. </p><p>They will have total leverage to exponentially raise API token prices when investors demand profitability.</p><div><hr></div><h2>Conclusion</h2><p>The cloud abstraction is failing under the weight of artificial intelligence. </p><p>You can enjoy the speed and subsidized prices for now but you must architect defensively.</p><p>If your business model relies on a single provider keeping APIs cheap forever it is built on borrowed time.</p><p>The AI Giants are building physical castles. </p><p>Make sure you are not locked inside when they raise the drawbridge.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading BinaryBox! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p>]]></content:encoded></item><item><title><![CDATA[Why Agentic AI requires Graph based Observability?]]></title><description><![CDATA[The industry is currently flooded with vendors claiming to have &#8220;solved&#8221; AI observability but when you view them through the lens of enterprise architecture, their solutions fall apart.]]></description><link>https://www.binarybox.org/p/why-agentic-ai-requires-graph-based</link><guid isPermaLink="false">https://www.binarybox.org/p/why-agentic-ai-requires-graph-based</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Wed, 08 Apr 2026 06:01:32 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!FMdJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F913abc70-2bc1-4a75-954d-31a2d8eb7349_1379x776.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!FMdJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F913abc70-2bc1-4a75-954d-31a2d8eb7349_1379x776.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!FMdJ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F913abc70-2bc1-4a75-954d-31a2d8eb7349_1379x776.jpeg 424w, https://substackcdn.com/image/fetch/$s_!FMdJ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F913abc70-2bc1-4a75-954d-31a2d8eb7349_1379x776.jpeg 848w, https://substackcdn.com/image/fetch/$s_!FMdJ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F913abc70-2bc1-4a75-954d-31a2d8eb7349_1379x776.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!FMdJ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F913abc70-2bc1-4a75-954d-31a2d8eb7349_1379x776.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!FMdJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F913abc70-2bc1-4a75-954d-31a2d8eb7349_1379x776.jpeg" width="1379" height="776" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/913abc70-2bc1-4a75-954d-31a2d8eb7349_1379x776.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:776,&quot;width&quot;:1379,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Observability: An Essential Block for Gen AI Solutions | by Gen AI @ Cybage  Software Private Limited | Medium&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Observability: An Essential Block for Gen AI Solutions | by Gen AI @ Cybage  Software Private Limited | Medium" title="Observability: An Essential Block for Gen AI Solutions | by Gen AI @ Cybage  Software Private Limited | Medium" srcset="https://substackcdn.com/image/fetch/$s_!FMdJ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F913abc70-2bc1-4a75-954d-31a2d8eb7349_1379x776.jpeg 424w, https://substackcdn.com/image/fetch/$s_!FMdJ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F913abc70-2bc1-4a75-954d-31a2d8eb7349_1379x776.jpeg 848w, https://substackcdn.com/image/fetch/$s_!FMdJ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F913abc70-2bc1-4a75-954d-31a2d8eb7349_1379x776.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!FMdJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F913abc70-2bc1-4a75-954d-31a2d8eb7349_1379x776.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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>Recently, I have received a call from an old client about their AI Agent making decisions which they cannot track even when they have invested in Observability tooling. </p><p>They had deployed a sophisticated procurement agent to manage their raw materials inventory. The agent was designed to read the Bill of Materials (BOM) for incoming orders and automatically interact with the ERP to ensure supply.</p><p>It had been running smoothly for weeks. Then, one night, the agent confidently issued a purchase order for 5,000 gallons of highly reactive industrial solvent that the company absolutely did not need. It was a $200,000 mistake executed in milliseconds.</p><p>The engineering team did what they were trained to do, they opened their AI Observability dashboards to debug the failure.</p><p>They were using one of the industry-standard LLMOps platforms (think LangSmith or Arize AI). They opened the specific trace, expecting to see a giant red error box.</p><p>Instead, the dashboard showed a 100% success rate.</p><p>The token usage was optimal. The latency was fine. The visual Directed Acyclic Graph (DAG) in the UI showed a perfectly clean execution path: the agent checked the ERP, saw a shortage, queried the vector DB for an alternative, found the solvent, and successfully executed the <code>Create_Purchase_Order</code> tool.</p><p>According to modern AI observability tools, the agent performed flawlessly. The JSON parsed correctly. The APIs returned <code>200 OK</code>.</p><p>The tools were completely blind to the fact that the agent had just committed a catastrophic logical error. This is the &#8220;Silent Success&#8221; problem of Agentic AI, and it exposes a massive architectural flaw in how the industry approaches observability.</p><h2>The AI Observability</h2><p>The industry is currently flooded with vendors claiming to have &#8220;solved&#8221; AI observability. When you view them through the lens of enterprise architecture, their solutions fall apart because they suffer from a severe semantic blindspot.</p><h3>The Giants (Datadog, Dynatrace, New Relic etc)</h3><p>To be fair, these platforms have evolved. They boast &#8220;Interactive Dependency Graphs&#8221; and &#8220;Entity Maps.&#8221; But look at what these graphs actually map, they map <em><strong>infrastructure and service flow</strong></em><strong>, not </strong><em><strong>reasoning</strong></em><strong>.</strong></p><p>They are built for deterministic microservices. They treat an LLM call exactly like a SQL query. </p><p>A <code>200 OK</code> HTTP status code between your agent container and the OpenAI endpoint means nothing if the agent just authorized a catastrophic purchase order. </p><p>They map the servers, but they are blind to the thought process.</p><h3>The AI Focused (Arize AI, LangSmith, Kore.ai etc)</h3><p>These platforms specifically target AI, and their marketing heavily touts &#8220;agentic tracing&#8221; and &#8220;graph visualization.&#8221; They do a great job of mapping a single agent&#8217;s trajectory.</p><p>But under the hood, they are still fundamentally OpenTelemetry (OTel) log stores. They suffer from <strong>Trace Isolation</strong>. They capture the agent&#8217;s actions perfectly, but that trace exists in a vacuum. </p><p>The tool does not know your business logic.</p><p>If an agent skips a mandatory safety check, LangSmith simply shows you a UI graph where the &#8220;Safety Check&#8221; node isn&#8217;t there. </p><p>Because the tool doesn&#8217;t know the rules of your enterprise, it assumes the agent&#8217;s path was correct. They treat the graph as a <em>UI visualization of an ephemeral log</em>, not as a <em><strong>computable mathematical structure tied to reality</strong></em><strong>.</strong></p><h2><strong>The Solution</strong></h2><p>If an agent&#8217;s execution is a branching decision tree, the observability layer must be a native graph database (like <strong><a href="https://neo4j.com/">Neo4j</a></strong>) that already holds your company&#8217;s business logic.</p><p>I have implemented a separate agent&#8217;s execution state directly into <strong>Neo4j</strong>, where the company&#8217;s manufacturing ontology (their Enterprise Knowledge Graph) already lived. </p><p>We ran the agent in a shadow environment, and a week later, it attempted the exact same hallucination.</p><p>This time, we didn&#8217;t look at a UI visualization of a single trace. We mathematically queried the agent&#8217;s behavior against the laws of the business.</p><p>Because both the <strong>Agent Trace</strong> and the <strong>Enterprise Ontology</strong> lived in the same database, we could write a Cypher query to perform an &#8220;Ontological Join&#8221;</p><pre><code><code>// Find any execution trace where the agent ordered a hazardous material
// WITHOUT executing a corresponding safety check tool.
MATCH (trace:AgentSession)-[:TOOL_CALL]-&gt;(po:PurchaseOrder)-[:TARGETS_ITEM]-&gt;(item:Material)
MATCH (item)-[:HAS_PROPERTY]-&gt;(prop:HazardLevel {value: 'High'})
WHERE NOT (trace)-[:TOOL_CALL]-&gt;(:SafetyMatrixCheck)
RETURN trace.id, item.name</code></code></pre><p><strong>The Graph revealed the semantic missing edge.</strong> The agent had queried the vector database for an alternative chemical. It found &#8220;Solvent Y-200&#8221;. In the company&#8217;s ontology, Y-200 is linked to a <code>[HazardLevel: High]</code> node, which strictly requires a <code>[:SAFETY_CLEARANCE]</code> edge.</p><p>The agent had bypassed the safety check tool entirely.</p><p>LangSmith couldn&#8217;t catch this because LangSmith doesn&#8217;t know what &#8220;Solvent Y-200&#8221; is. It only knows what the LLM typed. </p><p>Neo4j caught it instantly because it cross-referenced the agent&#8217;s ephemeral trace against the physical reality of the business.</p><h2>What else is needed?</h2><p>Once you have Native Graph Evals in place, you stop guessing and start engineering. Seeing the failure is step one. Preventing it requires expanding your architecture beyond trusting the LLM.</p><p>Here is what else you must implement when deploying agents to production</p><h3>Deterministic Tool Gateways</h3><p>An LLM should never speak directly to an ERP or a production database. </p><p>You must build a middleware gateway between the agent&#8217;s output and the actual API execution. Using our Neo4j setup, we built a gateway that intercepts the <code>Create_Purchase_Order</code> tool call, queries the graph to ensure the <code>[Safety_Check]</code> node exists in the current session trace, and blocks the API if the graph topology is invalid.</p><h3>State-Bound Prompts</h3><p>Do not give an agent all 15 of its tools in the initial system prompt. That is begging for hallucinations. </p><p>Use the graph state to dynamically inject only the tools that are valid for that specific moment. </p><p>If the agent has not successfully completed the <code>Inventory_Check</code> node, the <code>Create_Purchase_Order</code> tool should literally not exist in its context window.</p><h3>Macro-Topological Analysis</h3><p>Stop looking at crashes one by one. </p><p>With a native graph database, you can run PageRank or Cycle Detection algorithms across millions of historical traces simultaneously. </p><p>You can mathematically prove that 90% of your token-burning infinite loops only happen when the agent interacts with Tool A immediately after failing Tool B.</p><div><hr></div><h2>Conclusion</h2><p>If you deploy autonomous agents to production using isolated trace stores, you are not deploying software. You are deploying a dangerous, expensive black box.</p><p>Native graph observability shifts AI from &#8220;magic&#8221; back to determinism. By interrogating the topology of the agent&#8217;s reasoning against the ontology of your business, you stop relying on &#8220;Silent Successes.&#8221; </p><p>You patch the system prompt, build a gateway, or constrain the toolset precisely at the node where the graph broke.</p><p>Stop treating agents like magic functions. Treat them like autonomous state machines traversing a graph, and build the infrastructure to observe them accordingly.</p><div><hr></div><p>If you want to see exactly how to build this architecture in production, I am doing a deep dive on this exact topic at <strong><a href="https://neo4j.com/nodes-ai/">Neo4j&#8217;s NODES AI</a></strong>. </p><p>Register for free and come see the graph in action.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading BinaryBox! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[The $20/$200 AI Subscription is going to be Dead?]]></title><description><![CDATA[They priced access to massive supercomputers like a Spotify subscription. You paid $20 or $200 a month, and in exchange, you got an all-you-can-eat buffet of compute power.]]></description><link>https://www.binarybox.org/p/the-20200-ai-subscription-is-going</link><guid isPermaLink="false">https://www.binarybox.org/p/the-20200-ai-subscription-is-going</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Thu, 02 Apr 2026 06:02:25 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Kwhi!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8dfc557-d52f-4bb7-b801-4fc425dba879_1280x1560.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>For two years, the industry sold us the idea that frontier AI was just another consumer utility. They priced access to massive supercomputers like a Spotify subscription. You paid $20 or $200 a month, and in exchange, you got an all-you-can-eat buffet of compute power.</p><p>But by early 2026, the physical cost of running these models caught up with the business reality.</p><p>Look at the events of the last quarter. OpenAI shut down Sora and backed out of their Disney partnership. Microsoft is tightening its cloud budget. And a leaked internal dashboard shared by <strong><a href="https://www.linkedin.com/company/the-signal-ai/posts">The Signal</a></strong> from Anthropic showed just how unsustainable the generative AI business model is right now.</p><p>We aren&#8217;t entering an era of unlimited personal AI. We&#8217;re actually going back to the 1970s model, the era of the IBM Mainframe. The hallucination seems officially over &#128578;</p><h2>AI isn&#8217;t a SaaS</h2><p>Software-as-a-Service (SaaS) is a great business model because the marginal cost of serving one more user is effectively zero.</p><p>AI inference isn&#8217;t SaaS. It scales linearly. Every prompt requires physical hardware to do work.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Kwhi!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8dfc557-d52f-4bb7-b801-4fc425dba879_1280x1560.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Kwhi!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8dfc557-d52f-4bb7-b801-4fc425dba879_1280x1560.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Kwhi!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8dfc557-d52f-4bb7-b801-4fc425dba879_1280x1560.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Kwhi!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8dfc557-d52f-4bb7-b801-4fc425dba879_1280x1560.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Kwhi!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8dfc557-d52f-4bb7-b801-4fc425dba879_1280x1560.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Kwhi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8dfc557-d52f-4bb7-b801-4fc425dba879_1280x1560.jpeg" width="1280" height="1560" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d8dfc557-d52f-4bb7-b801-4fc425dba879_1280x1560.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1560,&quot;width&quot;:1280,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:220436,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.binarybox.org/i/192891847?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8dfc557-d52f-4bb7-b801-4fc425dba879_1280x1560.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Kwhi!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8dfc557-d52f-4bb7-b801-4fc425dba879_1280x1560.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Kwhi!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8dfc557-d52f-4bb7-b801-4fc425dba879_1280x1560.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Kwhi!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8dfc557-d52f-4bb7-b801-4fc425dba879_1280x1560.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Kwhi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8dfc557-d52f-4bb7-b801-4fc425dba879_1280x1560.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="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">From <strong><a href="https://www.linkedin.com/company/the-signal-ai/posts">The Signal</a></strong> </figcaption></figure></div><p>To understand why the flat-rate AI subscription is failing, look at the leaked Anthropic dashboard. An enterprise power user on a $200/month &#8220;Pro&#8221; tier ran an autonomous coding loop. In 23 days, that single user consumed 1.1 billion tokens and triggered 9,221 sub-agent tasks.</p><p>The actual compute cost of running those inferences on Anthropic&#8217;s GPU clusters was $27,000. Anthropic took a 135x loss on a single customer in less than a month. </p><p>Analyzing a 100-page PDF or running an autonomous agent isn&#8217;t a simple database query. It requires firing up clusters of GPUs and executing billions of operations. You can&#8217;t sell that kind of compute for a flat fee and hope to make it up in volume. Volume is exactly what causes the losses.</p><h3>The Death of Sora</h3><p>If you want proof that the subsidy is over, look at Sora.</p><p>OpenAI killed their flagship video generation model less than six months after its public launch. The tech press talked about &#8220;safety concerns&#8221; and &#8220;copyright,&#8221; but the reality was the Cost of Goods Sold (COGS).</p><p>Generating 60 frames per second of photorealistic video requires massive compute. Keeping the Sora clusters running for 500,000 active users burned an estimated $1 million a day in electricity and GPU depreciation.</p><p>They tried to pivot to the enterprise by signing a $1 billion partnership with Disney. But Disney realized that offloading their rendering pipeline to OpenAI&#8217;s servers was actually more expensive than doing it in-house. The unit economics didn&#8217;t make sense, so the servers were shut down.</p><h3>OpenAI&#8217;s &#8220;Risk Factor&#8221;</h3><p>The cloud providers have woken up. For years, Microsoft subsidized OpenAI&#8217;s compute to gain market share. That era of cheap infrastructure is over.</p><p>In a recent financial disclosure, OpenAI explicitly listed their reliance on Microsoft Azure&#8217;s compute pricing as a &#8220;Risk Factor.&#8221; </p><p>Wall Street is demanding a return on the billions poured into data centers. Investors are forcing AI labs to drop unprofitable consumer tools and focus entirely on enterprise contracts that actually pay the bills.</p><h2>Edge vs. Mainframe</h2><p>To fix the broken math, the AI market is splitting into two distinct tiers. </p><p>The middle ground which is $200/month frontier web app is disappearing.</p><h3>Tier 1: The Consumer Edge</h3><p>Consumers will get smaller, 8-billion parameter models running locally on their phones and laptops (Apple Silicon, Snapdragon NPUs etc).</p><p>These models are good enough for basic tasks like grammar correction and summarizing emails, but they aren&#8217;t capable of deep reasoning. </p><p>Why the shift? </p><p>Because by pushing the model to the edge, companies offload the cost of the compute and electricity directly onto the user&#8217;s battery. It is the only way the consumer unit economics work.</p><h3>Tier 2: The AI Mainframe (Enterprise)</h3><p>True frontier AI, massive models capable of deep, autonomous workflows will become bespoke enterprise tools.</p><p>These won&#8217;t be accessible via a casual web interface. </p><p>They will be sold via multi-million-dollar B2B contracts to pharmaceutical companies running protein simulations, and quant hedge funds executing trading logic. </p><p>They are the only businesses with gross margins high enough to afford the true, unsubsidized cost of compute.</p><div><hr></div><h2>Conclusion</h2><p>The idea that a solo developer in a garage will have the exact same compute power as the CTO of JPMorgan isn&#8217;t realistic. </p><p>The physics of data centers dictate otherwise.</p><p>As a Software Architect, you need to plan defensively. Relying on cloud providers to subsidize your application&#8217;s heavy reasoning is a risk.</p><p>Build your systems around cheap, local, open-source models for the basic plumbing such as routing, classification, and simple tasks. </p><p>Treat frontier API calls as an expensive, highly constrained physical resource. </p><p>Use them only when absolutely necessary and plan for AI like heavy industrial equipment. </p><p>The era of cheap, subsidized compute is over.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading BinaryBox! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[A ₹500 ($5) course won't make you an AI Engineer]]></title><description><![CDATA[They claim that AI is replacing software engineers tomorrow, and if you don&#8217;t buy their &#8220;AI Mastery Guide&#8221; today, your career is over before it begins.]]></description><link>https://www.binarybox.org/p/a-500-5-course-wont-make-you-an-ai</link><guid isPermaLink="false">https://www.binarybox.org/p/a-500-5-course-wont-make-you-an-ai</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Tue, 31 Mar 2026 12:03:53 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!y-Gm!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d3ed674-2cd5-40b7-8fee-5be0b4aebed3_1536x768.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!y-Gm!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d3ed674-2cd5-40b7-8fee-5be0b4aebed3_1536x768.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!y-Gm!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d3ed674-2cd5-40b7-8fee-5be0b4aebed3_1536x768.png 424w, https://substackcdn.com/image/fetch/$s_!y-Gm!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d3ed674-2cd5-40b7-8fee-5be0b4aebed3_1536x768.png 848w, https://substackcdn.com/image/fetch/$s_!y-Gm!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d3ed674-2cd5-40b7-8fee-5be0b4aebed3_1536x768.png 1272w, https://substackcdn.com/image/fetch/$s_!y-Gm!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d3ed674-2cd5-40b7-8fee-5be0b4aebed3_1536x768.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!y-Gm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d3ed674-2cd5-40b7-8fee-5be0b4aebed3_1536x768.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4d3ed674-2cd5-40b7-8fee-5be0b4aebed3_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;:1947599,&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.binarybox.org/i/191716866?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d3ed674-2cd5-40b7-8fee-5be0b4aebed3_1536x768.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_!y-Gm!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d3ed674-2cd5-40b7-8fee-5be0b4aebed3_1536x768.png 424w, https://substackcdn.com/image/fetch/$s_!y-Gm!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d3ed674-2cd5-40b7-8fee-5be0b4aebed3_1536x768.png 848w, https://substackcdn.com/image/fetch/$s_!y-Gm!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d3ed674-2cd5-40b7-8fee-5be0b4aebed3_1536x768.png 1272w, https://substackcdn.com/image/fetch/$s_!y-Gm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d3ed674-2cd5-40b7-8fee-5be0b4aebed3_1536x768.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>Take a breath.</p><p>I know what your LinkedIn and Twitter feeds look like right now. </p><p>Every time you open your phone, an influencer in a rented sports car or a sleek home office is screaming at you. </p><p>They claim that AI is replacing software engineers tomorrow, and if you don&#8217;t buy their <em><strong>&#8220;AI Mastery Guide&#8221;</strong></em> today, your career is over before it begins.</p><p>I see the panic in computer science cohorts and junior developers. It is entirely valid. </p><p>But you need to understand that this anxiety is not a natural reaction to the tech market. It is a manufactured emotion, meticulously engineered by marketers to make you feel inadequate so you will open your wallet.</p><p>In any gold rush, the people who actually get rich are the ones selling the shovels. Today&#8217;s &#8220;AI Influencers&#8221; are selling cheap, plastic shovels to desperate, anxious students.</p><p>Let&#8217;s tear down their selling tactics like an architecture.</p><h2>The Scam</h2><p>If you want to be an engineer, you need to learn how to reverse-engineer systems. </p><p>Let&#8217;s look at the system design of the influencer business model.</p><p>When you see an ad for a &#8220;Master ChatGPT in 30 Days&#8221; course priced at &#8377;500 or $5, you think you are buying an educational product. </p><p>You are not. You are participating in a Customer Acquisition Cost (CAC) mechanism.</p><p>That &#8377;500 course is just the entry point to a sales funnel. The content inside is nothing but regurgitated Twitter threads, repackaged into a PDF to create artificial complexity. </p><p>It is designed to give you a dopamine hit of &#8220;productivity&#8221; while making you feel like you are still missing the <em>real</em> secret.</p><p>Then, the trap springs. Once you finish the cheap course, the email sequence begins. </p><p>They tell you that to <em>actually</em> secure a six-figure job, you need to join their exclusive &#8220;AI Mastermind&#8221; or buy the advanced bootcamp for &#8377;50,000.</p><p>You are being farmed for your attention and your anxiety.</p><h2>The Delusion</h2><p>The core lie holding this entire grift together is the concept of the &#8220;Prompt Engineer.&#8221;</p><p>Let me give you the hard truth</p><p>Prompt Engineering is not a sustainable technical career. </p><p>A prompt is simply a natural language API call. You are no more an &#8220;engineer&#8221; for typing instructions into ChatGPT than you are a &#8220;Search Engineer&#8221; for typing queries into Google.</p><p>More importantly, it is a rapidly depreciating asset.</p><p>Two years ago, getting an LLM to output a specific JSON format required paragraphs of complex &#8220;jailbreak&#8221; constraints and magical phrasing. </p><p>Today, frontier models like Claude 3.5 Sonnet, GPT-4o, and Gemini 1.5 Pro natively understand intent, reason through logic, and output strict JSON out of the box.</p><p>The models are getting smarter at interpreting human ambiguity. As the compilers (the LLMs) get better at understanding natural language, the need for complex, esoteric &#8220;prompts&#8221; disappears. </p><p>Buying a course on prompting is investing your limited time and money into a dying skill.</p><h2>The Trap</h2><p>Part of the illusion relies heavily on visual spectacle. </p><p>The influencer will open a video by shouting, </p><p><em><strong>&#8220;I just generated a 50-page PowerPoint, a PDF marketing brochure, and 12 photorealistic images in under three minutes using these SECRET tools!&#8221;</strong></em></p><p>They will show you a curated list of glossy AI web apps or tools that automatically build slide decks, generate stock photos, or format PDFs. </p><p>They will try to convince you that knowing which button to click on these websites is a highly monetizable, technical skill.</p><p>Let me be brutally clear.</p><p>Using a SaaS wrapper to generate a PDF makes you an <em>end-user</em>, not an engineer.</p><p>You are not building software. You are consuming it. </p><p>Knowing how to type a prompt into an image generator or a presentation-maker is equivalent to claiming you are a Database Architect because you know how to sort a column in Microsoft Excel. </p><p>It is a neat productivity trick for a marketing manager, but it has absolutely zero engineering value. </p><p>When you buy a course to learn these tools, you are paying for a glorified software tutorial, not an engineering curriculum.</p><h2>The Real AI Engineering</h2><p>Contrast the influencer fantasy with the brutal reality of what the industry actually pays for.</p><p>Companies do not pay AI Engineers $150,000 a year to type clever sentences into a web interface or generate a pretty slide deck.</p><p>They pay engineers to build resilient, scalable systems around non-deterministic intelligence.</p><p>Real AI engineering is systems engineering. It is building deterministic RAG (Retrieval-Augmented Generation) pipelines. It is managing the severe latency of vector databases. It is calculating the unit economics of token costs versus API throughput.</p><p>An actual AI Engineer spends their day setting up strict guardrails to catch LLM hallucinations before they reach a customer. </p><p>They write middleware to mask Personally Identifiable Information (PII) before it hits a third-party API. </p><p>They write exponential backoff algorithms to handle <code>502 Bad Gateway</code> errors and <code>429 Too Many Requests</code> rate limits from OpenAI. </p><p>They build intelligent chunking strategies to fit a massive PDF into a 100k context window without destroying the semantic meaning.</p><p>If a course does not teach you how to handle network failures, rate limits, or context window chunking, it is not an AI engineering course. </p><p>It is a typing class.</p><h2>Where you should learn?</h2><p>So, where do you actually go to learn? </p><p>You ignore the influencers and you go to the raw, unpolished sources. </p><p>Here is your actual roadmap, and it is almost entirely free.</p><h3>The Math &amp; Mechanics</h3><p>Go to YouTube and search for <strong><a href="https://www.youtube.com/watch?v=VMj-3S1tku0&amp;list=PLAqhIrjkxbuWI23v9cThsA9GvCAUhRvKZ">Andrej Karpathy&#8217;s </a></strong><em><strong><a href="https://www.youtube.com/watch?v=VMj-3S1tku0&amp;list=PLAqhIrjkxbuWI23v9cThsA9GvCAUhRvKZ">&#8220;Neural Networks: Zero to Hero&#8221;</a></strong></em> series. <strong><a href="https://en.wikipedia.org/wiki/Andrej_Karpathy">Karpathy</a></strong> was a founding member of OpenAI and the Director of AI at Tesla. </p><p>He will teach you how to build a neural network from scratch using Python. </p><p>Understanding the underlying calculus and matrix multiplication is infinitely more valuable than memorizing a prompt template.</p><h3>The Applied Systems</h3><p>Stop buying courses and start reading official documentation. </p><p>Take <strong><a href="https://grow.google/ai-coursera">Grow with Google AI Lessons</a></strong>.</p><p>Read the <strong><a href="https://platform.claude.com/docs/en/home">Anthropic documentation</a></strong>. </p><p>Read the <strong><a href="https://developers.openai.com/cookbook">OpenAI Cookbooks</a></strong>. </p><p>If you need structured courses, take <strong><a href="https://www.coursera.org/instructor/andrewng">Andrew Ng&#8217;s</a></strong> DeepLearning AI classes. </p><p>They are built by actual AI researchers, not Twitter marketers.</p><h3>The Framework</h3><p>Want to build AI apps? </p><p>Go read the raw GitHub documentation for LangChain, LlamaIndex, or Hugging Face. </p><p>Build a simple Python script that takes a local text file, converts it into embeddings, stores it in a local ChromaDB, and queries it. </p><p>You will learn more in one weekend of fighting Python dependency errors than in a year of watching influencer videos.</p><div><hr></div><h2>Conclusion</h2><p>True technical leverage does not live behind a paywall on an Instagram ad. </p><p>It lives in your ability to sit in a quiet room, read difficult technical documentation, and build things that break until you figure out how to fix them.</p><p>A career in software engineering is a 40-year marathon. </p><p>Technologies will rise and fall. Frameworks will die. </p><p>Do not let marketers rush you into buying plastic shovels.</p><p>Ignore the noise. Protect your wallet. Focus on the fundamentals.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading BinaryBox! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p>]]></content:encoded></item><item><title><![CDATA[Thought - Why Token Costs will Bankrupt your LLM Wrapper]]></title><description><![CDATA[If your COGS scales perfectly linearly with every single user click, you do not have a software business. You have a subsidized consulting firm.]]></description><link>https://www.binarybox.org/p/thought-why-token-costs-will-bankrupt</link><guid isPermaLink="false">https://www.binarybox.org/p/thought-why-token-costs-will-bankrupt</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Thu, 26 Mar 2026 06:00:40 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Vqel!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69c8cb96-c797-4d10-94f0-213c6daa26c9_1400x723.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Vqel!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69c8cb96-c797-4d10-94f0-213c6daa26c9_1400x723.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Vqel!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69c8cb96-c797-4d10-94f0-213c6daa26c9_1400x723.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Vqel!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69c8cb96-c797-4d10-94f0-213c6daa26c9_1400x723.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Vqel!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69c8cb96-c797-4d10-94f0-213c6daa26c9_1400x723.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Vqel!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69c8cb96-c797-4d10-94f0-213c6daa26c9_1400x723.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Vqel!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69c8cb96-c797-4d10-94f0-213c6daa26c9_1400x723.jpeg" width="1400" height="723" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/69c8cb96-c797-4d10-94f0-213c6daa26c9_1400x723.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:723,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:155461,&quot;alt&quot;:&quot;Token by Token: Mastering AI Cost Optimization | by Pradeep Kumar  Muthukamatchi | Data Science Collective | Medium&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Token by Token: Mastering AI Cost Optimization | by Pradeep Kumar  Muthukamatchi | Data Science Collective | Medium" title="Token by Token: Mastering AI Cost Optimization | by Pradeep Kumar  Muthukamatchi | Data Science Collective | Medium" srcset="https://substackcdn.com/image/fetch/$s_!Vqel!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69c8cb96-c797-4d10-94f0-213c6daa26c9_1400x723.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Vqel!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69c8cb96-c797-4d10-94f0-213c6daa26c9_1400x723.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Vqel!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69c8cb96-c797-4d10-94f0-213c6daa26c9_1400x723.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Vqel!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69c8cb96-c797-4d10-94f0-213c6daa26c9_1400x723.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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 brought in to consult for a generative AI startup that had just closed a massive Seed round. They had built an &#8220;AI Customer Success Agent&#8221; that looked incredible in staging.</p><p>Then I opened their Anthropic billing dashboard.</p><p>Their Cost of Goods Sold (COGS) wasn&#8217;t just high. It was terminal. Every time a user asked their bot a question, the company lost money. </p><p>When I tore down their architecture to find the leak, I realized they hadn&#8217;t actually built a software company. They had built an unoptimized API proxy.</p><p>And this is not an isolated incident. </p><p>Look at the startup graveyard from the last two years. The AI Copywriter. The AI PDF Chatbot. The AI Email Assistant. They launched to deafening hype, dominated Product Hunt, and convinced investors they had cracked a new market.</p><p>Twelve months later, they were quietly shuttered or sold for parts.</p><p>Their entire product architecture consisted of prepending a system prompt to a user input and piping it directly to an LLM provider. They had no defensible moat, and their gross margins were systematically eaten alive by the underlying compute provider.</p><h2>The Maths of Margin Erosion</h2><p>Software-as-a-Service (SaaS) valuations are predicated on 80 percent gross margins and a near-zero marginal cost of replication. </p><p>If your COGS scales perfectly linearly with every single user click, you do not have a software business. You have a subsidized consulting firm.</p><h3>The RAG Trap</h3><p>Let&#8217;s examine the exact architecture that was killing my client. A standard enterprise RAG (Retrieval-Augmented Generation) implementation. You deploy a customer support bot handling a modest 10,000 conversations a day.</p><p>You write a dense, 2,000-token system prompt detailing the company&#8217;s tone and rules. Every time a user asks a question, your vector database retrieves 5,000 tokens of documentation context. Before the LLM generates a single word, your baseline payload is 7,000 input tokens.</p><p>At premium model pricing (roughly $10 to $15 per million input tokens for models like Claude 3 Opus or GPT-4), that single interaction costs about $0.10 just to read the prompt. Multiply that by 10,000 conversations, factoring in average multi-turn context window inflation, and you are burning <strong>$1,500+</strong> a day.</p><p>You are bleeding <strong>$500,000</strong> a year purely on input tokens before factoring in output costs, vector database hosting, or salaries.</p><h3>The Output Multiplier</h3><p>The input tax is just the entry fee. The output tax is where margins actually die.</p><p>Generating tokens requires significantly more compute than reading them. Providers charge 3x to 5x more for output tokens. If your bot generates a helpful 500-word response, that single output costs another $0.015.</p><p>Users do not ask one question; they iterate. A four-message conversation easily compounds to 30,000 total tokens processed. You are paying a premium cloud tax on every single syllable your system outputs, 24 hours a day.</p><h2>The Latency Tax</h2><p>Financial bleed is only the first failure mode. The second is Time to First Token (TTFT).</p><h3>TTFT</h3><p>TTFT is the ultimate metric in AI architecture. When you wire your frontend directly to an external LLM provider, you surrender total control of your application&#8217;s physics.</p><p>You inherit their network round-trips. You inherit their TLS handshakes. You inherit their peak-hour queue delays. You are at the mercy of raw 2-to-5-second inference times.</p><p>Human beings abandon interfaces that take more than 400 milliseconds to react. If your application takes five seconds to stream the first word because <code>us-east-1</code> is saturated, your users will leave.</p><h3>The Streaming Band-Aid</h3><p>Many developers try to hide this latency by streaming tokens to the UI. This is a visual band-aid, not an architectural fix.</p><p>Streaming gives the illusion of speed, but it does not change the physical time it takes to complete the task. </p><p>You cannot out-prompt the speed of light. </p><p>Prompt engineering cannot fix an overloaded cloud endpoint. If a backend task requires parsing JSON from an LLM response before executing a database query, streaming is useless. </p><p>You are simply blocked for five seconds.</p><h2>The Self-Hosting Fallacy</h2><p>Faced with massive API bills and latency spikes, engineering teams typically experience a knee-jerk reaction</p><p><em><strong>&#8220;Our API bill is too high. Let&#8217;s buy an H100 and host Llama 3 ourselves.&#8221;</strong></em></p><p>This is an ego trip disguised as a financial strategy.</p><h3>The Silicon Math</h3><p>Generating a million tokens on a hosted, heavily optimized API endpoint costs pennies for smaller models. Renting a single A100 or H100 GPU node costs upwards of $80 to $150 a day.</p><p>Because user traffic is spiky and unpredictable, that expensive silicon will sit completely idle 80 percent of the time. </p><p>You are paying for maximum capacity, but only utilizing a fraction of it.</p><h3>The DevOps Nightmare</h3><p>Running LLMs in production is not like running a Node.js server. It is a grueling battle with KV cache memory fragmentation, continuous batching algorithms, and CUDA out-of-memory crashes.</p><p>To keep a self-hosted model running efficiently, you need specialized AI infrastructure engineers. Those engineers cost <strong>$250,000</strong> a year.</p><p>Unless you process tens of millions of tokens daily at a perfectly consistent utilization rate, or you have strict air-gapped compliance requirements, self-hosting will bankrupt you faster than using LLM APIs. </p><p>You trade variable API costs for massive fixed CapEx and severe operational friction.</p><h2>Architecting the Defensive Moat</h2><p>To survive the LLM API tax, architects must build a ruthless abstraction layer between their application and the model provider. </p><p>You need an AI Gateway.</p><h3>Tactic 1: Semantic Caching</h3><p>Users ask the exact same questions constantly. You should not pay Anthropic 1,000 times a day to answer <em><strong>&#8220;What is your refund policy?&#8221;</strong></em></p><p>Instead, pass the user&#8217;s query through a cheap, sub-millisecond embedding model. Store that vector in a Redis cache alongside the LLM&#8217;s final generated response. </p><p>When the next user asks <em><strong>&#8220;How do I get my money back?&#8221;,</strong></em> perform a cosine similarity search.</p><p>If the mathematical match exceeds a 0.95 threshold, serve the cached string instantly. Your compute cost drops to $0. </p><p>Your TTFT drops to 50 milliseconds.</p><h3>Tactic 2: Intelligent Routing (The Cascade)</h3><p>Stop using premium frontier models for everything. A massive percentage of application logic involves basic classification, sentiment analysis, or summarization.</p><p>Your gateway should route trivial tasks to ultra-cheap, high-speed models like Gemini Flash, Llama 3 8B, or Claude Haiku. </p><p>Reserve the expensive, heavy reasoning models strictly for complex escalation paths. Implement a cascade, try the cheap model first, and only trigger the expensive model if the output fails a deterministic validation check.</p><h3>Tactic 3: Context Pruning</h3><p>Stop treating the LLM context window as a dumping ground. </p><p>Throwing 50 pages of PDF text into an API call because &#8220;the model supports 1M tokens&#8221; is financial suicide.</p><p>Implement strict context pruning. </p><p>Use a fast Cross-Encoder to re-rank your vector search results. Strip out boilerplate text, HTML tags, and redundant paragraphs before assembling the final prompt. </p><p>Sending exactly 800 highly relevant tokens is infinitely cheaper and yields better model accuracy than blindly dumping 8,000 tokens.</p><h3>Tactic 4: Circuit Breakers</h3><p>External APIs fail. Rate limits get exhausted. If your application crashes when LLM API throws a 502 Bad Gateway, your architecture is brittle.</p><p>Your gateway must implement strict circuit breakers. </p><p>If the primary provider times out or degrades, the gateway must instantly and transparently reroute the exact payload to a backup provider (e.g., failing over from OpenAI to Anthropic). </p><p>Graceful degradation is a mandatory requirement, not a feature.</p><div><hr></div><h2>Conclusion</h2><p>Large Language Models are not magic brains. They are commodity compute.</p><p>The value of your engineering team is not in writing a clever system prompt. The value is in building the caching, routing, pruning, and abstraction infrastructure that makes running that prompt economically viable.</p><p>If you build a thin wrapper, the API provider will eventually consume your margins. </p><p>Build the moat, or prepare to join the graveyard.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading BinaryBox! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p><p></p><p></p><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[Do you really need a Vector Database for your AI Product?]]></title><description><![CDATA[Before you sign a massive SaaS contract for a dedicated vector engine, you need to understand the physics of the hardware you are renting.]]></description><link>https://www.binarybox.org/p/do-you-really-need-a-vector-database</link><guid isPermaLink="false">https://www.binarybox.org/p/do-you-really-need-a-vector-database</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Tue, 24 Mar 2026 06:00:50 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!_Lc8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fa95570-4e88-4df3-97f2-f82586cd81c7_1200x675.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_Lc8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fa95570-4e88-4df3-97f2-f82586cd81c7_1200x675.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_Lc8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fa95570-4e88-4df3-97f2-f82586cd81c7_1200x675.jpeg 424w, https://substackcdn.com/image/fetch/$s_!_Lc8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fa95570-4e88-4df3-97f2-f82586cd81c7_1200x675.jpeg 848w, https://substackcdn.com/image/fetch/$s_!_Lc8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fa95570-4e88-4df3-97f2-f82586cd81c7_1200x675.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!_Lc8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fa95570-4e88-4df3-97f2-f82586cd81c7_1200x675.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_Lc8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fa95570-4e88-4df3-97f2-f82586cd81c7_1200x675.jpeg" width="1200" height="675" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0fa95570-4e88-4df3-97f2-f82586cd81c7_1200x675.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:675,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Comparing 10 Vector Database APIs For AI | Nordic APIs |&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Comparing 10 Vector Database APIs For AI | Nordic APIs |" title="Comparing 10 Vector Database APIs For AI | Nordic APIs |" srcset="https://substackcdn.com/image/fetch/$s_!_Lc8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fa95570-4e88-4df3-97f2-f82586cd81c7_1200x675.jpeg 424w, https://substackcdn.com/image/fetch/$s_!_Lc8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fa95570-4e88-4df3-97f2-f82586cd81c7_1200x675.jpeg 848w, https://substackcdn.com/image/fetch/$s_!_Lc8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fa95570-4e88-4df3-97f2-f82586cd81c7_1200x675.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!_Lc8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fa95570-4e88-4df3-97f2-f82586cd81c7_1200x675.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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 week, I sat in an architecture review with a client who had just secured Series A funding. They were building a standard Retrieval-Augmented Generation (RAG) pipeline for their internal documents. </p><p>Before anyone had written a single line of backend logic, the engineering lead proudly displayed a slide proposing a six-figure enterprise contract with a dedicated Vector Database.</p><p>When I asked why we weren&#8217;t just using Postgres, the answer was immediate</p><p><em><strong> &#8220;Because this is an AI app. You need a Vector DB for AI.&#8221;</strong></em></p><p>This is the exact kind of hype-driven development that destroys startup runways.</p><p>At the physical level, Vector Databases are not magic AI boxes. They do not understand &#8220;meaning,&#8221; &#8220;context,&#8221; or &#8220;semantics.&#8221; </p><p>They are simply C++ or Rust memory allocators navigating multi-dimensional mathematical graphs. </p><p>To do this quickly, they trade exact accuracy for speed, and they force you to pay an absolute fortune in RAM to do it.</p><p>Before you sign a massive SaaS contract for a dedicated vector engine, you need to understand the physics of the hardware you are renting.</p><h2>The Brute Force Math</h2><p>To understand why traditional databases fail at vector search, you have to look at the math of a &#8220;Vector.&#8221;</p><p>An OpenAI <code>text-embedding-3-small</code> embedding is a 1,536-dimensional array of floating-point numbers. In physical memory, a single 32-bit float consumes 4 bytes.</p><p><code>1,536 dimensions &#215; 4 bytes = 6,144 bytes (6 KB) per vector</code></p><p>If you want to find the closest vectors to a user&#8217;s query using exact math, a process called Exact K-Nearest Neighbors (KNN) which your CPU must calculate the cosine similarity between the query vector and every single row in the database.</p><p>Let&#8217;s do the memory bandwidth math on a small 1-million-row table</p><p><code>1,000,000 rows &#215; 6 KB = 6.1 Gigabytes of data</code></p><p>To answer one user query, </p><ul><li><p>the CPU must pull <strong>6.1 GB</strong> of data from RAM through the memory bus, </p></li><li><p>load it into the <strong>L1 cache</strong>, </p></li><li><p>and execute millions of <strong>AVX-512 SIMD</strong> (Single Instruction, Multiple Data) dot-product operations.</p></li></ul><p>Even on modern DDR5 RAM peaking at 50 GB/s of bandwidth, a single concurrent user doing an Exact KNN search will consume 12% of your entire server&#8217;s memory bandwidth. </p><p>If you get 10 concurrent searches, your CPU is completely starved for data. The system grinds to an absolute halt.</p><p>Even the traditional B-Trees cannot save you. </p><p>A B-Tree relies on 1-dimensional inequalities (<em>Is X &gt; 10? Go right</em>). You cannot sort or bisect 1,536 dimensions simultaneously.</p><h2>HNSW (Hierarchical Navigable Small World)</h2><p>If Exact KNN locks up the CPU, how do Vector DBs return results in 20 milliseconds?</p><p>They don&#8217;t do exact searches. They cheat.</p><p>Vector databases rely on <strong>Approximate Nearest Neighbor (ANN)</strong> algorithms.</p><p>They accept that finding the <em>perfect</em> match is computationally impossible at scale, so they settle for finding a <em>very good</em> match almost instantly.</p><p>The undisputed king of these algorithms is <strong><a href="https://en.wikipedia.org/wiki/Hierarchical_navigable_small_world">HNSW</a></strong>.</p><p>Do not let the academic name intimidate you. HNSW is just a multi-layered skip-list mapped over a proximity graph. </p><p>Imagine you are driving from New York to a specific house in a suburb of Los Angeles</p><h4>The Top Layer (Interstates)</h4><p>You don&#8217;t take local roads across the country. You get on an interstate. </p><p>In HNSW, the top layer has very few nodes, but they have long-distance links. </p><p>The search algorithm drops in here and makes massive, cross-graph jumps toward the general cluster of the target.</p><h4>The Middle Layers (City Roads)</h4><p>Once you are near Los Angeles, you drop down a layer. </p><p>There are more nodes here, connected by shorter links. </p><p>You navigate to the correct neighborhood.</p><h4>The Bottom Layer (Local Streets)</h4><p>You drop to the base layer, which contains every single vector in the database, and you traverse the local streets until you hit the closest possible house (a local minimum).</p><p>HNSW is a masterpiece of algorithmic engineering. It reduces a catastrophic <code>O(N)</code> full table scan into a blisteringly fast <code>O(log N)</code> graph traversal.</p><p>But it comes with a brutal physical cost called <strong>Pointer Chasing.</strong></p><h2>Why NVMe SSDs Hate HNSW (Pointer Chasing)</h2><p>Traditional relational databases are famous for being disk-friendly because they exploit <strong>Locality of Reference</strong>. </p><p>B-Tree nodes are packed cleanly into contiguous 8KB blocks (pages) on your SSD. When Postgres needs an index node, it pulls a single 8KB block into memory, and all the sequential keys are right there next to each other.</p><p>HNSW graphs are the exact opposite.</p><p>An HNSW index is a giant, chaotic web of pointers (memory addresses) pointing to other pointers across multiple layers. </p><p>The nodes are scattered randomly across the heap during insertion.</p><p>Traversing this graph means jumping wildly from memory address to memory address. </p><p>If your HNSW index does not fit in RAM and is forced onto a Solid-State Drive, following those pointers requires thousands of <strong>Random Disk Reads</strong> per query.</p><p>A standard NVMe SSD takes roughly 100 microseconds (<code>&#181;s</code>) to complete a random 4KB read. If an HNSW search requires 200 graph hops to find the nearest neighbor</p><p><code>200 hops &#215; 100 &#181;s = 20 milliseconds of pure disk latency</code></p><p>That sounds fast, until you realize this is for <em>one</em> query. </p><p>If your app is doing 1,000 queries per second, your SSD must sustain 200,000 random IOPS. </p><p>Even the most expensive AWS <code>io2 Block Express</code> volumes will buckle under that kind of random I/O queue depth. </p><p>Your 20ms latency will instantly spike to 2 seconds as the disk controllers choke.</p><p>Furthermore, pointer chasing completely defeats the OS Page Cache and the CPU&#8217;s hardware prefetchers. </p><p>The CPU cannot guess which memory address the graph will jump to next, resulting in continuous L3 cache misses.</p><h2>The RAM Tax</h2><p>Here is the physical reality of vector search</p><p><strong>To get the sub-50ms latency that Vector DBs advertise, the entire HNSW index must physically live in RAM.</strong></p><p>This brings us to the invoice (cost of the RAM). </p><p>RAM is exponentially more expensive than NVMe storage. Let&#8217;s do the math on a production-scale deployment of 100 million vectors.</p><ul><li><p><strong>Vector Payload</strong> - <code>100,000,000 &#215; 6 KB (1536-dim floats) = 600 GB</code></p></li><li><p><strong>HNSW Graph Overhead</strong> - Each node in HNSW maintains bidirectional pointers to its neighbors across multiple layers. This pointer overhead usually adds 30% to 50% to the base vector size. Let&#8217;s add 200 GB.</p></li></ul><p>To serve 100 million vectors, you need <strong>800 GB of RAM</strong>.</p><p>Storing 800 GB on a standard Postgres SSD costs about $65 a month. Holding 800 GB in an AWS <code>r6a.24xlarge</code> memory-optimized instance costs <strong>$5,300 a month</strong>.</p><p>When you buy a dedicated Vector Database, you are not buying better &#8220;AI.&#8221;</p><p>You are buying an expensive fleet of high-RAM cloud instances to hold a massive, chaotic pointer graph in volatile memory because the algorithm physically cannot survive on a disk.</p><h2>What you should do?</h2><p>Do not subsidize a SaaS company&#8217;s valuation because you think standard infrastructure can&#8217;t handle vector math. </p><p>Here is the architectural framework you should use before signing a vendor contract</p><h3>Use Postgres (<code>pgvector</code>)</h3><p><strong>If you have fewer than 5 million vectors</strong>, you do not have a scale problem. You have a standard CRUD problem.</p><p>Install the <code>pgvector</code> extension on your existing Postgres instance. </p><p>Postgres is perfectly capable of building an HNSW index and holding it in its <code>shared_buffers</code> (RAM). </p><p>You save thousands of dollars, you eliminate a fragile network hop in your infrastructure, and you keep your relational data and your embeddings in the exact same ACID-compliant transaction block. </p><p>You can <code>JOIN</code> your semantic search results directly against your user permission tables in a single query.</p><h3>Use a Dedicated Vector DB (Pinecone, Milvus, Qdrant)</h3><p>You only graduate to a dedicated vector engine when your index physically outgrows the RAM limits of a single, massive database instance.</p><p>When you hit 50 million, 100 million, or a billion vectors, a single Postgres node will OOM (Out of Memory) trying to fit the HNSW graph into <code>shared_buffers</code>. </p><p><em>That</em> is the exact moment you pay a premium for a distributed vector database. </p><p>You are paying them to shard the massive HNSW graph across multiple clustered nodes and handle the distributed scatter-gather networking required to query it.</p><div><hr></div><h2>Conclusion</h2><p>Architecture requires alignment between the physical realities of the hardware and the economic realities of the business.</p><p>HNSW is a brilliant algorithm, but it is an unapologetic memory glutton. </p><p>It defeats disk I/O, thrashes CPU caches, and demands expensive DDR5 RAM to function at scale. </p><p>Start with Postgres, monitor your memory saturation, and scale out to a distributed vector engine only when the physics of the graph demand it.</p><p>Don&#8217;t buy a distributed system until you have a distributed problem.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading BinaryBox! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p><p></p><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[Thought - Why Postgres is a dangerous default]]></title><description><![CDATA[Nobody gets fired for choosing Postgres. It is the safest, most defensible technical decision you can make. Until it isn't. Especially when you are building a highly concurrent, event-driven logger.]]></description><link>https://www.binarybox.org/p/thought-why-postgres-is-a-dangerous</link><guid isPermaLink="false">https://www.binarybox.org/p/thought-why-postgres-is-a-dangerous</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Thu, 19 Mar 2026 06:00:52 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!dbpC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a933fd4-4ab4-4f2c-8ff8-45c12b4c87b3_1024x521.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!dbpC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a933fd4-4ab4-4f2c-8ff8-45c12b4c87b3_1024x521.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dbpC!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a933fd4-4ab4-4f2c-8ff8-45c12b4c87b3_1024x521.png 424w, https://substackcdn.com/image/fetch/$s_!dbpC!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a933fd4-4ab4-4f2c-8ff8-45c12b4c87b3_1024x521.png 848w, https://substackcdn.com/image/fetch/$s_!dbpC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a933fd4-4ab4-4f2c-8ff8-45c12b4c87b3_1024x521.png 1272w, https://substackcdn.com/image/fetch/$s_!dbpC!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a933fd4-4ab4-4f2c-8ff8-45c12b4c87b3_1024x521.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!dbpC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a933fd4-4ab4-4f2c-8ff8-45c12b4c87b3_1024x521.png" width="1024" height="521" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3a933fd4-4ab4-4f2c-8ff8-45c12b4c87b3_1024x521.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:521,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Upgrading PostgreSQL with no data loss and minimal downtime | Tech blog |  Palark&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Upgrading PostgreSQL with no data loss and minimal downtime | Tech blog |  Palark" title="Upgrading PostgreSQL with no data loss and minimal downtime | Tech blog |  Palark" srcset="https://substackcdn.com/image/fetch/$s_!dbpC!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a933fd4-4ab4-4f2c-8ff8-45c12b4c87b3_1024x521.png 424w, https://substackcdn.com/image/fetch/$s_!dbpC!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a933fd4-4ab4-4f2c-8ff8-45c12b4c87b3_1024x521.png 848w, https://substackcdn.com/image/fetch/$s_!dbpC!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a933fd4-4ab4-4f2c-8ff8-45c12b4c87b3_1024x521.png 1272w, https://substackcdn.com/image/fetch/$s_!dbpC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a933fd4-4ab4-4f2c-8ff8-45c12b4c87b3_1024x521.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>Nobody gets fired for choosing Postgres. </p><p>It is the safest, most defensible technical decision you can make. Until it isn&#8217;t. Especially when you are building a highly concurrent, event-driven logger.</p><p>You pick it because it handles everything perfectly on day one, completely ignoring that you are buying a general-purpose engine for what might be a highly specialized problem.</p><p>We do this constantly in software. We slap a UUIDv4 on a primary key because it is convenient, blindly accepting the B-Tree fragmentation it guarantees at scale. </p><p>We spin up Postgres because it is the industry standard, ignoring what its storage engine actually does to our specific data shape.</p><p>Convenience dictates the architecture. Physics dictates the bill.</p><h2>The cost of MVCC Write</h2><p>Look at how Postgres manages concurrency. Multi-Version Concurrency Control (MVCC) is a brilliant mechanism. It allows readers and writers to operate simultaneously by creating new tuple versions instead of modifying data in place.</p><p>Let&#8217;s be absolutely clear.</p><p>If you are building a standard B2B SaaS application, with users, organizations, billing tables, and dynamic records, Postgres is flawless. If you are building a banking ledger where balances update constantly, MVCC is your best friend.</p><p>But if you are building an event log, a sensor stream, or an audit trail, MVCC is a parasite.</p><p>Consider a standard telemetry or event logging table. The schema looks entirely innocent</p><pre><code><code>CREATE TABLE user_events (
    event_id UUID PRIMARY KEY,
    user_id BIGINT,
    event_type VARCHAR(50),
    payload JSONB,
    created_at TIMESTAMPTZ DEFAULT NOW()
);

-- Executed 50,000 times a second
INSERT INTO user_events (event_id, user_id, event_type, payload)
VALUES ('...', 123, 'click', '{"button": "signup"}');</code></code></pre><p>To the developer, this is a simple, lightweight append operation. To the Postgres storage engine, this is a massive overhead event.</p><p>Your rows are immutable the second they hit the disk. Yet, every single insert carries a hidden 23-byte tuple header (<code>xmin</code>, <code>xmax</code>, <code>cmin</code>, <code>cmax</code>) tracking version visibility for concurrency that will never happen.</p><p>At 50,000 inserts a second, you are paying a massive, constant write tax on data that will never change. You are generating gigabytes of Write-Ahead Log (WAL) just to track ghosts.</p><h2>8KB at a Time</h2><p>When you do actually update or delete records in a highly active table, the architecture fights you in a completely different way.</p><pre><code><code>-- You think you are modifying data in place. You aren't.
UPDATE user_sessions 
SET last_seen = NOW() 
WHERE session_id = 'abc-123';</code></code></pre><p>Postgres does not delete old rows. It leaves the dead tuple sitting exactly where it was on the physical 8KB page. It writes the new, updated row to a new location. A background worker called autovacuum is supposed to sweep through eventually and mark that old space as reusable.</p><p>Under a heavy write load, autovacuum loses the race. Dead tuples accumulate faster than the database can process them.</p><p>Because live and dead records share the exact same physical pages, the query planner cannot skip the graveyard. If your table has 10 million live rows and 40 million dead ones, your hardware is pulling massive amounts of garbage from the disk into your buffer pool just to find the active data. The engine literally chokes on its own history.</p><p>As <strong><a href="https://www.cs.cmu.edu/~pavlo/">Andy Pavlo</a></strong> at CMU has pointed out, if someone were building a new MVCC database today, they would not implement it the way Postgres does. Its append-only storage design is a relic of the 1980s that predates log-structured storage patterns entirely.</p><h2>The Snapshot Collision</h2><p>One day someone asks for a dashboard. You run a long analytical query against this live operational data.</p><pre><code><code>-- The Data Analyst runs this at 9:00 AM
SELECT date_trunc('hour', created_at), count(*)
FROM user_events
GROUP BY 1
ORDER BY 1;</code></code></pre><p>Running a daily sales report on a 5-gigabyte SaaS database is fine. Running a 2-hour aggregation on a table absorbing 50,000 sensor readings a second is a death sentence.</p><p>To guarantee consistent reads, Postgres holds the transaction snapshot open. While that two-hour report runs, autovacuum is paralyzed.</p><p>It cannot clean up any dead tuples that fall behind that active transaction horizon. Your dashboard is actively blocking garbage collection for the entire operational database. </p><p>Every <code>UPDATE</code> happening on your site during those two hours leaves a permanent scar on the disk until the report finishes.</p><p>Friction generates heat. Heat generates wear. Wear destroys your query latency. Postgres was simply not designed to serve heavy OLTP and OLAP from the same instance under load.</p><h2>The Optimization Treadmill</h2><p>This is when you step onto the Optimization Treadmill. You do not fix the architecture. You treat the symptoms.</p><h4>Step 1 - The Index Trap</h4><p>Write throughput dips, so you add a composite index to speed up the read queries causing the locks. You just amplified your write penalty. Every insert now has to update multiple B-Trees.</p><h4>Step 2 - The Vacuum Illusion</h4><p>The table bloats, so you aggressively tune the background workers.</p><pre><code><code>ALTER TABLE user_sessions 
SET (autovacuum_vacuum_scale_factor = 0.01);</code></code></pre><p>You force the database to vacuum constantly. You are now burning precious CPU cycles fighting your own insert rate.</p><h4>Step 3 - Hardware Scaling</h4><p>CPU spikes, so you upgrade the instance class. You double the RAM. You provision higher IOPS.</p><p>Every single one of these interventions is the technically correct response to a real symptom. You are doing exactly what an experienced DBA would do. But none of it changes your trajectory. You are fighting an architectural ceiling, not a misconfiguration.</p><p>The treadmill only speeds up. Each fix buys you a few months of runway before the database collects its tax again.</p><h2>How to Spot the Treadmill Early</h2><p>The most critical decision you can make is recognizing the treadmill before you get on it. Stop treating Postgres as a zero-cost default. Look at the physical reality of your data before you write the schema.</p><ul><li><p>Are your writes predominantly inserts with no updates?</p></li><li><p>Are the rows permanently immutable once written?</p></li><li><p>Is your data volume growing by 50 percent year over year?</p></li><li><p>Do you need to run heavy analytics against the same live table?</p></li></ul><p>If you nod your head to any of those, the architectural mismatch is already baked in. The only variable is how much engineering time and AWS budget you burn before you stop asking how to tune the database, and start asking the question you should have asked on day one.</p><p>Are we actually building a general-purpose OLTP system?</p><h2>The HTAP Escape</h2><p>If you recognize the treadmill early, you can escape it. If you actually need to serve heavy OLTP and OLAP concurrently from the same system without melting your disks, you need an architecture designed for Hybrid Transactional/Analytical Processing (HTAP).</p><p>When Postgres is no longer the default, you have three primary paths</p><h3>1. <a href="https://www.singlestore.com/">SingleStore</a></h3><p>SingleStore (formerly MemSQL) solves the OLTP/OLAP collision by physically splitting the storage engine under the hood. It uses an in-memory rowstore for blazing-fast transactional inserts and a disk-based columnstore for your analytical queries.</p><p>It is true HTAP. You get millisecond ingest and sub-second aggregations on the exact same cluster. It speaks the MySQL wire protocol, making integration trivial.</p><p>But, it is proprietary and expensive. The in-memory rowstore demands that your operational working set fits entirely in RAM. You are trading software friction for a massive hardware bill.</p><h3>2. <a href="https://www.pingcap.com/">TiDB</a></h3><p>TiDB separates compute from storage entirely. It uses a Raft-based distributed key-value store (TiKV) for your transactional inserts, and asynchronously replicates that data to a columnar engine (TiFlash) for analytics. The smart query planner automatically routes your dashboard queries to the column nodes and your point-writes to the row nodes.</p><p>It scales horizontally forever. You can run massive analytical reports against TiFlash without ever locking an operational row in TiKV.</p><p>But, it has severe operational complexity. You do not just &#8220;spin up&#8221; TiDB. Running the control plane, compute nodes, row storage nodes, and column storage nodes requires a dedicated infrastructure team. It is a Ferrari; you have to hire the mechanics.</p><h3>3. <a href="https://kafka.apache.org/">Kafka</a> + <a href="https://clickhouse.com/">ClickHouse</a> (Split Stack)</h3><p>If you cannot justify HTAP licensing or operational overhead, stop trying to force both workloads into one database. Write your immutable events to an append-only log (Kafka). Consume that log into a pure columnar database (ClickHouse) for your dashboards.</p><p>The physics align perfectly. Kafka&#8217;s sequential writes effortlessly absorb the OLTP load. ClickHouse&#8217;s columnar compression destroys the OLAP load. Both systems run at absolute maximum efficiency.</p><p>But, you now maintain two distinct distributed systems and the pipeline connecting them. Eventual consistency is guaranteed; immediate consistency is impossible.</p><div><hr></div><h1>Conclusion</h1><p>There is a recurring theme in engineering failures, we mistake popularity for universal fit.</p><p>Postgres is arguably the greatest relational database ever built. But it is a machine with specific operating parameters. </p><p>When you force an append-only, high-velocity stream into an MVCC engine, you are not testing the limits of Postgres. You are testing the limits of your infrastructure budget.</p><p>Stop letting convenience dictate your architecture. The cost of learning a specialized database like ClickHouse or Kafka today is infinitely lower than the cost of fighting the Optimization Treadmill tomorrow.</p><p>Physics always wins. Choose your database accordingly.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading BinaryBox! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p>]]></content:encoded></item><item><title><![CDATA[Research - A Formal Threshold Model for B-Tree Performance Degradation Under Random Primary Keys in OLTP Systems]]></title><description><![CDATA[We prove that this degradation is a physical limitation of B-Tree mechanics under random insertion, compounded by Write Amplification Factor (WAF) penalties, rather than a hardware or traffic-scaling]]></description><link>https://www.binarybox.org/p/research-a-formal-threshold-model</link><guid isPermaLink="false">https://www.binarybox.org/p/research-a-formal-threshold-model</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Tue, 17 Mar 2026 06:01:02 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!F1Pb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af60071-dc0d-4682-af0c-647161e40d7c_1720x900.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!F1Pb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af60071-dc0d-4682-af0c-647161e40d7c_1720x900.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!F1Pb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af60071-dc0d-4682-af0c-647161e40d7c_1720x900.png 424w, https://substackcdn.com/image/fetch/$s_!F1Pb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af60071-dc0d-4682-af0c-647161e40d7c_1720x900.png 848w, https://substackcdn.com/image/fetch/$s_!F1Pb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af60071-dc0d-4682-af0c-647161e40d7c_1720x900.png 1272w, https://substackcdn.com/image/fetch/$s_!F1Pb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af60071-dc0d-4682-af0c-647161e40d7c_1720x900.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!F1Pb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af60071-dc0d-4682-af0c-647161e40d7c_1720x900.png" width="1456" height="762" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9af60071-dc0d-4682-af0c-647161e40d7c_1720x900.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:762,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:109405,&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.binarybox.org/i/191116240?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af60071-dc0d-4682-af0c-647161e40d7c_1720x900.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_!F1Pb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af60071-dc0d-4682-af0c-647161e40d7c_1720x900.png 424w, https://substackcdn.com/image/fetch/$s_!F1Pb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af60071-dc0d-4682-af0c-647161e40d7c_1720x900.png 848w, https://substackcdn.com/image/fetch/$s_!F1Pb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af60071-dc0d-4682-af0c-647161e40d7c_1720x900.png 1272w, https://substackcdn.com/image/fetch/$s_!F1Pb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af60071-dc0d-4682-af0c-647161e40d7c_1720x900.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><figcaption class="image-caption">Image credits Toptal</figcaption></figure></div><p>The adoption of UUIDv4 as a primary key in OLTP databases has become a widespread default, driven by ORM convenience and distributed system requirements. </p><p><strong><a href="https://zenodo.org/records/19034540">This paper</a></strong> demonstrates that UUIDv4 primary keys guarantee severe, predictable performance degradation as table size grows. We introduce the Buffer Saturation Ratio (BSR) and derive a closed-form threshold (N<sup>*</sup>) that predicts exactly when write latency will spike. </p><p>We prove that this degradation is a physical limitation of B-Tree mechanics under random insertion, compounded by Write Amplification Factor (WAF) penalties, rather than a hardware or traffic-scaling failure.</p><h2>The Anatomy of a Deferred Crisis</h2><p>Modern frameworks make it trivial to assign a random, 128-bit string as a primary key. Distributed ID generation solves immediate engineering headaches. It prevents sequence contention. It hides entity counts from users.</p><p>But it introduces a delayed tax on your storage layer.</p><p>Engineers rarely observe the cost of UUIDv4 during the first year of a project. Databases aggressively cache active indexes in RAM. As long as the primary key index fits entirely within the database buffer pool, random inserts perform acceptably.</p><p>The crisis arrives silently. The index quietly outgrows the allocated memory. The database begins reading cold pages from the physical disk to complete routine inserts. Write latency jumps by two orders of magnitude. The typical engineering response, upgrading the instance class which fails to resolve the underlying physics.</p><h2>B-Tree Mechanics and the Fill Factor Penalty</h2><p>Relational databases use B-Tree variants to store indexes. Sequential keys, such as BigInt sequences or UUIDv7, append new records to the rightmost edge of the tree. The database keeps that single, active leaf node hot in memory.</p><p>UUIDv4 values possess zero temporal locality. Every insert targets a random location in the B-Tree.</p><p>When you insert a record into a random leaf node that is already full, the database executes a page split. It allocates a new page (16KB in MySQL InnoDB, 8KB in PostgreSQL), transfers half the records, and updates the parent nodes.</p><p>Sequential inserts achieve a high index fill factor (f &#8776; 0.90 to 0.94). Random UUIDv4 inserts guarantee continuous page splits, driving the equilibrium fill factor down to approximately 0.50. You are permanently storing half-empty pages. Your index requires twice the RAM just to exist.</p><h2>The Buffer Saturation Ratio (BSR)</h2><p>To predict performance failure, we must track the relationship between index size and available memory. We define the Buffer Saturation Ratio (BSR)</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;BSR = \\frac{B_{pool}}{I_{size}}&quot;,&quot;id&quot;:&quot;MFHVRXGSZK&quot;}" data-component-name="LatexBlockToDOM"></div><p>Where B<sub>pool</sub> is the configured memory for caching (InnoDB Buffer Pool or PostgreSQL <code>shared_buffers</code>), and I<sub>size</sub> is the total size of the primary key index.</p><p>When BSR &#8805; 1.0, the entire index resides in memory. Writes are fast.<br>When BSR &lt; 1.0 , the index exceeds available RAM.</p><p>At BSR &lt; 1.0, every random insert carries a cache miss probability (P<sub>miss</sub>)</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;P_{miss} = 1 - BSR&quot;,&quot;id&quot;:&quot;TZQPTRAXYL&quot;}" data-component-name="LatexBlockToDOM"></div><p>When a cache miss occurs, the database evicts a page to load the target leaf node from disk. Because UUIDv4 targets pages uniformly, the newly loaded page is highly unlikely to be reused before it is evicted again. This creates LRU eviction thrashing.</p><p>Your expected insert latency (L<sub>insert</sub>) becomes completely dominated by disk I/O</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;L_{insert} = L_{cpu} + (P_{miss} \\times L_{io})&quot;,&quot;id&quot;:&quot;CESZUJJVNM&quot;}" data-component-name="LatexBlockToDOM"></div><h2>Deriving the Threshold Row Count (N<sup>*</sup>)</h2><p>We can calculate the exact row count where a database will fall off the performance cliff. First, we model the projected index size</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;I_{size} = \\frac{N \\times (K_{size} + P_{overhead})}{f}&quot;,&quot;id&quot;:&quot;XTXVBRBNEH&quot;}" data-component-name="LatexBlockToDOM"></div><p>Where</p><ul><li><p>N = Number of rows</p></li><li><p>K<sub>size</sub>= Key size in bytes (16 for binary UUID, 36 for char UUID, 8 for BigInt)</p></li><li><p>P<sub>overhead</sub> = Pointer overhead (roughly 8 bytes)</p></li><li><p>f = Fill factor (0.50 for UUIDv4, 0.94 for BigInt)</p></li></ul><p>To find the threshold row count (N<sup>*</sup>), we set I<sub>size</sub> equal to B<sub>pool </sub>(BSR = 1.0) and solve for N</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;N^* = \\frac{B_{pool} \\times f}{K_{size} + P_{overhead}}&quot;,&quot;id&quot;:&quot;ZDMSHGLYPT&quot;}" data-component-name="LatexBlockToDOM"></div><p>This equation allows architects to project the exact lifespan of a database schema configuration.</p><h2>Write Amplification Factor (WAF)</h2><p>Random inserts punish the storage layer beyond just cache misses. They generate massive Write Amplification Factor (WAF) in the Write-Ahead Log (WAL).</p><p>The write amplification for a UUIDv4 index follows a logarithmic curve</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;WAF_{uuid} = 1 + \\left(\\frac{2}{m}\\right) \\times \\log_2\\left(\\frac{N}{M}\\right)&quot;,&quot;id&quot;:&quot;NBQIQZZIXA&quot;}" data-component-name="LatexBlockToDOM"></div><p>Where m is the B-Tree order (roughly 80 for InnoDB at 16KB pages with 200-byte rows), N is total rows, and M is the number of rows that fit in the buffer pool.</p><p>Your total write amplification multiplies by your secondary indexes (k)</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;WAF_{total} = (k + 1) \\times WAF_{uuid}&quot;,&quot;id&quot;:&quot;OXLKBUZQIS&quot;}" data-component-name="LatexBlockToDOM"></div><p>MySQL InnoDB uses clustered indexes. The massive, random primary key is duplicated into the leaf nodes of every secondary index. PostgreSQL uses heap tables, bypassing clustered index bloat, but secondary indexes still suffer the brutal page split penalty and identical WAF multipliers.</p><h2>Case study</h2><p>One of my client ran a package scan event log using a <code>char(36)</code> UUIDv4 primary key on a 16 GB RDS instance equipped with a 12 GB buffer pool.</p><p>During the first year, at 50 million rows, performance remained nominal. Their BSR sat at 8.0. The buffer pool easily absorbed the random writes.</p><p>The table eventually reached 500 million rows. The <code>char(36)</code> key, combined with the 0.50 fill factor, swelled the index size to roughly 15 GB.</p><p>Their BSR dropped to 0.80. Write latency instantly climbed from 2 ms to 200 ms. CPU utilization on the RDS instance pinned at 90 percent, entirely consumed by managing LRU evictions.</p><p>They upgraded the RDS instance class twice. Neither upgrade resolved the latency. Each vertical scaling event raised CPU, RAM, and the buffer pool proportionally, but the BSR remained strictly below 1.0. The index remained larger than the pool.</p><p>Hardware scaling cannot outrun mathematical thresholds. The only viable solution was migrating the primary key to a sequential format.</p><h2>The N<sup>*</sup> Decision Matrix</h2><p>Applying the N<sup>*</sup> formula to standard infrastructure configurations reveals the severe capacity penalty of UUIDv4 strings</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!jV8A!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b3c774a-e626-4712-9967-8976142a32a6_1920x745.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jV8A!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b3c774a-e626-4712-9967-8976142a32a6_1920x745.png 424w, https://substackcdn.com/image/fetch/$s_!jV8A!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b3c774a-e626-4712-9967-8976142a32a6_1920x745.png 848w, https://substackcdn.com/image/fetch/$s_!jV8A!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b3c774a-e626-4712-9967-8976142a32a6_1920x745.png 1272w, https://substackcdn.com/image/fetch/$s_!jV8A!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b3c774a-e626-4712-9967-8976142a32a6_1920x745.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jV8A!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b3c774a-e626-4712-9967-8976142a32a6_1920x745.png" width="1456" height="565" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3b3c774a-e626-4712-9967-8976142a32a6_1920x745.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:565,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:125351,&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.binarybox.org/i/191116240?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b3c774a-e626-4712-9967-8976142a32a6_1920x745.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_!jV8A!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b3c774a-e626-4712-9967-8976142a32a6_1920x745.png 424w, https://substackcdn.com/image/fetch/$s_!jV8A!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b3c774a-e626-4712-9967-8976142a32a6_1920x745.png 848w, https://substackcdn.com/image/fetch/$s_!jV8A!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b3c774a-e626-4712-9967-8976142a32a6_1920x745.png 1272w, https://substackcdn.com/image/fetch/$s_!jV8A!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b3c774a-e626-4712-9967-8976142a32a6_1920x745.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>A 32 GB server running a <code>char(36)</code> UUIDv4 index chokes at 273 million rows. The exact same hardware running a BigInt handles 2.25 billion rows. You are paying a 400 percent RAM tax for a framework default.</p><div><hr></div><h2>Conclusion</h2><p>UUIDv4 primary keys constitute a systemic architectural flaw in high-throughput OLTP databases. They actively defeat database caching mechanisms and maximize physical disk I/O.</p><p>Engineers must stop treating database performance degradation as a generic symptom of traffic scaling. Use the N<sup>*</sup> threshold formula to project your schema&#8217;s structural limits before executing a <code>CREATE TABLE</code> statement.</p><p>If distributed ID generation is a hard requirement, adopt temporally sequential identifiers like UUIDv7 or ULID. Align your data structures with the physical constraints of B-Tree mechanics.</p><p>Read the paper here</p><p><strong><a href="https://zenodo.org/records/19034540">https://zenodo.org/records/19034540 </a></strong></p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading BinaryBox! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p>]]></content:encoded></item><item><title><![CDATA[Thought - Why Banks Can't "Just Rewrite" COBOL in Java/Python/Go?]]></title><description><![CDATA[This is technical debt. We are going to rewrite the Core Ledger in Java microservices. We will be cloud-native]]></description><link>https://www.binarybox.org/p/thought-why-banks-cant-just-rewrite</link><guid isPermaLink="false">https://www.binarybox.org/p/thought-why-banks-cant-just-rewrite</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Thu, 12 Mar 2026 06:01:49 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!e2QY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd55e57-b708-4a2a-8ee3-300accc387de_1198x627.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!e2QY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd55e57-b708-4a2a-8ee3-300accc387de_1198x627.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!e2QY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd55e57-b708-4a2a-8ee3-300accc387de_1198x627.jpeg 424w, https://substackcdn.com/image/fetch/$s_!e2QY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd55e57-b708-4a2a-8ee3-300accc387de_1198x627.jpeg 848w, https://substackcdn.com/image/fetch/$s_!e2QY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd55e57-b708-4a2a-8ee3-300accc387de_1198x627.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!e2QY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd55e57-b708-4a2a-8ee3-300accc387de_1198x627.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!e2QY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd55e57-b708-4a2a-8ee3-300accc387de_1198x627.jpeg" width="1198" height="627" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2dd55e57-b708-4a2a-8ee3-300accc387de_1198x627.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:627,&quot;width&quot;:1198,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Anthropic's COBOL-Crunching AI Shakes IBM, But Opens Big New Deals for  Indian IT Giants, ETEnterpriseai&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Anthropic's COBOL-Crunching AI Shakes IBM, But Opens Big New Deals for  Indian IT Giants, ETEnterpriseai" title="Anthropic's COBOL-Crunching AI Shakes IBM, But Opens Big New Deals for  Indian IT Giants, ETEnterpriseai" srcset="https://substackcdn.com/image/fetch/$s_!e2QY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd55e57-b708-4a2a-8ee3-300accc387de_1198x627.jpeg 424w, https://substackcdn.com/image/fetch/$s_!e2QY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd55e57-b708-4a2a-8ee3-300accc387de_1198x627.jpeg 848w, https://substackcdn.com/image/fetch/$s_!e2QY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd55e57-b708-4a2a-8ee3-300accc387de_1198x627.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!e2QY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd55e57-b708-4a2a-8ee3-300accc387de_1198x627.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>It happens every five years. A new CTO arrives at a Global 500 bank. </p><p>They look at the &#8220;Green Screen&#8221; terminals, the 40-year-old IBM Z/OS mainframes, and the millions of lines of COBOL. </p><p>They cringe.</p><p>&#8220;This is legacy,&#8221; they declare. </p><p>&#8220;This is technical debt. We are going to rewrite the Core Ledger in Java microservices. We will be cloud-native.&#8221;</p><p>Three years and $50 million later, the project is quietly cancelled. </p><p>The CTO moves on to a different company. </p><p><strong>The COBOL remains.</strong></p><p>Why? </p><p>It&#8217;s not because the bank is lazy. It&#8217;s not because we lost the source code. </p><p>It is because the fundamental architecture of modern programming languages is hostile to the requirements of global finance.</p><p>You are not fighting code, you are fighting how computers do math.</p><h2>The Math Problem (IEEE 754)</h2><p>When you write <code>float</code> or <code>double</code> in Java, Python, C++, or Go, you are using <strong><a href="https://en.wikipedia.org/wiki/IEEE_754">IEEE 754 Binary Floating Point</a></strong> arithmetic. </p><p>This standard is designed for scientific calculation, measuring the distance to a star or the velocity of a particle. </p><p>It prioritizes range and speed over absolute precision.</p><h3>The Rounding Error</h3><p>Open your browser console or a Node.js shell and type</p><pre><code><code>0.1 + 0.2
// The result: 0.30000000000000004</code></code></pre><p>In a physics simulation, that <code>0.00000000000000004</code> is noise. </p><p>In a banking ledger processing trillions of dollars a day, that error is a regulatory violation, a failed audit, and potentially a lawsuit.</p><h3>Fixed-Point Decimal (COBOL Way)</h3><p>COBOL was not designed for science. </p><p>It was designed for Business (Common Business Oriented Language). </p><p>It does not use Binary Floating Point for money. It uses <strong><a href="https://en.wikipedia.org/wiki/Fixed-point_arithmetic">Fixed-Point arithmetic</a> </strong>stored as<strong> <a href="https://en.wikipedia.org/wiki/Binary-coded_decimal">Binary-Coded Decimal (BCD)</a></strong>.</p><p>In COBOL, you define a variable like this</p><pre><code><code>01 ACCOUNT-BALANCE PIC S9(13)V99 COMP-3.</code></code></pre><ul><li><p><code>01</code>: <strong>Level Number</strong>. In COBOL, <code>01</code> represents a top-level record or variable. Think of it like <code>const</code> or <code>let</code> at the root scope.</p></li><li><p><code>ACCOUNT-BALANCE</code>: The <strong>Variable Name</strong>. (COBOL uses kebab-case because it was invented before snake_case or camelCase won the war).</p></li><li><p><code>PIC</code>: <strong>Picture Clause</strong>. This tells the compiler exactly what the data looks like.</p></li><li><p><code>S</code>: <strong>Signed</strong>. This bit tracks if the number is positive or negative.</p></li><li><p><code>9(13)</code>: <strong>Numeric Integers</strong>. The number <code>9</code> represents a digit. <code>(13)</code> means &#8220;allocate space for 13 of them.&#8221;</p></li><li><p><code>V</code>: <strong>Virtual Decimal</strong>. This is the magic. It tells the CPU &#8220;assume a decimal point here,&#8221; but it <em>does not store a dot character</em> in memory. It saves space.</p></li><li><p><code>99</code>: <strong>Precision</strong>. Allocate exactly 2 digits for cents.</p></li><li><p><code>COMP-3</code>: <strong>Packed Decimal (BCD)</strong>. This is the instruction to store 2 digits per byte (using 4 bits each), rather than the standard 1 byte per character. This is what enables the hardware math precision.</p></li></ul><p>When COBOL calculates <code>0.1 + 0.2</code>, it does not convert them to binary approximations. </p><p>It calculates them in base-10, digit by digit, often utilizing specific hardware instructions on the mainframe (Decimal Floating Point units) that x86 architectures have historically lacked or emulated poorly. </p><p>The result is exactly <code>0.3</code>. Always.</p><h3>The Cost of Emulation</h3><p>You must be wondering can&#8217;t we do this in Java? </p><p>Yes, using <code>java.math.BigDecimal</code>.</p><p>But <code>BigDecimal</code> is a software object. It adds memory overhead and CPU cycles for every single calculation. </p><p>COBOL operates on money at the instruction-set level. When you are processing 50,000 transactions per second (TPS), that overhead isn&#8217;t just a performance hit.</p><p>It&#8217;s an infrastructure bill.</p><h2>True Transactionality (The CICS)</h2><p>The second reason rewrites fail is the misunderstanding of &#8220;Transactionality.&#8221;</p><p>Modern web development is obsessed with &#8220;Statelessness.&#8221; </p><p>You send a REST request, the server forgets you, and you send another. </p><p>State is hard.</p><p>The Mainframe world runs on <strong>CICS</strong> (Customer Information Control System). CICS is an application server that manages transactions with <strong>ACID</strong> properties (Atomicity, Consistency, Isolation, Durability) as a law of physics.</p><p>Lets take an example of ATM withdrawal</p><ol><li><p>Check Balance.</p></li><li><p>Debit Ledger.</p></li><li><p>Dispense Cash.</p></li><li><p>Log Audit Trail.</p></li></ol><p>In CICS, if step 3 fails (the cash jams), the entire transaction rolls back instantly. The ledger is never touched. </p><p>The state remains consistent. </p><h3>The Microservices Nightmare</h3><p>In a distributed microservices architecture, you break these steps into different services.</p><ul><li><p>Service A (Ledger) debits the account.</p></li><li><p>Service B (ATM) fails to dispense.</p></li><li><p>Now Service A must &#8220;compensate&#8221; (undo) the transaction.</p></li></ul><p>You have moved from immediate consistency to <strong>Eventual Consistency</strong>. </p><p>You are now managing &#8220;Distributed Transactions&#8221; and &#8220;Sagas.&#8221;</p><p>So question to you is, do you want your checking account balance to be &#8220;Eventually Consistent&#8221;? </p><p>Or do you want it to be Correct?</p><h2>Scale Up vs. Scale Out</h2><p>The philosophy of the modern cloud is <strong>Scale Out</strong>.</p><p><em>&#8220;If the server is overloaded, spin up 100 more cheap nodes. If a node fails, kill it and retry.&#8221;</em></p><p>The philosophy of the Mainframe is <strong>Scale Up</strong>.</p><p><em>&#8220;This single machine will process everything. It will not fail. If a CPU dies, a backup CPU takes over without the operating system even noticing.&#8221;</em></p><p>Mainframes utilize specialized <strong>I/O Processors</strong> (Channel Subsystems). </p><p>The main CPU doesn&#8217;t waste time reading from a disk or talking to the network card. It delegates that to a sub-processor and keeps crunching numbers. This allows mainframes to run at 100% CPU utilization for years without throttling. </p><p>Try running a Linux server at 100% CPU for an hour, it will become unresponsive.</p><p>Finally, the verdict is</p><ul><li><p>For Twitter, Scale Out. If a tweet fails to load, nobody loses money.</p></li><li><p>For the Global Economy, Scale Up. Reliability is not optional.</p></li></ul><h2>Why this matters to You?</h2><p>Even if you never touch a line of COBOL, the principles of the Mainframe apply to your modern stack.</p><h3>Never Use Floats for Money</h3><p>If you are building a FinTech app in JavaScript or Python, do not use standard number types for currency.</p><p><code>const price = 19.99; // </code>Is Wrong</p><p>Use libraries like <code>decimal.js</code>, Python&#8217;s <code>decimal</code> module, or store values as Integers (cents) and format them only for display </p><p>(<code>const priceInCents = 1999;</code>)</p><h3>Respect the Monolith</h3><p>We have been trained to think &#8220;Microservices = Good&#8221; and &#8220;Monolith = Bad.&#8221;</p><p>But if your application requires strict ACID compliance (inventory management, voting systems, banking), a well-structured Monolith with a single database transaction is infinitely less buggy than a distributed system trying to coordinate state across ten services.</p><h3>&#8220;Legacy&#8221; is a Success Metric</h3><p>Code becomes &#8220;legacy&#8221; only if it survives. </p><p>If you are looking at a system that has been running for 30 years, do not mock it. </p><p>Learn from it. It has survived market crashes, leap years, and user stupidity for decades. </p><p>It is doing something right.</p><div><hr></div><h2>Conclusion</h2><p>Rewriting a Core Banking System is rarely a &#8220;refactoring&#8221; effort. It is an archaeological excavation.</p><p>That &#8220;ugly&#8221; COBOL code contains 40 years of edge cases, the tax law change of 1992, the negative interest rate handling of 2015, the specific rounding rule required by the Bank of Japan.</p><p>If you rewrite it, you will miss these rules. </p><p>You will introduce bugs that were solved in 1985.</p><p>Don&#8217;t replace the Mainframe. Modernize it.</p><p>Wrap the COBOL logic in REST APIs (using Z/OS Connect). </p><p>Let the Java frontend look pretty, but let the Iron down in the basement handle the math.</p><p>Respect the Old Gods. </p><p>They are still holding up the sky.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading BinaryBox! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[Thought - Why Abstract Syntax Tree (AST) makes sense for AI Code Migration]]></title><description><![CDATA[Large Language Models are probabilistic text generators. They are not compilers. They do not possess an underlying, deterministic model of the code they are ingesting.]]></description><link>https://www.binarybox.org/p/thought-why-abstract-syntax-tree</link><guid isPermaLink="false">https://www.binarybox.org/p/thought-why-abstract-syntax-tree</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Tue, 10 Mar 2026 06:01:04 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!kF3a!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba79a375-7367-4eff-8668-f2f8ca435fcf_1001x489.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!kF3a!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba79a375-7367-4eff-8668-f2f8ca435fcf_1001x489.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!kF3a!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba79a375-7367-4eff-8668-f2f8ca435fcf_1001x489.jpeg 424w, https://substackcdn.com/image/fetch/$s_!kF3a!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba79a375-7367-4eff-8668-f2f8ca435fcf_1001x489.jpeg 848w, https://substackcdn.com/image/fetch/$s_!kF3a!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba79a375-7367-4eff-8668-f2f8ca435fcf_1001x489.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!kF3a!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba79a375-7367-4eff-8668-f2f8ca435fcf_1001x489.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!kF3a!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba79a375-7367-4eff-8668-f2f8ca435fcf_1001x489.jpeg" width="1001" height="489" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ba79a375-7367-4eff-8668-f2f8ca435fcf_1001x489.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:489,&quot;width&quot;:1001,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:92486,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!kF3a!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba79a375-7367-4eff-8668-f2f8ca435fcf_1001x489.jpeg 424w, https://substackcdn.com/image/fetch/$s_!kF3a!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba79a375-7367-4eff-8668-f2f8ca435fcf_1001x489.jpeg 848w, https://substackcdn.com/image/fetch/$s_!kF3a!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba79a375-7367-4eff-8668-f2f8ca435fcf_1001x489.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!kF3a!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba79a375-7367-4eff-8668-f2f8ca435fcf_1001x489.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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>Right now, in boardrooms and daily stand-ups across the world, executives are signing off on millions for &#8220;AI Modernization,&#8221; while engineers are blindly feeding legacy scripts into ChatGPT to refactor core business logic. </p><p>The pitch is intoxicatingly simple, take a 10,000-line C++ monolith, paste it into an LLM window, and ask it to output pristine, idiomatic Python, Go or Rust microservices.</p><p>This is not engineering. This is reckless gambling.</p><p>The fundamental flaw in this strategy, whether you are a VP buying an enterprise AI tool or a Senior Engineer writing a migration script, is a misunderstanding of what an LLM actually is. </p><p>Large Language Models are probabilistic text generators. They are not compilers. They do not possess an underlying, deterministic model of the code they are ingesting. They do not mathematically understand state mutation, variable shadowing, or lexical scope. </p><p>They simply predict the next most likely token based on latent space vectors.</p><p>An LLM might translate a complex legacy <code>while</code> loop correctly 99 times. But on the 100th time, distracted by a weirdly named variable or an obscure GOTO statement, it will silently hallucinate. It will drop a crucial state mutation. It will misinterpret the lexical scope of a nested variable.</p><p>When you are migrating a critical system such as, a core banking ledger or a flight control system, a 99% success rate is another term for a catastrophic production outage.</p><p>Let&#8217;s look at an example of how a pure LLM migration breaks. </p><p>Smart LLMs rarely make basic syntax errors anymore, instead, they make <strong>semantic errors</strong> by translating text perfectly while fundamentally changing how the computer manages memory which we will see in the example below</p><p>Imagine a pricing calculation in legacy C++ using a <code>struct</code>. By default, C++ passes structs by <em>value</em> (meaning it creates a safe copy).</p><pre><code><code>struct Trade { 
    double price; 
};

// Passed by VALUE. Modifies a local copy for a "what-if" simulation.
void simulateDiscount(Trade t) { 
    t.price *= 0.9; 
    logSimulation("Discounted price would be: ", t.price);
}

// ... elsewhere in the system ...
Trade myTrade = { 100.0 };
simulateDiscount(myTrade);

// myTrade.price is STILL 100.0 here. The original is safely untouched.
processPayment(myTrade); // Processes the actual, full price.</code></code></pre><p>An engineer pastes this into an LLM and asks for an &#8220;idiomatic Python&#8221; translation. The LLM confidently spits out beautifully formatted Python</p><pre><code><code>class Trade:
    def __init__(self, price: float):
        self.price = price

# Passed by REFERENCE. Modifies the original object!
def simulate_discount(t: Trade):
    t.price *= 0.9
    log_simulation("Discounted price would be: ", t.price)

# ... elsewhere in the system ...
my_trade = Trade(100.0)
simulate_discount(my_trade)

# my_trade.price is now 90.0! 
process_payment(my_trade) 
# You just undercharged the client by 10% because of a simulation!</code></code></pre><p>The LLM got a 100% on the syntax. The code is highly readable. </p><p><strong>But it completely corrupted your ledger.</strong> </p><p>The LLM didn&#8217;t know <em>why</em> this was wrong because it doesn&#8217;t build a memory execution graph. It mapped a C++ function signature to a Python function signature. It completely failed to realize it just changed a safe, immutable pass-by-value operation into a highly destructive pass-by-reference mutation.</p><h2>Why AST matters</h2><p>To translate code safely, we have to return to Computer Science 101. </p><p>Code is not text. Treating code as a string of characters is the original issue of pure-LLM migration.</p><p>Code is a tree. Specifically, it is an <strong>Abstract Syntax Tree (AST)</strong>.</p><p>When a traditional compiler reads your code, the very first thing it does is strip away the formatting, the whitespace, and the text, converting the logic into a strict, hierarchical graph of nodes and edges.</p><p>If we parse our legacy C++ <code>simulateDiscount(Trade t)</code> function into an AST, the parser generates a structural map that looks something like this</p><pre><code><code>{
  "node_type": "FunctionDeclaration",
  "identifier": "simulateDiscount",
  "parameters": [
    {
      "node_type": "Parameter",
      "identifier": "t",
      "data_type": "Trade",
      "memory_model": "PASS_BY_VALUE" // &lt;-- The Lifesaver
    }
  ],
  "body": [ ... ]
}</code></code></pre><p>Notice the <code>memory_model</code> metadata. </p><p>The AST isn&#8217;t guessing based on text patterns, it mathematically <em>knows</em> that this specific C++ language construct creates a local copy.</p><p>When an AST-driven migration maps this to Python, it compares the source memory model (<code>PASS_BY_VALUE</code>) to the target language&#8217;s default memory model (in Python, objects are passed by reference).</p><p>Because it detects this mismatch, the structural translation engine intervenes <em>before</em> the LLM can make a mistake. </p><p>It physically forces a constraint into the generated Python code to preserve the semantic contract of the original architecture. </p><p>The resulting code structurally generated by the tool will look like this</p><pre><code><code>import copy

def simulate_discount(t: Trade):
    # AST-enforced safety boundary to preserve C++ pass-by-value
    t_local = copy.copy(t) 
    t_local.price *= 0.9
    log_simulation("Discounted price would be: ", t_local.price)</code></code></pre><p>A pure LLM drops the constraint because it just sees words. </p><p>An AST preserves the constraint because it enforces mathematical logic. </p><p>Probabilistic models guess. ASTs prove.</p><h2>The Hybrid approach</h2><p>If pure LLMs are dangerous, and pure AST translation (source-to-source compilers/transpilers) produces ugly, unmaintainable &#8220;machine code,&#8221; what is the solution?</p><p>If you are building an enterprise-grade migration tool, like the local AI agent architectures we build at BinaryBox, you must use a hybrid pipeline. You do not ask the AI to write code from scratch. You force it to operate within a deterministic pipeline</p><h3>Parse</h3><p>Use a traditional, deterministic parser (like Tree-sitter) to generate the AST of the legacy C++, or Java codebase. </p><p>This locks the exact structure, memory model, and control flow into a mathematical graph.</p><h3>Analyze</h3><p>Pass specific, isolated subtrees of the AST to the LLM. </p><p>Instead of asking the AI to &#8220;rewrite this file,&#8221; you ask it to identify <em>intent</em>.</p><p> <em>&#8220;Analyze this AST node block. Is this an implementation of a bubble sort? Is this a deprecated synchronous network call?&#8221;</em></p><h3>Generate</h3><p>Use the AST to deterministically generate the new syntax, utilizing the LLM only to provide modern idiomatic mapping. </p><p>As shown above, if the AST dictates a pass-by-value parameter, the LLM is constrained to generating code that enforces a clone or copy in the target language.</p><p>The AST guarantees the <em>structure</em>. The AI translates the <em>semantics</em>.</p><h2>Why you should care?</h2><p>Why does this architectural distinction matter to a CTO? </p><p>Because of QA costs.</p><p>If you use a pure LLM to translate a 500,000-line monolith, you cannot trust the output. </p><p>Because the system is probabilistic, human Senior Engineers must manually read, verify, and test <em>every single line</em> of the generated code to ensure no silent bugs were introduced.</p><p>The time and salary cost of having a Principal Engineer QA 500,000 lines of AI-generated spaghetti is often <em>higher</em> than the cost of having them rewrite it by hand. </p><p>The ROI of the migration drops to zero.</p><p>An AST+AI hybrid approach mathematically guarantees structural equivalence. </p><p>If the AST parser proves that all control flows and state mutations have been preserved in the new language, your engineers do not need to read every line. </p><p>They only need to review the architectural patterns and idiomatic choices.</p><p>You eliminate the operational risk of silent logic drops, and you cut the migration timeline from years to months.</p><div><hr></div><h2>Conclusion</h2><p>There is a recurring theme in resilient system design, <strong>Architecture requires constraints.</strong></p><p>We saw this in the Editor Wars. Atom gave developers total freedom to touch the DOM, resulting in chaotic performance. VS Code built a strict Extension Host, a structural prison that constrained plugins and guaranteed a flawless user experience.</p><p>AI agents are no different. If you give an LLM the freedom to write whatever text it wants, it will eventually write a bug that bankrupts your company.</p><p>To do a reliable AI code migration, you must build a structural prison. </p><p>The Abstract Syntax Tree (AST) is that prison. You lock the LLM inside the boundaries of the AST, forcing it to translate node-by-node, bounded by the laws of lexical scope, memory models, and control flow.</p><p>Freedom is chaos. Constraints are reliability. </p><p>Stop trying to use a magic wand, and start building a compiler.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading BinaryBox! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[Deep Dive - How Kafka hit 1 Million write per second on a $40 HDD]]></title><description><![CDATA[Not NVMe. Not even SATA SSDs. Actual magnetic platters with mechanical arms. The kind of physical, spinning rust drives you can buy for $40 at Amazon.]]></description><link>https://www.binarybox.org/p/deep-dive-how-kafka-hit-1-million</link><guid isPermaLink="false">https://www.binarybox.org/p/deep-dive-how-kafka-hit-1-million</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Thu, 05 Mar 2026 06:01:47 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!uE17!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a5fb744-89e6-4560-80d1-bebb8f74af95_1200x628.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!uE17!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a5fb744-89e6-4560-80d1-bebb8f74af95_1200x628.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!uE17!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a5fb744-89e6-4560-80d1-bebb8f74af95_1200x628.jpeg 424w, https://substackcdn.com/image/fetch/$s_!uE17!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a5fb744-89e6-4560-80d1-bebb8f74af95_1200x628.jpeg 848w, https://substackcdn.com/image/fetch/$s_!uE17!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a5fb744-89e6-4560-80d1-bebb8f74af95_1200x628.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!uE17!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a5fb744-89e6-4560-80d1-bebb8f74af95_1200x628.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!uE17!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a5fb744-89e6-4560-80d1-bebb8f74af95_1200x628.jpeg" width="1200" height="628" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9a5fb744-89e6-4560-80d1-bebb8f74af95_1200x628.jpeg&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;:null,&quot;alt&quot;:&quot;A Guide to Setup a Kafka Environment | Mitrais&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="A Guide to Setup a Kafka Environment | Mitrais" title="A Guide to Setup a Kafka Environment | Mitrais" srcset="https://substackcdn.com/image/fetch/$s_!uE17!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a5fb744-89e6-4560-80d1-bebb8f74af95_1200x628.jpeg 424w, https://substackcdn.com/image/fetch/$s_!uE17!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a5fb744-89e6-4560-80d1-bebb8f74af95_1200x628.jpeg 848w, https://substackcdn.com/image/fetch/$s_!uE17!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a5fb744-89e6-4560-80d1-bebb8f74af95_1200x628.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!uE17!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a5fb744-89e6-4560-80d1-bebb8f74af95_1200x628.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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 previous Deep Dive, I tried to write 1,000,000 records per second to PostgreSQL running on an AWS c8g.48xlarge instance backed by Provisioned IOPS SSDs (io2 Block Express).</p><p>The database locked up. The queue depth exploded. The disk, a $30,000/month NVMe SSD simply couldn&#8217;t physically accept the write signals fast enough. </p><p>We had to abandon persistent storage entirely and switch to a Redis cluster. </p><p>We traded durability for speed, accepting that a power failure would vaporize millions of transactions in an instant.</p><p>But here&#8217;s the part that breaks most engineers&#8217; mental models</p><p><strong>Apache Kafka handles 1 million writes per second on cheap, spinning hard drives. </strong></p><p>Not NVMe. Not even SATA SSDs. Actual magnetic platters with mechanical arms. The kind of physical, spinning rust drives you can buy for $40 at Amazon.</p><p>How is this possible?</p><p>The answer isn&#8217;t &#8220;Kafka is written in a faster language&#8221; (it runs on the JVM, which is notoriously heavy). </p><p>The answer isn&#8217;t &#8220;Kafka uses better compression.&#8221;</p><p>The answer is physics.</p><p>Kafka doesn&#8217;t fight the hard drive. It exploits it. This is the story of how Kafka &#8220;cheats&#8221; by respecting the fundamental constraints of hardware, while traditional databases try to bend reality and lose.</p><h2>RAM is Fast, Disk is Slow?</h2><p>Every engineer &#8220;knows&#8221; RAM is faster than disk. But at scale, throughput beats latency. Sequential disk can outrun random RAM.</p><p>Let&#8217;s challenge the conventional wisdom directly. We are all taught these standard latency numbers</p><ul><li><p><strong>RAM</strong> ~100 nanoseconds access time</p></li><li><p><strong>SSD</strong> ~100 microseconds access time (1,000x slower)</p></li><li><p><strong>HDD</strong> ~10 milliseconds access time (100,000x slower)</p></li></ul><p>These numbers are factually correct. But for high-throughput workloads, they are completely irrelevant. The missing context in that table is <strong>Random vs. Sequential I/O</strong>.</p><p>Those latency numbers assume random access, your application is jumping to arbitrary memory addresses or disk sectors. </p><p>But when you switch to sequential access, the story completely flips.</p><p>Let&#8217;s look at Sequential Read/Write Throughput</p><ul><li><p><strong>RAM (DDR4)</strong> ~20-50 GB/sec</p></li><li><p><strong>NVMe SSD</strong> ~3-7 GB/sec</p></li><li><p><strong>SATA SSD</strong> ~500 MB/sec</p></li><li><p><strong>7200 RPM HDD </strong>~200 MB/sec</p></li></ul><p>Here is the key insight. </p><p>A standard, cheap hard drive doing pure sequential I/O can easily saturate a 1 Gbps network link. If your system bottleneck is network throughput (which it absolutely is at 1,000,000 requests per second), the magnetic disk is actually fast enough.</p><p>Let&#8217;s look at the real comparison between our failed experiment and Kafka&#8217;s architecture.</p><h3>Postgres doing 1M random inserts</h3><p>Each insert updates multiple B-Tree indexes. Each index update requires seeking to a random page on the disk. Even on an enterprise SSD, a random seek takes ~100 microseconds. </p><p><code>1,000,000 random seeks &#215; 100 microseconds = 100 seconds of pure seek time. </code></p><p>It is mathematically impossible to process that in one second.</p><h3>Kafka doing 1M sequential appends</h3><p>Kafka writes to the end of a log file. There is no seeking. A modern hard drive sequentially writes at ~200 MB/sec.</p><p><code>1,000,000 writes &#215; 1KB each = 1 GB.</code></p><p>At sequential speeds, that takes roughly <strong>5 seconds</strong> on a single cheap disk, and is trivially parallelized across 5-10 disks in a JBOD (Just a Bunch of Disks) configuration to handle it in 1 second.</p><p>The lesson here. Sequential disk beats random RAM when throughput matters more than latency. </p><p>This is why Kafka doesn&#8217;t need NVMe. It just needs sequential access patterns.</p><blockquote><p>What&#8217;s the throughput of your production database doing sequential scans vs. indexed lookups? If you don&#8217;t know, you&#8217;re optimizing blind.</p></blockquote><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zkN9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb96c0252-3b11-400a-b5c5-9709772792bc_2816x1536.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zkN9!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb96c0252-3b11-400a-b5c5-9709772792bc_2816x1536.png 424w, https://substackcdn.com/image/fetch/$s_!zkN9!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb96c0252-3b11-400a-b5c5-9709772792bc_2816x1536.png 848w, https://substackcdn.com/image/fetch/$s_!zkN9!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb96c0252-3b11-400a-b5c5-9709772792bc_2816x1536.png 1272w, https://substackcdn.com/image/fetch/$s_!zkN9!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb96c0252-3b11-400a-b5c5-9709772792bc_2816x1536.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zkN9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb96c0252-3b11-400a-b5c5-9709772792bc_2816x1536.png" width="1456" height="794" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b96c0252-3b11-400a-b5c5-9709772792bc_2816x1536.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:794,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:7498061,&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.binarybox.org/i/189540105?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb96c0252-3b11-400a-b5c5-9709772792bc_2816x1536.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_!zkN9!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb96c0252-3b11-400a-b5c5-9709772792bc_2816x1536.png 424w, https://substackcdn.com/image/fetch/$s_!zkN9!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb96c0252-3b11-400a-b5c5-9709772792bc_2816x1536.png 848w, https://substackcdn.com/image/fetch/$s_!zkN9!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb96c0252-3b11-400a-b5c5-9709772792bc_2816x1536.png 1272w, https://substackcdn.com/image/fetch/$s_!zkN9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb96c0252-3b11-400a-b5c5-9709772792bc_2816x1536.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>How Kafka Enforces Sequential I/O</h2><p>Unlike relational databases, which rely heavily on B-Trees to enable fast random lookups, Kafka is built around a single, aggressively simple data structure. <strong>The Commit Log</strong>.</p><p>When a message arrives at a Kafka broker, the system does exactly one thing, it appends the message to the end of the current log segment (a raw file on disk).</p><ul><li><p>It never updates existing entries.</p></li><li><p>It never seeks backward to modify a state.</p></li><li><p>It writes in large batches (saving multiple messages in a single system call).</p></li></ul><p>Why does this work so perfectly?</p><p>Hard drives have a mechanical read/write head. To read or write data, that head must physically move across the platter to find the correct sector. </p><p>This is why random I/O is so devastatingly slow, the mechanical arm is constantly repositioning. It is physically vibrating.</p><p>But when you strictly append to the end of a file, the head drops into position and stays there. The disk controller can stop worrying about seek times and optimize entirely for pure throughput. </p><p>You are essentially turning a hard drive into a firehose.</p><p>If you add batching, writing 100 messages per <code>write()</code> syscall instead of 1, you reduce the CPU context-switch overhead by 100x while keeping the disk arm perfectly still.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!CKxA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc022f59d-3413-46ca-88f3-434a6bb7819e_2816x1536.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!CKxA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc022f59d-3413-46ca-88f3-434a6bb7819e_2816x1536.png 424w, https://substackcdn.com/image/fetch/$s_!CKxA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc022f59d-3413-46ca-88f3-434a6bb7819e_2816x1536.png 848w, https://substackcdn.com/image/fetch/$s_!CKxA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc022f59d-3413-46ca-88f3-434a6bb7819e_2816x1536.png 1272w, https://substackcdn.com/image/fetch/$s_!CKxA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc022f59d-3413-46ca-88f3-434a6bb7819e_2816x1536.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!CKxA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc022f59d-3413-46ca-88f3-434a6bb7819e_2816x1536.png" width="1456" height="794" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c022f59d-3413-46ca-88f3-434a6bb7819e_2816x1536.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:794,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:8293945,&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.binarybox.org/i/189540105?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc022f59d-3413-46ca-88f3-434a6bb7819e_2816x1536.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_!CKxA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc022f59d-3413-46ca-88f3-434a6bb7819e_2816x1536.png 424w, https://substackcdn.com/image/fetch/$s_!CKxA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc022f59d-3413-46ca-88f3-434a6bb7819e_2816x1536.png 848w, https://substackcdn.com/image/fetch/$s_!CKxA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc022f59d-3413-46ca-88f3-434a6bb7819e_2816x1536.png 1272w, https://substackcdn.com/image/fetch/$s_!CKxA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc022f59d-3413-46ca-88f3-434a6bb7819e_2816x1536.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3>The Trade-off Kafka Makes</h3><p>Databases optimize for flexibility, random access (<em>give me record ID 47293</em>), updates in place (<em>change this user&#8217;s email</em>), and complex queries (<em>JOIN across three tables</em>).</p><p>Kafka completely abandons this. It optimizes strictly for append-only writes (<em>add this event</em>), sequential reads (<em>replay messages in order</em>), and time-based queries (<em>give me all events from 2:00 PM</em>).</p><p>This is a conscious architectural choice, not magic. By refusing to support random updates, Kafka gets to use the fastest possible I/O pattern the hardware offers.</p><p>Look at Netflix. They log every single user interaction (play, pause, seek, stop) to Kafka. At peak, that is hundreds of thousands of events per second from millions of concurrent users. </p><p>Netflix doesn&#8217;t need to query &#8220;what did user X do exactly 4 seconds ago?&#8221; in real-time. They need to capture the firehose of data and process it asynchronously. </p><p>A B-Tree database would collapse under that write load. Kafka&#8217;s append-only log absorbs it effortlessly.</p><blockquote><p><strong>Look at your highest-volume write workload.</strong> </p><p>Is it actually appending events, or are you using INSERT/UPDATE simply because &#8220;that&#8217;s what databases do&#8221;?</p></blockquote><h2>Kafka Doesn&#8217;t Manage Memory</h2><p>If you write a standard application that interacts with a disk and a network, your data flow generally looks like this</p><ol><li><p>Read data from disk into a kernel buffer.</p></li><li><p>Copy data from the kernel buffer to application memory (like the JVM heap).</p></li><li><p>Process the data.</p></li><li><p>Copy data from application memory back to a kernel socket buffer.</p></li><li><p>Write to the network socket.</p></li></ol><p>At extreme throughput, this standard pattern creates two massive system bottlenecks.</p><h4>1. Garbage Collection Death</h4><p>Every message object allocated in the JVM heap must eventually be garbage collected. </p><p>If you are pushing 1,000,000 messages per second through application memory, the Garbage Collector cannot keep up. </p><p>You will experience massive &#8220;stop-the-world&#8221; pauses that instantly kill your throughput and trigger network timeouts.</p><h4>2. Double Buffering</h4><p>Your data exists in two places at once, kernel memory (the OS page cache) and application memory (the JVM heap). </p><p>You are wasting RAM, and more importantly, you are wasting CPU cycles copying the exact same bytes back and forth between user space and kernel space.</p><h3>Kafka&#8217;s Solution</h3><p><strong>Bypass Application Memory Entirely.</strong></p><p>Kafka does not attempt to manage a complex internal buffer pool. It relies entirely on the Linux OS Page Cache.</p><p>When Kafka writes a message, it calls <code>write()</code> to append to the log file. The OS buffers this write in the page cache in RAM. Kafka immediately returns a success acknowledgment to the producer. </p><p>The Linux kernel flushes that page cache to the physical disk asynchronously in the background.</p><p>When Kafka reads a message, the OS loads the file into the page cache. Kafka references the page cache directly. The message data is never copied into the JVM heap. Therefore, there is no garbage collection penalty.</p><p>Modern operating systems are ruthlessly efficient at managing file caches. Linux will gladly use 100% of your free RAM as a page cache. Kafka doesn&#8217;t try to outsmart the OS, it defers to the kernel.</p><p>The practical result? </p><p>A Kafka broker with 64 GB of RAM effectively has ~4 GB dedicated to the JVM heap (which is tiny), and ~60 GB dedicated to the OS page cache. </p><p>Consumers reading recent data get RAM-speed access because the OS serves it directly from the cache. Older messages fall out of cache and are read from disk, but because it&#8217;s sequential, it remains incredibly fast.</p><p>Postgres must manage its own complex buffer pool because it supports random updates, ACID transactions, and row-level locking. </p><p>Kafka can rely entirely on the OS because it only does sequential access.</p><h2>Zero-Copy</h2><p>This brings us to the centerpiece of Kafka&#8217;s architecture.</p><p>The fastest code is the code that never runs. Zero-Copy means the CPU doesn&#8217;t touch your data. </p><p>That&#8217;s why it&#8217;s fast.</p><h3>The Traditional Data Path (4 Copies)</h3><p>When a consumer requests a batch of messages from Kafka, a naive implementation would execute the following path</p><ol><li><p><strong>Disk &#8594; Kernel Buffer -</strong> Via DMA - Direct Memory Access. Hardware does the work.</p></li><li><p><strong>Kernel Buffer &#8594; Application Buffer -</strong> CPU copies data from kernel space into the Kafka JVM heap.</p></li><li><p><strong>Application Buffer &#8594; Socket Buffer -</strong> CPU copies data from the JVM back to the kernel network stack.</p></li><li><p><strong>Socket Buffer &#8594; NIC -</strong> Via DMA to the Network Interface Card.</p></li></ol><p>At each copy boundary, you suffer. CPU cycles are wasted. You force expensive context switches between user space and kernel space. You pollute the CPU L1/L2 caches, evicting hot application state just to make room for transient message bytes that are passing through.</p><p>At scale, serving 1,000,000 messages/sec means copying 1 GB/sec <em>four times</em>. That is 4 GB/sec of memory bandwidth consumed just moving the exact same bytes around the motherboard. </p><p>On our massive c8g.48xlarge server, the CPU would be saturated just copying data, doing absolutely zero actual processing.</p><h3>The Zero-Copy Solution</h3><p><code>sendfile() </code>Linux provides the <code>sendfile()</code> syscall (and its cousin <code>splice()</code>) to solve this exact bottleneck.</p><pre><code><code>// Traditional approach (CPU intensive)
read(file_fd, buffer, size);           // Copy from kernel to app
write(socket_fd, buffer, size);        // Copy from app to kernel

// Zero-copy approach (Hardware accelerated)
sendfile(socket_fd, file_fd, offset, size);  // Copy directly kernel-to-kernel</code></code></pre><p>What actually happens under the hood when Kafka uses zero-copy?</p><ol><li><p><strong>Disk &#8594; Kernel Page Cache - </strong>DMA read.</p></li><li><p><strong>Page Cache &#8594; Socket Buffer - </strong> A kernel-to-kernel copy. <strong>User-space is completely bypassed.</strong></p></li><li><p><strong>Socket Buffer &#8594; NIC - </strong>DMA write.</p></li></ol><p>The message data <em>never enters Kafka&#8217;s application memory</em>. Kafka simply issues a command to the Linux kernel, </p><p><em>&#8220;Take 500 bytes from file descriptor Z at offset X, and stream them directly into network socket W.&#8221;</em></p><p>The kernel and the DMA controllers handle everything.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!o_bS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc94f8fe4-dad4-4a4e-a2aa-398897675231_2816x1536.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!o_bS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc94f8fe4-dad4-4a4e-a2aa-398897675231_2816x1536.png 424w, https://substackcdn.com/image/fetch/$s_!o_bS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc94f8fe4-dad4-4a4e-a2aa-398897675231_2816x1536.png 848w, https://substackcdn.com/image/fetch/$s_!o_bS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc94f8fe4-dad4-4a4e-a2aa-398897675231_2816x1536.png 1272w, https://substackcdn.com/image/fetch/$s_!o_bS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc94f8fe4-dad4-4a4e-a2aa-398897675231_2816x1536.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!o_bS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc94f8fe4-dad4-4a4e-a2aa-398897675231_2816x1536.png" width="1456" height="794" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c94f8fe4-dad4-4a4e-a2aa-398897675231_2816x1536.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:794,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:7118821,&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.binarybox.org/i/189540105?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc94f8fe4-dad4-4a4e-a2aa-398897675231_2816x1536.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!o_bS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc94f8fe4-dad4-4a4e-a2aa-398897675231_2816x1536.png 424w, https://substackcdn.com/image/fetch/$s_!o_bS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc94f8fe4-dad4-4a4e-a2aa-398897675231_2816x1536.png 848w, https://substackcdn.com/image/fetch/$s_!o_bS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc94f8fe4-dad4-4a4e-a2aa-398897675231_2816x1536.png 1272w, https://substackcdn.com/image/fetch/$s_!o_bS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc94f8fe4-dad4-4a4e-a2aa-398897675231_2816x1536.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>Instead of 4 copies, you get 2 copies (and both are heavily hardware-accelerated). Instead of 4 expensive context switches, you get 1. Instead of thrashing the CPU cache, you keep it pristine for actual orchestration logic.</p><p><strong><a href="https://www.linkedin.com/blog/engineering/open-source/benchmarking-apache-kafka-2-million-writes-second-three-cheap-machines">LinkedIn engineering published benchmarks</a></strong> demonstrating that zero-copy improves Kafka&#8217;s throughput by 2-3x for consumer reads. At 1M messages/sec, that is the literal difference between needing a cluster of 3 massive servers versus 1 server.</p><h4>Why traditional message queues can&#8217;t do this</h4><p>RabbitMQ, ActiveMQ, and traditional enterprise queues usually transform messages (adding headers, parsing routing keys), encrypt payloads in the application layer, or apply middleware. </p><p>All of these actions require the message to be pulled into application memory so the CPU can inspect and alter the bytes.</p><p>Kafka&#8217;s messages are opaque byte arrays. Kafka does not parse them, it does not transform them, and it does not care about their contents. </p><p>This architectural constraint allows Kafka to use zero-copy. The broker is just a dumb, incredibly fast pipe moving bytes from a disk to a network card.</p><blockquote><p><strong>How many times is your data copied between receiving it and sending it?</strong> Every single copy is CPU waste you are paying for on your AWS bill.</p></blockquote><h2>When to Use This Pattern</h2><p>Understanding how Kafka works is only half the battle. You need to know when to apply these principles, append-only logs and zero-copy transfers to your own systems.</p><h3>This pattern WORKS when</h3><h4>Write-heavy, read-sequential workloads</h4><p>Event logging, audit trails, analytics ingestion pipelines, and background job queues.</p><h4>Messages are opaque blobs</h4><p>You don&#8217;t need the broker to parse, transform, or route based on content. Consumers handle the deserialization.</p><h4>Recent data is hot, old data is cold</h4><p>99% of your reads are for data written in the last few minutes (guaranteeing a page cache hit). Occasional historical reads (requiring a disk seek) are acceptable.</p><h4>Durability matters, but immediate consistency does not</h4><p>Relying on the OS page cache flush (write-behind caching) is &#8220;good enough,&#8221; and you don&#8217;t need to force an <code>fsync()</code> to the physical platter on every single write.</p><h3>This pattern DOES NOT work when</h3><h4>Random access queries</h4><p>&#8220;Give me user 47293&#8217;s profile.&#8221; (Use a traditional database).</p><h4>Low-latency single-message processing</h4><p>If you need sub-millisecond latency per message, Kafka isn&#8217;t the tool. Zero-copy optimizes for massive batch throughput, not single-message latency.</p><h4>Message transformation in the broker</h4><p>If your broker must decrypt, dynamically route, or mutate messages, you cannot use zero-copy because you must pull the data into application memory.</p><p>Before reaching for Postgres, Redis, or MongoDB for a high-volume endpoint, ask yourself</p><p><em>&#8220;Am I appending events, or am I updating records?&#8221;</em> </p><p>If your workload is append-mostly and sequential-read, you are leaving 10x performance on the table by using a general-purpose B-Tree database.</p><p>Consider Kafka for event streams, ClickHouse for analytics, or InfluxDB for time-series metrics. </p><p>All of them use append-only logs. All of them respect sequential I/O.</p><div><hr></div><h2>Conclusion</h2><p>In my 1M RPS test, Postgres failed not because it was poorly designed, but because it was designed for a entirely different problem space.</p><p>Postgres optimizes for maximum flexibility, random updates, complex queries, and strict ACID guarantees. To deliver this flexibility, it must use B-Trees, endure random I/O, and manage its own application buffers.</p><p>Kafka optimizes for maximum throughput, append-only writes, sequential reads, and eventual consistency. To deliver this throughput, it uses commit logs, demands sequential I/O, and relies entirely on kernel-managed caching.</p><p>Neither system is &#8220;better.&#8221; They solve different physical problems.</p><p>The lesson here isn&#8217;t &#8220;use Kafka instead of Postgres.&#8221; </p><p>The lesson is, <strong>understand the physics of your hardware, and then choose the data structure that ruthlessly exploits it.</strong></p><p>Sequential disk is faster than random RAM. Zero-copy is faster than application processing. The Linux OS page cache is smarter than your hand-rolled buffer pool.</p><p>Stop fighting the metal. Start respecting it. When you align your architecture with the strict constraints of the underlying hardware, you don&#8217;t need to scale out to hundreds of servers. You can handle 1 million writes per second on a $40 hard drive.</p><p>That&#8217;s not magic. That&#8217;s engineering.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading BinaryBox! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[Report - How Andres Freund saves the Internet]]></title><description><![CDATA[The backdoor had been planted over 2.5 years by a nation-state actor who earned the trust of the maintainer, contributed legitimate code, and then injected malware into the build process itself.]]></description><link>https://www.binarybox.org/p/report-how-andres-freund-saves-the</link><guid isPermaLink="false">https://www.binarybox.org/p/report-how-andres-freund-saves-the</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Tue, 03 Mar 2026 06:00:15 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!kGkU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30a0e6ff-c853-47a5-a339-ef93e724660b_1920x1080.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!kGkU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30a0e6ff-c853-47a5-a339-ef93e724660b_1920x1080.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!kGkU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30a0e6ff-c853-47a5-a339-ef93e724660b_1920x1080.png 424w, https://substackcdn.com/image/fetch/$s_!kGkU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30a0e6ff-c853-47a5-a339-ef93e724660b_1920x1080.png 848w, https://substackcdn.com/image/fetch/$s_!kGkU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30a0e6ff-c853-47a5-a339-ef93e724660b_1920x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!kGkU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30a0e6ff-c853-47a5-a339-ef93e724660b_1920x1080.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!kGkU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30a0e6ff-c853-47a5-a339-ef93e724660b_1920x1080.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/30a0e6ff-c853-47a5-a339-ef93e724660b_1920x1080.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2501805,&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.binarybox.org/i/189579121?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30a0e6ff-c853-47a5-a339-ef93e724660b_1920x1080.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_!kGkU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30a0e6ff-c853-47a5-a339-ef93e724660b_1920x1080.png 424w, https://substackcdn.com/image/fetch/$s_!kGkU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30a0e6ff-c853-47a5-a339-ef93e724660b_1920x1080.png 848w, https://substackcdn.com/image/fetch/$s_!kGkU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30a0e6ff-c853-47a5-a339-ef93e724660b_1920x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!kGkU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30a0e6ff-c853-47a5-a339-ef93e724660b_1920x1080.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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>March 2024. <strong><a href="https://www.linkedin.com/in/andres-freund/">Andres Freund</a></strong>, a Microsoft engineer and PostgreSQL developer, is working from home when he notices something odd.</p><p>His SSH logins are taking 500 milliseconds longer than normal.</p><p>Most engineers would ignore this. Network latency. A busy server. Maybe restart the daemon and forget about it.</p><p>Freund didn&#8217;t. He broke out the profiler and debugged it.</p><p>He traced the micro-delay to <code>liblzma</code>. A ubiquitous compression library used by OpenSSH (via systemd). </p><p>He found that recent versions contained a backdoor so sophisticated that it had bypassed</p><ul><li><p>Automated security scanners</p></li><li><p>Code reviews from major Linux distributions</p></li><li><p>Penetration testing</p></li><li><p>Static analysis tools</p></li><li><p>The &#8220;many eyes&#8221; of the open-source community</p></li></ul><p>The backdoor had been planted over 2.5 years by a nation-state actor who earned the trust of the maintainer, contributed legitimate code, and then injected malware into the build process itself.</p><p>If Freund had ignored that 500ms delay, every major Linux distribution would have shipped SSH servers with a pre-installed, pre-authentication remote access backdoor.</p><p>Every CISO in the world relies on million-dollar security budgets, automated scanners, and penetration tests. A backdoor that took 2.5 years to plant was caught by one engineer who thought, &#8220;Huh, that CPU spike is weird.&#8221;</p><p>This is the story of why your security budget missed what one curious engineer caught by accident. And why &#8220;free&#8221; open-source software might be the most expensive dependency in your infrastructure.</p><h2>The Myth</h2><p>Let&#8217;s challenge the core religion of modern software engineering.</p><p>Linus&#8217;s Law states</p><p><em>&#8220;Given enough eyeballs, all bugs are shallow.&#8221;</em> </p><p>This has been gospel in the tech industry for 30 years. It&#8217;s why enterprise companies confidently build trillion-dollar infrastructures on open-source software. </p><p>The assumption is that open source is inherently more secure than proprietary code because anyone can audit it. Bad actors can&#8217;t hide in plain sight when millions of developers are watching.</p><p>Here is the reality of <strong><a href="https://github.com/tukaani-project/xz">XZ Utils</a></strong></p><ul><li><p><strong>Downloads - </strong>1.4 million per day.</p></li><li><p><strong>Usage - </strong>Core dependency for every major Linux distribution (Debian, Ubuntu, Fedora, Red Hat).</p></li><li><p><strong>Criticality - </strong>Required for SSH authentication on virtually every server on the internet.</p></li><li><p><strong>Maintainers -</strong> ONE unpaid volunteer (<strong><a href="https://github.com/Larhzu">Lasse Collin</a></strong>).</p></li><li><p><strong>Annual Budget -</strong> $0.</p></li><li><p><strong>Last Security Audit -</strong> Never.</p></li></ul><p>According to the Open Source Security and Risk Analysis (OSSRA) report, 87% of commercial applications contain open-source components. </p><p>Yet, less than 3% of organizations perform regular security audits of their dependencies, and the average application relies on 500+ transitive dependencies.</p><p>Linus&#8217;s Law assumes the eyes are looking. But nobody audits compression libraries. Nobody reviews arcane build scripts. Nobody sponsors the maintainer working nights and weekends for zero pay.</p><p>Your production infrastructure runs on code that hasn&#8217;t been reviewed since it was written. The &#8220;many eyes&#8221; aren&#8217;t watching. They&#8217;re assuming someone else is. This collective delusion is exactly what made the XZ attack possible.</p><blockquote><p>How many dependencies does your main application have? How many of those have you personally reviewed in the last year? If the answer is &#8216;zero,&#8217; you&#8217;re trusting strangers with your production environment.</p></blockquote><h2>How Jia Tan Bypassed the Eyeballs</h2><p>To understand why your scanners failed, you have to understand the mechanics of the attack. It was a masterpiece of both social and software engineering.</p><h3>Phase 1 - Social Engineering the Maintainer</h3><p>The attack didn&#8217;t start with code. It started with economics.</p><p>Lasse Collin had maintained XZ Utils alone, unpaid, for over 15 years. He had a full-time job. XZ was his nights-and-weekends project. In 2021, a coordinated pressure campaign began. Multiple sock-puppet accounts created hostile issues on the XZ mailing list</p><ul><li><p><em>&#8220;Lasse is unresponsive to patches.&#8221;</em></p></li><li><p><em>&#8220;This project is effectively unmaintained.&#8221;</em></p></li><li><p><em>&#8220;We need new leadership or XZ will die.&#8221;</em></p></li></ul><p>The manufactured urgency worked. Lasse, burnt out and dealing with personal health issues, accepted help.</p><p>Enter &#8220;Jia Tan&#8221;</p><p>A seemingly legitimate open-source contributor who had been making small, helpful commits for months. Jia earned trust slowly. He fixed real bugs. He responded to issues professionally. He became indispensable. After two years of free labor, Lasse granted Jia Tan co-maintainer status and release access.</p><p>The initial vulnerability wasn&#8217;t a buffer overflow. It was the economics. One unpaid volunteer maintaining critical infrastructure for billions of users. The attackers didn&#8217;t need a zero-day. They just needed patience.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-prN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5bd98d1-9989-40d1-9c64-48d97518e226_2816x1536.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-prN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5bd98d1-9989-40d1-9c64-48d97518e226_2816x1536.png 424w, https://substackcdn.com/image/fetch/$s_!-prN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5bd98d1-9989-40d1-9c64-48d97518e226_2816x1536.png 848w, https://substackcdn.com/image/fetch/$s_!-prN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5bd98d1-9989-40d1-9c64-48d97518e226_2816x1536.png 1272w, https://substackcdn.com/image/fetch/$s_!-prN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5bd98d1-9989-40d1-9c64-48d97518e226_2816x1536.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-prN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5bd98d1-9989-40d1-9c64-48d97518e226_2816x1536.png" width="1456" height="794" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d5bd98d1-9989-40d1-9c64-48d97518e226_2816x1536.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:794,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:6972543,&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.binarybox.org/i/189579121?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5bd98d1-9989-40d1-9c64-48d97518e226_2816x1536.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_!-prN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5bd98d1-9989-40d1-9c64-48d97518e226_2816x1536.png 424w, https://substackcdn.com/image/fetch/$s_!-prN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5bd98d1-9989-40d1-9c64-48d97518e226_2816x1536.png 848w, https://substackcdn.com/image/fetch/$s_!-prN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5bd98d1-9989-40d1-9c64-48d97518e226_2816x1536.png 1272w, https://substackcdn.com/image/fetch/$s_!-prN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5bd98d1-9989-40d1-9c64-48d97518e226_2816x1536.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3>Phase 2 - Hiding the Payload</h3><p>Traditional malware injection is obvious: You add malicious code to <code>.c</code> source files. But Jia Tan knew code reviewers read source files. Even casual contributors glance at GitHub diffs.</p><p>Jia Tan&#8217;s solution was brilliant. Don&#8217;t hide the backdoor in the source code. Hide it where nobody looks.</p><p>The payload was concealed inside binary test files, specifically, <code>.xz</code> compressed blobs used for the test suite to verify the compressor was working. Developers assume test data is benign. Nobody reviews binary blobs. The malicious test files sat in the repository for months, completely invisible to the human eye.</p><h3>Phase 3 - Build-Time Injection</h3><p>The source code remained clean. Your Veracode or Snyk scanners found nothing suspicious in the <code>.c</code> files. But Jia Tan heavily obfuscated and modified the build scripts (<code>configure.ac</code> and <code>Makefile.am</code>).</p><p>During the <code>make</code> compilation process on a Debian or RPM build serve</p><ol><li><p>The build script extracted the hidden payload from the binary test files.</p></li><li><p>It decrypted the payload and injected the backdoor directly into the compiled binary (<code>liblzma.so</code>).</p></li></ol><p>The source code <em>never</em> contained the malware, it only existed in the build artifact.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ekmx!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8879f369-88b9-4b9b-8ff9-022839cebc8f_2816x1536.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ekmx!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8879f369-88b9-4b9b-8ff9-022839cebc8f_2816x1536.png 424w, https://substackcdn.com/image/fetch/$s_!ekmx!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8879f369-88b9-4b9b-8ff9-022839cebc8f_2816x1536.png 848w, https://substackcdn.com/image/fetch/$s_!ekmx!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8879f369-88b9-4b9b-8ff9-022839cebc8f_2816x1536.png 1272w, https://substackcdn.com/image/fetch/$s_!ekmx!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8879f369-88b9-4b9b-8ff9-022839cebc8f_2816x1536.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ekmx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8879f369-88b9-4b9b-8ff9-022839cebc8f_2816x1536.png" width="1456" height="794" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8879f369-88b9-4b9b-8ff9-022839cebc8f_2816x1536.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:794,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:8399540,&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.binarybox.org/i/189579121?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8879f369-88b9-4b9b-8ff9-022839cebc8f_2816x1536.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_!ekmx!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8879f369-88b9-4b9b-8ff9-022839cebc8f_2816x1536.png 424w, https://substackcdn.com/image/fetch/$s_!ekmx!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8879f369-88b9-4b9b-8ff9-022839cebc8f_2816x1536.png 848w, https://substackcdn.com/image/fetch/$s_!ekmx!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8879f369-88b9-4b9b-8ff9-022839cebc8f_2816x1536.png 1272w, https://substackcdn.com/image/fetch/$s_!ekmx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8879f369-88b9-4b9b-8ff9-022839cebc8f_2816x1536.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><blockquote><p><strong>Your build process is a black box.</strong> </p><p>You review code, but do you verify the compiled binary matches the source? If not, how would you detect a build-time injection?</p></blockquote><h3>Phase 4 - The IFUNC/GOT Hijacking</h3><p>Once the malicious <code>liblzma.so</code> was loaded into memory by the SSH daemon, it executed a sophisticated Linux exploitation technique</p><p><strong>IFUNC (Indirect Function) Resolvers and GOT (Global Offset Table) Hijacking.</strong></p><p>Linux supports IFUNC, a mechanism where a function&#8217;s implementation is chosen dynamically at runtime based on CPU capabilities (e.g., choosing an AVX-512 optimized version if the hardware supports it). </p><p>The backdoor registered a malicious IFUNC resolver that executed during the dynamic linking phase, <em>before</em> <code>main()</code> even runs.</p><p>This resolver modified the Global Offset Table, replacing the pointer to OpenSSH&#8217;s <code>RSA_public_decrypt()</code> function with a pointer to the attacker&#8217;s own code.</p><p>The backdoor allowed remote code execution using a specific Ed448 cryptographic key controlled by the attacker. No valid SSH credentials were required. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gDY6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7167fb4e-95b2-4eb7-8981-2af07cfc1338_2816x1536.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gDY6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7167fb4e-95b2-4eb7-8981-2af07cfc1338_2816x1536.png 424w, https://substackcdn.com/image/fetch/$s_!gDY6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7167fb4e-95b2-4eb7-8981-2af07cfc1338_2816x1536.png 848w, https://substackcdn.com/image/fetch/$s_!gDY6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7167fb4e-95b2-4eb7-8981-2af07cfc1338_2816x1536.png 1272w, https://substackcdn.com/image/fetch/$s_!gDY6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7167fb4e-95b2-4eb7-8981-2af07cfc1338_2816x1536.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gDY6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7167fb4e-95b2-4eb7-8981-2af07cfc1338_2816x1536.png" width="1456" height="794" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7167fb4e-95b2-4eb7-8981-2af07cfc1338_2816x1536.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:794,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:6868307,&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.binarybox.org/i/189579121?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7167fb4e-95b2-4eb7-8981-2af07cfc1338_2816x1536.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_!gDY6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7167fb4e-95b2-4eb7-8981-2af07cfc1338_2816x1536.png 424w, https://substackcdn.com/image/fetch/$s_!gDY6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7167fb4e-95b2-4eb7-8981-2af07cfc1338_2816x1536.png 848w, https://substackcdn.com/image/fetch/$s_!gDY6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7167fb4e-95b2-4eb7-8981-2af07cfc1338_2816x1536.png 1272w, https://substackcdn.com/image/fetch/$s_!gDY6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7167fb4e-95b2-4eb7-8981-2af07cfc1338_2816x1536.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>It was entirely stealthy, it checked if the process was <code>/usr/sbin/sshd</code> so it wouldn&#8217;t crash normal tarball extractions, and it self-destructed if it detected profiling or debugging tools. (It only failed to hide from Freund&#8217;s profiler because of a tiny CPU cycle overhead bug).</p><p>Modern security assumes you can trust the build process. Code review, static analysis, and fuzzing all operate on source code. </p><p>But if the build itself is compromised, none of that matters. This was an attack on the software supply chain, not the software itself.</p><h2>The Root Cause</h2><p>Let&#8217;s shift from the technical to the economic. The brutal math of open-source maintenance is the actual root cause of CVE-2024-3094.</p><p>Let&#8217;s quantify what Lasse Collin was managing</p><ul><li><p><strong>Impact -</strong> Billions of devices worldwide.</p></li><li><p><strong>Critical dependencies -</strong> OpenSSH, systemd, dpkg, rpm.</p></li><li><p><strong>Maintainer compensation -</strong> $0/year.</p></li><li><p><strong>Support burden -</strong> Thousands of emails, bug reports, and feature requests from corporations demanding free support.</p></li></ul><p>The Fortune 500 runs mission-critical infrastructure on a foundation of unpaid labor.</p><ul><li><p><strong>OpenSSL</strong> - Maintained by ~10 people with an Annual Budget of ~$1M (via grants) and used by Billions of users.</p></li><li><p><strong>curl</strong> - Maintained by Daniel Stenberg (mostly solo) with an annual budget of ~100k (sponsors) and used by Billions of users.</p></li><li><p><strong>SQLite</strong> - Maintained by D. Richard Hipp + 2 contractors with a Self-funded budget and used by Billions of users.</p></li><li><p><strong>XZ Utils (pre-attack)</strong> - Maintained by 1 unpaid volunteer with $0 budget and used by Billions of users.</p></li></ul><p>The sock-puppet pressure campaign worked because Lasse was genuinely overwhelmed. The complaints about slow response times were real. &#8220;Helpful&#8221; contributors offered relief, and no one else (not Amazon, not Google, not Microsoft) was stepping up to help him. Handing off maintenance seemed like the responsible thing to do.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8QXF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88abcdcd-0c14-4c1b-a1a3-03014bcd7227_2816x1536.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8QXF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88abcdcd-0c14-4c1b-a1a3-03014bcd7227_2816x1536.png 424w, https://substackcdn.com/image/fetch/$s_!8QXF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88abcdcd-0c14-4c1b-a1a3-03014bcd7227_2816x1536.png 848w, https://substackcdn.com/image/fetch/$s_!8QXF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88abcdcd-0c14-4c1b-a1a3-03014bcd7227_2816x1536.png 1272w, https://substackcdn.com/image/fetch/$s_!8QXF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88abcdcd-0c14-4c1b-a1a3-03014bcd7227_2816x1536.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8QXF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88abcdcd-0c14-4c1b-a1a3-03014bcd7227_2816x1536.png" width="1456" height="794" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/88abcdcd-0c14-4c1b-a1a3-03014bcd7227_2816x1536.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:794,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:7251510,&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.binarybox.org/i/189579121?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88abcdcd-0c14-4c1b-a1a3-03014bcd7227_2816x1536.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_!8QXF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88abcdcd-0c14-4c1b-a1a3-03014bcd7227_2816x1536.png 424w, https://substackcdn.com/image/fetch/$s_!8QXF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88abcdcd-0c14-4c1b-a1a3-03014bcd7227_2816x1536.png 848w, https://substackcdn.com/image/fetch/$s_!8QXF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88abcdcd-0c14-4c1b-a1a3-03014bcd7227_2816x1536.png 1272w, https://substackcdn.com/image/fetch/$s_!8QXF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88abcdcd-0c14-4c1b-a1a3-03014bcd7227_2816x1536.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>If XZ Utils disappeared tomorrow and you had to build a replacement in-house, how much would it cost? </p><p>A conservative estimate</p><p><code>3 senior engineers &#215; 2 years &#215; $200K = $1.2 million. </code></p><p>That is the real enterprise value Lasse Collin was providing. For free. While working a separate full-time job.</p><p>Companies will happily pay $50,000 annually for a Datadog license to monitor their infrastructure. </p><p>But they won&#8217;t pay $50,000 to sponsor the unpaid maintainer of the compression library that every server in their data center depends on. Until the maintainer burns out. Hands over access. And a nation-state backdoor ends up in production.</p><blockquote><p>If your most critical open-source dependency disappeared tomorrow, how much would it cost to replace it? That&#8217;s what the maintainer is saving you. Are you paying them anything?</p></blockquote><h2>What you should do now?</h2><p>The era of blind trust in <code>npm install</code> and <code>apt-get upgrade</code> is over. </p><p>Here is the framework for securing your supply chain Monday morning</p><h3>Audit Your Dependency Tree</h3><p>Don&#8217;t just look for known CVEs. Identify <strong>maintenance risk</strong>.</p><ul><li><p>Run dependency analysis (<code>npm audit</code>, <code>pip-audit</code>, <code>cargo audit</code>).</p></li><li><p>Find dependencies with fewer than 3 active maintainers.</p></li><li><p>Check the last commit date (&gt;1 year without activity is a massive red flag).</p></li><li><p><strong>Red Flags - </strong>A single maintainer, hundreds of unresolved issues, or a maintainer posting &#8220;looking for new ownership.&#8221;</p></li></ul><h3>Pin and Vendor Critical Dependencies</h3><p>Stop trusting the internet to compile your software.</p><p>Stop using <code>latest</code> or <code>^1.0.0</code> version ranges in production. Stop auto-updating dependencies without review.</p><p>Pin exact versions with SHA checksums. Use lock files (<code>package-lock.json</code>, <code>Cargo.lock</code>). For ultra-critical infrastructure libraries, <strong>vendor them</strong> (copy the source into your own repository) and build them from source.</p><h3>Zero Trust for the Build Process</h3><p>If the build is compromised, the code review doesn&#8217;t matter.</p><ul><li><p>Implement <strong>Reproducible Builds</strong> (the exact same source code must produce the exact same byte-for-byte binary).</p></li><li><p>Isolate your build environments in ephemeral containers or VMs.</p></li><li><p>Generate a <strong>Software Bill of Materials (SBOM)</strong> for every release.</p></li><li><p>Verify that downloaded packages match published checksums and ensure no unexpected network requests happen during your CI/CD pipeline.</p></li></ul><h3>Fund the Maintainers</h3><p>Funding maintainers isn&#8217;t charity. It&#8217;s cheaper than breach response, cheaper than in-house development, and cheaper than explaining to your board why you ignored supply chain risk.</p><ul><li><p>If a library is critical to your business, sponsor it via GitHub Sponsors, Tidelift, or Open Collective.</p></li><li><p>The Goal - $50K&#8211;$100K/year for infrastructure-level libraries.</p></li><li><p>This reduces maintainer burnout, creates accountability, and gives you input on roadmap and priority bug fixes.</p></li></ul><h3>Treat Open Source Like Vendors</h3><p>Apply the exact same due diligence to your open-source libraries that you apply to a SaaS vendor. Monitor dependencies like production services. Alert on new releases, review changelogs <em>before</em> upgrading, and test updates in staging.</p><p>You cannot audit every line of every dependency. You have 500+ transitive dependencies, and they change constantly. But you CAN control your build process, fund the maintainers of critical libraries, and treat &#8220;free&#8221; software as unpaid labor with systemic risk.</p><div><hr></div><h2>Conclusion</h2><p>The XZ backdoor wasn&#8217;t a failure of code. It was a failure of economics.</p><p>Jia Tan didn&#8217;t find a zero-day or exploit a race condition. He exploited the fact that trillion-dollar companies depend on unpaid volunteers, and then act surprised when those volunteers burn out and hand over the keys.</p><p>Linus&#8217;s Law &#8221;with enough eyeballs, all bugs are shallow&#8221; assumes the eyeballs are actually looking. But nobody reviews compression libraries. Nobody audits build scripts. Nobody funds the maintainer. Until something breaks.</p><p>The next time your CFO questions a $500,000 budget for open-source sponsorships, show them the XZ timeline. </p><p>Show them the 2.5 years of patient infiltration. Show them that one burnt-out maintainer was all that stood between production systems and a global, nation-state backdoor.</p><p>&#8220;Free&#8221; software isn&#8217;t free. You&#8217;re just deferring the payment. The only question is</p><p>Will you pay before the breach, or after?</p><p>Every dependency in your stack is either funded, or it&#8217;s a countdown timer.</p><div><hr></div><p>Credit to <strong><a href="https://www.youtube.com/@veritasium">Veritasium</a></strong> for their exceptional video breakdown of the Jia Tan timeline, which served as the foundation for this architectural teardown. <strong><a href="https://www.youtube.com/watch?v=aoag03mSuXQ">Watch it here</a></strong></p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading BinaryBox! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p>]]></content:encoded></item></channel></rss>