<?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:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by João Franco on Medium]]></title>
        <description><![CDATA[Stories by João Franco on Medium]]></description>
        <link>https://medium.com/@joaodfranco94?source=rss-5ef0b291be8e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*rCEf8hOxFUymCA261xf8cA.jpeg</url>
            <title>Stories by João Franco on Medium</title>
            <link>https://medium.com/@joaodfranco94?source=rss-5ef0b291be8e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 14:45:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@joaodfranco94/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[AI Doesn’t Need Your Monolith. It Needs Your Discipline.]]></title>
            <link>https://medium.com/@joaodfranco94/ai-doesnt-need-your-monolith-it-needs-your-discipline-415bbe0156bd?source=rss-5ef0b291be8e------2</link>
            <guid isPermaLink="false">https://medium.com/p/415bbe0156bd</guid>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[João Franco]]></dc:creator>
            <pubDate>Fri, 13 Mar 2026 15:14:39 GMT</pubDate>
            <atom:updated>2026-03-13T15:42:11.737Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bA96pZNrYpCxbqgYBllEuQ.jpeg" /></figure><h3>The Decade-Long Playbook</h3><p>For over a decade, the story of scaling software organizations followed a well-known arc.</p><p>Companies grow. Teams expand. At some point, <a href="https://en.wikipedia.org/wiki/Dunbar%27s_number">Dunbar’s number</a>— the cognitive limit of roughly 150 stable relationships — kicks in. Communication becomes expensive. Hierarchies form. Teams cluster into autonomous units.</p><p>And then <a href="https://en.wikipedia.org/wiki/Conway%27s_law">Conway’s Law</a> does what it always does: the systems a company builds start to mirror its communication structures. Monoliths break apart. Services emerge. Microservices become the dominant architecture for organizations at scale — not because they were inherently superior, but because they mapped to how people were organized.</p><p>This was the norm. It made sense. It worked.</p><h3>The AI Reversal</h3><p>Now, with the rise of AI-assisted development, a reverse argument is gaining traction: <em>”We need to go back to the monolith so the AI can have full context.”</em></p><p>The evidence gets stacked up quickly. Amazon Prime Video’s <a href="https://www.primevideotech.com/video-streaming/scaling-up-the-prime-video-audio-video-monitoring-service-and-reducing-costs-by-90">famous 2023 blog post</a> about moving from microservices back to a monolith — and cutting costs by 90% — got paraded as vindication. Shopify’s long-standing commitment to a <a href="https://shopify.engineering/shopify-monolith">modular monolith on Rails</a> gets cited as the template for the AI era. DHH declared the “<a href="https://signalvnoise.com/svn3/the-majestic-monolith/">majestic monolith</a>” was always the right answer.</p><p>The narrative goes: LLMs work best when they can see everything. Microservices scatter context across repositories. Therefore, consolidate. Return to the monolith. Give the AI the full picture.</p><p>I think we’re missing the point entirely.</p><h4>AI Is Being Used to Justify Poorly Made Abstractions</h4><p>When people say “the AI needs full context to work effectively,” what they’re really saying is something more uncomfortable: ”<em>Our service boundaries are so poorly defined that even we don’t understand where one system ends and another begins.”</em></p><p>That’s not an AI problem. That’s an architecture problem. And it predates LLMs by decades.</p><p>If your microservices are just a distributed monolith — tightly coupled, sharing databases, with implicit contracts and undocumented side effects — then yes, no tool will navigate that well. Not AI, not a senior engineer on their first week, not anyone.</p><p>But the answer isn’t to shove everything back into one deployable. The answer is to fix the abstractions.</p><p>If your services have well-defined contracts, clear interfaces, documented APIs, versioned schemas, and proper domain boundaries — the AI doesn’t need to see everything. It needs to understand the boundaries. Give it the input, the output, and the contract in between. That’s enough. That’s always been enough — for humans and machines alike.</p><p>This is what <a href="https://swagger.io/resources/articles/adopting-an-api-first-approach/">API-first design</a> and <a href="https://pact.io/">contract testing</a> have been about for years. AI didn’t change the requirements. It just made the penalty for ignoring them more obvious.</p><h4>We’re Overcomplicating What “Context” Means for an LLM</h4><p>Here’s something we keep getting wrong: we think AI navigates code the way we do — through IDEs, file trees, color-coded syntax, project icons, and carefully arranged workspace layouts. It doesn’t.</p><p>An LLM tokenizes text. That’s it.</p><p>A monorepo with 30 services? To the AI, that’s a directory with subdirectories containing text files.<br>A multirepo setup where all repos are cloned under `~/projects`? To the AI, that’s… also a directory with subdirectories containing text files.</p><p>The distinction between a “project” and a “directory” is that one contains a build file (`pom.xml`, `build.gradle`, `package.json`) and the other doesn’t. That distinction matters enormously for your CI/CD pipeline. It matters for your IDE, which uses it to resolve dependencies, highlight errors, and provide autocompletion. It matters for your developers, who rely on visual cues and tooling affordances to navigate complexity.</p><p><strong>It does not matter for the LLM.</strong></p><p>We are projecting human interpretations onto a system that processes tokens. The concept of “project boundary” is a human construct reinforced by tooling. For the AI, it’s all just text in directories. If you clone ten repositories into a single parent folder and point an AI coding assistant at it, you have functionally created a monorepo — from the LLM’s perspective.</p><p>I’m not opposed to monorepos. They have real advantages: atomic commits across services, simplified dependency management, unified tooling. But the argument that “AI needs a monorepo to work” is simply false. What AI needs is discoverability — clear file structures, good naming conventions, and documentation that explains the relationships between components. That can exist in any repository topology.</p><p>Even with 1M token context windows — available today in models like Claude Opus — the argument that “AI needs to see everything” is weak. You don’t hand a new developer every file in a monolith on day one either. You point them to the relevant module, the interface, the tests. AI works the same way, possibly better, since it can consume and cross-reference thousands of files faster than any human ever could.</p><h4>What AI Actually Needs Is Clean Engineering</h4><p>This is where the real conversation should be.</p><p>Large language models were trained on decades of open-source code, technical documentation, design patterns, and software engineering literature. They have internalized <a href="https://en.wikipedia.org/wiki/SOLID">SOLID principles</a>. <a href="https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html">Clean Architecture</a>. <a href="https://martinfowler.com/bliki/DomainDrivenDesign.html">Domain-Driven Design</a>. API-first design. Contract testing. <a href="https://12factor.net/">The Twelve-Factor App</a>. All of it.</p><p>When your code follows these established principles, the AI thrives. It recognizes the patterns because it has seen them thousands of times during training. It understands the intent because the structure communicates it clearly. It produces quality output because the input matches the distribution of high-quality data it was trained on.</p><p>When your code is a tangled mess of shared mutable state, circular dependencies, god classes, and undocumented side effects — moving it into a monolith doesn’t fix anything. You’ve just given the AI more garbage with more context. More context of bad code doesn’t produce better results. It produces more confidently wrong results.</p><p>And here’s the uncomfortable truth that nobody is talking about: if we keep producing poorly structured code with AI assistance and feeding it back into training loops, <strong>the models will degrade</strong>. This is the <a href="https://en.wikipedia.org/wiki/Model_collapse">model collapse</a>. problem applied to software engineering. We’ll reach a point where we need to quarantine AI-generated code or revert to older, cleaner training datasets because the newer ones are polluted with the AI-generated spaghetti that came before.</p><p><strong>AI is probabilistic in nature.</strong> It doesn’t “understand” your codebase — it predicts the most likely next token based on patterns it has learned. It maximizes its probability of success when the environment is well-structured, when the patterns are familiar, when the conventions are consistent. Our job as engineers is not to reshape our architectures to fit the AI’s context window. Our job is to create the conditions where the AI’s probabilistic nature works in our favor.</p><h3>So What Should We Actually Do?</h3><p>Whether you choose a monorepo, multirepo, or modular monolith — the architecture pattern matters far less than the engineering discipline behind it:</p><p>- <strong>Define clear service boundaries and domain ownership.</strong> Use <a href="https://martinfowler.com/bliki/BoundedContext.html">Bounded Contexts</a> from DDD. Each service should own its domain and expose a well-defined interface.</p><p>- <strong>Maintain strong contracts and versioned APIs.</strong> Use OpenAPI specs, Protocol Buffers, or similar schema definitions. Make the contracts machine-readable — this helps AI just as much as it helps developers.</p><p>- <strong>Invest in build tooling and CI/CD.</strong> Whether monorepo or multirepo, changes should be isolated, tested, and deployed independently. Tools like <a href="https://bazel.build/">Bazel</a>, <a href="https://nx.dev/">Nx</a>, or <a href="https://turbo.build/repo">Turborepo</a> exist precisely to solve the “monorepo build complexity” problem. The deployment pipeline should not grow exponentially with the number of services.</p><p>- <strong>Write clean, well-documented code that follows established patterns.</strong> Not for the AI — for everyone. The AI benefits as a side effect. Good code is good code regardless of who or what reads it.</p><p>- <strong>Treat architecture decisions as independent from AI tooling decisions.</strong> Your system design should be driven by business domains, team topology, scalability requirements, and operational needs — not by the context window of your coding assistant.</p><h3>The Bottom Line</h3><p>The monolith-vs-microservices debate has been raging for over a decade. AI didn’t change the answer. It just made the consequences of getting it wrong more visible — and more expensive.</p><p>A poorly abstracted monolith is still a mess, even if the AI can see all of it. Well-designed services with clean boundaries are navigable by any tool, human or artificial.</p><p><strong>Stop restructuring your systems for the AI. Start structuring them properly for everyone.</strong></p><p>The fundamentals haven’t changed. Years and years of hard-won software engineering wisdom — separation of concerns, loose coupling, high cohesion, clean interfaces — these principles exist because they work. They worked before AI, they work with AI, and they’ll work after whatever comes next.</p><p>The AI doesn’t need to understand your entire system. It needs to understand the boundaries. And if those boundaries are well-drawn, it doesn’t matter whether they live in one repo or a hundred.</p><p>Respect the fundamentals. The AI will follow.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=415bbe0156bd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>