<rss xmlns:source="http://source.scripting.com/" version="2.0">
  <channel>
    <title>Aravind Kunnath</title>
    <link>https://aravindkunnath.com/</link>
    <description></description>
    
    <language>en</language>
    
    <lastBuildDate>Sat, 21 Nov 2026 21:41:47 -0500</lastBuildDate>
    <item>
      <title>Profiling teams on AI usage is not a good idea!</title>
      <link>https://aravindkunnath.com/2026/11/21/profiling-developers-or-teams-by/</link>
      <pubDate>Sat, 21 Nov 2026 21:41:47 -0500</pubDate>
      
      <guid>http://aravindkunnath.micro.blog/2026/11/21/profiling-developers-or-teams-by/</guid>
      <description>&lt;p&gt;Profiling developers or teams by their AI usage and scoring them as power users, regular users, or &amp;ldquo;agent-illiterate&amp;rdquo; is a bad idea. It measures activity and it erodes trust. Build trust with your team instead and evaluate performance holistically, based on goals and outcomes.&lt;/p&gt;
</description>
      <source:markdown>Profiling developers or teams by their AI usage and scoring them as power users, regular users, or &#34;agent-illiterate&#34; is a bad idea. It measures activity and it erodes trust. Build trust with your team instead and evaluate performance holistically, based on goals and outcomes.
</source:markdown>
    </item>
    
    <item>
      <title>Abstract problem solving</title>
      <link>https://aravindkunnath.com/2026/11/14/abstract-problem-solving/</link>
      <pubDate>Sat, 14 Nov 2026 12:01:41 -0500</pubDate>
      
      <guid>http://aravindkunnath.micro.blog/2026/11/14/abstract-problem-solving/</guid>
      <description>&lt;p&gt;Developers constantly zoom-in and zoom-out of an abstract problem. This periscope like movement while developing software is misunderstood by many though. Those who provide air support fail to see this, like leaders, and misunderstand that the work is always zoomed in. A lot like flatland blindness.&lt;/p&gt;
</description>
      <source:markdown>Developers constantly zoom-in and zoom-out of an abstract problem. This periscope like movement while developing software is misunderstood by many though. Those who provide air support fail to see this, like leaders, and misunderstand that the work is always zoomed in. A lot like flatland blindness.
</source:markdown>
    </item>
    
    <item>
      <title>Shorter fragments going forward</title>
      <link>https://aravindkunnath.com/2026/11/13/shorter-fragments-going-forward/</link>
      <pubDate>Fri, 13 Nov 2026 21:29:52 -0500</pubDate>
      
      <guid>http://aravindkunnath.micro.blog/2026/11/13/shorter-fragments-going-forward/</guid>
      <description>&lt;p&gt;My writing style is changing. Primarily due to the availability of time, or the lack of it. I think a shorter form may work better for me.&lt;/p&gt;
&lt;p&gt;When I started writing last year, I did not know which style was optimal for me. My thinking process usually is to spend a lot of time connecting and reflecting on the different fragments and observations. This often results in a drive without a destination or walk through the aisles of Home Depot as if I am searching for a tool that is yet to be invented.&lt;/p&gt;
&lt;p&gt;But connecting fragments in my mind is one thing; translating that into words for someone else to read is a completely different exercise. Several articles that I started a long time ago are unfinished, and I honestly don&amp;rsquo;t know how to complete them.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s to one fragment at a time, written as well as I can, and as short as it can be.&lt;/p&gt;
</description>
      <source:markdown>My writing style is changing. Primarily due to the availability of time, or the lack of it. I think a shorter form may work better for me.

When I started writing last year, I did not know which style was optimal for me. My thinking process usually is to spend a lot of time connecting and reflecting on the different fragments and observations. This often results in a drive without a destination or walk through the aisles of Home Depot as if I am searching for a tool that is yet to be invented.

But connecting fragments in my mind is one thing; translating that into words for someone else to read is a completely different exercise. Several articles that I started a long time ago are unfinished, and I honestly don&#39;t know how to complete them.

Here&#39;s to one fragment at a time, written as well as I can, and as short as it can be.
</source:markdown>
    </item>
    
    <item>
      <title>I need a Reductive AI in the Generative Era</title>
      <link>https://aravindkunnath.com/2026/06/07/i-need-a-reductive-ai/</link>
      <pubDate>Sun, 07 Jun 2026 21:41:43 -0500</pubDate>
      
      <guid>http://aravindkunnath.micro.blog/2026/06/08/i-need-a-reductive-ai/</guid>
      <description>&lt;p&gt;My perception about the large language models and its generative power has changed. I believe that the super power of Generative AI is Reduction, which is probably a paradox of a kind.&lt;/p&gt;
&lt;p&gt;The general usage pattern that I see is all generation. Docs are written by LLM, and the reader uses LLM to summarize it. Team members are using LLM to fine tune their messages to other team members. Email responses come pretty quickly with a lot of text, obviously written by LLMs, as if the problem at hand was the response time from whom the email was addressed. For the sake of solving a problem or answering a question, employees are copy pasting auto generated responses. We are probably at a stage where the distance from reality is far enough that the writer and reader are not understanding what is going on between them.&lt;/p&gt;
&lt;p&gt;A recent experience worth calling out here is when we were asked to generate an API contract, but the details - data model, validations, patterns, methods etc were not clear and alignment was missing altogether. So naturally, it was marked blocked. It took no time for the architect to ask an agent to build it and voila - an entire Swagger was available in the chat response. Without checking, it was shared to the team asking to continue the build. Only when we opened it we realized that 99% of the APIs just return 200 OK responses, there is no data returned. There were no models or definitions. The task is technically complete, which was to generate an API contract, with no value or alignment.&lt;/p&gt;
&lt;p&gt;It is hard to see how LLM is the root cause of this. But previously, when this tool was not present, the unknowns could not be translated to hallucinations and could not be forced into completion. When LLM is present, especially the generated ones, it is easy to show that something was generated rather than nothing, when in fact nothing was better than something.&lt;/p&gt;
&lt;p&gt;Reduction, the act of making something smaller in quantity, is what I am now mostly using LLMs for. It’s as if my entire usage pattern has changed in the last few months, and I see real benefit from it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1. Chaos to Knowledge Graph&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;My brain, and most of ours presumably, is naturally chaotic. There is never a straight line of thought in my mind, except when I am highly focused. And it fits into my small, localized, world. But the moment I want to transfer a part of my brain to someone else, I find it very hard to understand where to start from. For example - when working with slides for solutioning, proposal et al, I used to ask others to show me a template and I will fill it in. They would reject this idea, saying that I first have to write and the template is a later problem. I don’t think like that - I want to know the sections and order beforehand, otherwise they themselves will ask me, how do we order this. &lt;/p&gt;
&lt;p&gt;Using the knowledge graph, thanks to Karpathy, I have found myself in a very comfortable position nowadays. Several of my “chain of thoughts” are now externalized in a way that is rich, searchable and connectable - all of which would have taken more than my focus-time allowances from family.&lt;/p&gt;
&lt;p&gt;I also have a tendency to apply Systems Thinking almost at every problem I see ( sorry, I cannot resist it ). I now use the “Interrogatory LLM” approach to connect the dots. This was interesting, because sometimes I need a question for me to tap into some of the areas of memory and an LLM is super efficient in doing that.&lt;/p&gt;
&lt;p&gt;I also use voice memos in my phone, copy the transcript and then feed it into the LLM to create 3-bullet single line summaries.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2. Assessing quality of implementation&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Another area where reduction is super powerful is to gather the meaning of various sections, visualizing them and finding or spotting issues with it. The agents particularly can also review the test code, make it more behavioural so that the source to test coupling is removed one by one, and in the event I have found that the actual lines of code that we need to maintain goes down considerably. This is also partly due to the fact that the applications that I tried had test design issues.&lt;/p&gt;
&lt;p&gt;One another way I use to apply reduction is to load two classes or modules of source code to compare the level of entropy in them. Areas such as domain leakage, duplicated code, leaky abstractions can all be compared and the report is quite useful for brownfield projects. We can also assess the quality of tests, see how they are managing their dependencies in the test, also if there are any composite functionalities between them and whether tests (integration scope) are covering it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;3. Decomposing Information&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Occasionally, I get overwhelmed with the amount of information that I need to break down. Applying systems thinking is useful, but will quickly get a reality check that it is too large to comprehend in a single go. Most information is vector in nature, with a certain velocity and a direction. I mean, the same information delivered by a peer or an executive has a different span or weight associated with it, all dependent on the context and problem statement. While the decision is largely mine, I now eagerly get the inter-connectedness established through the agents. Using BMad is one option, there are also downloadable skills available in Github and in Tessl. I have got a personal skill of my own too, that I have meticulously created based on the way I think and understand. All these with templates and workflows that I generated iteratively, will leave different levels of information categorized by tags, directories and read more links depending on how deep I want to go back and recollect.&lt;/p&gt;
&lt;p&gt;LLMs generative capabilities come from the past, but blindly repeating the past to progress does not bring a new future. Creativity and ingenuity are both forward looking, and we should be trusting ourselves with it. This technology is here to stay. As for me, less of generation and more of reduction.&lt;/p&gt;
</description>
      <source:markdown>My perception about the large language models and its generative power has changed. I believe that the super power of Generative AI is Reduction, which is probably a paradox of a kind.

The general usage pattern that I see is all generation. Docs are written by LLM, and the reader uses LLM to summarize it. Team members are using LLM to fine tune their messages to other team members. Email responses come pretty quickly with a lot of text, obviously written by LLMs, as if the problem at hand was the response time from whom the email was addressed. For the sake of solving a problem or answering a question, employees are copy pasting auto generated responses. We are probably at a stage where the distance from reality is far enough that the writer and reader are not understanding what is going on between them.

A recent experience worth calling out here is when we were asked to generate an API contract, but the details - data model, validations, patterns, methods etc were not clear and alignment was missing altogether. So naturally, it was marked blocked. It took no time for the architect to ask an agent to build it and voila - an entire Swagger was available in the chat response. Without checking, it was shared to the team asking to continue the build. Only when we opened it we realized that 99% of the APIs just return 200 OK responses, there is no data returned. There were no models or definitions. The task is technically complete, which was to generate an API contract, with no value or alignment.

It is hard to see how LLM is the root cause of this. But previously, when this tool was not present, the unknowns could not be translated to hallucinations and could not be forced into completion. When LLM is present, especially the generated ones, it is easy to show that something was generated rather than nothing, when in fact nothing was better than something.

Reduction, the act of making something smaller in quantity, is what I am now mostly using LLMs for. It’s as if my entire usage pattern has changed in the last few months, and I see real benefit from it.

**1\. Chaos to Knowledge Graph**

My brain, and most of ours presumably, is naturally chaotic. There is never a straight line of thought in my mind, except when I am highly focused. And it fits into my small, localized, world. But the moment I want to transfer a part of my brain to someone else, I find it very hard to understand where to start from. For example - when working with slides for solutioning, proposal et al, I used to ask others to show me a template and I will fill it in. They would reject this idea, saying that I first have to write and the template is a later problem. I don’t think like that - I want to know the sections and order beforehand, otherwise they themselves will ask me, how do we order this. 

Using the knowledge graph, thanks to Karpathy, I have found myself in a very comfortable position nowadays. Several of my “chain of thoughts” are now externalized in a way that is rich, searchable and connectable - all of which would have taken more than my focus-time allowances from family.

I also have a tendency to apply Systems Thinking almost at every problem I see ( sorry, I cannot resist it ). I now use the “Interrogatory LLM” approach to connect the dots. This was interesting, because sometimes I need a question for me to tap into some of the areas of memory and an LLM is super efficient in doing that.

I also use voice memos in my phone, copy the transcript and then feed it into the LLM to create 3-bullet single line summaries.

**2\. Assessing quality of implementation**

Another area where reduction is super powerful is to gather the meaning of various sections, visualizing them and finding or spotting issues with it. The agents particularly can also review the test code, make it more behavioural so that the source to test coupling is removed one by one, and in the event I have found that the actual lines of code that we need to maintain goes down considerably. This is also partly due to the fact that the applications that I tried had test design issues.

One another way I use to apply reduction is to load two classes or modules of source code to compare the level of entropy in them. Areas such as domain leakage, duplicated code, leaky abstractions can all be compared and the report is quite useful for brownfield projects. We can also assess the quality of tests, see how they are managing their dependencies in the test, also if there are any composite functionalities between them and whether tests (integration scope) are covering it.

**3\. Decomposing Information**

Occasionally, I get overwhelmed with the amount of information that I need to break down. Applying systems thinking is useful, but will quickly get a reality check that it is too large to comprehend in a single go. Most information is vector in nature, with a certain velocity and a direction. I mean, the same information delivered by a peer or an executive has a different span or weight associated with it, all dependent on the context and problem statement. While the decision is largely mine, I now eagerly get the inter-connectedness established through the agents. Using BMad is one option, there are also downloadable skills available in Github and in Tessl. I have got a personal skill of my own too, that I have meticulously created based on the way I think and understand. All these with templates and workflows that I generated iteratively, will leave different levels of information categorized by tags, directories and read more links depending on how deep I want to go back and recollect.

LLMs generative capabilities come from the past, but blindly repeating the past to progress does not bring a new future. Creativity and ingenuity are both forward looking, and we should be trusting ourselves with it. This technology is here to stay. As for me, less of generation and more of reduction.
</source:markdown>
    </item>
    
    <item>
      <title>The Last Unassisted Generation</title>
      <link>https://aravindkunnath.com/2026/01/14/the-last-unassisted-generation/</link>
      <pubDate>Wed, 14 Jan 2026 16:20:23 -0500</pubDate>
      
      <guid>http://aravindkunnath.micro.blog/2026/01/14/the-last-unassisted-generation/</guid>
      <description>&lt;p&gt;The introduction of AI-assisted and Agentic coding makes me think about the history of agriculture, specifically the shift toward monocultures.&lt;/p&gt;
&lt;p&gt;By increasing harvesting efficiency to feed billions and being successful at it, we removed the genetic diversity that crops achieved through thousands of years of adaptation. By optimizing for yield, profit, and predictability, we traded off adaptability, resilience, and diversity. When the Irish Potato Famine struck, a million people died because a single cultivar couldn&amp;rsquo;t resist a pathogen.&lt;/p&gt;
&lt;p&gt;We optimized for what we could measure—yield and velocity—and lost what we couldn&amp;rsquo;t: the distributed knowledge of millions of farmers making small, careful selections over generations.&lt;/p&gt;
&lt;p&gt;We are doing it again. This time, with how we think.&lt;/p&gt;
&lt;h2 id=&#34;the-flattening-of-understanding&#34;&gt;The Flattening of Understanding&lt;/h2&gt;
&lt;p&gt;In a previous post, I wrote about how &lt;a href=&#34;https://akdev.blog/your-application-needs-different-zones-for-different-levels-of-understanding&#34;&gt;your application needs different zones for different levels of understanding&lt;/a&gt;. I argued that we must protect the &amp;ldquo;Core&amp;rdquo; of our systems—the parts where we require absolute clarity—while allowing the &amp;ldquo;Edge&amp;rdquo; to be experimental and volatile.&lt;/p&gt;
&lt;p&gt;AI is effectively &lt;strong&gt;flattening these zones.&lt;/strong&gt; Because AI can generate code for the &amp;ldquo;Core&amp;rdquo; as easily as it can for a &amp;ldquo;Feature Toggle,&amp;rdquo; it creates an illusion that we understand both equally. It allows us to build the foundation of our systems using the same low-friction, low-understanding methods we usually reserve for prototypes.&lt;/p&gt;
&lt;h2 id=&#34;the-paradox-of-velocity&#34;&gt;The Paradox of Velocity&lt;/h2&gt;
&lt;p&gt;AI is extraordinary at accelerating what you know &lt;em&gt;and&lt;/em&gt; what you don&amp;rsquo;t know. It generates code faster than we can build the mental models to evaluate it. This creates a dangerous inversion: &lt;strong&gt;As the time to generate code shortens, the feedback loop between mistake and consequence actually lengthens.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In the past, the speed of writing code was throttled by the speed of understanding it. If you didn&amp;rsquo;t understand the logic, you couldn&amp;rsquo;t write the syntax. You felt the friction immediately.&lt;/p&gt;
&lt;p&gt;Today, we get instant gratification—code compiles, tests pass, CI is green. But we get delayed comprehension. The bug surfaces in production, weeks later, in ways that obscure causation. Short-term success breeds long-term fragility.&lt;/p&gt;
&lt;p&gt;I saw this play out recently. A developer followed TDD, wrote tests, and got green lights. The AI-generated code was syntactically perfect and worked flawlessly in local development.&lt;/p&gt;
&lt;p&gt;But the AI had made a subtle error: it stored temporary state in a local variable. In an ephemeral, containerized environment, that state vanishes the moment the pod scales or restarts. Because the generation was so fast, and the code looked so &amp;ldquo;right&amp;rdquo; (even to human reviewers scanning for syntax rather than architecture), more PRs were merged on top of it.&lt;/p&gt;
&lt;p&gt;This is a textbook example of &lt;strong&gt;Doyle&amp;rsquo;s Catch&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Named after engineer John Doyle, the concept warns that as our tools for simulation and modeling become more powerful, the gap between a successful &amp;ldquo;demonstration&amp;rdquo; (local dev) and the real world (production) actually widens and becomes harder to see.&lt;/p&gt;
&lt;p&gt;AI makes the &amp;ldquo;demonstration&amp;rdquo; phase trivial. We can generate code that passes tests and looks correct in seconds. But because the generation was so effortless, we assume the bridge to the real world is equally solid. It isn&amp;rsquo;t. The AI optimized for the idealized environment of the prompt, not the hostile reality of the real world systems.&lt;/p&gt;
&lt;h2 id=&#34;the-ironies-of-automation&#34;&gt;The Ironies of Automation&lt;/h2&gt;
&lt;p&gt;In systems engineering, the &lt;strong&gt;Ironies of Automation&lt;/strong&gt; teach us that the more reliable an automated system becomes, the more crucial the human operator becomes for the rare moments it fails.&lt;/p&gt;
&lt;p&gt;When AI fails, it doesn&amp;rsquo;t fail like a human. It doesn&amp;rsquo;t get &amp;ldquo;tired&amp;rdquo;; it hallucinates with confidence. It creates solutions that violate unstated architectural constraints—the &amp;ldquo;invisible foundations&amp;rdquo; that live only in the mental models of the engineers.&lt;/p&gt;
&lt;p&gt;If nobody in the room has the manual &amp;ldquo;tracing&amp;rdquo; skills to diagnose these failures without the tool that created them, the failure will cascade. We are effectively creating a &amp;ldquo;Cognitive Lock-in,&amp;rdquo; where we are dependent on the vendor not just for the tools, but for the thought process itself.&lt;/p&gt;
&lt;h2 id=&#34;the-responsibility-of-the-bridge&#34;&gt;The Responsibility of the Bridge&lt;/h2&gt;
&lt;p&gt;I am part of the last generation of engineers who developed entirely without AI. We learned through friction. We broke things and read cryptic error messages. It wasn&amp;rsquo;t that our code was inherently &amp;ldquo;better&amp;rdquo;—we wrote plenty of spaghetti—but the high cost of iteration forced us to build &amp;ldquo;Zones of Understanding&amp;rdquo; in our heads. We &lt;em&gt;had&lt;/em&gt; to simulate the system mentally because we couldn&amp;rsquo;t just regenerate it.&lt;/p&gt;
&lt;p&gt;In the new reality, these zones of understanding are fading. I am afraid that our solution to the pressure of AI is to &amp;ldquo;rewrite code&amp;rdquo; every single time because we no longer understand the existing codebase enough to refactor it. That is not a sustainable model; we will never catch up to the pace at which negative feedback loops occur.&lt;/p&gt;
&lt;p&gt;Once the pre-AI generation retires, the instinct for &amp;ldquo;architectural smell&amp;rdquo;—the ability to look at a piece of code and know it will cause a crisis in six months—doesn&amp;rsquo;t automatically transfer. It only survives if we create intentional &amp;ldquo;Seed Vaults&amp;rdquo; of knowledge.&lt;/p&gt;
&lt;h2 id=&#34;what-this-looks-like-practically&#34;&gt;What This Looks Like Practically&lt;/h2&gt;
&lt;p&gt;We can&amp;rsquo;t withstand the economic pressure to fully slow down. But we can design systems that restore essential feedback loops without abandoning AI&amp;rsquo;s benefits.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1. Staged AI Access (Calibrating for Risk)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This needs the lens of risk management, and not gatekeeping or privileges.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Entry Level (Spec-First):&lt;/strong&gt; You cannot generate the solution until you can articulate the problem. Write the spec and decompose the data flow manually &lt;em&gt;before&lt;/em&gt; engaging the AI.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Senior Level (Resilience Ownership):&lt;/strong&gt; Unrestricted AI use, but you carry the burden of the team&amp;rsquo;s comprehension. If you ship complex, AI-generated patterns that your team cannot debug or make sense of, that velocity was borrowed, not earned.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;2. Comprehension Gates&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Before merging AI-generated code, the author must be able to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Explain the flow of information, data and decisions in their own words.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Identify the most likely failure mode.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Describe the recovery plan if it fails in production. If you can&amp;rsquo;t do this, you don&amp;rsquo;t understand the code well enough to ship it.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;3. The &amp;ldquo;Manual Override&amp;rdquo; Drill&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;At least once a quarter, run an entire sprint (or a specific critical feature) without AI assistance. Managers often push back on this due to velocity concerns. The counter-argument is simple: disaster recovery for augmented capabilities. If Github Copilot goes down, or we change vendors, or the model starts degrading, does the team grind to a halt? If yes, you are a security risk.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;4. Failure Retrospectives with Context&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;When AI-generated code fails:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Document the prompt, the output, why it seemed right, and why it failed.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Turn failures into teaching moments about &lt;em&gt;architecture and practices&lt;/em&gt;, not just syntax.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Ideally, future models with persistent memory and project-level context will handle this &amp;ldquo;context repair&amp;rdquo; automatically. But until the tools can effectively articulate their own reasoning back to the team, our social systems must be stronger than our technical ones.&lt;/p&gt;
&lt;h2 id=&#34;be-the-seed-vault&#34;&gt;Be the Seed Vault&lt;/h2&gt;
&lt;p&gt;We may be the only ones who understand both worlds: the friction of the manual struggle and the speed of the augmented future. Our role is not to guard the past, but to secure the future.&lt;/p&gt;
&lt;p&gt;We must act as the bridge. We must ensure that as we move toward a world of &amp;ldquo;instant code,&amp;rdquo; we don&amp;rsquo;t lose the &amp;ldquo;earned understanding&amp;rdquo; that keeps those systems standing. We must become the Seed Vaults—preserving the genetic diversity of thought required to survive the next famine.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Note: Parts of this post were refined using Gemini and Claude to sharpen the articulation.&lt;/em&gt;&lt;/p&gt;
</description>
      <source:markdown>The introduction of AI-assisted and Agentic coding makes me think about the history of agriculture, specifically the shift toward monocultures.

By increasing harvesting efficiency to feed billions and being successful at it, we removed the genetic diversity that crops achieved through thousands of years of adaptation. By optimizing for yield, profit, and predictability, we traded off adaptability, resilience, and diversity. When the Irish Potato Famine struck, a million people died because a single cultivar couldn&#39;t resist a pathogen.

We optimized for what we could measure—yield and velocity—and lost what we couldn&#39;t: the distributed knowledge of millions of farmers making small, careful selections over generations.

We are doing it again. This time, with how we think.

## The Flattening of Understanding

In a previous post, I wrote about how [your application needs different zones for different levels of understanding](https://akdev.blog/your-application-needs-different-zones-for-different-levels-of-understanding). I argued that we must protect the &#34;Core&#34; of our systems—the parts where we require absolute clarity—while allowing the &#34;Edge&#34; to be experimental and volatile.

AI is effectively **flattening these zones.** Because AI can generate code for the &#34;Core&#34; as easily as it can for a &#34;Feature Toggle,&#34; it creates an illusion that we understand both equally. It allows us to build the foundation of our systems using the same low-friction, low-understanding methods we usually reserve for prototypes.

## The Paradox of Velocity

AI is extraordinary at accelerating what you know *and* what you don&#39;t know. It generates code faster than we can build the mental models to evaluate it. This creates a dangerous inversion: **As the time to generate code shortens, the feedback loop between mistake and consequence actually lengthens.**

In the past, the speed of writing code was throttled by the speed of understanding it. If you didn&#39;t understand the logic, you couldn&#39;t write the syntax. You felt the friction immediately.

Today, we get instant gratification—code compiles, tests pass, CI is green. But we get delayed comprehension. The bug surfaces in production, weeks later, in ways that obscure causation. Short-term success breeds long-term fragility.

I saw this play out recently. A developer followed TDD, wrote tests, and got green lights. The AI-generated code was syntactically perfect and worked flawlessly in local development.

But the AI had made a subtle error: it stored temporary state in a local variable. In an ephemeral, containerized environment, that state vanishes the moment the pod scales or restarts. Because the generation was so fast, and the code looked so &#34;right&#34; (even to human reviewers scanning for syntax rather than architecture), more PRs were merged on top of it.

This is a textbook example of **Doyle&#39;s Catch**.

Named after engineer John Doyle, the concept warns that as our tools for simulation and modeling become more powerful, the gap between a successful &#34;demonstration&#34; (local dev) and the real world (production) actually widens and becomes harder to see.

AI makes the &#34;demonstration&#34; phase trivial. We can generate code that passes tests and looks correct in seconds. But because the generation was so effortless, we assume the bridge to the real world is equally solid. It isn&#39;t. The AI optimized for the idealized environment of the prompt, not the hostile reality of the real world systems.

## The Ironies of Automation

In systems engineering, the **Ironies of Automation** teach us that the more reliable an automated system becomes, the more crucial the human operator becomes for the rare moments it fails.

When AI fails, it doesn&#39;t fail like a human. It doesn&#39;t get &#34;tired&#34;; it hallucinates with confidence. It creates solutions that violate unstated architectural constraints—the &#34;invisible foundations&#34; that live only in the mental models of the engineers.

If nobody in the room has the manual &#34;tracing&#34; skills to diagnose these failures without the tool that created them, the failure will cascade. We are effectively creating a &#34;Cognitive Lock-in,&#34; where we are dependent on the vendor not just for the tools, but for the thought process itself.

## The Responsibility of the Bridge

I am part of the last generation of engineers who developed entirely without AI. We learned through friction. We broke things and read cryptic error messages. It wasn&#39;t that our code was inherently &#34;better&#34;—we wrote plenty of spaghetti—but the high cost of iteration forced us to build &#34;Zones of Understanding&#34; in our heads. We *had* to simulate the system mentally because we couldn&#39;t just regenerate it.

In the new reality, these zones of understanding are fading. I am afraid that our solution to the pressure of AI is to &#34;rewrite code&#34; every single time because we no longer understand the existing codebase enough to refactor it. That is not a sustainable model; we will never catch up to the pace at which negative feedback loops occur.

Once the pre-AI generation retires, the instinct for &#34;architectural smell&#34;—the ability to look at a piece of code and know it will cause a crisis in six months—doesn&#39;t automatically transfer. It only survives if we create intentional &#34;Seed Vaults&#34; of knowledge.

## What This Looks Like Practically

We can&#39;t withstand the economic pressure to fully slow down. But we can design systems that restore essential feedback loops without abandoning AI&#39;s benefits.

**1\. Staged AI Access (Calibrating for Risk)**

This needs the lens of risk management, and not gatekeeping or privileges.

* **Entry Level (Spec-First):** You cannot generate the solution until you can articulate the problem. Write the spec and decompose the data flow manually *before* engaging the AI.
    
* **Senior Level (Resilience Ownership):** Unrestricted AI use, but you carry the burden of the team&#39;s comprehension. If you ship complex, AI-generated patterns that your team cannot debug or make sense of, that velocity was borrowed, not earned.
    

**2\. Comprehension Gates**

Before merging AI-generated code, the author must be able to:

* Explain the flow of information, data and decisions in their own words.
    
* Identify the most likely failure mode.
    
* Describe the recovery plan if it fails in production. If you can&#39;t do this, you don&#39;t understand the code well enough to ship it.
    

**3\. The &#34;Manual Override&#34; Drill**

At least once a quarter, run an entire sprint (or a specific critical feature) without AI assistance. Managers often push back on this due to velocity concerns. The counter-argument is simple: disaster recovery for augmented capabilities. If Github Copilot goes down, or we change vendors, or the model starts degrading, does the team grind to a halt? If yes, you are a security risk.

**4\. Failure Retrospectives with Context**

When AI-generated code fails:

* Document the prompt, the output, why it seemed right, and why it failed.
    
* Turn failures into teaching moments about *architecture and practices*, not just syntax.
    

Ideally, future models with persistent memory and project-level context will handle this &#34;context repair&#34; automatically. But until the tools can effectively articulate their own reasoning back to the team, our social systems must be stronger than our technical ones.

## Be the Seed Vault

We may be the only ones who understand both worlds: the friction of the manual struggle and the speed of the augmented future. Our role is not to guard the past, but to secure the future.

We must act as the bridge. We must ensure that as we move toward a world of &#34;instant code,&#34; we don&#39;t lose the &#34;earned understanding&#34; that keeps those systems standing. We must become the Seed Vaults—preserving the genetic diversity of thought required to survive the next famine.

*Note: Parts of this post were refined using Gemini and Claude to sharpen the articulation.*
</source:markdown>
    </item>
    
    <item>
      <title>Delaying architectural commitment until team understanding emerges</title>
      <link>https://aravindkunnath.com/2026/01/09/delaying-architectural-commitment-until-team/</link>
      <pubDate>Fri, 09 Jan 2026 16:36:41 -0500</pubDate>
      
      <guid>http://aravindkunnath.micro.blog/2026/01/09/delaying-architectural-commitment-until-team/</guid>
      <description>&lt;p&gt;Two related problems that I have consistently seen in teams are&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Architectural decisions made before understanding the domain become increasingly difficult to change. Technically, organizationally and psychologically difficult. Teams carry these decisions like a weight.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;This weight manifests as regret. Not the mild &amp;lsquo;we could have done this better&amp;rsquo; kind. The kind that slows teams down, creates friction, and makes every subsequent decision harder.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I&amp;rsquo;ve also seen the inverse - teams that prioritize explicit learning over uncertainty or premature certainty are able to deliver smoothly. With such teams, the software and its evolution follows the path of the team&amp;rsquo;s understanding. Much like Peter Naur&amp;rsquo;s theory building, the shared mental model produces the system&amp;rsquo;s attributes. Software in that sense is an emergent artifact.&lt;/p&gt;
&lt;p&gt;Following is one of many real-world project experiences that I have, where I actively learned about this.&lt;/p&gt;
&lt;p&gt;This was a project of 4 pairs of developers, and we had a somewhat rigid deadline of 3-4 months. Before I joined, the team and the architect decided to implement 3 services for a system - one for accepting messages, another one for sending out reports and the third one was a CRUD service for managing some configuration and metadata. Because of budget constraints and organizational policies around having a single writer for a single database instance, it was decided to use one database. Since the data consistency requirements were pretty strict, it was decided that the third service will be hosting an HTTP API and the other two services would use a synchronous API call to fetch/persist data. I inherited these decisions and watched the team struggle with them.&lt;/p&gt;
&lt;p&gt;It took us 3 months to complete all the initial requirements and go to production. Once it had gone into production, we started seeing some challenges with this architecture. In hindsight, the signals were there even before we went to production, but we were too busy getting things done. The challenges were&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;HTTP semantics was leaked into the model&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;API calls took more than 300ms most of the times and we did not have any control over the overall API gateway setup&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;When minor new requirements to add a few flags into the database came in, we had to start updating the models in all three services. We were already in a coupled deployments mode, so this was not going to fix much.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The team was distributed and required increasingly more communication to synchronize changes.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;We were learning that the architectural decisions of the past were biting us. All of this had taken around 3 months to build. And we were learning from our mistakes. But we had done something right, we had a pretty good handle on our testing. Our tests were largely behavioural. Though there were some meet-the-coverage tests, we had built a good suite of tests that we trusted on. A short internal discussion with the team screamed frustration around the way changes had to be done. And then I reframed it - &amp;lsquo;What if those three months were learning? What can we do with that knowledge?&amp;rsquo;. To all of us, the obvious option was &amp;ldquo;remove the service that does not work for us&amp;rdquo;. We did a back of the napkin estimation of what we would need to do to change the architecture, and rewrite/refactor the whole thing. I had by then introduced the concepts of feature flags from evolutionary architecture to the team, so we devised a case, a plan and estimated a timeline of 3 weeks to change everything.&lt;/p&gt;
&lt;p&gt;We had to convince leadership to approve a re-architecture of 3-month-old production code. Most organizations default to &amp;ldquo;make it work&amp;rdquo; rather than &amp;ldquo;let&amp;rsquo;s redo it&amp;rdquo;. We presented the facts as follows&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Every change takes 2 days instead of 2 hours due to coordination overhead&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;APM shows that there is a consistent mean latency of more than 300ms . We have to address this before we scale up.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;We are here due to the policy, and we know a better way to address that policy&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;We understand the problem and domain better now to solve this&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Feature flags is a guard rail and let us run both in parallel and roll back instantly&amp;quot;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And in 3 weeks, we&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;removed the CRUD service entirely&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;addressed the performance and scalability concerns&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;unified the data models across the rest of the two services and had clear idea of which service is responsibility for what&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;feature flagged the transition&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;3 weeks is all it took to change the approach to deploy it into production and in the fourth week we had switched the flag. Surprisingly, the team just knew what needed to be done. Since the organizational mandate to have one writer service had to be complied with, we designated the second service as the sole writer. The first service simply published messages to a topic rather than blocking on a synchronous HTTP call.&lt;/p&gt;
&lt;p&gt;Was the initial architecture wrong? Yea, it was. Could we have known it beforehand? I am not sure. Almost everything about the technology, except some of the org policies, the team knew and were highly skilled at. But the team had not learned about the problem. Once they learned the problem, when there was a shared understanding, the development velocity changed unprecedentedly. The first three months were actually a learning phase that changed the way the team understood about the feature. Once learnt, their commitment and understanding of how to build the software had drastically changed. If we had called this phase as a learning phase explicitly, the organizational friction would have been much lower. The team psychology would have been different. We would have made different technical choices (simpler, easier to change). We may not have taken that whole 3 months to achieve the understanding and the architecture would have emerged without the frustration.&lt;/p&gt;
&lt;p&gt;This also aligns with the &amp;lsquo;Monolith First&amp;rsquo; principle - teams need to learn boundaries before committing. Rigid adherence to any architectural pattern or decision without explicit learning prevents the co-evolution of teams and systems that produce satisfactory software.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What if we acknowledged that software exists in different states of team&amp;rsquo;s understanding or learning - not like &amp;lsquo;development&amp;rsquo; then &amp;lsquo;production,&amp;rsquo; but states based on how well we grasp the problem we&amp;rsquo;re solving?&lt;/strong&gt; Certainly, the entire application cannot be in learning state forever. But could we have different parts at different levels of certainty - some we&amp;rsquo;re learning, some stable, some foundational?&lt;/p&gt;
&lt;p&gt;I call this Adaptive Architecture (though the name matters much less than the concept right now). It has three distinct zones within your solution space:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Learning Zone&lt;/strong&gt; - Where teams are discovering the problem&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Stable Zone&lt;/strong&gt; - Where understanding is proven and patterns are formalized&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Non-negotiable Zone&lt;/strong&gt; - Where aspects that are foundational and cannot be traded off lives&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Each zone has different rules, different quality bars, and different expectations. The key is making these zones explicit and providing clear criteria for moving between them.&lt;/p&gt;
&lt;p&gt;![](&lt;a href=&#34;https://cdn.hashnode.com/res/hashnode/image/upload/v1767992915866/9160d4a7-81d6-4a7f-8498-8cd5f897a8e8.png&#34;&gt;cdn.hashnode.com/res/hashn&amp;hellip;&lt;/a&gt; align=&amp;ldquo;center&amp;rdquo;)&lt;/p&gt;
&lt;h2 id=&#34;learning-zone&#34;&gt;Learning Zone&lt;/h2&gt;
&lt;p&gt;The Learning Zone is where teams discover what they will actually building. The priority is for the team to learn, and build the simplest thing that can teach you about the problem.  Product and engineering work closely, defining success criteria before writing code: What needs to be true for this to work? What signals will tell us if it&amp;rsquo;s working?&lt;/p&gt;
&lt;p&gt;Don&amp;rsquo;t sacrifice quality, testability, or observability. Instead sacrifice architectural purity, code coverage targets, and fitting into existing patterns. Write behavioural tests that capture what the feature/capability does, not how it does it. These tests are important and become your safety net for refactoring or rewriting later. Use CUPID or light weight patterns. Don&amp;rsquo;t try to abstract. Instead make your tests be simple, readable and overall - show that you are learning the expected behaviour.&lt;/p&gt;
&lt;p&gt;There is only one goal in this phase - learn - for both product and engineering. This phase is over once the code is deployed into production and there is feedback about how it is working. Gather signals. If the implementation feels wrong, rewrite it. If the feature isn&amp;rsquo;t valuable, delete it. You haven&amp;rsquo;t committed yet.&lt;/p&gt;
&lt;h2 id=&#34;promotion-gate&#34;&gt;Promotion Gate&lt;/h2&gt;
&lt;p&gt;Once a feature proves its value in production, it goes through a promotion gate—a joint ritual between product and engineering. The questions are simple: Did we achieve the goals / expectations? Can we articulate the problem clearly? Can we name or rename concepts without ambiguity? Has the team built a shared mental model? Some of these are measurable, and some are not. And that is fine.&lt;/p&gt;
&lt;p&gt;If the answer is yes, refactor or rewrite it into the Stable Zone. The behavioural tests from Learning become your safety net - if they still pass, you understand the behaviour. If they break, you missed something. Tests may need minor adjustments but a complete rewrite of tests means that you did not understand the behaviour.&lt;/p&gt;
&lt;p&gt;Not everything gets promoted either. Failed experiments are removed and those do not touch the stable zone. Experiments that worked but need a different approach get rewritten—cheaply, because you haven&amp;rsquo;t committed to the architecture yet. Only features that prove their value earn the investment in proper patterns.&lt;/p&gt;
&lt;h2 id=&#34;stable-zone&#34;&gt;Stable Zone&lt;/h2&gt;
&lt;p&gt;The Stable Zone is where proven features live. Here, architectural patterns matter. SOLID principles make sense because you know what should be open/closed. DDD tactical patterns work because you&amp;rsquo;ve learned the actual entities. Bounded contexts can be formalized because you discovered where natural seams are.&lt;/p&gt;
&lt;p&gt;Code here has proper structure, documentation, and fits the broader architecture. Changes are deliberate and well-tested. The quality bar is high because this code has earned the right to stay.&lt;/p&gt;
&lt;p&gt;Features in the Learning Zone can depend on Stable Zone code, but never the reverse. Stable code cannot depend on Learning Zone experiments—that would make it unstable.&lt;/p&gt;
&lt;p&gt;If a Stable Zone feature needs significant change, it returns to the Learning Zone first. You&amp;rsquo;re learning again, so treat it as uncertain. Feature flags and evolutionary architecture patterns make this transition safe—the stable version keeps running while you experiment with the new approach.&lt;/p&gt;
&lt;h2 id=&#34;non-negotiable-zone&#34;&gt;Non-negotiable Zone&lt;/h2&gt;
&lt;p&gt;The Non-negotiable Zone is where the platform lives. Infrastructure, observability, authentication, deployment pipelines, feature flags, monitoring - the foundational aspects both other zones depend on. This is also the set of foundational decisions that the team has to make and carry.&lt;/p&gt;
&lt;p&gt;The quality bar here is also different: resilience, redundancy, careful change management, peer reviews. Changes are infrequent and heavily scrutinized. In Team Topologies terms, this is platform team territory - providing capabilities as a service to product teams.&lt;/p&gt;
&lt;p&gt;This zone doesn&amp;rsquo;t learn about the domain. It enables learning.&lt;/p&gt;
&lt;h2 id=&#34;closing-notes&#34;&gt;Closing notes&lt;/h2&gt;
&lt;p&gt;This extends the principles from my earlier essay on &lt;a href=&#34;https://akdev.blog/empathetic-systems-designing-systems-for-human-decision-making&#34;&gt;Empathetic Systems&lt;/a&gt;, where I argued for designing systems around human decision-making and psychological safety. Adaptive Architecture is how to operationalize those principles - giving teams explicit structures that acknowledge uncertainty, validate learning, and remove the burden of premature commitment.&lt;/p&gt;
&lt;p&gt;Most of my regret for the software systems that I built accumulated from knowledge gained after deployment, when I&amp;rsquo;d already committed to decisions that weren&amp;rsquo;t easy to revert. Adaptive Architecture is a framework that structures delayed decision-making for teams building under uncertainty. If your team is churning on decisions, the zones and language might help.&lt;/p&gt;
&lt;p&gt;To the purist in you, this is not a new architecture. It&amp;rsquo;s more of a meta-architecture or an architectural decision-making framework that codifies patterns I&amp;rsquo;ve observed across projects. When teams had explicit permission to learn before committing, delivery improved and regret decreased.&lt;/p&gt;
&lt;p&gt;If you try this, even with just one feature, I&amp;rsquo;d welcome your feedback. What worked? What friction did you hit? I&amp;rsquo;m developing reference implementations and refining the framework based on real use.&lt;/p&gt;
&lt;p&gt;In the next post, I hope to show you an example using Java and Spring Boot.&lt;/p&gt;
</description>
      <source:markdown>Two related problems that I have consistently seen in teams are

1. Architectural decisions made before understanding the domain become increasingly difficult to change. Technically, organizationally and psychologically difficult. Teams carry these decisions like a weight.
    
2. This weight manifests as regret. Not the mild &#39;we could have done this better&#39; kind. The kind that slows teams down, creates friction, and makes every subsequent decision harder.
    

I&#39;ve also seen the inverse - teams that prioritize explicit learning over uncertainty or premature certainty are able to deliver smoothly. With such teams, the software and its evolution follows the path of the team&#39;s understanding. Much like Peter Naur&#39;s theory building, the shared mental model produces the system&#39;s attributes. Software in that sense is an emergent artifact.

Following is one of many real-world project experiences that I have, where I actively learned about this.

This was a project of 4 pairs of developers, and we had a somewhat rigid deadline of 3-4 months. Before I joined, the team and the architect decided to implement 3 services for a system - one for accepting messages, another one for sending out reports and the third one was a CRUD service for managing some configuration and metadata. Because of budget constraints and organizational policies around having a single writer for a single database instance, it was decided to use one database. Since the data consistency requirements were pretty strict, it was decided that the third service will be hosting an HTTP API and the other two services would use a synchronous API call to fetch/persist data. I inherited these decisions and watched the team struggle with them.

It took us 3 months to complete all the initial requirements and go to production. Once it had gone into production, we started seeing some challenges with this architecture. In hindsight, the signals were there even before we went to production, but we were too busy getting things done. The challenges were

1. HTTP semantics was leaked into the model
    
2. API calls took more than 300ms most of the times and we did not have any control over the overall API gateway setup
    
3. When minor new requirements to add a few flags into the database came in, we had to start updating the models in all three services. We were already in a coupled deployments mode, so this was not going to fix much.
    
4. The team was distributed and required increasingly more communication to synchronize changes.
    

We were learning that the architectural decisions of the past were biting us. All of this had taken around 3 months to build. And we were learning from our mistakes. But we had done something right, we had a pretty good handle on our testing. Our tests were largely behavioural. Though there were some meet-the-coverage tests, we had built a good suite of tests that we trusted on. A short internal discussion with the team screamed frustration around the way changes had to be done. And then I reframed it - &#39;What if those three months were learning? What can we do with that knowledge?&#39;. To all of us, the obvious option was &#34;remove the service that does not work for us&#34;. We did a back of the napkin estimation of what we would need to do to change the architecture, and rewrite/refactor the whole thing. I had by then introduced the concepts of feature flags from evolutionary architecture to the team, so we devised a case, a plan and estimated a timeline of 3 weeks to change everything.

We had to convince leadership to approve a re-architecture of 3-month-old production code. Most organizations default to &#34;make it work&#34; rather than &#34;let&#39;s redo it&#34;. We presented the facts as follows

* Every change takes 2 days instead of 2 hours due to coordination overhead
    
* APM shows that there is a consistent mean latency of more than 300ms . We have to address this before we scale up.
    
* We are here due to the policy, and we know a better way to address that policy
    
* We understand the problem and domain better now to solve this
    
* Feature flags is a guard rail and let us run both in parallel and roll back instantly&#34;
    

And in 3 weeks, we

1. removed the CRUD service entirely
    
2. addressed the performance and scalability concerns
    
3. unified the data models across the rest of the two services and had clear idea of which service is responsibility for what
    
4. feature flagged the transition
    

3 weeks is all it took to change the approach to deploy it into production and in the fourth week we had switched the flag. Surprisingly, the team just knew what needed to be done. Since the organizational mandate to have one writer service had to be complied with, we designated the second service as the sole writer. The first service simply published messages to a topic rather than blocking on a synchronous HTTP call.

Was the initial architecture wrong? Yea, it was. Could we have known it beforehand? I am not sure. Almost everything about the technology, except some of the org policies, the team knew and were highly skilled at. But the team had not learned about the problem. Once they learned the problem, when there was a shared understanding, the development velocity changed unprecedentedly. The first three months were actually a learning phase that changed the way the team understood about the feature. Once learnt, their commitment and understanding of how to build the software had drastically changed. If we had called this phase as a learning phase explicitly, the organizational friction would have been much lower. The team psychology would have been different. We would have made different technical choices (simpler, easier to change). We may not have taken that whole 3 months to achieve the understanding and the architecture would have emerged without the frustration.

This also aligns with the &#39;Monolith First&#39; principle - teams need to learn boundaries before committing. Rigid adherence to any architectural pattern or decision without explicit learning prevents the co-evolution of teams and systems that produce satisfactory software.

**What if we acknowledged that software exists in different states of team&#39;s understanding or learning - not like &#39;development&#39; then &#39;production,&#39; but states based on how well we grasp the problem we&#39;re solving?** Certainly, the entire application cannot be in learning state forever. But could we have different parts at different levels of certainty - some we&#39;re learning, some stable, some foundational?

I call this Adaptive Architecture (though the name matters much less than the concept right now). It has three distinct zones within your solution space:

1. **Learning Zone** - Where teams are discovering the problem
    
2. **Stable Zone** - Where understanding is proven and patterns are formalized
    
3. **Non-negotiable Zone** - Where aspects that are foundational and cannot be traded off lives
    

Each zone has different rules, different quality bars, and different expectations. The key is making these zones explicit and providing clear criteria for moving between them.

![]([cdn.hashnode.com/res/hashn...](https://cdn.hashnode.com/res/hashnode/image/upload/v1767992915866/9160d4a7-81d6-4a7f-8498-8cd5f897a8e8.png) align=&#34;center&#34;)

## Learning Zone

The Learning Zone is where teams discover what they will actually building. The priority is for the team to learn, and build the simplest thing that can teach you about the problem.  Product and engineering work closely, defining success criteria before writing code: What needs to be true for this to work? What signals will tell us if it&#39;s working?

Don&#39;t sacrifice quality, testability, or observability. Instead sacrifice architectural purity, code coverage targets, and fitting into existing patterns. Write behavioural tests that capture what the feature/capability does, not how it does it. These tests are important and become your safety net for refactoring or rewriting later. Use CUPID or light weight patterns. Don&#39;t try to abstract. Instead make your tests be simple, readable and overall - show that you are learning the expected behaviour.

There is only one goal in this phase - learn - for both product and engineering. This phase is over once the code is deployed into production and there is feedback about how it is working. Gather signals. If the implementation feels wrong, rewrite it. If the feature isn&#39;t valuable, delete it. You haven&#39;t committed yet.

## Promotion Gate

Once a feature proves its value in production, it goes through a promotion gate—a joint ritual between product and engineering. The questions are simple: Did we achieve the goals / expectations? Can we articulate the problem clearly? Can we name or rename concepts without ambiguity? Has the team built a shared mental model? Some of these are measurable, and some are not. And that is fine.

If the answer is yes, refactor or rewrite it into the Stable Zone. The behavioural tests from Learning become your safety net - if they still pass, you understand the behaviour. If they break, you missed something. Tests may need minor adjustments but a complete rewrite of tests means that you did not understand the behaviour.

Not everything gets promoted either. Failed experiments are removed and those do not touch the stable zone. Experiments that worked but need a different approach get rewritten—cheaply, because you haven&#39;t committed to the architecture yet. Only features that prove their value earn the investment in proper patterns.

## Stable Zone

The Stable Zone is where proven features live. Here, architectural patterns matter. SOLID principles make sense because you know what should be open/closed. DDD tactical patterns work because you&#39;ve learned the actual entities. Bounded contexts can be formalized because you discovered where natural seams are.

Code here has proper structure, documentation, and fits the broader architecture. Changes are deliberate and well-tested. The quality bar is high because this code has earned the right to stay.

Features in the Learning Zone can depend on Stable Zone code, but never the reverse. Stable code cannot depend on Learning Zone experiments—that would make it unstable.

If a Stable Zone feature needs significant change, it returns to the Learning Zone first. You&#39;re learning again, so treat it as uncertain. Feature flags and evolutionary architecture patterns make this transition safe—the stable version keeps running while you experiment with the new approach.

## Non-negotiable Zone

The Non-negotiable Zone is where the platform lives. Infrastructure, observability, authentication, deployment pipelines, feature flags, monitoring - the foundational aspects both other zones depend on. This is also the set of foundational decisions that the team has to make and carry.

The quality bar here is also different: resilience, redundancy, careful change management, peer reviews. Changes are infrequent and heavily scrutinized. In Team Topologies terms, this is platform team territory - providing capabilities as a service to product teams.

This zone doesn&#39;t learn about the domain. It enables learning.

## Closing notes

This extends the principles from my earlier essay on [Empathetic Systems](https://akdev.blog/empathetic-systems-designing-systems-for-human-decision-making), where I argued for designing systems around human decision-making and psychological safety. Adaptive Architecture is how to operationalize those principles - giving teams explicit structures that acknowledge uncertainty, validate learning, and remove the burden of premature commitment.

Most of my regret for the software systems that I built accumulated from knowledge gained after deployment, when I&#39;d already committed to decisions that weren&#39;t easy to revert. Adaptive Architecture is a framework that structures delayed decision-making for teams building under uncertainty. If your team is churning on decisions, the zones and language might help.

To the purist in you, this is not a new architecture. It&#39;s more of a meta-architecture or an architectural decision-making framework that codifies patterns I&#39;ve observed across projects. When teams had explicit permission to learn before committing, delivery improved and regret decreased.

If you try this, even with just one feature, I&#39;d welcome your feedback. What worked? What friction did you hit? I&#39;m developing reference implementations and refining the framework based on real use.

In the next post, I hope to show you an example using Java and Spring Boot.
</source:markdown>
    </item>
    
    <item>
      <title>Empathetic Systems: Designing Systems for Human Decision-Making</title>
      <link>https://aravindkunnath.com/2025/11/11/empathetic-systems-designing-systems-for/</link>
      <pubDate>Tue, 11 Nov 2025 16:12:21 -0500</pubDate>
      
      <guid>http://aravindkunnath.micro.blog/2025/11/11/empathetic-systems-designing-systems-for/</guid>
      <description>&lt;p&gt;Software begins as an idea in our minds, gets translated through assumptions and decisions into code, and then gets deployed into an environment where it becomes &amp;ldquo;the software.&amp;rdquo; But what we&amp;rsquo;re rarely taught is that the story doesn&amp;rsquo;t end there.&lt;/p&gt;
&lt;p&gt;Once software is deployed and running in production, it starts providing feedback loops that actively shape how teams seek context, acquire knowledge, and open or close communication pathways. This is the reverse flow: how deployed software reforms the cognitive and social patterns of the teams that maintain it. An engineer who can easily set up the application locally learns differently from one struggling with a complex local setup. A slow-to-query database influences which questions teams choose to ask or avoid. Tightly coupled services dictate who talks to whom during planning sessions.&lt;/p&gt;
&lt;p&gt;The reverse flow matters because it shapes the most fundamental activity in software development: decision-making. Deployed systems actively train teams through feedback—rewarding certain patterns, punishing others, enabling or constraining choices. The quality of any software system is not a property of the code or the process itself, but a reflection of the quality of the thousands of decisions that have shaped it over time. When an engineer delays decisions until a senior manager is available, the system has taught them autonomous choices don&amp;rsquo;t survive. When another moves at lightning speed without reflection, the system rewards velocity over coherence. &lt;/p&gt;
&lt;p&gt;This essay argues that the ability to make, evaluate, and correct these decisions depends not on technical skill, but on the psychological safety of the environment in which they are made. The capacity to surface, evaluate, and reverse decisions ultimately determines whether systems thrive or decay under pressure.&lt;/p&gt;
&lt;p&gt;This realization prompts a critical question: If psychological safety drives our ability to report and learn from mistakes, shouldn&amp;rsquo;t we treat human dynamics as a first-class force in software system evolution? And if so, how might we design systems, architectures, and team boundaries with empathy and human values as organizing principles rather than afterthoughts?&lt;/p&gt;
&lt;h2 id=&#34;foundational-insights&#34;&gt;Foundational Insights&lt;/h2&gt;
&lt;p&gt;This essay is built upon the tradition of Peter Naur&amp;rsquo;s &amp;ldquo;Programming as Theory Building.&amp;rdquo; Instead of offering a formula or universally quantifiable patterns, I share patterns I’ve seen, felt, and reflected on during more than a decade of experience with multiple teams.&lt;/p&gt;
&lt;p&gt;Working with E-type systems—a concept originating in Lehman’s Theories of Software Evolution and central to modern Evolutionary Architecture—I&amp;rsquo;ve consistently observed that systems actively teach teams how to think, who to talk to, and what to care about. A slow database changes which questions teams ask. Tightly coupled services dictate who communicates during planning. Complex deployment pipelines reshape what counts as &amp;ldquo;done.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;This phenomenon, which I call the &amp;ldquo;reverse flow,&amp;rdquo; is a direct expression of a &lt;strong&gt;Socio-Technical System (STS)&lt;/strong&gt;. STS is a framework positing that the technical system (the code, the infrastructure) and the social system (the team, its communication patterns, its hierarchy) are inseparable. They continuously co-evolve, and a change in one will inevitably provoke a change in the other. This feedback loop—how deployed systems reshape the cognitive and social patterns of teams—appears consistently across E-type systems.&lt;/p&gt;
&lt;p&gt;The critical factor determining whether this feedback loop enables evolution or decay isn&amp;rsquo;t technical skill—it&amp;rsquo;s &lt;strong&gt;psychological safety&lt;/strong&gt;. Dr. Amy Edmondson&amp;rsquo;s research and Google&amp;rsquo;s Project Aristotle confirmed that of five characteristics of high-performing teams, psychological safety—the belief that one won&amp;rsquo;t be punished for speaking up—was the most important.&lt;/p&gt;
&lt;p&gt;Through this essay, I encourage leaders and practitioners to see these invisible, socio-technical forces and ask: what are our systems really teaching? Are they creating conditions for teams to sense problems and evolve—or suppressing the feedback loops we need?&lt;/p&gt;
&lt;h2 id=&#34;the-education-of-a-technical-expert&#34;&gt;The Education of a &amp;ldquo;Technical Expert&amp;rdquo;&lt;/h2&gt;
&lt;p&gt;The first few interviews I attended when trying to switch from my first job were, in the kindest terms, a monumental disaster. In one of them, an interviewer looked me in the eye and asked &amp;ldquo;Do you even know Java? If not, please don&amp;rsquo;t waste our time!&amp;rdquo; I apologized and left silently, feeling as though my years of study and effort amounted to nothing more than a few awkward moments. Bangalore traffic that evening gave me plenty of time to reflect. By the time I reached my apartment, I had made up my mind: I was going to learn this properly—mastering every technical detail from everything that I could grab.&lt;/p&gt;
&lt;p&gt;For the next six months, I consumed and learned everything I could get my hands on. JDK source files, Spring and Struts docs, Apache projects, IDEs like NetBeans and Eclipse—the list seemed endless. The &amp;ldquo;investment&amp;rdquo; paid off. All the interviews after that were a breeze and I landed a role at a late-stage startup, complete with the title—Associate Tech Lead.&lt;/p&gt;
&lt;p&gt;It was only when I actually joined this new team that I realized knowledge—however hard-won—was not the most precious commodity. In those initial days, I looked at my teammates and wondered how they managed to get so much done, even though some of them hadn&amp;rsquo;t memorized the internals of the JDK or weren’t obsessed over API docs. They built elegant software without needing to show off deep theoretical knowledge. My confidence began to wobble, and I found myself wrestling with frustration and impatience.&lt;/p&gt;
&lt;p&gt;There was something within the team that I didn&amp;rsquo;t really understand—a harmony in producing software without the burden of excessive theoretical knowledge. More importantly, they seemed to make decisions with a confidence and consistency I couldn&amp;rsquo;t explain. I had to know how they did it, but initial attempts weren&amp;rsquo;t successful. Nobody could explain how they were doing it. Questioning their thought process occasionally was acceptable, but I wanted deeper access to their mental models. I realized I needed to build interpersonal relationships with them.&lt;/p&gt;
&lt;p&gt;My urge to display my expertise and gain access to their thinking process, even though I was a &amp;lsquo;friendly lead,&amp;rsquo; backfired. The more I pushed, the more out of step I felt with the group. That insecurity—that leftover tension of being an outsider—made me reflect. Leadership, I soon realized, isn&amp;rsquo;t a title. It&amp;rsquo;s something you earn, step by step, by building trust and connection. So I let go of the burden of a lead and started small: inviting people for tea, for lunch, or the occasional after-work beer. Gradually, as I worked to break the ice, those small acts led to real conversations, the sharing of tips and tricks, the exchange of smiles, and—most importantly—everyone&amp;rsquo;s guard dropping.&lt;/p&gt;
&lt;p&gt;I was slowly gaining insights into their thinking process, their decision-making process. And I started noticing something interesting: each of us on the team had a different—but effective—way of making decisions. I was the quick starter, not afraid to make mistakes and learn fast. Another engineer was meticulous, needing to have every piece in place before committing. Yet another was skilled at following the manager&amp;rsquo;s direction and juggling everyone&amp;rsquo;s expectations. We all produced valuable software, each in our own style, pace, and rhythm. But more importantly, the decisions we made had different lifespans—some held up over days, weeks or months, others needed constant revision.&lt;/p&gt;
&lt;h2 id=&#34;discovering-and-reflecting-on-the-four-tendencies&#34;&gt;Discovering and Reflecting on the Four Tendencies&lt;/h2&gt;
&lt;p&gt;That observation became the focus of my work for the next twelve years. Working with multiple teams, I consistently saw this pattern of individual approaches to decision-making. Initially, I called this &amp;ldquo;profiling,&amp;rdquo; but that word never quite fit—it felt clinical and narrow. Instead of seeing differences as quirks or obstacles, I began recognizing them as decision-making patterns. That’s when I was introduced to Gretchen Rubin&amp;rsquo;s &amp;ldquo;Four Tendencies&amp;rdquo; framework, and suddenly, the diversity I had sensed in team dynamics had a language of its own.&lt;/p&gt;
&lt;p&gt;The Four Tendencies model categorizes human motivation into four types, based on how we respond to expectations:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Upholder&lt;/strong&gt;: Responds readily to both outer and inner expectations.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Questioner&lt;/strong&gt;: Meets expectations only if they make sense internally.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Obliger&lt;/strong&gt;: Meets outer expectations, struggles with inner expectations.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Rebel&lt;/strong&gt;: Resists both outer and inner expectations.  &lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In software teams, these tendencies are deciding factors for success—they&amp;rsquo;re at the heart of how architectural decisions get made, how long they last, and whether they serve the system or create debt. Understanding what motivates individuals becomes a tool for real leadership, adapting practices, communications, and even architecture to fit the constellation of personalities in the room.&lt;/p&gt;
&lt;h2 id=&#34;decisions-that-endure&#34;&gt;Decisions That Endure&lt;/h2&gt;
&lt;p&gt;Some engineers respond readily to both outer and inner expectations—what Gretchen Rubin calls Upholders. Their motto is &amp;ldquo;Discipline is my freedom,&amp;rdquo; reflecting their ability to create structure and follow through consistently. In software projects, upholders possess high regard for their values—whether that&amp;rsquo;s code quality, design purity, or other aspects they hold dear. They strive to maintain these standards and can seem reluctant to change because compromising their values feels like an attack on their identity.&lt;/p&gt;
&lt;p&gt;As decision-makers, upholders excel at creating durable architectural choices that protect system invariants. When they commit to a decision, it tends to hold up over time because they&amp;rsquo;ve aligned it with their core values.&lt;/p&gt;
&lt;p&gt;In one of the projects that I joined midway, John, a senior engineer used to leave comments about readability—variable names, line width, spaces vs tabs—in pretty much every single PR that was created by the team. Being nice to talk to, nobody really figured out why the comments were a little too &amp;ldquo;pedantic.&amp;rdquo; I started noticing that there was visible discomfort growing in the team, and decided to understand what was motivating John. It turns out, John was spending most of the time in on-call support. And to John, the most readable code was the easiest to debug when there was a production issue. My curiosity to understand, to uncover the why for this behavior, revealed something interesting. The on-call roster was almost always fixed with John supporting during the weekend or late hours. It turned out that John, deeply valuing the application&amp;rsquo;s availability**,** always volunteered for the duty, ensuring he was the one to guard its stability**.** &lt;/p&gt;
&lt;p&gt;As an intervention, I started advocating for the importance of rotation and introduced linters and formatters after standardizing our norms. This wasn&amp;rsquo;t just about code style—it created the necessary decision framework where readability standards became automated, allowing the Upholder to protect their values without blocking team velocity. The architectural decision to standardize through tooling meant individual PRs no longer required manual review for style, freeing this engineer to make higher-level stability decisions. The linter intervention broke a feedback loop: the Upholder no longer received constant negative feedback from PRs violating his values, which had been reinforcing his gatekeeping behavior. Automation changed what the deployed system taught him about his role.&lt;/p&gt;
&lt;p&gt;Upholders excel as guardians of software, especially in areas requiring attention and stability. They continuously keep things tidied up, tested, and documented. As a lead, your role is to identify the upholders, understand their values, and map them to areas of the software where stability, clean practices, and reliability are crucial. While automated tooling like linters provides elegant solutions, larger architectural evolution requires careful conversation to help Upholders see how change protects rather than compromises their core values.&lt;/p&gt;
&lt;p&gt;This dynamic illustrates how psychological safety for Upholders means explicitly protecting their core values and creating automated frameworks that respect those standards. When the environment validates their sense of discipline and maintains stability, Upholders thrive and produce lasting architectural decisions. Without this safety, they tend to gatekeep or disengage, harming team morale and quality.&lt;/p&gt;
&lt;h2 id=&#34;decisions-built-on-conviction&#34;&gt;Decisions Built on Conviction&lt;/h2&gt;
&lt;p&gt;Other engineers question all expectations before deciding whether to meet them—the Questioners. They will only comply if they understand the reasoning and believe it makes sense. Their motto is &amp;ldquo;I&amp;rsquo;ll comply—if you convince me why,&amp;rdquo; highlighting their need for logical reasoning and evidence-based decision-making.&lt;/p&gt;
&lt;p&gt;Being a questioner myself, I know that without understanding the &amp;ldquo;why,&amp;rdquo; a questioner simply cannot function well. They aren&amp;rsquo;t asking because they want answers handed to them; they want conviction and the satisfaction of finding answers themselves. As decision-makers, questioners require full understanding of the decision space before committing. Without investigation time, they either delay decisions or make uncommitted ones that create technical debt.&lt;/p&gt;
&lt;p&gt;A new engineer, Sarah, on my team was tasked with implementing a feature using a third-party library. Sarah received code snippets, relevant stories and was instructed, &amp;ldquo;Let&amp;rsquo;s go!&amp;rdquo; Instead of an implementation, the first week produced endless questions: How will you do it? Who did this POC? Can I talk to them? How did they decide option A versus option B?&lt;/p&gt;
&lt;p&gt;Recognizing the tendency, I knew we had to let Sarah find the answers. I worked with her to prepare a roadmap for talking to other engineers and gave them room to ask questions, while still setting a clear timeline to produce working software—even if imperfect—to enable iteration. For two weeks, nothing worthy of being called a solution emerged. In the third week, Sarah reached out: &amp;ldquo;I think I figured it out.&amp;rdquo; She presented a high-quality approach that answered every question I could throw at her, complete with bookmarks to documentation. But she didn&amp;rsquo;t stop at the immediate problem. She also delivered recommendations for caching and observability—the stepping stones for a platform-first approach that would benefit the entire team. She had acquired deep knowledge without anyone teaching her. It was a powerful lesson in leadership: sometimes the most valuable action is not to provide answers, but to create the space for conviction to grow. This was one of the best teachable moments of my life.&lt;/p&gt;
&lt;p&gt;The two-week exploration period enabled high-quality architectural decision-making because Sarah understood the entire decision space. The decision she made held up throughout the project because it was built on genuine conviction, not blind execution. The exploration period created a new feedback loop: instead of the deployed system sending confusing signals that increased their questions, they could interrogate the system directly until it made sense. The architecture stopped being a black box that they had to accept or that was handed down from someone else. It became something that they could question, understand and improvise. &lt;/p&gt;
&lt;p&gt;Most projects don&amp;rsquo;t allocate the investigation time Questioners need to build conviction. I&amp;rsquo;ve learned to create explicit time boundaries that protect their exploration while maintaining delivery momentum. In 1-1s, I encourage them to start with small, working increments they can question and improve iteratively, rather than trying to achieve complete understanding upfront. This gives them a tangible system to interrogate—turning their natural questioning into rapid learning rather than decision paralysis. However, not every project can afford weeks of exploration before producing output. The ongoing work is convincing Questioners that working software is the only reliable way to test reality—that conviction builds through the reverse flow from deployed systems, not endless upfront analysis.&lt;/p&gt;
&lt;p&gt;For Questioners, psychological safety manifests as allowing space for exploration and assuring their questions will be taken seriously. This sense of safety enables them to build internal conviction and contribute deeply reasoned decisions. When teams respect this need, Questioners become pillars of architectural integrity and learning; when the environment dismisses their inquiries, quality and trust suffer.&lt;/p&gt;
&lt;h2 id=&#34;external-accountability-as-decision-enabler&#34;&gt;External Accountability as Decision Enabler&lt;/h2&gt;
&lt;p&gt;Many engineers readily meet outer expectations but struggle with self-imposed ones—these are Obligers. Their motto is &amp;ldquo;You can count on me; and I&amp;rsquo;m counting on you to count on me,&amp;rdquo; emphasizing their responsiveness to external accountability.&lt;/p&gt;
&lt;p&gt;Obligers are often the most dependable members in a team, readily meeting external expectations. They blend well into most organizations, and are also the most common tendency I have observed. In hierarchical organizations, obliger patterns become normalized and nearly invisible. What looks like the shortest path to get work done is often an obliger tendency in action.  Obligers also look up to leaders who make decisions for them. They are excellent executors. As long as the context aligns, they produce satisfactory software and aren&amp;rsquo;t afraid of feedback. As decision-makers, they excel at executing decisions when accountability structures are clear, but struggle with autonomous architectural decisions.&lt;/p&gt;
&lt;p&gt;One challenge I&amp;rsquo;ve seen Obligers struggle with: without a safe environment, it&amp;rsquo;s hard to get their voice heard. Constant &amp;ldquo;pushing&amp;rdquo; without autonomy will wear them out, often translating to silent burnout. You can sense this during stand-ups: an untold frustration or a lack of interest, worst of all, a silent agreement.&lt;/p&gt;
&lt;p&gt;I once worked with a senior engineer, Alex, who knew how every part of the application had evolved. Yet, he would not propose new ideas or refactor with newer or different patterns. His response to most requests was the same—”Tell me what you need, I will get it done”. This was a significant bottleneck and he would delay the decision until I or another leader was available to make a decision for him, even though he was well aware of which route to take. This generated friction resulted in issues that were often taken care of as technical debt later. However, he saw the job as executing jira cards, and not actively participating in the evolution of the software. &lt;/p&gt;
&lt;p&gt;Simple conversations with Alex weren&amp;rsquo;t effective, but we both continuously shared how this friction in decision-making was slowing us down. However, over the many 1-1s Alex was also voicing the coupling issues between REST controllers and service logic—a problem that needed addressing. I used this as an opportunity to initiate a change—to decouple the controller layer and establish explicit package boundaries. Alex became the owner of the controller domain. This restructuring combined with explicit structural boundaries and ownership allowed us to establish a formal mandate for architectural ownership. This architectural intervention established a clear team boundary and reduced Alex&amp;rsquo;s cognitive load, giving him the external accountability and autonomy he needed to thrive.&lt;/p&gt;
&lt;p&gt;Alex was initially surprised and conveyed that he never thought that the application, architecture and structure, would be changed for him. He comfortably accepted the responsibility and territory. In further conversations, more and more room for experimentation and learning was introduced. The shift in Alex’s collaboration and participation was visible. He began experimenting with newer patterns in Spring, started making decisions without further delays and proactively refactoring and improving the controller layer. &lt;/p&gt;
&lt;p&gt;Obligers require psychological safety through clear, reliable external accountability structures and invitations to contribute. This external validation creates a secure space where they can take ownership and voice concerns without fear. For Alex, changing architecture was the clearest possible signal of trust and expectation, and was reciprocated with ownership and collaboration. External accountability structures inevitably change as organizations evolve, which can leave Obligers without their scaffolding. Rather than maintaining fixed structures, the goal is helping Obligers develop voice and agency alongside structural shifts—co-evolving their capacity to surface concerns even when familiar accountability patterns disappear. When such structures are absent or inconsistent, Obligers may silently withdraw, limiting architectural innovation and introducing hidden risks.&lt;/p&gt;
&lt;h2 id=&#34;rapid-decisions-and-decision-reconciliation&#34;&gt;Rapid Decisions and Decision Reconciliation&lt;/h2&gt;
&lt;p&gt;Some engineers resist all expectations, whether from others or themselves—the Rebels. They value freedom and autonomy above all else. Their motto is &amp;ldquo;You can&amp;rsquo;t make me, and neither can I.&amp;rdquo; Rebels are motivated by choice and the ability to act according to their own desires.&lt;/p&gt;
&lt;p&gt;Rebels push the boundaries of what is possible with software. They love to seek challenges and often work better with ambiguous requirements and less process. As decision-makers, rebels make rapid architectural decisions in ambiguous spaces but create decision inconsistency over time. This often creates an unprecedented drift in the software architecture. Their strength in quick decision-making can, over time, be seen as anti-process. I have noticed in teams with strong rebels a sine-wave like velocity—a period of quick action followed by a period of slow tidying up.&lt;/p&gt;
&lt;p&gt;I eventually understood this pattern as decision accumulation followed by decision reconciliation. The “tidying up” was for resolving inconsistencies between rapid decisions made without coordination.&lt;/p&gt;
&lt;p&gt;An engineer with around 5-6 years of experience, Nathan, was extremely good at any problem we could throw at him. Nathan also did not worry about many of the team&amp;rsquo;s practices, and seniors were always on alert when his PRs appeared. But, when speed was critical, the team expected Nathan to roll up his sleeves. I proposed to run an experiment: Nathan would actively contribute only four days a week. The fifth day, which I called &amp;ldquo;No-Decision Friday,&amp;rdquo; Nathan’s only tasks were to talk to other team members, reviewing changes, and updating documentation. No decisions on new work were allowed.&lt;/p&gt;
&lt;p&gt;No-Decision Fridays were simply a decision review cadence. This ritual slowed the pace but gave ample time to reflect and talk to others, relieving the frantic pace of work. Over many such Fridays, Nathan learned to distinguish which parts of the system could handle rapid iteration and which required coordination. He started contextualizing his changes—explaining his assumptions and trade-offs in PRs—which enabled continuous validation rather than late discovery of misalignments. The reconciliation periods shortened as Nathan developed judgment about where his speed was valuable and where it created friction. No-Decision Friday interrupted the rapid feedback loop that reinforced his quick-decision pattern. By forcing reflection before the deployed system responded to his changes, he could see the long-term consequences his decisions created.&lt;/p&gt;
&lt;p&gt;Decision reconciliation is expensive—the alignment conversations and rework have real costs to team velocity. The trade-off makes sense where pushing creative or innovation boundaries matters most, but in domains requiring tight coordination or predictable delivery, the reconciliation overhead can exceed the value of rapid experimentation. Not every rapid decision-maker is a high performer either—speed without skill creates chaos, not innovation. The key question is whether the rapid decisions, despite needing reconciliation, ultimately move the system forward. For Nathan, the experimentation phase uncovered possibilities that slower, more coordinated approaches would miss. The reconciliation cost was real but worthwhile. Given a different person and context, they  may require other non-technical, non-systemic interventions. In contexts where consistency matters more than exploration, this pattern becomes a liability rather than an asset.&lt;/p&gt;
&lt;p&gt;Rebels embody psychological safety through freedom and autonomy in choosing how and when to engage with architectural decisions. Providing ritualized time for reflection, like “No-Decision Friday,” creates a safe container for them to balance rapid innovation with necessary stabilization. Denying them this autonomy risks chaos, frustration, and architectural drift.&lt;/p&gt;
&lt;h2 id=&#34;conclusion---empathetic-systems&#34;&gt;Conclusion - Empathetic Systems&lt;/h2&gt;
&lt;p&gt;My observations and experiments consistently revealed that the human elements of a team had the most significant and sustained impact on team outcomes. I came to call this goal &amp;ldquo;Empathetic Systems&amp;rdquo;—a software system design that deeply resonates with the team&amp;rsquo;s mental models, their tendencies, and their learning paths.&lt;/p&gt;
&lt;p&gt;These tendencies are lenses, neither fixed characteristics nor labels. A Rebel may become an Obliger depending on the power dynamic, and an Upholder who values their team may become a Rebel in the face of an external threat. In reality, we are all four tendencies combined, depending on the context. Given different external factors—a new project, a change in team dynamics, a supportive manager, a challenging life event, or the evolution of the social system itself—a person&amp;rsquo;s dominant tendency can shift, and they can learn to access and strengthen other tendencies.&lt;/p&gt;
&lt;p&gt;This framework is a powerful tool for fostering empathy and understanding, but it must be used with wisdom and caution. These tendencies are not rigid boxes to put people in. Leaders should never use this framework to stereotype, label, or pre-judge team members. The goal is to open up conversations and build bridges of understanding, not to create divisions or limit opportunities. With the right environment—one built on trust, respect, and psychological safety—individuals can strengthen all four tendencies, becoming more versatile, resilient, and effective.&lt;/p&gt;
&lt;p&gt;The purpose of this approach is to shift our architectural thinking from &amp;ldquo;making good decisions&amp;rdquo; to &amp;ldquo;creating conditions where bad decisions surface fast.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;As Dr. Amy Edmondson found and Google’s Project Aristotle confirmed, psychological safety enables the learning behaviour required for error correction. In software terms, this means the most resilient architectures aren&amp;rsquo;t those with the fewest initial mistakes—they&amp;rsquo;re systems where decision problems surface quickly enough to fix before they spread. But a generic &amp;ldquo;open door policy&amp;rdquo; isn&amp;rsquo;t enough. To be effective, psychological safety must be targeted to the specific motivational drivers of the individuals on the team.&lt;/p&gt;
&lt;p&gt;Why emphasize these patterns when we&amp;rsquo;re hired for our technical expertise? Because how we learn software development creates a fundamental mismatch with how we must practice it.&lt;/p&gt;
&lt;p&gt;We&amp;rsquo;re taught to build programs that meet specifications—technical problems with known solutions. But most professional work is about maintaining E-type systems through collaborative decision-making under uncertainty. When professionally trained individuals enter these environments, they must unlearn the individualistic patterns that earned academic success. This unlearning only happens when psychological safety makes it safe to say &amp;ldquo;I don&amp;rsquo;t know&amp;rdquo; or &amp;ldquo;this isn&amp;rsquo;t working.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;The deployed system itself is the best teacher. It creates &amp;ldquo;teachable moments&amp;rdquo; through its reverse flow—defects, incidents, and structural constraints that reveal where our assumptions were wrong. Psychological safety simply creates the readiness to learn from what the system is teaching us.&lt;/p&gt;
&lt;p&gt;This is also why initiatives to adopt microservices, Team Topologies, or other &amp;ldquo;proven practices&amp;rdquo; so often fail to provide the promised value. Organizations apply the evolved blueprint without understanding the evolution itself. They miss the reverse flow and co-evolution: the continuous adaptation between human decision-making patterns and technical constraints. We must factor in this co-evolution for even the minutest aspects of software creation—from naming conventions to testing strategies to code review rituals. Successful teams didn&amp;rsquo;t start with the &amp;ldquo;right&amp;rdquo; architecture—they built psychological safety that allowed them to detect and correct architectural problems rapidly, creating feedback loops where the reverse flow could teach them effectively.&lt;/p&gt;
&lt;p&gt;Creating such responsiveness requires coordinated attention: architectural structures that enable reversible decisions, delivery practices that create guardrails like automated testing and feature flags, and processes that cultivate safety through rituals like blameless retrospectives and decision review cadences.&lt;/p&gt;
&lt;p&gt;Empathetic systems recognize that humans are both the agents and sensors of the systems they maintain. The deployed system sends signals constantly, but only humans can sense them and act. And different individuals sense different signals based on what they&amp;rsquo;re motivated to protect or pursue. Tightly coupled services create blame pressure; poorly abstracted boundaries teach teams that speaking up won&amp;rsquo;t help. When our architecture, delivery practices, and processes work together intentionally, they create feedback loops that strengthen psychological safety rather than erode it.&lt;/p&gt;
&lt;p&gt;After twelve years of observing these patterns, I&amp;rsquo;m convinced that understanding individual motivation is foundational for sustainable software architecture. The goal is to cultivate a high-performing team capable of continuously evolving the software. The system evolves through the decision-making conversation between human values and technical constraints—but only if both sides can speak honestly about what&amp;rsquo;s working and what isn&amp;rsquo;t.&lt;/p&gt;
&lt;p&gt;By caring for and nurturing the social system that creates the software, the system that is software evolves better. That is a future worth pursuing.&lt;/p&gt;
</description>
      <source:markdown>Software begins as an idea in our minds, gets translated through assumptions and decisions into code, and then gets deployed into an environment where it becomes &#34;the software.&#34; But what we&#39;re rarely taught is that the story doesn&#39;t end there.

Once software is deployed and running in production, it starts providing feedback loops that actively shape how teams seek context, acquire knowledge, and open or close communication pathways. This is the reverse flow: how deployed software reforms the cognitive and social patterns of the teams that maintain it. An engineer who can easily set up the application locally learns differently from one struggling with a complex local setup. A slow-to-query database influences which questions teams choose to ask or avoid. Tightly coupled services dictate who talks to whom during planning sessions.

The reverse flow matters because it shapes the most fundamental activity in software development: decision-making. Deployed systems actively train teams through feedback—rewarding certain patterns, punishing others, enabling or constraining choices. The quality of any software system is not a property of the code or the process itself, but a reflection of the quality of the thousands of decisions that have shaped it over time. When an engineer delays decisions until a senior manager is available, the system has taught them autonomous choices don&#39;t survive. When another moves at lightning speed without reflection, the system rewards velocity over coherence. 

This essay argues that the ability to make, evaluate, and correct these decisions depends not on technical skill, but on the psychological safety of the environment in which they are made. The capacity to surface, evaluate, and reverse decisions ultimately determines whether systems thrive or decay under pressure.

This realization prompts a critical question: If psychological safety drives our ability to report and learn from mistakes, shouldn&#39;t we treat human dynamics as a first-class force in software system evolution? And if so, how might we design systems, architectures, and team boundaries with empathy and human values as organizing principles rather than afterthoughts?

## Foundational Insights

This essay is built upon the tradition of Peter Naur&#39;s &#34;Programming as Theory Building.&#34; Instead of offering a formula or universally quantifiable patterns, I share patterns I’ve seen, felt, and reflected on during more than a decade of experience with multiple teams.

Working with E-type systems—a concept originating in Lehman’s Theories of Software Evolution and central to modern Evolutionary Architecture—I&#39;ve consistently observed that systems actively teach teams how to think, who to talk to, and what to care about. A slow database changes which questions teams ask. Tightly coupled services dictate who communicates during planning. Complex deployment pipelines reshape what counts as &#34;done.&#34;

This phenomenon, which I call the &#34;reverse flow,&#34; is a direct expression of a **Socio-Technical System (STS)**. STS is a framework positing that the technical system (the code, the infrastructure) and the social system (the team, its communication patterns, its hierarchy) are inseparable. They continuously co-evolve, and a change in one will inevitably provoke a change in the other. This feedback loop—how deployed systems reshape the cognitive and social patterns of teams—appears consistently across E-type systems.

The critical factor determining whether this feedback loop enables evolution or decay isn&#39;t technical skill—it&#39;s **psychological safety**. Dr. Amy Edmondson&#39;s research and Google&#39;s Project Aristotle confirmed that of five characteristics of high-performing teams, psychological safety—the belief that one won&#39;t be punished for speaking up—was the most important.

Through this essay, I encourage leaders and practitioners to see these invisible, socio-technical forces and ask: what are our systems really teaching? Are they creating conditions for teams to sense problems and evolve—or suppressing the feedback loops we need?

## The Education of a &#34;Technical Expert&#34;

The first few interviews I attended when trying to switch from my first job were, in the kindest terms, a monumental disaster. In one of them, an interviewer looked me in the eye and asked &#34;Do you even know Java? If not, please don&#39;t waste our time!&#34; I apologized and left silently, feeling as though my years of study and effort amounted to nothing more than a few awkward moments. Bangalore traffic that evening gave me plenty of time to reflect. By the time I reached my apartment, I had made up my mind: I was going to learn this properly—mastering every technical detail from everything that I could grab.

For the next six months, I consumed and learned everything I could get my hands on. JDK source files, Spring and Struts docs, Apache projects, IDEs like NetBeans and Eclipse—the list seemed endless. The &#34;investment&#34; paid off. All the interviews after that were a breeze and I landed a role at a late-stage startup, complete with the title—Associate Tech Lead.

It was only when I actually joined this new team that I realized knowledge—however hard-won—was not the most precious commodity. In those initial days, I looked at my teammates and wondered how they managed to get so much done, even though some of them hadn&#39;t memorized the internals of the JDK or weren’t obsessed over API docs. They built elegant software without needing to show off deep theoretical knowledge. My confidence began to wobble, and I found myself wrestling with frustration and impatience.

There was something within the team that I didn&#39;t really understand—a harmony in producing software without the burden of excessive theoretical knowledge. More importantly, they seemed to make decisions with a confidence and consistency I couldn&#39;t explain. I had to know how they did it, but initial attempts weren&#39;t successful. Nobody could explain how they were doing it. Questioning their thought process occasionally was acceptable, but I wanted deeper access to their mental models. I realized I needed to build interpersonal relationships with them.

My urge to display my expertise and gain access to their thinking process, even though I was a &#39;friendly lead,&#39; backfired. The more I pushed, the more out of step I felt with the group. That insecurity—that leftover tension of being an outsider—made me reflect. Leadership, I soon realized, isn&#39;t a title. It&#39;s something you earn, step by step, by building trust and connection. So I let go of the burden of a lead and started small: inviting people for tea, for lunch, or the occasional after-work beer. Gradually, as I worked to break the ice, those small acts led to real conversations, the sharing of tips and tricks, the exchange of smiles, and—most importantly—everyone&#39;s guard dropping.

I was slowly gaining insights into their thinking process, their decision-making process. And I started noticing something interesting: each of us on the team had a different—but effective—way of making decisions. I was the quick starter, not afraid to make mistakes and learn fast. Another engineer was meticulous, needing to have every piece in place before committing. Yet another was skilled at following the manager&#39;s direction and juggling everyone&#39;s expectations. We all produced valuable software, each in our own style, pace, and rhythm. But more importantly, the decisions we made had different lifespans—some held up over days, weeks or months, others needed constant revision.

## Discovering and Reflecting on the Four Tendencies

That observation became the focus of my work for the next twelve years. Working with multiple teams, I consistently saw this pattern of individual approaches to decision-making. Initially, I called this &#34;profiling,&#34; but that word never quite fit—it felt clinical and narrow. Instead of seeing differences as quirks or obstacles, I began recognizing them as decision-making patterns. That’s when I was introduced to Gretchen Rubin&#39;s &#34;Four Tendencies&#34; framework, and suddenly, the diversity I had sensed in team dynamics had a language of its own.

The Four Tendencies model categorizes human motivation into four types, based on how we respond to expectations:

* **Upholder**: Responds readily to both outer and inner expectations.
    
* **Questioner**: Meets expectations only if they make sense internally.
    
* **Obliger**: Meets outer expectations, struggles with inner expectations.
    
* **Rebel**: Resists both outer and inner expectations.  
    

In software teams, these tendencies are deciding factors for success—they&#39;re at the heart of how architectural decisions get made, how long they last, and whether they serve the system or create debt. Understanding what motivates individuals becomes a tool for real leadership, adapting practices, communications, and even architecture to fit the constellation of personalities in the room.

## Decisions That Endure

Some engineers respond readily to both outer and inner expectations—what Gretchen Rubin calls Upholders. Their motto is &#34;Discipline is my freedom,&#34; reflecting their ability to create structure and follow through consistently. In software projects, upholders possess high regard for their values—whether that&#39;s code quality, design purity, or other aspects they hold dear. They strive to maintain these standards and can seem reluctant to change because compromising their values feels like an attack on their identity.

As decision-makers, upholders excel at creating durable architectural choices that protect system invariants. When they commit to a decision, it tends to hold up over time because they&#39;ve aligned it with their core values.

In one of the projects that I joined midway, John, a senior engineer used to leave comments about readability—variable names, line width, spaces vs tabs—in pretty much every single PR that was created by the team. Being nice to talk to, nobody really figured out why the comments were a little too &#34;pedantic.&#34; I started noticing that there was visible discomfort growing in the team, and decided to understand what was motivating John. It turns out, John was spending most of the time in on-call support. And to John, the most readable code was the easiest to debug when there was a production issue. My curiosity to understand, to uncover the why for this behavior, revealed something interesting. The on-call roster was almost always fixed with John supporting during the weekend or late hours. It turned out that John, deeply valuing the application&#39;s availability**,** always volunteered for the duty, ensuring he was the one to guard its stability**.** 

As an intervention, I started advocating for the importance of rotation and introduced linters and formatters after standardizing our norms. This wasn&#39;t just about code style—it created the necessary decision framework where readability standards became automated, allowing the Upholder to protect their values without blocking team velocity. The architectural decision to standardize through tooling meant individual PRs no longer required manual review for style, freeing this engineer to make higher-level stability decisions. The linter intervention broke a feedback loop: the Upholder no longer received constant negative feedback from PRs violating his values, which had been reinforcing his gatekeeping behavior. Automation changed what the deployed system taught him about his role.

Upholders excel as guardians of software, especially in areas requiring attention and stability. They continuously keep things tidied up, tested, and documented. As a lead, your role is to identify the upholders, understand their values, and map them to areas of the software where stability, clean practices, and reliability are crucial. While automated tooling like linters provides elegant solutions, larger architectural evolution requires careful conversation to help Upholders see how change protects rather than compromises their core values.

This dynamic illustrates how psychological safety for Upholders means explicitly protecting their core values and creating automated frameworks that respect those standards. When the environment validates their sense of discipline and maintains stability, Upholders thrive and produce lasting architectural decisions. Without this safety, they tend to gatekeep or disengage, harming team morale and quality.

## Decisions Built on Conviction

Other engineers question all expectations before deciding whether to meet them—the Questioners. They will only comply if they understand the reasoning and believe it makes sense. Their motto is &#34;I&#39;ll comply—if you convince me why,&#34; highlighting their need for logical reasoning and evidence-based decision-making.

Being a questioner myself, I know that without understanding the &#34;why,&#34; a questioner simply cannot function well. They aren&#39;t asking because they want answers handed to them; they want conviction and the satisfaction of finding answers themselves. As decision-makers, questioners require full understanding of the decision space before committing. Without investigation time, they either delay decisions or make uncommitted ones that create technical debt.

A new engineer, Sarah, on my team was tasked with implementing a feature using a third-party library. Sarah received code snippets, relevant stories and was instructed, &#34;Let&#39;s go!&#34; Instead of an implementation, the first week produced endless questions: How will you do it? Who did this POC? Can I talk to them? How did they decide option A versus option B?

Recognizing the tendency, I knew we had to let Sarah find the answers. I worked with her to prepare a roadmap for talking to other engineers and gave them room to ask questions, while still setting a clear timeline to produce working software—even if imperfect—to enable iteration. For two weeks, nothing worthy of being called a solution emerged. In the third week, Sarah reached out: &#34;I think I figured it out.&#34; She presented a high-quality approach that answered every question I could throw at her, complete with bookmarks to documentation. But she didn&#39;t stop at the immediate problem. She also delivered recommendations for caching and observability—the stepping stones for a platform-first approach that would benefit the entire team. She had acquired deep knowledge without anyone teaching her. It was a powerful lesson in leadership: sometimes the most valuable action is not to provide answers, but to create the space for conviction to grow. This was one of the best teachable moments of my life.

The two-week exploration period enabled high-quality architectural decision-making because Sarah understood the entire decision space. The decision she made held up throughout the project because it was built on genuine conviction, not blind execution. The exploration period created a new feedback loop: instead of the deployed system sending confusing signals that increased their questions, they could interrogate the system directly until it made sense. The architecture stopped being a black box that they had to accept or that was handed down from someone else. It became something that they could question, understand and improvise. 

Most projects don&#39;t allocate the investigation time Questioners need to build conviction. I&#39;ve learned to create explicit time boundaries that protect their exploration while maintaining delivery momentum. In 1-1s, I encourage them to start with small, working increments they can question and improve iteratively, rather than trying to achieve complete understanding upfront. This gives them a tangible system to interrogate—turning their natural questioning into rapid learning rather than decision paralysis. However, not every project can afford weeks of exploration before producing output. The ongoing work is convincing Questioners that working software is the only reliable way to test reality—that conviction builds through the reverse flow from deployed systems, not endless upfront analysis.

For Questioners, psychological safety manifests as allowing space for exploration and assuring their questions will be taken seriously. This sense of safety enables them to build internal conviction and contribute deeply reasoned decisions. When teams respect this need, Questioners become pillars of architectural integrity and learning; when the environment dismisses their inquiries, quality and trust suffer.

## External Accountability as Decision Enabler

Many engineers readily meet outer expectations but struggle with self-imposed ones—these are Obligers. Their motto is &#34;You can count on me; and I&#39;m counting on you to count on me,&#34; emphasizing their responsiveness to external accountability.

Obligers are often the most dependable members in a team, readily meeting external expectations. They blend well into most organizations, and are also the most common tendency I have observed. In hierarchical organizations, obliger patterns become normalized and nearly invisible. What looks like the shortest path to get work done is often an obliger tendency in action.  Obligers also look up to leaders who make decisions for them. They are excellent executors. As long as the context aligns, they produce satisfactory software and aren&#39;t afraid of feedback. As decision-makers, they excel at executing decisions when accountability structures are clear, but struggle with autonomous architectural decisions.

One challenge I&#39;ve seen Obligers struggle with: without a safe environment, it&#39;s hard to get their voice heard. Constant &#34;pushing&#34; without autonomy will wear them out, often translating to silent burnout. You can sense this during stand-ups: an untold frustration or a lack of interest, worst of all, a silent agreement.

I once worked with a senior engineer, Alex, who knew how every part of the application had evolved. Yet, he would not propose new ideas or refactor with newer or different patterns. His response to most requests was the same—”Tell me what you need, I will get it done”. This was a significant bottleneck and he would delay the decision until I or another leader was available to make a decision for him, even though he was well aware of which route to take. This generated friction resulted in issues that were often taken care of as technical debt later. However, he saw the job as executing jira cards, and not actively participating in the evolution of the software. 

Simple conversations with Alex weren&#39;t effective, but we both continuously shared how this friction in decision-making was slowing us down. However, over the many 1-1s Alex was also voicing the coupling issues between REST controllers and service logic—a problem that needed addressing. I used this as an opportunity to initiate a change—to decouple the controller layer and establish explicit package boundaries. Alex became the owner of the controller domain. This restructuring combined with explicit structural boundaries and ownership allowed us to establish a formal mandate for architectural ownership. This architectural intervention established a clear team boundary and reduced Alex&#39;s cognitive load, giving him the external accountability and autonomy he needed to thrive.

Alex was initially surprised and conveyed that he never thought that the application, architecture and structure, would be changed for him. He comfortably accepted the responsibility and territory. In further conversations, more and more room for experimentation and learning was introduced. The shift in Alex’s collaboration and participation was visible. He began experimenting with newer patterns in Spring, started making decisions without further delays and proactively refactoring and improving the controller layer. 

Obligers require psychological safety through clear, reliable external accountability structures and invitations to contribute. This external validation creates a secure space where they can take ownership and voice concerns without fear. For Alex, changing architecture was the clearest possible signal of trust and expectation, and was reciprocated with ownership and collaboration. External accountability structures inevitably change as organizations evolve, which can leave Obligers without their scaffolding. Rather than maintaining fixed structures, the goal is helping Obligers develop voice and agency alongside structural shifts—co-evolving their capacity to surface concerns even when familiar accountability patterns disappear. When such structures are absent or inconsistent, Obligers may silently withdraw, limiting architectural innovation and introducing hidden risks.

## Rapid Decisions and Decision Reconciliation

Some engineers resist all expectations, whether from others or themselves—the Rebels. They value freedom and autonomy above all else. Their motto is &#34;You can&#39;t make me, and neither can I.&#34; Rebels are motivated by choice and the ability to act according to their own desires.

Rebels push the boundaries of what is possible with software. They love to seek challenges and often work better with ambiguous requirements and less process. As decision-makers, rebels make rapid architectural decisions in ambiguous spaces but create decision inconsistency over time. This often creates an unprecedented drift in the software architecture. Their strength in quick decision-making can, over time, be seen as anti-process. I have noticed in teams with strong rebels a sine-wave like velocity—a period of quick action followed by a period of slow tidying up.

I eventually understood this pattern as decision accumulation followed by decision reconciliation. The “tidying up” was for resolving inconsistencies between rapid decisions made without coordination.

An engineer with around 5-6 years of experience, Nathan, was extremely good at any problem we could throw at him. Nathan also did not worry about many of the team&#39;s practices, and seniors were always on alert when his PRs appeared. But, when speed was critical, the team expected Nathan to roll up his sleeves. I proposed to run an experiment: Nathan would actively contribute only four days a week. The fifth day, which I called &#34;No-Decision Friday,&#34; Nathan’s only tasks were to talk to other team members, reviewing changes, and updating documentation. No decisions on new work were allowed.

No-Decision Fridays were simply a decision review cadence. This ritual slowed the pace but gave ample time to reflect and talk to others, relieving the frantic pace of work. Over many such Fridays, Nathan learned to distinguish which parts of the system could handle rapid iteration and which required coordination. He started contextualizing his changes—explaining his assumptions and trade-offs in PRs—which enabled continuous validation rather than late discovery of misalignments. The reconciliation periods shortened as Nathan developed judgment about where his speed was valuable and where it created friction. No-Decision Friday interrupted the rapid feedback loop that reinforced his quick-decision pattern. By forcing reflection before the deployed system responded to his changes, he could see the long-term consequences his decisions created.

Decision reconciliation is expensive—the alignment conversations and rework have real costs to team velocity. The trade-off makes sense where pushing creative or innovation boundaries matters most, but in domains requiring tight coordination or predictable delivery, the reconciliation overhead can exceed the value of rapid experimentation. Not every rapid decision-maker is a high performer either—speed without skill creates chaos, not innovation. The key question is whether the rapid decisions, despite needing reconciliation, ultimately move the system forward. For Nathan, the experimentation phase uncovered possibilities that slower, more coordinated approaches would miss. The reconciliation cost was real but worthwhile. Given a different person and context, they  may require other non-technical, non-systemic interventions. In contexts where consistency matters more than exploration, this pattern becomes a liability rather than an asset.

Rebels embody psychological safety through freedom and autonomy in choosing how and when to engage with architectural decisions. Providing ritualized time for reflection, like “No-Decision Friday,” creates a safe container for them to balance rapid innovation with necessary stabilization. Denying them this autonomy risks chaos, frustration, and architectural drift.

## Conclusion - Empathetic Systems

My observations and experiments consistently revealed that the human elements of a team had the most significant and sustained impact on team outcomes. I came to call this goal &#34;Empathetic Systems&#34;—a software system design that deeply resonates with the team&#39;s mental models, their tendencies, and their learning paths.

These tendencies are lenses, neither fixed characteristics nor labels. A Rebel may become an Obliger depending on the power dynamic, and an Upholder who values their team may become a Rebel in the face of an external threat. In reality, we are all four tendencies combined, depending on the context. Given different external factors—a new project, a change in team dynamics, a supportive manager, a challenging life event, or the evolution of the social system itself—a person&#39;s dominant tendency can shift, and they can learn to access and strengthen other tendencies.

This framework is a powerful tool for fostering empathy and understanding, but it must be used with wisdom and caution. These tendencies are not rigid boxes to put people in. Leaders should never use this framework to stereotype, label, or pre-judge team members. The goal is to open up conversations and build bridges of understanding, not to create divisions or limit opportunities. With the right environment—one built on trust, respect, and psychological safety—individuals can strengthen all four tendencies, becoming more versatile, resilient, and effective.

The purpose of this approach is to shift our architectural thinking from &#34;making good decisions&#34; to &#34;creating conditions where bad decisions surface fast.&#34;

As Dr. Amy Edmondson found and Google’s Project Aristotle confirmed, psychological safety enables the learning behaviour required for error correction. In software terms, this means the most resilient architectures aren&#39;t those with the fewest initial mistakes—they&#39;re systems where decision problems surface quickly enough to fix before they spread. But a generic &#34;open door policy&#34; isn&#39;t enough. To be effective, psychological safety must be targeted to the specific motivational drivers of the individuals on the team.

Why emphasize these patterns when we&#39;re hired for our technical expertise? Because how we learn software development creates a fundamental mismatch with how we must practice it.

We&#39;re taught to build programs that meet specifications—technical problems with known solutions. But most professional work is about maintaining E-type systems through collaborative decision-making under uncertainty. When professionally trained individuals enter these environments, they must unlearn the individualistic patterns that earned academic success. This unlearning only happens when psychological safety makes it safe to say &#34;I don&#39;t know&#34; or &#34;this isn&#39;t working.&#34;

The deployed system itself is the best teacher. It creates &#34;teachable moments&#34; through its reverse flow—defects, incidents, and structural constraints that reveal where our assumptions were wrong. Psychological safety simply creates the readiness to learn from what the system is teaching us.

This is also why initiatives to adopt microservices, Team Topologies, or other &#34;proven practices&#34; so often fail to provide the promised value. Organizations apply the evolved blueprint without understanding the evolution itself. They miss the reverse flow and co-evolution: the continuous adaptation between human decision-making patterns and technical constraints. We must factor in this co-evolution for even the minutest aspects of software creation—from naming conventions to testing strategies to code review rituals. Successful teams didn&#39;t start with the &#34;right&#34; architecture—they built psychological safety that allowed them to detect and correct architectural problems rapidly, creating feedback loops where the reverse flow could teach them effectively.

Creating such responsiveness requires coordinated attention: architectural structures that enable reversible decisions, delivery practices that create guardrails like automated testing and feature flags, and processes that cultivate safety through rituals like blameless retrospectives and decision review cadences.

Empathetic systems recognize that humans are both the agents and sensors of the systems they maintain. The deployed system sends signals constantly, but only humans can sense them and act. And different individuals sense different signals based on what they&#39;re motivated to protect or pursue. Tightly coupled services create blame pressure; poorly abstracted boundaries teach teams that speaking up won&#39;t help. When our architecture, delivery practices, and processes work together intentionally, they create feedback loops that strengthen psychological safety rather than erode it.

After twelve years of observing these patterns, I&#39;m convinced that understanding individual motivation is foundational for sustainable software architecture. The goal is to cultivate a high-performing team capable of continuously evolving the software. The system evolves through the decision-making conversation between human values and technical constraints—but only if both sides can speak honestly about what&#39;s working and what isn&#39;t.

By caring for and nurturing the social system that creates the software, the system that is software evolves better. That is a future worth pursuing.
</source:markdown>
    </item>
    
    <item>
      <title>Using Systems Thinking to Identify Stocks, Flows, Feedback and Blast Radius</title>
      <link>https://aravindkunnath.com/2025/08/10/using-systems-thinking-to-identify/</link>
      <pubDate>Sun, 10 Aug 2025 21:40:46 -0500</pubDate>
      
      <guid>http://aravindkunnath.micro.blog/2025/08/11/using-systems-thinking-to-identify/</guid>
      <description>&lt;h3 id=&#34;using-systems-thinking-to-identify-stocks-flows-feedback-and-blast-radius&#34;&gt;Using Systems Thinking to Identify Stocks, Flows, Feedback and Blast Radius&lt;/h3&gt;
&lt;h3 id=&#34;introduction-software-as-living-systems&#34;&gt;Introduction: Software as Living Systems&lt;/h3&gt;
&lt;p&gt;In 1958, mathematician John Wilder Tukey used the term &lt;em&gt;software&lt;/em&gt; in print, distinguishing written instructions from physical hardware (Tukey, &lt;em&gt;American Mathematical Monthly&lt;/em&gt;, Jan. 1958). Whether he coined the term or simply popularized it is still debated, but the shift it represented is undisputed.&lt;/p&gt;
&lt;p&gt;In the decades since, software has expanded far beyond that definition. Today it is a complex web of languages, frameworks, processes, and increasingly, machine intelligence. It is no longer just a technical artifact; it&amp;rsquo;s an evolving socio-technical ecosystem where people and technology constantly shape each other.&lt;/p&gt;
&lt;p&gt;Many have tried to narrate and explain the process of building software. This post takes a different lens: systems thinking. I want to show how software, at its core, behaves like a living system and how understanding it through a systems thinking lens can help us see both technical and human complexity more clearly.&lt;/p&gt;
&lt;p&gt;I lean here on foundational systems thinking work: Donella Meadows&amp;rsquo; &lt;em&gt;Thinking in Systems&lt;/em&gt; (2008) for the language of stocks, flows, and feedback. My goal isn&amp;rsquo;t to re-teach their work, I am adapting it into the concepts of software.&lt;/p&gt;
&lt;h3 id=&#34;the-systems-thinking-vocabulary&#34;&gt;The Systems Thinking Vocabulary&lt;/h3&gt;
&lt;p&gt;Here are the key systems thinking terms that I am using in this post.&lt;/p&gt;
&lt;table&gt;
  &lt;thead&gt;
      &lt;tr&gt;
          &lt;th&gt;&lt;strong&gt;Term&lt;/strong&gt;&lt;/th&gt;
          &lt;th&gt;&lt;strong&gt;Description&lt;/strong&gt;&lt;/th&gt;
      &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;strong&gt;Stock&lt;/strong&gt;&lt;/td&gt;
          &lt;td&gt;An accumulation of something that represents the memory or state of a system; it changes only via flows.&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;strong&gt;Flow&lt;/strong&gt;&lt;/td&gt;
          &lt;td&gt;The rate of change that increases or decreases a stock over time; only flows change stocks.&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;strong&gt;Inflow&lt;/strong&gt;&lt;/td&gt;
          &lt;td&gt;A flow that increases a stock.&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;strong&gt;Outflow&lt;/strong&gt;&lt;/td&gt;
          &lt;td&gt;A flow that decreases a stock.&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;strong&gt;Source&lt;/strong&gt;&lt;/td&gt;
          &lt;td&gt;A point outside the system boundary from which a flow originates.&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;strong&gt;Sink&lt;/strong&gt;&lt;/td&gt;
          &lt;td&gt;A point outside the system boundary where a flow terminates.&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;strong&gt;Transient Flow&lt;/strong&gt;&lt;/td&gt;
          &lt;td&gt;An action that occurs and completes without changing stocks within your system boundary (e.g., send email to external provider). &lt;strong&gt;In reality, software always leaves traces, but these effects occur outside the system we&amp;rsquo;re analyzing.&lt;/strong&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;strong&gt;Process&lt;/strong&gt;&lt;/td&gt;
          &lt;td&gt;The mechanism that transforms inputs and influences flows acting on stocks.&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;strong&gt;Feedback Loop&lt;/strong&gt;&lt;/td&gt;
          &lt;td&gt;A structure where outputs feed back as inputs, influencing future actions (reinforcing or balancing).&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;strong&gt;Balancing Feedback Loop&lt;/strong&gt;&lt;/td&gt;
          &lt;td&gt;A goal-seeking loop that counteracts deviation to stabilize a stock near a target.&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;strong&gt;Reinforcing Feedback Loop&lt;/strong&gt;&lt;/td&gt;
          &lt;td&gt;A loop that amplifies change, producing exponential growth or decay.&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;strong&gt;Delay&lt;/strong&gt;&lt;/td&gt;
          &lt;td&gt;The time it takes for information in a feedback loop to be processed and acted upon. Delays can destabilize systems.&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;h3 id=&#34;from-bathtubs-to-a-systems-perspective&#34;&gt;From Bathtubs to a Systems Perspective&lt;/h3&gt;
&lt;p&gt;Let&amp;rsquo;s start with a classic Systems Thinking example: a bathtub. The water in the tub is the &lt;strong&gt;stock&lt;/strong&gt;. The faucet creates an &lt;strong&gt;inflow&lt;/strong&gt;. You, watching the water level and adjusting the faucet, are a &lt;strong&gt;feedback loop&lt;/strong&gt;. The float in a toilet tank that automatically shuts off the water is a &lt;strong&gt;balancing feedback loop&lt;/strong&gt;, maintaining a stable water level. You, feeling relaxed listening to the sound of water and increasing the flow, would create a &lt;strong&gt;reinforcing feedback loop&lt;/strong&gt;. The drain creates an &lt;strong&gt;outflow&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Now, let&amp;rsquo;s apply this same thinking to software. At its simplest, software takes an input, processes it, and produces an output. Let&amp;rsquo;s make this specific: software that accepts a user input and sends an email. This &amp;ldquo;Send Email&amp;rdquo; action is a &lt;strong&gt;transient flow&lt;/strong&gt; - it happens once, leaves your system boundary, and creates no memory within your system.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-mermaid&#34; data-lang=&#34;mermaid&#34;&gt;graph LR
    A[(&amp;#34;User Input&amp;lt;br/&amp;gt;(Source)&amp;#34;)] --&amp;gt; B[&amp;#34;Software Process&amp;#34;]
    B --&amp;gt; C[(&amp;#34;Email Provider&amp;lt;br/&amp;gt;(Sink)&amp;#34;)]
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;A Note on Diagram Conventions&lt;/strong&gt;: The diagrams in this post follow standard systems thinking notation. Here&amp;rsquo;s what the symbols mean:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Cylinders&lt;/strong&gt; represent &lt;strong&gt;stocks&lt;/strong&gt; - places where things accumulate (data, requests, resources)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Rectangles&lt;/strong&gt; represent &lt;strong&gt;processes&lt;/strong&gt; - activities that transform inputs or control flows&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Solid arrows&lt;/strong&gt; show &lt;strong&gt;material flows&lt;/strong&gt; - actual movement that changes stock levels&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Dotted arrows&lt;/strong&gt; show &lt;strong&gt;information flows&lt;/strong&gt; - feedback that influences decisions but doesn&amp;rsquo;t directly change stocks&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Sources and sinks&lt;/strong&gt; (shown outside the system boundary) represent external inputs and outputs&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The key insight is separating what flows (materials, data, work) from what informs (measurements, signals, feedback). A database getting new records is a material flow. A monitoring system reading CPU usage to decide whether to scale is an information flow.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-mermaid&#34; data-lang=&#34;mermaid&#34;&gt;graph TD
    subgraph &amp;#34;Diagram Legend&amp;#34;
        Stock[(&amp;#34;Stock&amp;lt;br/&amp;gt;(Accumulation)&amp;#34;)]
        Process[&amp;#34;Process&amp;lt;br/&amp;gt;(Transformation)&amp;#34;]
        Source[(&amp;#34;Source&amp;lt;br/&amp;gt;(External Input)&amp;#34;)]
        Sink[(&amp;#34;Sink&amp;lt;br/&amp;gt;(External Output)&amp;#34;)]
        
        Stock --&amp;gt;|&amp;#34;Material Flow&amp;lt;br/&amp;gt;(Changes Stock)&amp;#34;| Process
        Stock -.-&amp;gt;|&amp;#34;Information Flow&amp;lt;br/&amp;gt;(Feedback)&amp;#34;| Process
    end
    
    style Stock fill:#ffeb3b
    style Process fill:#e3f2fd
    style Source fill:#e8f5e8
    style Sink fill:#fce4ec
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;adding-memory-your-first-stock&#34;&gt;Adding Memory: Your First Stock&lt;/h3&gt;
&lt;p&gt;Next, let&amp;rsquo;s add memory. A database is the perfect tool for the job. Our software uses a database to save user data. This action creates an &lt;strong&gt;inflow&lt;/strong&gt; that increases the number of user records in the database. This is our system&amp;rsquo;s first &lt;strong&gt;stock&lt;/strong&gt; - an accumulation of memory.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s give the user an option to delete their data, which is an &lt;strong&gt;outflow&lt;/strong&gt;. This triggers a flow that removes a record from our database stock.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-mermaid&#34; data-lang=&#34;mermaid&#34;&gt;graph TD
    subgraph &amp;#34;System Boundary&amp;#34;
        direction TB
        UserCreate[(&amp;#34;User Input Create&amp;lt;br/&amp;gt;(Source)&amp;#34;)] --&amp;gt; Software[&amp;#34;Software Process&amp;#34;]
        UserDelete[(&amp;#34;User Input Delete&amp;lt;br/&amp;gt;(Source)&amp;#34;)] --&amp;gt; Software
        
        Software --&amp;gt;|&amp;#34;Add Record&amp;lt;br/&amp;gt;(Inflow)&amp;#34;| DB[(&amp;#34;User Database&amp;lt;br/&amp;gt;Stock&amp;#34;)]
        Software --&amp;gt;|&amp;#34;Remove Record&amp;lt;br/&amp;gt;(Outflow)&amp;#34;| DB
        
        Software --&amp;gt; EmailSink[(&amp;#34;Email Provider&amp;lt;br/&amp;gt;(Sink)&amp;#34;)]
    end
    
    style DB fill:#ffeb3b
    style Software fill:#e3f2fd
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;environmental-context&#34;&gt;Environmental Context&lt;/h3&gt;
&lt;p&gt;Software never runs in a vacuum. The environment - hardware, operating systems, networks - introduces its own triggers, like interrupts or errors. Let&amp;rsquo;s consider that our software just logs the interrupts. This introduces a second stock: a &lt;strong&gt;log file&lt;/strong&gt;. An OS interrupt triggers an inflow that writes to this log, increasing its size.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-mermaid&#34; data-lang=&#34;mermaid&#34;&gt;graph TD
    subgraph &amp;#34;System Boundary&amp;#34;
        direction TB
        UserCreate[(&amp;#34;User Create&amp;lt;br/&amp;gt;(Source)&amp;#34;)] --&amp;gt; Software[&amp;#34;Software Process&amp;#34;]
        UserDelete[(&amp;#34;User Delete&amp;lt;br/&amp;gt;(Source)&amp;#34;)] --&amp;gt; Software
        OSInterrupt[(&amp;#34;OS Interrupt&amp;lt;br/&amp;gt;(Source)&amp;#34;)] --&amp;gt; Software
        
        Software --&amp;gt;|&amp;#34;Add Record&amp;lt;br/&amp;gt;(Inflow)&amp;#34;| UserDB[(&amp;#34;User Database&amp;lt;br/&amp;gt;Stock&amp;#34;)]
        Software --&amp;gt;|&amp;#34;Remove Record&amp;lt;br/&amp;gt;(Outflow)&amp;#34;| UserDB
        
        Software --&amp;gt;|&amp;#34;Write Log&amp;lt;br/&amp;gt;(Inflow)&amp;#34;| LogFile[(&amp;#34;Log File&amp;lt;br/&amp;gt;Stock&amp;#34;)]
        
        Software --&amp;gt; EmailSink[(&amp;#34;Email Provider&amp;lt;br/&amp;gt;(Sink)&amp;#34;)]
    end
    
    style UserDB fill:#ffeb3b
    style LogFile fill:#ffeb3b
    style Software fill:#e3f2fd
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;the-first-feedback-loop-self-regulation&#34;&gt;The First Feedback Loop: Self-Regulation&lt;/h3&gt;
&lt;p&gt;Whenever a new stock appears in a system, I immediately start looking for the feedback loop. &lt;strong&gt;Who or what will react to the level of this stock&lt;/strong&gt;?&lt;/p&gt;
&lt;p&gt;In this case, the log file is limited by disk space. If it grows too large, it can crash the application. To prevent this, the software must regulate itself using a &lt;strong&gt;balancing feedback loop&lt;/strong&gt;. It monitors the log size and, upon reaching a threshold, triggers a rotation - an &lt;strong&gt;outflow&lt;/strong&gt; that reduces the stock.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-mermaid&#34; data-lang=&#34;mermaid&#34;&gt;graph TD
    subgraph &amp;#34;System Boundary&amp;#34;
        direction TB
        UserCreate[(&amp;#34;User Create&amp;lt;br/&amp;gt;(Source)&amp;#34;)] --&amp;gt; Software[&amp;#34;Software Process&amp;#34;]
        UserDelete[(&amp;#34;User Delete&amp;lt;br/&amp;gt;(Source)&amp;#34;)] --&amp;gt; Software
        OSInterrupt[(&amp;#34;OS Interrupt&amp;lt;br/&amp;gt;(Source)&amp;#34;)] --&amp;gt; Software
        
        Software --&amp;gt;|&amp;#34;Add Record&amp;lt;br/&amp;gt;(Inflow)&amp;#34;| UserDB[(&amp;#34;User Database&amp;lt;br/&amp;gt;Stock&amp;#34;)]
        Software --&amp;gt;|&amp;#34;Remove Record&amp;lt;br/&amp;gt;(Outflow)&amp;#34;| UserDB
        
        Software --&amp;gt;|&amp;#34;Write Log&amp;lt;br/&amp;gt;(Inflow)&amp;#34;| LogFile[(&amp;#34;Log File&amp;lt;br/&amp;gt;Stock&amp;#34;)]
        LogFile -.-&amp;gt;|&amp;#34;Size Info&amp;#34;| LogRotator[&amp;#34;Log Rotation Process&amp;#34;]
        LogRotator --&amp;gt;|&amp;#34;Rotate/Delete&amp;lt;br/&amp;gt;(Outflow)&amp;#34;| LogFile
        
        Software --&amp;gt; EmailSink[(&amp;#34;Email Provider&amp;lt;br/&amp;gt;(Sink)&amp;#34;)]
    end
    
    style UserDB fill:#ffeb3b
    style LogFile fill:#ffeb3b
    style Software fill:#e3f2fd
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;What began as a simple system for managing user data has now evolved. The software&amp;rsquo;s primary function, handling user input, inadvertently created a secondary requirement: a self-regulating system to manage the logs generated by its own operation.&lt;/p&gt;
&lt;p&gt;This is where things get complicated. Logs are for the humans in the system. When rotation fails or lags, the application may keep running, but the cost shows up in human effort. The &lt;strong&gt;delay&lt;/strong&gt; between when a log fills up and when it&amp;rsquo;s rotated can lead to slow searches, delayed alerts, and missing context during an incident.&lt;/p&gt;
&lt;p&gt;Once I find a feedback loop, the next question I ask is: &lt;strong&gt;where are the delays, and what is their impact?&lt;/strong&gt; A delay in the log rotation loop pushes the cost onto humans first.&lt;/p&gt;
&lt;h3 id=&#34;a-quick-look-at-reinforcing-loops&#34;&gt;A Quick Look at Reinforcing Loops&lt;/h3&gt;
&lt;p&gt;While our examples so far have been about stabilization, systems can also have loops that amplify change. Imagine we add a feature where each new user can invite three friends. This creates a &lt;strong&gt;reinforcing feedback loop&lt;/strong&gt;. The more users we have, the more new users are invited, leading to exponential growth in our &amp;ldquo;Users&amp;rdquo; stock. This is a virtuous cycle, but reinforcing loops can also be vicious. Think of a server under high load that starts failing requests, which causes clients to retry, which increases the load even more, leading to a complete crash.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-mermaid&#34; data-lang=&#34;mermaid&#34;&gt;graph LR
    subgraph &amp;#34;System Boundary&amp;#34;
        Users[(&amp;#34;Users&amp;lt;br/&amp;gt;Stock&amp;#34;)] -.-&amp;gt;|&amp;#34;User Count Info&amp;#34;| InviteProcess[&amp;#34;Invitation Process&amp;#34;]
        InviteProcess --&amp;gt;|&amp;#34;Generate Invites&amp;lt;br/&amp;gt;(Flow)&amp;#34;| Invites[(&amp;#34;Pending Invites&amp;lt;br/&amp;gt;Stock&amp;#34;)]
        Invites --&amp;gt;|&amp;#34;Accept Invites&amp;lt;br/&amp;gt;(Flow)&amp;#34;| Users
    end
    
    ExternalUsers[(&amp;#34;External Users&amp;lt;br/&amp;gt;(Source)&amp;#34;)] --&amp;gt; Invites
    
    style Users fill:#4caf50
    style Invites fill:#ff9800
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;evolution-under-pressure-adding-queues&#34;&gt;Evolution Under Pressure: Adding Queues&lt;/h3&gt;
&lt;p&gt;Now, let&amp;rsquo;s watch our system evolve under pressure. Traffic is spiking, and while the database holds up, sending emails synchronously is too slow. Users are noticing failures. A common solution is to add a queue, a choice that introduces a new stock and a different class of feedback.&lt;/p&gt;
&lt;p&gt;What was once a simple transient flow now becomes a system with a new stock to manage:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-mermaid&#34; data-lang=&#34;mermaid&#34;&gt;graph TD
    subgraph &amp;#34;System Boundary&amp;#34;
        direction TB
        UserClick[(&amp;#34;User Click&amp;lt;br/&amp;gt;(Source)&amp;#34;)] --&amp;gt; WebServer[&amp;#34;Web Server Process&amp;#34;]
        
        WebServer --&amp;gt;|&amp;#34;Enqueue&amp;lt;br/&amp;gt;(Inflow)&amp;#34;| EmailQueue[(&amp;#34;Email Queue&amp;lt;br/&amp;gt;Stock&amp;#34;)]
        
        EmailQueue --&amp;gt;|&amp;#34;Dequeue&amp;lt;br/&amp;gt;(Outflow)&amp;#34;| EmailWorker[&amp;#34;Email Worker Process&amp;#34;]
    end
    
    EmailWorker --&amp;gt; EmailProvider[(&amp;#34;Email Provider&amp;lt;br/&amp;gt;(Sink)&amp;#34;)]
    
    style EmailQueue fill:#ffeb3b
    style EmailWorker fill:#e3f2fd
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This new stock forces us to ask new questions about potential feedback loops. What happens when there&amp;rsquo;s a delay? The queue will back up. Do we need autoscaling to handle it? What&amp;rsquo;s our plan if the email provider is slow or the network fails?&lt;/p&gt;
&lt;p&gt;This leads to a crucial fourth question - &lt;strong&gt;what&amp;rsquo;s the blast radius?&lt;/strong&gt; Please note that this is not a traditional systems thinking term. &lt;strong&gt;Blast radius&lt;/strong&gt; refers to the &lt;em&gt;scope and extent of impact when a system component fails, changes, or is compromised - encompassing all users, processes, systems, and business functions that would be directly or indirectly affected&lt;/em&gt;. This question forces us to map the scope of impact and see the connected systems and human lives that depend on our decisions.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt; - I spend considerable time on this question because making the invisible humans visible is one of the toughest challenges in system design. It&amp;rsquo;s easy to see the technical components - databases, queues, servers - but the humans affected by our technical decisions often remain hidden until something goes wrong.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id=&#34;putting-systems-thinking-into-practice&#34;&gt;Putting Systems Thinking into Practice&lt;/h3&gt;
&lt;p&gt;You can ask yourself, pair or team these four questions whenever you design, change, or troubleshoot your system:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;What are the stocks?&lt;/strong&gt; Identify every place where information or work accumulates.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;How are they regulated?&lt;/strong&gt; Find the feedback loops - both automated and human - that watch these stocks and try to keep them in balance.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Where are the delays?&lt;/strong&gt; Pinpoint where the information in those feedback loops could be slow to arrive or act upon. That&amp;rsquo;s where you&amp;rsquo;ll find your most important work.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What&amp;rsquo;s the blast radius?&lt;/strong&gt; Map the scope of impact when this system fails or changes - which users, teams, processes, and downstream systems will be affected.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;a-practical-example-spike-in-web-traffic&#34;&gt;A Practical Example: Spike in Web Traffic&lt;/h3&gt;
&lt;p&gt;This system is a web application that&amp;rsquo;s suddenly getting more traffic than expected. It accepts HTTP requests, has a database, and manages user session data.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-mermaid&#34; data-lang=&#34;mermaid&#34;&gt;graph TD
    subgraph &amp;#34;System Boundary&amp;#34;
        direction TB
        
        %% Main stocks
        CPU[(&amp;#34;CPU Usage&amp;lt;br/&amp;gt;Stock&amp;#34;)]
        ServerPool[(&amp;#34;Server Pool&amp;lt;br/&amp;gt;Stock&amp;#34;)]
        DBConns[(&amp;#34;DB Connections&amp;lt;br/&amp;gt;Stock&amp;#34;)]
        ErrorRate[(&amp;#34;Error Rate&amp;lt;br/&amp;gt;Stock&amp;#34;)]
        
        %% Control processes
        Autoscaler[&amp;#34;Autoscaler&amp;lt;br/&amp;gt;Process&amp;#34;]
        ConnPooler[&amp;#34;Connection Pooler&amp;lt;br/&amp;gt;Process&amp;#34;]
        CircuitBreaker[&amp;#34;Circuit Breaker&amp;lt;br/&amp;gt;Process&amp;#34;]
        
        %% Feedback loops (information flows)
        CPU -.-&amp;gt;|&amp;#34;High CPU Info&amp;#34;| Autoscaler
        Autoscaler --&amp;gt;|&amp;#34;Add Servers&amp;lt;br/&amp;gt;(Inflow)&amp;#34;| ServerPool
        ServerPool -.-&amp;gt;|&amp;#34;More Capacity Info&amp;#34;| CPU
        
        DBConns -.-&amp;gt;|&amp;#34;High Usage Info&amp;#34;| ConnPooler
        ConnPooler --&amp;gt;|&amp;#34;Limit Connections&amp;lt;br/&amp;gt;(Outflow)&amp;#34;| DBConns
        
        ErrorRate -.-&amp;gt;|&amp;#34;High Error Info&amp;#34;| CircuitBreaker
        CircuitBreaker --&amp;gt;|&amp;#34;Block Requests&amp;lt;br/&amp;gt;(Outflow)&amp;#34;| ErrorRate
    end
    
    %% External sources
    Traffic[(&amp;#34;Web Traffic&amp;lt;br/&amp;gt;(Source)&amp;#34;)] --&amp;gt; CPU
    Traffic --&amp;gt; DBConns
    Traffic --&amp;gt; ErrorRate
    
    style CPU fill:#f44336
    style ServerPool fill:#4caf50
    style DBConns fill:#2196f3
    style ErrorRate fill:#ff9800
    style Autoscaler fill:#e3f2fd
    style ConnPooler fill:#e3f2fd
    style CircuitBreaker fill:#e3f2fd
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Question 1: What are the stocks?&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;HTTP request queue (connection pool)&lt;/li&gt;
&lt;li&gt;Database connections pool&lt;/li&gt;
&lt;li&gt;Memory usage (heap, cache)&lt;/li&gt;
&lt;li&gt;CPU utilization&lt;/li&gt;
&lt;li&gt;Disk space (logs, temp files, database)&lt;/li&gt;
&lt;li&gt;User session data&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Question 2: How are they regulated?&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Load balancer distributes requests (balancing loop)&lt;/li&gt;
&lt;li&gt;Connection pool limits concurrent database access (balancing loop)&lt;/li&gt;
&lt;li&gt;Garbage collector manages memory (balancing loop)&lt;/li&gt;
&lt;li&gt;Log rotation prevents disk overflow (balancing loop)&lt;/li&gt;
&lt;li&gt;Auto-scaling adds servers when CPU is high (balancing loop)&lt;/li&gt;
&lt;li&gt;Circuit breakers trip when error rates spike (balancing loop)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Question 3: Where are the delays?&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Auto-scaling taking time to provision new instances&lt;/li&gt;
&lt;li&gt;Database connection recovery after a failure takes a few seconds&lt;/li&gt;
&lt;li&gt;Cache warming after deployment takes several minutes&lt;/li&gt;
&lt;li&gt;Log analysis during an incident requires manual searching&lt;/li&gt;
&lt;li&gt;Memory leaks accumulate slowly, then crash suddenly&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Question 4: What&amp;rsquo;s the blast radius?&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Users can&amp;rsquo;t reset passwords or receive account confirmations (direct user impact)&lt;/li&gt;
&lt;li&gt;Support team overwhelmed with &amp;ldquo;missing email&amp;rdquo; tickets (operational team impact)&lt;/li&gt;
&lt;li&gt;Marketing campaigns fail silently, skewing conversion metrics (business process impact)&lt;/li&gt;
&lt;li&gt;Security alerts don&amp;rsquo;t reach on-call engineers (critical system impact)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;conclusion-the-technical-foundation&#34;&gt;Conclusion: The Technical Foundation&lt;/h3&gt;
&lt;p&gt;These questions and their answers help uncover the stocks, flows, feedback loops, and delays in your system&amp;rsquo;s technical architecture. You can start asking them during the design phase. I find this perspective creates a better catalyst for discussions - we tend to get stuck on implementation details and miss the bigger dynamics at play.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s also effective for making architectural trade-offs explicit. When you bring a systems perspective to the table, the conversation changes. It forces different questions and moves the team from low-level concerns to the larger forces shaping system behaviour.&lt;/p&gt;
&lt;p&gt;While this post tries to show the technical interplay in systems, a stronger system - humans - are embedded throughout as designers, operators, and decision-makers. They have their own stocks (knowledge, capacity, trust), flows (learning, communication, burnout), and feedback loops (code reviews, incident responses, performance evaluations).&lt;/p&gt;
&lt;p&gt;The human systems often have longer delays, more complex dynamics, and ultimately determine whether our technical designs succeed or fail in practice. A perfectly designed auto-scaling system is useless if the team doesn&amp;rsquo;t understand how to configure it, or if the organizational culture punishes the temporary slowdowns that come with scaling events.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;My recommendation for now&lt;/strong&gt;: Start with the next feature you&amp;rsquo;re building or the current problem you&amp;rsquo;re debugging. Draw a simple diagram of the technical system. Ask the four questions. Identify new or changing stocks. Look for the feedback loops. Identify the delays. Map the blast radius. See if it gives you a new perspective on the technical challenges.&lt;/p&gt;
&lt;p&gt;But as you do this, pay attention to the human decisions, delays, and feedback loops you encounter. Notice where knowledge gets stuck, where communication breaks down, where good technical designs meet organizational reality. Those observations will be crucial for the next layer of systems thinking we&amp;rsquo;ll explore.&lt;/p&gt;
&lt;p&gt;In my next post, we&amp;rsquo;ll apply this framework to the human and organizational dynamics that surround our technical systems. We&amp;rsquo;ll discover that the most persistent problems in software often aren&amp;rsquo;t in the code - they&amp;rsquo;re in the human systems that create, operate, and evolve that code.&lt;/p&gt;
&lt;p&gt;Good luck!&lt;/p&gt;
</description>
      <source:markdown>### Using Systems Thinking to Identify Stocks, Flows, Feedback and Blast Radius

### Introduction: Software as Living Systems

In 1958, mathematician John Wilder Tukey used the term _software_ in print, distinguishing written instructions from physical hardware (Tukey, _American Mathematical Monthly_, Jan. 1958). Whether he coined the term or simply popularized it is still debated, but the shift it represented is undisputed.

In the decades since, software has expanded far beyond that definition. Today it is a complex web of languages, frameworks, processes, and increasingly, machine intelligence. It is no longer just a technical artifact; it&#39;s an evolving socio-technical ecosystem where people and technology constantly shape each other.

Many have tried to narrate and explain the process of building software. This post takes a different lens: systems thinking. I want to show how software, at its core, behaves like a living system and how understanding it through a systems thinking lens can help us see both technical and human complexity more clearly.

I lean here on foundational systems thinking work: Donella Meadows&#39; _Thinking in Systems_ (2008) for the language of stocks, flows, and feedback. My goal isn&#39;t to re-teach their work, I am adapting it into the concepts of software.

### The Systems Thinking Vocabulary

Here are the key systems thinking terms that I am using in this post.

| **Term**                      | **Description**                                                                                                                                                                                                                             |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Stock**                     | An accumulation of something that represents the memory or state of a system; it changes only via flows.                                                                                                                                    |
| **Flow**                      | The rate of change that increases or decreases a stock over time; only flows change stocks.                                                                                                                                                 |
| **Inflow**                    | A flow that increases a stock.                                                                                                                                                                                                              |
| **Outflow**                   | A flow that decreases a stock.                                                                                                                                                                                                              |
| **Source**                    | A point outside the system boundary from which a flow originates.                                                                                                                                                                           |
| **Sink**                      | A point outside the system boundary where a flow terminates.                                                                                                                                                                                |
| **Transient Flow**            | An action that occurs and completes without changing stocks within your system boundary (e.g., send email to external provider). **In reality, software always leaves traces, but these effects occur outside the system we&#39;re analyzing.** |
| **Process**                   | The mechanism that transforms inputs and influences flows acting on stocks.                                                                                                                                                                 |
| **Feedback Loop**             | A structure where outputs feed back as inputs, influencing future actions (reinforcing or balancing).                                                                                                                                       |
| **Balancing Feedback Loop**   | A goal-seeking loop that counteracts deviation to stabilize a stock near a target.                                                                                                                                                          |
| **Reinforcing Feedback Loop** | A loop that amplifies change, producing exponential growth or decay.                                                                                                                                                                        |
| **Delay**                     | The time it takes for information in a feedback loop to be processed and acted upon. Delays can destabilize systems.                                                                                                                        |

### From Bathtubs to a Systems Perspective

Let&#39;s start with a classic Systems Thinking example: a bathtub. The water in the tub is the **stock**. The faucet creates an **inflow**. You, watching the water level and adjusting the faucet, are a **feedback loop**. The float in a toilet tank that automatically shuts off the water is a **balancing feedback loop**, maintaining a stable water level. You, feeling relaxed listening to the sound of water and increasing the flow, would create a **reinforcing feedback loop**. The drain creates an **outflow**.

Now, let&#39;s apply this same thinking to software. At its simplest, software takes an input, processes it, and produces an output. Let&#39;s make this specific: software that accepts a user input and sends an email. This &#34;Send Email&#34; action is a **transient flow** - it happens once, leaves your system boundary, and creates no memory within your system.

```mermaid
graph LR
    A[(&#34;User Input&lt;br/&gt;(Source)&#34;)] --&gt; B[&#34;Software Process&#34;]
    B --&gt; C[(&#34;Email Provider&lt;br/&gt;(Sink)&#34;)]
```

**A Note on Diagram Conventions**: The diagrams in this post follow standard systems thinking notation. Here&#39;s what the symbols mean:

- **Cylinders** represent **stocks** - places where things accumulate (data, requests, resources)
- **Rectangles** represent **processes** - activities that transform inputs or control flows
- **Solid arrows** show **material flows** - actual movement that changes stock levels
- **Dotted arrows** show **information flows** - feedback that influences decisions but doesn&#39;t directly change stocks
- **Sources and sinks** (shown outside the system boundary) represent external inputs and outputs

The key insight is separating what flows (materials, data, work) from what informs (measurements, signals, feedback). A database getting new records is a material flow. A monitoring system reading CPU usage to decide whether to scale is an information flow.

```mermaid
graph TD
    subgraph &#34;Diagram Legend&#34;
        Stock[(&#34;Stock&lt;br/&gt;(Accumulation)&#34;)]
        Process[&#34;Process&lt;br/&gt;(Transformation)&#34;]
        Source[(&#34;Source&lt;br/&gt;(External Input)&#34;)]
        Sink[(&#34;Sink&lt;br/&gt;(External Output)&#34;)]
        
        Stock --&gt;|&#34;Material Flow&lt;br/&gt;(Changes Stock)&#34;| Process
        Stock -.-&gt;|&#34;Information Flow&lt;br/&gt;(Feedback)&#34;| Process
    end
    
    style Stock fill:#ffeb3b
    style Process fill:#e3f2fd
    style Source fill:#e8f5e8
    style Sink fill:#fce4ec
```
### Adding Memory: Your First Stock

Next, let&#39;s add memory. A database is the perfect tool for the job. Our software uses a database to save user data. This action creates an **inflow** that increases the number of user records in the database. This is our system&#39;s first **stock** - an accumulation of memory.

Let&#39;s give the user an option to delete their data, which is an **outflow**. This triggers a flow that removes a record from our database stock.

```mermaid
graph TD
    subgraph &#34;System Boundary&#34;
        direction TB
        UserCreate[(&#34;User Input Create&lt;br/&gt;(Source)&#34;)] --&gt; Software[&#34;Software Process&#34;]
        UserDelete[(&#34;User Input Delete&lt;br/&gt;(Source)&#34;)] --&gt; Software
        
        Software --&gt;|&#34;Add Record&lt;br/&gt;(Inflow)&#34;| DB[(&#34;User Database&lt;br/&gt;Stock&#34;)]
        Software --&gt;|&#34;Remove Record&lt;br/&gt;(Outflow)&#34;| DB
        
        Software --&gt; EmailSink[(&#34;Email Provider&lt;br/&gt;(Sink)&#34;)]
    end
    
    style DB fill:#ffeb3b
    style Software fill:#e3f2fd
```

### Environmental Context

Software never runs in a vacuum. The environment - hardware, operating systems, networks - introduces its own triggers, like interrupts or errors. Let&#39;s consider that our software just logs the interrupts. This introduces a second stock: a **log file**. An OS interrupt triggers an inflow that writes to this log, increasing its size.

```mermaid
graph TD
    subgraph &#34;System Boundary&#34;
        direction TB
        UserCreate[(&#34;User Create&lt;br/&gt;(Source)&#34;)] --&gt; Software[&#34;Software Process&#34;]
        UserDelete[(&#34;User Delete&lt;br/&gt;(Source)&#34;)] --&gt; Software
        OSInterrupt[(&#34;OS Interrupt&lt;br/&gt;(Source)&#34;)] --&gt; Software
        
        Software --&gt;|&#34;Add Record&lt;br/&gt;(Inflow)&#34;| UserDB[(&#34;User Database&lt;br/&gt;Stock&#34;)]
        Software --&gt;|&#34;Remove Record&lt;br/&gt;(Outflow)&#34;| UserDB
        
        Software --&gt;|&#34;Write Log&lt;br/&gt;(Inflow)&#34;| LogFile[(&#34;Log File&lt;br/&gt;Stock&#34;)]
        
        Software --&gt; EmailSink[(&#34;Email Provider&lt;br/&gt;(Sink)&#34;)]
    end
    
    style UserDB fill:#ffeb3b
    style LogFile fill:#ffeb3b
    style Software fill:#e3f2fd
```
### The First Feedback Loop: Self-Regulation

Whenever a new stock appears in a system, I immediately start looking for the feedback loop. **Who or what will react to the level of this stock**?

In this case, the log file is limited by disk space. If it grows too large, it can crash the application. To prevent this, the software must regulate itself using a **balancing feedback loop**. It monitors the log size and, upon reaching a threshold, triggers a rotation - an **outflow** that reduces the stock. 

```mermaid
graph TD
    subgraph &#34;System Boundary&#34;
        direction TB
        UserCreate[(&#34;User Create&lt;br/&gt;(Source)&#34;)] --&gt; Software[&#34;Software Process&#34;]
        UserDelete[(&#34;User Delete&lt;br/&gt;(Source)&#34;)] --&gt; Software
        OSInterrupt[(&#34;OS Interrupt&lt;br/&gt;(Source)&#34;)] --&gt; Software
        
        Software --&gt;|&#34;Add Record&lt;br/&gt;(Inflow)&#34;| UserDB[(&#34;User Database&lt;br/&gt;Stock&#34;)]
        Software --&gt;|&#34;Remove Record&lt;br/&gt;(Outflow)&#34;| UserDB
        
        Software --&gt;|&#34;Write Log&lt;br/&gt;(Inflow)&#34;| LogFile[(&#34;Log File&lt;br/&gt;Stock&#34;)]
        LogFile -.-&gt;|&#34;Size Info&#34;| LogRotator[&#34;Log Rotation Process&#34;]
        LogRotator --&gt;|&#34;Rotate/Delete&lt;br/&gt;(Outflow)&#34;| LogFile
        
        Software --&gt; EmailSink[(&#34;Email Provider&lt;br/&gt;(Sink)&#34;)]
    end
    
    style UserDB fill:#ffeb3b
    style LogFile fill:#ffeb3b
    style Software fill:#e3f2fd
```

What began as a simple system for managing user data has now evolved. The software&#39;s primary function, handling user input, inadvertently created a secondary requirement: a self-regulating system to manage the logs generated by its own operation.

This is where things get complicated. Logs are for the humans in the system. When rotation fails or lags, the application may keep running, but the cost shows up in human effort. The **delay** between when a log fills up and when it&#39;s rotated can lead to slow searches, delayed alerts, and missing context during an incident.

Once I find a feedback loop, the next question I ask is: **where are the delays, and what is their impact?** A delay in the log rotation loop pushes the cost onto humans first.

### A Quick Look at Reinforcing Loops

While our examples so far have been about stabilization, systems can also have loops that amplify change. Imagine we add a feature where each new user can invite three friends. This creates a **reinforcing feedback loop**. The more users we have, the more new users are invited, leading to exponential growth in our &#34;Users&#34; stock. This is a virtuous cycle, but reinforcing loops can also be vicious. Think of a server under high load that starts failing requests, which causes clients to retry, which increases the load even more, leading to a complete crash.

```mermaid
graph LR
    subgraph &#34;System Boundary&#34;
        Users[(&#34;Users&lt;br/&gt;Stock&#34;)] -.-&gt;|&#34;User Count Info&#34;| InviteProcess[&#34;Invitation Process&#34;]
        InviteProcess --&gt;|&#34;Generate Invites&lt;br/&gt;(Flow)&#34;| Invites[(&#34;Pending Invites&lt;br/&gt;Stock&#34;)]
        Invites --&gt;|&#34;Accept Invites&lt;br/&gt;(Flow)&#34;| Users
    end
    
    ExternalUsers[(&#34;External Users&lt;br/&gt;(Source)&#34;)] --&gt; Invites
    
    style Users fill:#4caf50
    style Invites fill:#ff9800
```

### Evolution Under Pressure: Adding Queues

Now, let&#39;s watch our system evolve under pressure. Traffic is spiking, and while the database holds up, sending emails synchronously is too slow. Users are noticing failures. A common solution is to add a queue, a choice that introduces a new stock and a different class of feedback.

What was once a simple transient flow now becomes a system with a new stock to manage:

```mermaid
graph TD
    subgraph &#34;System Boundary&#34;
        direction TB
        UserClick[(&#34;User Click&lt;br/&gt;(Source)&#34;)] --&gt; WebServer[&#34;Web Server Process&#34;]
        
        WebServer --&gt;|&#34;Enqueue&lt;br/&gt;(Inflow)&#34;| EmailQueue[(&#34;Email Queue&lt;br/&gt;Stock&#34;)]
        
        EmailQueue --&gt;|&#34;Dequeue&lt;br/&gt;(Outflow)&#34;| EmailWorker[&#34;Email Worker Process&#34;]
    end
    
    EmailWorker --&gt; EmailProvider[(&#34;Email Provider&lt;br/&gt;(Sink)&#34;)]
    
    style EmailQueue fill:#ffeb3b
    style EmailWorker fill:#e3f2fd
```

This new stock forces us to ask new questions about potential feedback loops. What happens when there&#39;s a delay? The queue will back up. Do we need autoscaling to handle it? What&#39;s our plan if the email provider is slow or the network fails?

This leads to a crucial fourth question - **what&#39;s the blast radius?** Please note that this is not a traditional systems thinking term. **Blast radius** refers to the *scope and extent of impact when a system component fails, changes, or is compromised - encompassing all users, processes, systems, and business functions that would be directly or indirectly affected*. This question forces us to map the scope of impact and see the connected systems and human lives that depend on our decisions.

&gt; **Note** - I spend considerable time on this question because making the invisible humans visible is one of the toughest challenges in system design. It&#39;s easy to see the technical components - databases, queues, servers - but the humans affected by our technical decisions often remain hidden until something goes wrong.

### Putting Systems Thinking into Practice

You can ask yourself, pair or team these four questions whenever you design, change, or troubleshoot your system:

1. **What are the stocks?** Identify every place where information or work accumulates.
2. **How are they regulated?** Find the feedback loops - both automated and human - that watch these stocks and try to keep them in balance.
3. **Where are the delays?** Pinpoint where the information in those feedback loops could be slow to arrive or act upon. That&#39;s where you&#39;ll find your most important work.
4. **What&#39;s the blast radius?** Map the scope of impact when this system fails or changes - which users, teams, processes, and downstream systems will be affected.

### A Practical Example: Spike in Web Traffic

This system is a web application that&#39;s suddenly getting more traffic than expected. It accepts HTTP requests, has a database, and manages user session data.

```mermaid
graph TD
    subgraph &#34;System Boundary&#34;
        direction TB
        
        %% Main stocks
        CPU[(&#34;CPU Usage&lt;br/&gt;Stock&#34;)]
        ServerPool[(&#34;Server Pool&lt;br/&gt;Stock&#34;)]
        DBConns[(&#34;DB Connections&lt;br/&gt;Stock&#34;)]
        ErrorRate[(&#34;Error Rate&lt;br/&gt;Stock&#34;)]
        
        %% Control processes
        Autoscaler[&#34;Autoscaler&lt;br/&gt;Process&#34;]
        ConnPooler[&#34;Connection Pooler&lt;br/&gt;Process&#34;]
        CircuitBreaker[&#34;Circuit Breaker&lt;br/&gt;Process&#34;]
        
        %% Feedback loops (information flows)
        CPU -.-&gt;|&#34;High CPU Info&#34;| Autoscaler
        Autoscaler --&gt;|&#34;Add Servers&lt;br/&gt;(Inflow)&#34;| ServerPool
        ServerPool -.-&gt;|&#34;More Capacity Info&#34;| CPU
        
        DBConns -.-&gt;|&#34;High Usage Info&#34;| ConnPooler
        ConnPooler --&gt;|&#34;Limit Connections&lt;br/&gt;(Outflow)&#34;| DBConns
        
        ErrorRate -.-&gt;|&#34;High Error Info&#34;| CircuitBreaker
        CircuitBreaker --&gt;|&#34;Block Requests&lt;br/&gt;(Outflow)&#34;| ErrorRate
    end
    
    %% External sources
    Traffic[(&#34;Web Traffic&lt;br/&gt;(Source)&#34;)] --&gt; CPU
    Traffic --&gt; DBConns
    Traffic --&gt; ErrorRate
    
    style CPU fill:#f44336
    style ServerPool fill:#4caf50
    style DBConns fill:#2196f3
    style ErrorRate fill:#ff9800
    style Autoscaler fill:#e3f2fd
    style ConnPooler fill:#e3f2fd
    style CircuitBreaker fill:#e3f2fd
```

**Question 1: What are the stocks?**
- HTTP request queue (connection pool)
- Database connections pool
- Memory usage (heap, cache)
- CPU utilization
- Disk space (logs, temp files, database)
- User session data

**Question 2: How are they regulated?**
- Load balancer distributes requests (balancing loop)
- Connection pool limits concurrent database access (balancing loop)
- Garbage collector manages memory (balancing loop)
- Log rotation prevents disk overflow (balancing loop)
- Auto-scaling adds servers when CPU is high (balancing loop)
- Circuit breakers trip when error rates spike (balancing loop)

**Question 3: Where are the delays?**
- Auto-scaling taking time to provision new instances
- Database connection recovery after a failure takes a few seconds
- Cache warming after deployment takes several minutes
- Log analysis during an incident requires manual searching
- Memory leaks accumulate slowly, then crash suddenly

**Question 4: What&#39;s the blast radius?**
- Users can&#39;t reset passwords or receive account confirmations (direct user impact)
- Support team overwhelmed with &#34;missing email&#34; tickets (operational team impact)
- Marketing campaigns fail silently, skewing conversion metrics (business process impact)
- Security alerts don&#39;t reach on-call engineers (critical system impact)

### Conclusion: The Technical Foundation

These questions and their answers help uncover the stocks, flows, feedback loops, and delays in your system&#39;s technical architecture. You can start asking them during the design phase. I find this perspective creates a better catalyst for discussions - we tend to get stuck on implementation details and miss the bigger dynamics at play.

It&#39;s also effective for making architectural trade-offs explicit. When you bring a systems perspective to the table, the conversation changes. It forces different questions and moves the team from low-level concerns to the larger forces shaping system behaviour.

While this post tries to show the technical interplay in systems, a stronger system - humans - are embedded throughout as designers, operators, and decision-makers. They have their own stocks (knowledge, capacity, trust), flows (learning, communication, burnout), and feedback loops (code reviews, incident responses, performance evaluations).

The human systems often have longer delays, more complex dynamics, and ultimately determine whether our technical designs succeed or fail in practice. A perfectly designed auto-scaling system is useless if the team doesn&#39;t understand how to configure it, or if the organizational culture punishes the temporary slowdowns that come with scaling events.

**My recommendation for now**: Start with the next feature you&#39;re building or the current problem you&#39;re debugging. Draw a simple diagram of the technical system. Ask the four questions. Identify new or changing stocks. Look for the feedback loops. Identify the delays. Map the blast radius. See if it gives you a new perspective on the technical challenges.

But as you do this, pay attention to the human decisions, delays, and feedback loops you encounter. Notice where knowledge gets stuck, where communication breaks down, where good technical designs meet organizational reality. Those observations will be crucial for the next layer of systems thinking we&#39;ll explore.

In my next post, we&#39;ll apply this framework to the human and organizational dynamics that surround our technical systems. We&#39;ll discover that the most persistent problems in software often aren&#39;t in the code - they&#39;re in the human systems that create, operate, and evolve that code.

Good luck!
</source:markdown>
    </item>
    
    <item>
      <title>How Questions Build Software</title>
      <link>https://aravindkunnath.com/2025/06/27/how-questions-build-software/</link>
      <pubDate>Fri, 27 Jun 2025 08:31:38 -0500</pubDate>
      
      <guid>http://aravindkunnath.micro.blog/2025/06/27/how-questions-build-software/</guid>
      <description>&lt;p&gt;Looking back, I never thought I would build a career in software. My degree is in Chemistry, a field of precise rules and predictable reactions. What could a mind buzzing with ionic bonds and benzene rings understand about software?&lt;/p&gt;
&lt;p&gt;That self-inflicted doubt was so strong that in my first year on the job, I didn&amp;rsquo;t write much code at all. I chose to spend most of my time testing software that others built. I called myself a professional observer.&lt;/p&gt;
&lt;p&gt;It turns out, learning to test was the best way to learn how to build software. Sure it took me a few years, but it taught me how to think in the long run, not just how to code.&lt;/p&gt;
&lt;h2 id=&#34;the-testers-lens-thinking-from-the-outside-in&#34;&gt;The Tester&amp;rsquo;s Lens: Thinking from the Outside-In&lt;/h2&gt;
&lt;p&gt;When you test a simple login screen, you don’t just check the happy path. You probe the edges. What about an incorrect password? A non-existent username? What if a field is left blank? What if someone enters 10,000 characters? What happens if the database is down? You aren’t just testing a feature; you are mapping the uncharted territories of a feature.&lt;/p&gt;
&lt;p&gt;This is ‘outside-in’ thinking. It’s the opposite of the ‘inside-out’ approach, where you immediately jump into implementation details without grasping the landscape the code lives in. The context is everything.&lt;/p&gt;
&lt;p&gt;Imagine you need to send notifications to customers. An inside-out approach might lead you to loop through a list. But an outside-in approach forces you to ask questions first. How many customers? How fast does this need to be? Can the process fail and be safely restarted?&lt;/p&gt;
&lt;p&gt;Asking these questions shifts your focus - from writing a for loop to designing a resilient system. Suddenly, the solution might involve message queues, retries, background workers, or batching. The context doesn’t just broaden your perspective - it shapes what’s even viable. It becomes the constraint and the canvas for the system’s design.&lt;/p&gt;
&lt;h2 id=&#34;the-persistent-problem-why-smart-people-make-silly-mistakes&#34;&gt;The Persistent Problem: Why Smart People Make Silly Mistakes&lt;/h2&gt;
&lt;p&gt;As I moved into development, I realized that seeing the big picture wasn&amp;rsquo;t enough; you still have to build the individual components. But even when I tried to balance both mindsets, I still made silly mistakes. I could not blame timelines or distraction or personal emergencies all the time, so I was forced down a path of reflection and reading. My search for answers led me to Daniel Kahneman’s work on our two cognitive systems:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;System 1&lt;/strong&gt; is fast, intuitive, and based on patterns. It’s the gut feeling that a 500-line method needs refactoring. It’s quick and automatic.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;System 2&lt;/strong&gt; is slow, deliberate, and analytical. It’s what you use to reason through trade-offs, evaluate design alternatives, or think about how another developer will see your code in six months.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The challenge is that software development, due to various internal and external factors, creates perfect conditions for System 1 to take over. Factors such as biases, opinions, experiences, hunger, emotions, weekend plans - the list goes on! We reach for familiar patterns and make quick decisions, often missing the bigger picture. Overcoming millions of years of evolutionary wiring is hard.&lt;/p&gt;
&lt;p&gt;One of my strongest memories around this comes from my years-long pledge to become a polyglot. I was mugging up as many programming languages as possible during the early years of my career - to become a true polyglot. But my Python, Scala, JavaScript and everything in between looked suspiciously similar to Java. I was fluent in many languages but a native speaker in none.&lt;/p&gt;
&lt;p&gt;During one code review in a Javascript project, a teammate asked why I wrote a complex, Java-esque list filter using prototypes. &amp;ldquo;All you had to do was a filtered map,&amp;rdquo; he said. He was right. My System 1 had jumped for a familiar pattern, a remnant of my Java 6 OOP experiences, even though it was the wrong one for the job.&lt;/p&gt;
&lt;p&gt;These aren&amp;rsquo;t failures of human intelligence. They are the natural consequences of how our minds work under a heavy cognitive load. The real question is, how do we, as developers, train System 2 to show up when we need it the most?&lt;/p&gt;
&lt;h2 id=&#34;writing-tests-to-think-better&#34;&gt;Writing Tests to Think Better&lt;/h2&gt;
&lt;p&gt;Test-Driven Development (TDD) is a powerful tool for enforcing System 2 thinking. Our natural impulse is to jump into code as soon as we see an opportunity. TDD interrupts this. The ritual of writing a failing test, making the minimal changes to make it green, and then refactoring forces deliberate, methodical engagement of our analytical brain.&lt;/p&gt;
&lt;p&gt;But I must admit, my first reaction to TDD was that it was a conspiracy to slow me down. The core question it asks is &amp;ldquo;What&amp;rsquo;s the smallest possible piece of functionality I can test?&amp;rdquo;. It was inspiring, but frankly, I wasn’t ready for the deep probing it required. Instead, I bought into TDD for a more practical reason: my tests became better documentation. Before, my tests were often an afterthought and didn’t really tell much other than increasing coverage. With TDD, tests showed intent and context - not just coverage. Over time, I realized that my components and interfaces were becoming easier to adapt. Fast forward to now, TDD isn’t just about writing tests for me; it&amp;rsquo;s a discipline that forces analytical thinking and clarity of thought.&lt;/p&gt;
&lt;p&gt;This might also explain the endless debate around TDD. Perhaps experienced developers who resist TDD have already found other ways to engage System 2. But if you haven’t consciously been aware of your own thought process, TDD may be worth another look.&lt;/p&gt;
&lt;p&gt;Asking tough questions alone is one thing. Doing it while someone else is watching - that’s a whole different kind of pressure.&lt;/p&gt;
&lt;h2 id=&#34;when-a-question-becomes-a-threat&#34;&gt;When a Question Becomes a Threat&lt;/h2&gt;
&lt;p&gt;Having someone watch me code used to feel like a nightmare. The fear of being judged was real. When I first tried pair programming, I approached it like TDD - focusing on the technical aspects. But unlike TDD, where I could force System 2 thinking through ritual and discipline, the questions during pairing sessions weren&amp;rsquo;t working. The questions that made TDD so powerful - whether from me or my pair - felt threatening rather than showing curiosity.&lt;/p&gt;
&lt;p&gt;It took me a while and a lot of reading to understand why. Our brain doesn&amp;rsquo;t just optimize for familiar patterns; it also optimizes for safety. When we feel exposed or judged, we go into a defensive mode, rejecting questions that might reveal our uncertainty or ignorance. The very mechanism that makes pair programming powerful - having someone challenge your thinking - becomes counterproductive when trust and safety is absent.&lt;/p&gt;
&lt;p&gt;This is where I learned that pair programming has a prerequisite that TDD doesn&amp;rsquo;t: trust and safety. You need to feel secure enough to say &amp;ldquo;I don&amp;rsquo;t know&amp;rdquo; or &amp;ldquo;I&amp;rsquo;m not sure about this approach&amp;rdquo;. Without that foundation, the questions meant to engage System 2 thinking instead triggered System 1&amp;rsquo;s defense.&lt;/p&gt;
&lt;p&gt;So I started building relationships before I started building code. I&amp;rsquo;d spend time getting to know my pair - their communication style, their experiences, their preferred way of working through problems. This wasn&amp;rsquo;t just being nice and jolly; it was creating the conditions where System 2 could actually function. When someone asks &amp;ldquo;Why did you do it that way?&amp;rdquo; it needs to feel like genuine curiosity, and not judgment.&lt;/p&gt;
&lt;p&gt;The transformation was remarkable. Once that trust existed, pair programming became one of the most powerful ways to break out of autopilot mode. Your partner&amp;rsquo;s questions force you to articulate your reasoning, expose your assumptions, and consider alternatives you might have missed. It&amp;rsquo;s like having an external System 2 processor helping you think through problems.&lt;/p&gt;
&lt;p&gt;This insight about trust and safety wasn&amp;rsquo;t just practical. It pointed to something deeper about how teams function. Much later in my career, I learned there was a name for what I&amp;rsquo;d discovered: psychological safety, the condition where you can ask questions, admit uncertainty, and make mistakes without worrying about humiliation or punishment.&lt;/p&gt;
&lt;p&gt;But this also revealed why pair programming can feel forced or ineffective. When it&amp;rsquo;s mandated without attention to the relationship dynamics, you get compliance instead of collaboration. The social energy required to maintain both technical focus and interpersonal safety is immense - which is why effective pairing, like TDD, requires intentional practice and can&amp;rsquo;t be sustained indefinitely.&lt;/p&gt;
&lt;h2 id=&#34;when-questioning-wears-you-down&#34;&gt;When Questioning Wears You Down&lt;/h2&gt;
&lt;p&gt;Asking better questions can transform how we build software. But questioning - especially the deliberate kind - has its own costs: cognitive, emotional, and social. When we adopt practices like TDD or pair programming, we’re not just writing better code - we&amp;rsquo;re trying to slow down and force clarity. These practices succeed by injecting questions into a developer’s workflow.&lt;/p&gt;
&lt;p&gt;Constantly asking hard questions - about purpose, design, or behavior - requires sustained attention. And attention is a limited resource. When we overuse reflective practices without acknowledging their limits, we risk burnout, fragility, or polite but unproductive collaboration.&lt;/p&gt;
&lt;p&gt;Take TDD, for instance. It’s not a universal solution. You can&amp;rsquo;t approach every layer - domain logic, database code, API contracts - with the same testing mindset. TDD is most powerful where behavior is crisp and intention matters. Asking the same questions in every layer blindly adds more ceremony than clarity. You have to keep asking: “What exactly am I validating here and how is it different from there?” And that takes mental effort.&lt;/p&gt;
&lt;p&gt;Pair programming carries similar weight. It&amp;rsquo;s built on questions - “Why did you choose this?”, “What if we did it another way?” - but those questions only help if there&amp;rsquo;s trust. Without psychological safety, questioning can feel like interrogation. Dysfunctional pairing happens when one person dominates, the other withdraws, or neither feels safe being uncertain. You get silence or compliance, not true collaboration.&lt;/p&gt;
&lt;p&gt;These aren’t reasons to abandon questioning. But they’re reminders that deep thought costs energy, and that our tools and practices only work when used with intention, not obligation. Build relationships. Take breaks. Recognize when reflection becomes overload.&lt;/p&gt;
&lt;h2 id=&#34;the-questions-that-matter&#34;&gt;&lt;strong&gt;The Questions That Matter&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;Looking back at my journey from chemistry lab to the many software teams I worked with, I realize the common thread wasn&amp;rsquo;t the transition from molecules to code - it was learning to ask better questions. In chemistry, precise questions led to predictable outcomes. In software, the right questions reveal the unpredictable complexities that make or break our systems.&lt;/p&gt;
&lt;p&gt;The tester&amp;rsquo;s mindset taught me to question assumptions: &amp;ldquo;What happens when this fails?&amp;rdquo;&lt;/p&gt;
&lt;p&gt;TDD forced me to question purpose: &amp;ldquo;What&amp;rsquo;s the smallest thing I can verify?&amp;rdquo;&lt;/p&gt;
&lt;p&gt;Pair programming showed me how to question safely: &amp;ldquo;Can you walk me through your thinking?&amp;rdquo;&lt;/p&gt;
&lt;p&gt;These aren&amp;rsquo;t just development practices - they&amp;rsquo;re frameworks to interrogate assumptions that pull us out of System 1&amp;rsquo;s comfortable autopilot mode and into System 2&amp;rsquo;s deliberate analysis. They transform us from developers who just write code, to designers who understand systems.&lt;/p&gt;
&lt;p&gt;The art lies in knowing which questions to ask when. The power comes from creating environments - both technical and social - where those questions can be asked honestly. Whether you&amp;rsquo;re debugging a failing test, architecting a notification system, or working through a complex problem with a teammate, the quality of your questions determines the quality of your solutions.&lt;/p&gt;
&lt;p&gt;Your degree, your background, your fear of being judged - none of these disqualify you from building great software. What matters is cultivating the curiosity to question what you think you know, and the wisdom to create spaces where others can do the same.&lt;/p&gt;
&lt;p&gt;We spend so much energy designing systems that check every dimension of technology. Our code handles edge cases and unexpected inputs because we know systems fail in unpredictable ways. What if we applied the same engineering rigor to our teams? What if we spent half that engineering effort on creating humane environments where questions are welcome, uncertainty is normal, and intellectual curiosity isn&amp;rsquo;t punished but celebrated?&lt;/p&gt;
</description>
      <source:markdown>Looking back, I never thought I would build a career in software. My degree is in Chemistry, a field of precise rules and predictable reactions. What could a mind buzzing with ionic bonds and benzene rings understand about software?

That self-inflicted doubt was so strong that in my first year on the job, I didn&#39;t write much code at all. I chose to spend most of my time testing software that others built. I called myself a professional observer.

It turns out, learning to test was the best way to learn how to build software. Sure it took me a few years, but it taught me how to think in the long run, not just how to code.

## The Tester&#39;s Lens: Thinking from the Outside-In

When you test a simple login screen, you don’t just check the happy path. You probe the edges. What about an incorrect password? A non-existent username? What if a field is left blank? What if someone enters 10,000 characters? What happens if the database is down? You aren’t just testing a feature; you are mapping the uncharted territories of a feature.

This is ‘outside-in’ thinking. It’s the opposite of the ‘inside-out’ approach, where you immediately jump into implementation details without grasping the landscape the code lives in. The context is everything.

Imagine you need to send notifications to customers. An inside-out approach might lead you to loop through a list. But an outside-in approach forces you to ask questions first. How many customers? How fast does this need to be? Can the process fail and be safely restarted?

Asking these questions shifts your focus - from writing a for loop to designing a resilient system. Suddenly, the solution might involve message queues, retries, background workers, or batching. The context doesn’t just broaden your perspective - it shapes what’s even viable. It becomes the constraint and the canvas for the system’s design.

## The Persistent Problem: Why Smart People Make Silly Mistakes

As I moved into development, I realized that seeing the big picture wasn&#39;t enough; you still have to build the individual components. But even when I tried to balance both mindsets, I still made silly mistakes. I could not blame timelines or distraction or personal emergencies all the time, so I was forced down a path of reflection and reading. My search for answers led me to Daniel Kahneman’s work on our two cognitive systems:

* **System 1** is fast, intuitive, and based on patterns. It’s the gut feeling that a 500-line method needs refactoring. It’s quick and automatic.
    
* **System 2** is slow, deliberate, and analytical. It’s what you use to reason through trade-offs, evaluate design alternatives, or think about how another developer will see your code in six months.
    

The challenge is that software development, due to various internal and external factors, creates perfect conditions for System 1 to take over. Factors such as biases, opinions, experiences, hunger, emotions, weekend plans - the list goes on! We reach for familiar patterns and make quick decisions, often missing the bigger picture. Overcoming millions of years of evolutionary wiring is hard.

One of my strongest memories around this comes from my years-long pledge to become a polyglot. I was mugging up as many programming languages as possible during the early years of my career - to become a true polyglot. But my Python, Scala, JavaScript and everything in between looked suspiciously similar to Java. I was fluent in many languages but a native speaker in none.

During one code review in a Javascript project, a teammate asked why I wrote a complex, Java-esque list filter using prototypes. &#34;All you had to do was a filtered map,&#34; he said. He was right. My System 1 had jumped for a familiar pattern, a remnant of my Java 6 OOP experiences, even though it was the wrong one for the job.

These aren&#39;t failures of human intelligence. They are the natural consequences of how our minds work under a heavy cognitive load. The real question is, how do we, as developers, train System 2 to show up when we need it the most?

## Writing Tests to Think Better

Test-Driven Development (TDD) is a powerful tool for enforcing System 2 thinking. Our natural impulse is to jump into code as soon as we see an opportunity. TDD interrupts this. The ritual of writing a failing test, making the minimal changes to make it green, and then refactoring forces deliberate, methodical engagement of our analytical brain.

But I must admit, my first reaction to TDD was that it was a conspiracy to slow me down. The core question it asks is &#34;What&#39;s the smallest possible piece of functionality I can test?&#34;. It was inspiring, but frankly, I wasn’t ready for the deep probing it required. Instead, I bought into TDD for a more practical reason: my tests became better documentation. Before, my tests were often an afterthought and didn’t really tell much other than increasing coverage. With TDD, tests showed intent and context - not just coverage. Over time, I realized that my components and interfaces were becoming easier to adapt. Fast forward to now, TDD isn’t just about writing tests for me; it&#39;s a discipline that forces analytical thinking and clarity of thought.

This might also explain the endless debate around TDD. Perhaps experienced developers who resist TDD have already found other ways to engage System 2. But if you haven’t consciously been aware of your own thought process, TDD may be worth another look.

Asking tough questions alone is one thing. Doing it while someone else is watching - that’s a whole different kind of pressure.

## When a Question Becomes a Threat

Having someone watch me code used to feel like a nightmare. The fear of being judged was real. When I first tried pair programming, I approached it like TDD - focusing on the technical aspects. But unlike TDD, where I could force System 2 thinking through ritual and discipline, the questions during pairing sessions weren&#39;t working. The questions that made TDD so powerful - whether from me or my pair - felt threatening rather than showing curiosity.

It took me a while and a lot of reading to understand why. Our brain doesn&#39;t just optimize for familiar patterns; it also optimizes for safety. When we feel exposed or judged, we go into a defensive mode, rejecting questions that might reveal our uncertainty or ignorance. The very mechanism that makes pair programming powerful - having someone challenge your thinking - becomes counterproductive when trust and safety is absent.

This is where I learned that pair programming has a prerequisite that TDD doesn&#39;t: trust and safety. You need to feel secure enough to say &#34;I don&#39;t know&#34; or &#34;I&#39;m not sure about this approach&#34;. Without that foundation, the questions meant to engage System 2 thinking instead triggered System 1&#39;s defense.

So I started building relationships before I started building code. I&#39;d spend time getting to know my pair - their communication style, their experiences, their preferred way of working through problems. This wasn&#39;t just being nice and jolly; it was creating the conditions where System 2 could actually function. When someone asks &#34;Why did you do it that way?&#34; it needs to feel like genuine curiosity, and not judgment.

The transformation was remarkable. Once that trust existed, pair programming became one of the most powerful ways to break out of autopilot mode. Your partner&#39;s questions force you to articulate your reasoning, expose your assumptions, and consider alternatives you might have missed. It&#39;s like having an external System 2 processor helping you think through problems.

This insight about trust and safety wasn&#39;t just practical. It pointed to something deeper about how teams function. Much later in my career, I learned there was a name for what I&#39;d discovered: psychological safety, the condition where you can ask questions, admit uncertainty, and make mistakes without worrying about humiliation or punishment.

But this also revealed why pair programming can feel forced or ineffective. When it&#39;s mandated without attention to the relationship dynamics, you get compliance instead of collaboration. The social energy required to maintain both technical focus and interpersonal safety is immense - which is why effective pairing, like TDD, requires intentional practice and can&#39;t be sustained indefinitely.

## When Questioning Wears You Down

Asking better questions can transform how we build software. But questioning - especially the deliberate kind - has its own costs: cognitive, emotional, and social. When we adopt practices like TDD or pair programming, we’re not just writing better code - we&#39;re trying to slow down and force clarity. These practices succeed by injecting questions into a developer’s workflow.

Constantly asking hard questions - about purpose, design, or behavior - requires sustained attention. And attention is a limited resource. When we overuse reflective practices without acknowledging their limits, we risk burnout, fragility, or polite but unproductive collaboration.

Take TDD, for instance. It’s not a universal solution. You can&#39;t approach every layer - domain logic, database code, API contracts - with the same testing mindset. TDD is most powerful where behavior is crisp and intention matters. Asking the same questions in every layer blindly adds more ceremony than clarity. You have to keep asking: “What exactly am I validating here and how is it different from there?” And that takes mental effort.

Pair programming carries similar weight. It&#39;s built on questions - “Why did you choose this?”, “What if we did it another way?” - but those questions only help if there&#39;s trust. Without psychological safety, questioning can feel like interrogation. Dysfunctional pairing happens when one person dominates, the other withdraws, or neither feels safe being uncertain. You get silence or compliance, not true collaboration.

These aren’t reasons to abandon questioning. But they’re reminders that deep thought costs energy, and that our tools and practices only work when used with intention, not obligation. Build relationships. Take breaks. Recognize when reflection becomes overload.

## **The Questions That Matter**

Looking back at my journey from chemistry lab to the many software teams I worked with, I realize the common thread wasn&#39;t the transition from molecules to code - it was learning to ask better questions. In chemistry, precise questions led to predictable outcomes. In software, the right questions reveal the unpredictable complexities that make or break our systems.

The tester&#39;s mindset taught me to question assumptions: &#34;What happens when this fails?&#34;

TDD forced me to question purpose: &#34;What&#39;s the smallest thing I can verify?&#34;

Pair programming showed me how to question safely: &#34;Can you walk me through your thinking?&#34;

These aren&#39;t just development practices - they&#39;re frameworks to interrogate assumptions that pull us out of System 1&#39;s comfortable autopilot mode and into System 2&#39;s deliberate analysis. They transform us from developers who just write code, to designers who understand systems.

The art lies in knowing which questions to ask when. The power comes from creating environments - both technical and social - where those questions can be asked honestly. Whether you&#39;re debugging a failing test, architecting a notification system, or working through a complex problem with a teammate, the quality of your questions determines the quality of your solutions.

Your degree, your background, your fear of being judged - none of these disqualify you from building great software. What matters is cultivating the curiosity to question what you think you know, and the wisdom to create spaces where others can do the same.

We spend so much energy designing systems that check every dimension of technology. Our code handles edge cases and unexpected inputs because we know systems fail in unpredictable ways. What if we applied the same engineering rigor to our teams? What if we spent half that engineering effort on creating humane environments where questions are welcome, uncertainty is normal, and intellectual curiosity isn&#39;t punished but celebrated?
</source:markdown>
    </item>
    
    <item>
      <title>Who&#39;s Driving Your Architecture?</title>
      <link>https://aravindkunnath.com/2025/06/20/whos-driving-your-architecture/</link>
      <pubDate>Fri, 20 Jun 2025 08:29:46 -0500</pubDate>
      
      <guid>http://aravindkunnath.micro.blog/2025/06/20/whos-driving-your-architecture/</guid>
      <description>&lt;p&gt;Ask any architect who drives their technical decisions, and you&amp;rsquo;ll hear the usual suspects: &amp;ldquo;the product,&amp;rdquo; &amp;ldquo;the business,&amp;rdquo; or &amp;ldquo;the end-user.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;I believe they&amp;rsquo;re all missing the most critical factor.&lt;/p&gt;
&lt;p&gt;End-users want working products. The business wants shipped features. Managers want predictable timelines. But there&amp;rsquo;s one group that ultimately decides whether your architecture thrives or becomes technical debt: &lt;strong&gt;the development team&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Your developers aren&amp;rsquo;t just stakeholders—they&amp;rsquo;re your architecture&amp;rsquo;s true customers. And most architects are building systems their customers can&amp;rsquo;t actually use.&lt;/p&gt;
&lt;h2 id=&#34;the-vanilla-ice-cream-problem&#34;&gt;The Vanilla Ice Cream Problem&lt;/h2&gt;
&lt;p&gt;No story captures this better than the classic industry tale of the vanilla ice cream car, for me.&lt;/p&gt;
&lt;p&gt;A man wrote to an American car company complaining that his car wouldn&amp;rsquo;t start whenever he bought vanilla ice cream. Chocolate, strawberry, any other flavour—the car started fine. Just vanilla caused this problem.&lt;/p&gt;
&lt;p&gt;Most of the engineers in the company dismissed this as absurd. But one, an empathetic and curious engineer, decided to investigate. He accompanied the customer on his ice cream runs and discovered something subtle but critical: vanilla was the most popular flavour, so stores kept it at the front. Other flavours were stored in back and took longer to retrieve.&lt;/p&gt;
&lt;p&gt;The extra time for non-vanilla flavours let the engine cool down. The quick vanilla trips meant the engine was still hot, causing vapour lock—a known issue that prevented restart.&lt;/p&gt;
&lt;p&gt;The flavour was a red herring. The real problem was timing.&lt;/p&gt;
&lt;p&gt;This is what software architects face daily: teams bring you &amp;ldquo;vanilla ice cream problems&amp;rdquo;—confusing errors, unexpected pain points, workflows that seem irrational, vague requirements from another team. The reflex is dismissal: &amp;ldquo;That&amp;rsquo;s not how it&amp;rsquo;s supposed to work&amp;rdquo; or &amp;ldquo;They just don&amp;rsquo;t understand the design.&amp;rdquo; or &amp;ldquo;Just create another API&amp;rdquo;&lt;/p&gt;
&lt;p&gt;But here&amp;rsquo;s what the car engineer understood: &lt;strong&gt;assume they&amp;rsquo;re not wrong; assume you&amp;rsquo;re missing something.&lt;/strong&gt;&lt;/p&gt;
&lt;h2 id=&#34;the-hidden-cost-of-developer-friction&#34;&gt;The Hidden Cost of Developer Friction&lt;/h2&gt;
&lt;p&gt;The flaws that kill productivity don&amp;rsquo;t show up in system diagrams or monitoring dashboards. They&amp;rsquo;re invisible until you watch how developers actually work.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cognitive Overload&lt;/strong&gt;: When a simple change requires navigating six services, four layers of abstraction, and three different authentication schemes, developers burn mental energy just figuring out where to start. I&amp;rsquo;ve watched senior engineers spend entire mornings tracing through code to understand a basic data flow.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Death by a Thousand Cuts&lt;/strong&gt;: Cryptic error messages. Inconsistent naming conventions. Setup processes that require archaic knowledge of the past decisions. APIs that work differently than they&amp;rsquo;re documented. Each small friction point seems minor, but together they create a development experience like assembling IKEA furniture—blindfolded, without an Allen key.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The Workaround Culture&lt;/strong&gt;: When your architecture is hard to use, and team’s complaints unaddressed, teams stop complaining about the vanilla ice-cream runs—they adapt. They build shadow APIs. They duplicate functionality. They create one-off solutions that bypass your carefully designed interfaces. Team stop ordering vanilla flavour. This creates entropy, a slow decay that hollows out your system from the inside. And it could be happening right now in your codebase.&lt;/p&gt;
&lt;p&gt;You can measure this dysfunction. Track time-to-first-commit for new team members. Count &amp;ldquo;house-keeping&amp;rdquo; stories. Monitor backlog for tech debt. Monitor how often new services deviate from your patterns. Measure deployment times. Survey developers about their biggest daily frustrations. The invisible has visible footprints.&lt;/p&gt;
&lt;h2 id=&#34;treating-architecture-as-a-product&#34;&gt;Treating Architecture as a Product&lt;/h2&gt;
&lt;p&gt;The solution requires a fundamental mindset shift: &lt;strong&gt;treat your architecture like a product, with developers as your users.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This means usability matters as much as technical elegance. Here&amp;rsquo;s how I would operationalize that:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Embed with Your Users&lt;/strong&gt;: You can&amp;rsquo;t ride shotgun with every team, but you can create touchpoints at scale. Run weekly office hours. You can&amp;rsquo;t be in every sprint review, but you can create touchpoints. Occasionally pair-program on small features. Better yet, record yourself building something with your own architecture—narrate the steps, show the gotchas, invite collaboration. Let people see how it&amp;rsquo;s actually supposed to work. Get in to the car with your customer.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Conduct User Research&lt;/strong&gt;: Run developer experience surveys and interviews where you watch—don&amp;rsquo;t explain, just observe—as developers use your systems. Where do they pause? What do they seek assistance for? What makes them swear under their breath? These moments reveal your architecture&amp;rsquo;s true usability. Listen to your user&amp;rsquo;s feedback.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Use Your Own Product&lt;/strong&gt;: Build something real with your architecture regularly. Feel the pain directly. If you don&amp;rsquo;t have bandwidth for this, rotate a &amp;ldquo;developer-in-residence&amp;rdquo; from one of your user teams into the architecture group for a few months. Let them bring their daily friction back to you with full context. You won&amp;rsquo;t find the vanilla bug unless you taste it yourself.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cultivate Internal Champions&lt;/strong&gt;: Find engineers in your teams who deeply understand your architecture. These champions can relay context both ways—helping their teams use systems effectively while giving you ground-truth feedback about what&amp;rsquo;s actually broken. They’re the ones who know when the vanilla flavour starts causing a mess in your system.&lt;/p&gt;
&lt;h2 id=&#34;when-developers-and-architecture-conflict&#34;&gt;When Developers and Architecture Conflict&lt;/h2&gt;
&lt;p&gt;This doesn&amp;rsquo;t mean giving developers everything they ask for. Business constraints, security requirements, or scalability needs - they all require difficult trade-offs that create friction. The key is making those trade-offs transparent and providing sensible defaults for the common cases.&lt;/p&gt;
&lt;p&gt;When Netflix moved to microservices, they didn’t order teams to break up monoliths. They built tools that made microservices easier to deploy, monitor, and debug. They made it easy to adopt and let the teams decide when they are ready.&lt;/p&gt;
&lt;p&gt;When Stripe designed their API, they didn’t obsess over the purity of their REST-iness. They prioritized developer experience—making common operations simple, errors helpful, and the learning curve gentle. Their &amp;ldquo;unorthodox&amp;rdquo; API became a standard because it worked for real people building real applications.&lt;/p&gt;
&lt;h2 id=&#34;redefining-success&#34;&gt;Redefining Success&lt;/h2&gt;
&lt;p&gt;We need to abandon the notion that the best architecture is the one with the cleanest diagram or fewest moving parts. Those might be good architectures, but they&amp;rsquo;re not necessarily useful architectures.&lt;/p&gt;
&lt;p&gt;A truly good architecture doesn&amp;rsquo;t just work—it works &lt;em&gt;for people&lt;/em&gt;. It empowers developers. It makes complex problems feel manageable. It turns architectural constraints into guardrails that help teams move faster, not walls that slow them down.&lt;/p&gt;
&lt;p&gt;Success of an architecture isn&amp;rsquo;t measured by theoretical elegance. It&amp;rsquo;s measured by how confidently and quickly teams can use your systems to solve the problems in front of them.&lt;/p&gt;
&lt;h2 id=&#34;stop-dismissing-the-vanilla-ice-cream&#34;&gt;Stop Dismissing the Vanilla Ice Cream&lt;/h2&gt;
&lt;p&gt;The next time a developer brings you a problem that seems irrational or misguided, resist the urge to explain why they&amp;rsquo;re wrong. Instead, get curious. Get in the car with them. Watch them order vanilla ice-cream!&lt;/p&gt;
&lt;p&gt;Be curious and ask why the car won&amp;rsquo;t start.&lt;/p&gt;
&lt;p&gt;Because the answer is rarely about the ice cream flavour. It&amp;rsquo;s about the system you&amp;rsquo;ve built—and whether it actually serves the people who have to use it every day.&lt;/p&gt;
&lt;p&gt;Your architecture&amp;rsquo;s success depends entirely on their success. Start designing for it.&lt;/p&gt;
</description>
      <source:markdown>Ask any architect who drives their technical decisions, and you&#39;ll hear the usual suspects: &#34;the product,&#34; &#34;the business,&#34; or &#34;the end-user.&#34;

I believe they&#39;re all missing the most critical factor.

End-users want working products. The business wants shipped features. Managers want predictable timelines. But there&#39;s one group that ultimately decides whether your architecture thrives or becomes technical debt: **the development team**.

Your developers aren&#39;t just stakeholders—they&#39;re your architecture&#39;s true customers. And most architects are building systems their customers can&#39;t actually use.

## The Vanilla Ice Cream Problem

No story captures this better than the classic industry tale of the vanilla ice cream car, for me.

A man wrote to an American car company complaining that his car wouldn&#39;t start whenever he bought vanilla ice cream. Chocolate, strawberry, any other flavour—the car started fine. Just vanilla caused this problem.

Most of the engineers in the company dismissed this as absurd. But one, an empathetic and curious engineer, decided to investigate. He accompanied the customer on his ice cream runs and discovered something subtle but critical: vanilla was the most popular flavour, so stores kept it at the front. Other flavours were stored in back and took longer to retrieve.

The extra time for non-vanilla flavours let the engine cool down. The quick vanilla trips meant the engine was still hot, causing vapour lock—a known issue that prevented restart.

The flavour was a red herring. The real problem was timing.

This is what software architects face daily: teams bring you &#34;vanilla ice cream problems&#34;—confusing errors, unexpected pain points, workflows that seem irrational, vague requirements from another team. The reflex is dismissal: &#34;That&#39;s not how it&#39;s supposed to work&#34; or &#34;They just don&#39;t understand the design.&#34; or &#34;Just create another API&#34;

But here&#39;s what the car engineer understood: **assume they&#39;re not wrong; assume you&#39;re missing something.**

## The Hidden Cost of Developer Friction

The flaws that kill productivity don&#39;t show up in system diagrams or monitoring dashboards. They&#39;re invisible until you watch how developers actually work.

**Cognitive Overload**: When a simple change requires navigating six services, four layers of abstraction, and three different authentication schemes, developers burn mental energy just figuring out where to start. I&#39;ve watched senior engineers spend entire mornings tracing through code to understand a basic data flow.

**Death by a Thousand Cuts**: Cryptic error messages. Inconsistent naming conventions. Setup processes that require archaic knowledge of the past decisions. APIs that work differently than they&#39;re documented. Each small friction point seems minor, but together they create a development experience like assembling IKEA furniture—blindfolded, without an Allen key.

**The Workaround Culture**: When your architecture is hard to use, and team’s complaints unaddressed, teams stop complaining about the vanilla ice-cream runs—they adapt. They build shadow APIs. They duplicate functionality. They create one-off solutions that bypass your carefully designed interfaces. Team stop ordering vanilla flavour. This creates entropy, a slow decay that hollows out your system from the inside. And it could be happening right now in your codebase.

You can measure this dysfunction. Track time-to-first-commit for new team members. Count &#34;house-keeping&#34; stories. Monitor backlog for tech debt. Monitor how often new services deviate from your patterns. Measure deployment times. Survey developers about their biggest daily frustrations. The invisible has visible footprints.

## Treating Architecture as a Product

The solution requires a fundamental mindset shift: **treat your architecture like a product, with developers as your users.**

This means usability matters as much as technical elegance. Here&#39;s how I would operationalize that:

**Embed with Your Users**: You can&#39;t ride shotgun with every team, but you can create touchpoints at scale. Run weekly office hours. You can&#39;t be in every sprint review, but you can create touchpoints. Occasionally pair-program on small features. Better yet, record yourself building something with your own architecture—narrate the steps, show the gotchas, invite collaboration. Let people see how it&#39;s actually supposed to work. Get in to the car with your customer.

**Conduct User Research**: Run developer experience surveys and interviews where you watch—don&#39;t explain, just observe—as developers use your systems. Where do they pause? What do they seek assistance for? What makes them swear under their breath? These moments reveal your architecture&#39;s true usability. Listen to your user&#39;s feedback.

**Use Your Own Product**: Build something real with your architecture regularly. Feel the pain directly. If you don&#39;t have bandwidth for this, rotate a &#34;developer-in-residence&#34; from one of your user teams into the architecture group for a few months. Let them bring their daily friction back to you with full context. You won&#39;t find the vanilla bug unless you taste it yourself.

**Cultivate Internal Champions**: Find engineers in your teams who deeply understand your architecture. These champions can relay context both ways—helping their teams use systems effectively while giving you ground-truth feedback about what&#39;s actually broken. They’re the ones who know when the vanilla flavour starts causing a mess in your system.

## When Developers and Architecture Conflict

This doesn&#39;t mean giving developers everything they ask for. Business constraints, security requirements, or scalability needs - they all require difficult trade-offs that create friction. The key is making those trade-offs transparent and providing sensible defaults for the common cases.

When Netflix moved to microservices, they didn’t order teams to break up monoliths. They built tools that made microservices easier to deploy, monitor, and debug. They made it easy to adopt and let the teams decide when they are ready.

When Stripe designed their API, they didn’t obsess over the purity of their REST-iness. They prioritized developer experience—making common operations simple, errors helpful, and the learning curve gentle. Their &#34;unorthodox&#34; API became a standard because it worked for real people building real applications.

## Redefining Success

We need to abandon the notion that the best architecture is the one with the cleanest diagram or fewest moving parts. Those might be good architectures, but they&#39;re not necessarily useful architectures.

A truly good architecture doesn&#39;t just work—it works *for people*. It empowers developers. It makes complex problems feel manageable. It turns architectural constraints into guardrails that help teams move faster, not walls that slow them down.

Success of an architecture isn&#39;t measured by theoretical elegance. It&#39;s measured by how confidently and quickly teams can use your systems to solve the problems in front of them.

## Stop Dismissing the Vanilla Ice Cream

The next time a developer brings you a problem that seems irrational or misguided, resist the urge to explain why they&#39;re wrong. Instead, get curious. Get in the car with them. Watch them order vanilla ice-cream!

Be curious and ask why the car won&#39;t start.

Because the answer is rarely about the ice cream flavour. It&#39;s about the system you&#39;ve built—and whether it actually serves the people who have to use it every day.

Your architecture&#39;s success depends entirely on their success. Start designing for it.
</source:markdown>
    </item>
    
    <item>
      <title>Hexagonal Architecture - Understanding Ports</title>
      <link>https://aravindkunnath.com/2025/05/22/hexagonal-architecture-understanding-ports/</link>
      <pubDate>Thu, 22 May 2025 21:54:53 -0500</pubDate>
      
      <guid>http://aravindkunnath.micro.blog/2025/05/23/hexagonal-architecture-understanding-ports/</guid>
      <description>&lt;p&gt;&lt;strong&gt;What are Ports and Why Do They Matter?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In Hexagonal Architecture, ports are an important part of the core of the application. They are essentially interfaces or contracts that govern the interactions between your application&amp;rsquo;s core logic and the outside world. Their primary purpose is to protect this core business logic from all the external details it might need to interact with.&lt;/p&gt;
&lt;p&gt;What do we mean by &amp;ldquo;external details&amp;rdquo;? This refers to any component or technology that isn&amp;rsquo;t part of the core business logic itself, such as HTTP controllers, database interaction mechanisms (such as JDBC or an ORM), integrations with message queues, or clients for third-party APIs. The core should remain ignorant of &lt;em&gt;how&lt;/em&gt; data arrives or &lt;em&gt;how&lt;/em&gt; it&amp;rsquo;s persisted. By clearly defining these interaction points as ports, we can achieve a more decoupled, maintainable, and adaptable system.&lt;/p&gt;
&lt;p&gt;To better understand how ports fit in, let&amp;rsquo;s look at a diagram illustrating the interactions and dependencies within Hexagonal Architecture.&lt;/p&gt;
&lt;p&gt;![](&lt;a href=&#34;https://lh7-rt.googleusercontent.com/docsz/AD_4nXcR1TG0_d1UtisbTO0ke8HR7GXqcfl6_-sKpjUk7l8m9nLZgPk0omyZ9r3-N0_ENSOaWmDGwWSAoGcQ4Hazs-KhNWoHbaOpIOokZ23qzaSX0gMFWlFUP8BxsWdgHxA35AfqT-lbgA?key=nFhxI6_Q8dZxiYKwCHXuuQ&#34;&gt;https://lh7-rt.googleusercontent.com/docsz/AD_4nXcR1TG0_d1UtisbTO0ke8HR7GXqcfl6_-sKpjUk7l8m9nLZgPk0omyZ9r3-N0_ENSOaWmDGwWSAoGcQ4Hazs-KhNWoHbaOpIOokZ23qzaSX0gMFWlFUP8BxsWdgHxA35AfqT-lbgA?key=nFhxI6_Q8dZxiYKwCHXuuQ&lt;/a&gt; align=&amp;ldquo;left&amp;rdquo;)&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The &lt;strong&gt;Core&lt;/strong&gt; contains the application&amp;rsquo;s business logic.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Driver/API&lt;/strong&gt; and &lt;strong&gt;Driven/SPI&lt;/strong&gt; represent the ports themselves. &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Inbound Adapters&lt;/strong&gt; (e.g., HTTP controllers) use the Driver/API ports to send commands or queries to the core.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Outbound Adapters&lt;/strong&gt; (e.g., database connectors, external service clients) implement the Driven/SPI ports that the core uses to send data or request actions from external systems.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Notice the direction of the arrows – they all point towards the core. This is the Dependency Inversion Principle from SOLID, which states that low-level modules should depend on high-level modules, not the other way around. In this context, low-level modules are the concrete, technology-dependent parts like HTTP Controllers (an inbound adapter) or JDBC implementations (an outbound adapter). The high-level module is the abstract representation of the real world containing the business logic - that&amp;rsquo;s the core.&lt;/p&gt;
&lt;p&gt;Any cohesive unit of capability in the core should only be accessed through an API (inbound) port, and any external interactions the core needs must only be implemented as per an SPI (outbound) Port.&lt;/p&gt;
&lt;p&gt;Ports facilitate two primary directions of interaction:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Inbound Interaction:&lt;/strong&gt; The outside world (users, other systems, automated tests) initiates communication with the application&amp;rsquo;s core logic.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Outbound Interaction:&lt;/strong&gt; The application&amp;rsquo;s core logic initiates communication with external systems (databases, messaging systems, third-party services).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Inbound Ports (Driver/API Ports): The Gateway to Your Core Logic&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Inbound ports define how external actors can invoke the application&amp;rsquo;s use cases or capabilities. In most programming languages, these ports are implemented as interfaces.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Naming Conventions for Inbound Ports&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;Effective naming is key for clarity. Two common types of naming conventions that I have used are&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Use-Case Naming:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Names that are derived from the use cases provided in requirements and used by the business in the real world. Examples include &lt;code&gt;CreateOrder&lt;/code&gt;, &lt;code&gt;CreateOrderPort&lt;/code&gt;, &lt;code&gt;OrderCreationService&lt;/code&gt;, &lt;code&gt;ForOrderCreation&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt; Excellent for smaller applications due to high readability.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt; Scales reasonably well up to a point, after which you might face too many ports or require refactoring.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Bounded Context Naming:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This convention groups related use cases into a single port, representing a specific bounded context from Domain-Driven Design (DDD). This helps organize ports in larger systems. It follows a domain-driven design approach. An example is &lt;code&gt;OrderManagementPort&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt; Ideal for larger applications and aligns well with DDD principles.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt; Can have slightly lower initial readability compared to use-case naming.&lt;/p&gt;
&lt;p&gt;A third style, &lt;strong&gt;Actor-based naming&lt;/strong&gt;, is not covered in detail here. Please leave a comment if you would like to know more&lt;/p&gt;
&lt;p&gt;These naming strategies help group methods or behaviours for adapters and keep the system aligned with real-world use cases or business language.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Defining the inbound contract&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Since an inbound port is an interface and a contract, it must contain methods for the use cases or capabilities it exposes. Consider an order placement application that receives an HTTP request to create an order in a database.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s a sample inbound port in Java for creating an order:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-java&#34; data-lang=&#34;java&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;public&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;interface&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;CreateOrder&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    OrderCreated &lt;span style=&#34;color:#a6e22e&#34;&gt;createOrder&lt;/span&gt;(CreateOrderCommand command);
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Let&amp;rsquo;s break down the input and output:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Input:&lt;/strong&gt; The &lt;code&gt;createOrder&lt;/code&gt; method takes a &lt;code&gt;CreateOrderCommand&lt;/code&gt; object. This is a wrapper class containing all necessary attributes to create an order. It&amp;rsquo;s called a &amp;ldquo;Command&amp;rdquo; here because this behavior is asking for a change in the application&amp;rsquo;s state, which is a DDD principle (related to Command-Query-Response). You can also use &lt;code&gt;CreateOrderRequest&lt;/code&gt; or &lt;code&gt;CreateOrderDTO&lt;/code&gt; if those are more familiar to you.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt; For the &lt;code&gt;CreateOrder&lt;/code&gt; behaviour, a successful response is named &lt;code&gt;OrderCreated&lt;/code&gt;. This follows an event naming convention, indicating something that has happened in the past (&amp;ldquo;Do something, the adapter requested, core responds I did&amp;rdquo;). You can also use names like &lt;code&gt;CreateOrderResponse&lt;/code&gt; or &lt;code&gt;OrderDTO&lt;/code&gt; if those are more familiar to you. &lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Sometimes, it&amp;rsquo;s worth checking your team&amp;rsquo;s &amp;ldquo;collective finger muscle memory&amp;rdquo; for naming.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Outbound Ports (Driven/SPI Ports)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Driven Ports, also known as Secondary Ports or Outbound Ports, define the contract for how your application&amp;rsquo;s core logic interacts with external systems or infrastructure concerns. Think of them as the interfaces that your application &lt;em&gt;needs the outside world to implement&lt;/em&gt;. These ports are on the &amp;ldquo;right side&amp;rdquo; or &amp;ldquo;driven side&amp;rdquo; of the hexagon, representing services your application &lt;em&gt;consumes&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;The primary role of a driven port is to abstract away the specific details of external dependencies. Your core application logic shouldn&amp;rsquo;t care if it&amp;rsquo;s communicating with a PostgreSQL database, a REST API, a message queue, or a simple in-memory store for testing purposes. It only cares that &lt;em&gt;something&lt;/em&gt; exists that can fulfill its request, as defined by the port&amp;rsquo;s interface.&lt;/p&gt;
&lt;p&gt;Outbound ports are often defined in terms of your domain objects, not in terms of the technology used by the external service. For example, if your application manages Order entities, you&amp;rsquo;ll likely define an &lt;code&gt;OrderRepository&lt;/code&gt; or &lt;code&gt;OrderDataGateway&lt;/code&gt; port. Here is an example&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-java&#34; data-lang=&#34;java&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;public&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;interface&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;OrderDataGateway&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;public&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;void&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;save&lt;/span&gt;(OrderData order);
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;public&lt;/span&gt; OrderData &lt;span style=&#34;color:#a6e22e&#34;&gt;findById&lt;/span&gt;(FindOrderData order);
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;public&lt;/span&gt; List&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;OrderData&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;findAll&lt;/span&gt;();
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This approach keeps your core domain pure and free from infrastructure leakage, and that is the first step to anti-corruption layer. These ports frequently mirror key entities or aggregates within your domain model.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Naming Conventions&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;Again, context matters! Here are a few tips to name the outbound ports.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Repository:&lt;/strong&gt; This term is popularized by Domain-Driven Design (DDD), is commonly used when the port specifically handles the persistence and retrieval of domain aggregates, mimicking a collection of entities. An &lt;code&gt;OrderRepository&lt;/code&gt; is a very common and descriptive name if its sole purpose is managing Order persistence.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Gateway:&lt;/strong&gt; This term, like &lt;code&gt;OrderGateway&lt;/code&gt;, describes a point of entry/exit for data or functionality related to a specific domain concept. It&amp;rsquo;s a broader term that can encompass more than just data persistence. For instance, an &lt;code&gt;OrderNotificationGateway&lt;/code&gt; wouldn&amp;rsquo;t be a repository but would still be a driven port.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;DataGateway:&lt;/strong&gt; Adding &amp;ldquo;Data&amp;rdquo; as a prefix, like &lt;code&gt;OrderDataGateway&lt;/code&gt;, can be useful to be more explicit that this gateway is primarily concerned with data access, distinguishing it from other types of gateways (e.g., a &lt;code&gt;OrderNotificationGateway&lt;/code&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Choose a convention that makes sense for your team and stick to it. The goal is to make the port&amp;rsquo;s purpose immediately understandable.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Best Practices for Designing Port Interfaces&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Whether defining inbound or outbound ports, certain practices lead to more robust and maintainable contracts.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The Power of Wrapper Objects (Commands, DTOs, Request/Response Objects)&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;Using well-defined Data Transfer Objects (DTOs) or dedicated request/response objects as parameters and return types for port methods is crucial. Always try to use wrapper types, POJOs (Plain Old Java Objects), or Command/Query objects in interfaces. Do not use primitives and too many arguments, as they have a high tendency to break the contract and cause significant refactoring effort.&lt;/p&gt;
&lt;p&gt;Let’s look at these two methods&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-java&#34; data-lang=&#34;java&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;public&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;void&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;save&lt;/span&gt;(String customerId, List&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;String&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt; productIds, &lt;span style=&#34;color:#66d9ef&#34;&gt;double&lt;/span&gt; totalAmount, Instant orderDate);
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;versus&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-java&#34; data-lang=&#34;java&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;public&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;void&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;save&lt;/span&gt;(OrderData order);
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Which is better for clarity? What if you want to add a new attribute? Will you remember the order of attributes in the first method?&lt;/p&gt;
&lt;p&gt;And Interface Segregation Principle from SOLID must be mentioned here - no client should be forced to depend on methods it does not use. This encourages the creation of smaller, more specific interfaces. This allows a variety of techniques to allow mixins, composition and strategies in your core that are just elegant (and more fun to work with), while addressing the requirements.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The Value of Ports&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;By adhering to these principles, your inbound and outbound ports become robust, maintainable contracts. They effectively decouple your application core from the never ending framework upgrades, database migrations while improving testability and evolution of the application. &lt;/p&gt;
&lt;p&gt;Well-defined ports are a cornerstone of building flexible, long-lasting software systems with Hexagonal Architecture. &lt;/p&gt;
&lt;p&gt;In the next post, we will explore the core of hexagonal architecture.&lt;/p&gt;
</description>
      <source:markdown>**What are Ports and Why Do They Matter?**

In Hexagonal Architecture, ports are an important part of the core of the application. They are essentially interfaces or contracts that govern the interactions between your application&#39;s core logic and the outside world. Their primary purpose is to protect this core business logic from all the external details it might need to interact with.

What do we mean by &#34;external details&#34;? This refers to any component or technology that isn&#39;t part of the core business logic itself, such as HTTP controllers, database interaction mechanisms (such as JDBC or an ORM), integrations with message queues, or clients for third-party APIs. The core should remain ignorant of *how* data arrives or *how* it&#39;s persisted. By clearly defining these interaction points as ports, we can achieve a more decoupled, maintainable, and adaptable system.

To better understand how ports fit in, let&#39;s look at a diagram illustrating the interactions and dependencies within Hexagonal Architecture.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcR1TG0_d1UtisbTO0ke8HR7GXqcfl6_-sKpjUk7l8m9nLZgPk0omyZ9r3-N0_ENSOaWmDGwWSAoGcQ4Hazs-KhNWoHbaOpIOokZ23qzaSX0gMFWlFUP8BxsWdgHxA35AfqT-lbgA?key=nFhxI6_Q8dZxiYKwCHXuuQ align=&#34;left&#34;)

* The **Core** contains the application&#39;s business logic.
    
* **Driver/API** and **Driven/SPI** represent the ports themselves. 
    
* **Inbound Adapters** (e.g., HTTP controllers) use the Driver/API ports to send commands or queries to the core.
    
* **Outbound Adapters** (e.g., database connectors, external service clients) implement the Driven/SPI ports that the core uses to send data or request actions from external systems.
    

Notice the direction of the arrows – they all point towards the core. This is the Dependency Inversion Principle from SOLID, which states that low-level modules should depend on high-level modules, not the other way around. In this context, low-level modules are the concrete, technology-dependent parts like HTTP Controllers (an inbound adapter) or JDBC implementations (an outbound adapter). The high-level module is the abstract representation of the real world containing the business logic - that&#39;s the core.

Any cohesive unit of capability in the core should only be accessed through an API (inbound) port, and any external interactions the core needs must only be implemented as per an SPI (outbound) Port.

Ports facilitate two primary directions of interaction:

* **Inbound Interaction:** The outside world (users, other systems, automated tests) initiates communication with the application&#39;s core logic.
    
* **Outbound Interaction:** The application&#39;s core logic initiates communication with external systems (databases, messaging systems, third-party services).
    

**Inbound Ports (Driver/API Ports): The Gateway to Your Core Logic**

Inbound ports define how external actors can invoke the application&#39;s use cases or capabilities. In most programming languages, these ports are implemented as interfaces.

**Naming Conventions for Inbound Ports** 

Effective naming is key for clarity. Two common types of naming conventions that I have used are

**Use-Case Naming:**

Names that are derived from the use cases provided in requirements and used by the business in the real world. Examples include `CreateOrder`, `CreateOrderPort`, `OrderCreationService`, `ForOrderCreation`.

**Pros:** Excellent for smaller applications due to high readability.

**Cons:** Scales reasonably well up to a point, after which you might face too many ports or require refactoring.

**Bounded Context Naming:**

This convention groups related use cases into a single port, representing a specific bounded context from Domain-Driven Design (DDD). This helps organize ports in larger systems. It follows a domain-driven design approach. An example is `OrderManagementPort`.

**Pros:** Ideal for larger applications and aligns well with DDD principles.

**Cons:** Can have slightly lower initial readability compared to use-case naming.

A third style, **Actor-based naming**, is not covered in detail here. Please leave a comment if you would like to know more

These naming strategies help group methods or behaviours for adapters and keep the system aligned with real-world use cases or business language.

**Defining the inbound contract**

Since an inbound port is an interface and a contract, it must contain methods for the use cases or capabilities it exposes. Consider an order placement application that receives an HTTP request to create an order in a database.

Here&#39;s a sample inbound port in Java for creating an order:

```java
public interface CreateOrder {
    OrderCreated createOrder(CreateOrderCommand command);
}
```

Let&#39;s break down the input and output:

* **Input:** The `createOrder` method takes a `CreateOrderCommand` object. This is a wrapper class containing all necessary attributes to create an order. It&#39;s called a &#34;Command&#34; here because this behavior is asking for a change in the application&#39;s state, which is a DDD principle (related to Command-Query-Response). You can also use `CreateOrderRequest` or `CreateOrderDTO` if those are more familiar to you.
    
* **Output:** For the `CreateOrder` behaviour, a successful response is named `OrderCreated`. This follows an event naming convention, indicating something that has happened in the past (&#34;Do something, the adapter requested, core responds I did&#34;). You can also use names like `CreateOrderResponse` or `OrderDTO` if those are more familiar to you. 
    

Sometimes, it&#39;s worth checking your team&#39;s &#34;collective finger muscle memory&#34; for naming.

**Outbound Ports (Driven/SPI Ports)**

Driven Ports, also known as Secondary Ports or Outbound Ports, define the contract for how your application&#39;s core logic interacts with external systems or infrastructure concerns. Think of them as the interfaces that your application *needs the outside world to implement*. These ports are on the &#34;right side&#34; or &#34;driven side&#34; of the hexagon, representing services your application *consumes*.

The primary role of a driven port is to abstract away the specific details of external dependencies. Your core application logic shouldn&#39;t care if it&#39;s communicating with a PostgreSQL database, a REST API, a message queue, or a simple in-memory store for testing purposes. It only cares that *something* exists that can fulfill its request, as defined by the port&#39;s interface.

Outbound ports are often defined in terms of your domain objects, not in terms of the technology used by the external service. For example, if your application manages Order entities, you&#39;ll likely define an `OrderRepository` or `OrderDataGateway` port. Here is an example

```java
public interface OrderDataGateway {
    public void save(OrderData order);
    public OrderData findById(FindOrderData order);
    public List&lt;OrderData&gt; findAll();
}
```

This approach keeps your core domain pure and free from infrastructure leakage, and that is the first step to anti-corruption layer. These ports frequently mirror key entities or aggregates within your domain model.

**Naming Conventions** 

Again, context matters! Here are a few tips to name the outbound ports.

* **Repository:** This term is popularized by Domain-Driven Design (DDD), is commonly used when the port specifically handles the persistence and retrieval of domain aggregates, mimicking a collection of entities. An `OrderRepository` is a very common and descriptive name if its sole purpose is managing Order persistence.
    
* **Gateway:** This term, like `OrderGateway`, describes a point of entry/exit for data or functionality related to a specific domain concept. It&#39;s a broader term that can encompass more than just data persistence. For instance, an `OrderNotificationGateway` wouldn&#39;t be a repository but would still be a driven port.
    
* **DataGateway:** Adding &#34;Data&#34; as a prefix, like `OrderDataGateway`, can be useful to be more explicit that this gateway is primarily concerned with data access, distinguishing it from other types of gateways (e.g., a `OrderNotificationGateway`).
    

Choose a convention that makes sense for your team and stick to it. The goal is to make the port&#39;s purpose immediately understandable.

**Best Practices for Designing Port Interfaces**

Whether defining inbound or outbound ports, certain practices lead to more robust and maintainable contracts.

**The Power of Wrapper Objects (Commands, DTOs, Request/Response Objects)** 

Using well-defined Data Transfer Objects (DTOs) or dedicated request/response objects as parameters and return types for port methods is crucial. Always try to use wrapper types, POJOs (Plain Old Java Objects), or Command/Query objects in interfaces. Do not use primitives and too many arguments, as they have a high tendency to break the contract and cause significant refactoring effort.

Let’s look at these two methods

```java
    public void save(String customerId, List&lt;String&gt; productIds, double totalAmount, Instant orderDate);
```

versus

```java
    public void save(OrderData order);
```

Which is better for clarity? What if you want to add a new attribute? Will you remember the order of attributes in the first method?

And Interface Segregation Principle from SOLID must be mentioned here - no client should be forced to depend on methods it does not use. This encourages the creation of smaller, more specific interfaces. This allows a variety of techniques to allow mixins, composition and strategies in your core that are just elegant (and more fun to work with), while addressing the requirements.

**The Value of Ports**

By adhering to these principles, your inbound and outbound ports become robust, maintainable contracts. They effectively decouple your application core from the never ending framework upgrades, database migrations while improving testability and evolution of the application. 

Well-defined ports are a cornerstone of building flexible, long-lasting software systems with Hexagonal Architecture. 

In the next post, we will explore the core of hexagonal architecture.
</source:markdown>
    </item>
    
    <item>
      <title>It’s not just a directory, it is a decision!</title>
      <link>https://aravindkunnath.com/2025/04/21/its-not-just-a-directory/</link>
      <pubDate>Mon, 21 Apr 2025 22:04:00 -0500</pubDate>
      
      <guid>http://aravindkunnath.micro.blog/2025/04/22/its-not-just-a-directory/</guid>
      <description>&lt;p&gt;Understanding Hexagonal Architecture concepts is the first step. Applying it effectively to your codebase through a smart and practical structure is the next critical one. Getting this right means your team will navigate, evolve, and maintain the application with greater ease.&lt;/p&gt;
&lt;p&gt;But what does a project structure look like for a Java Hexagonal application, and why does it matter beyond just organizing classes and files? This post dives into practical project structure options, emphasizing how you arrange your code is a fundamental architectural decision.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s start with the fundamental question: Why does a project structure matter? I&amp;rsquo;ve found two primary reasons, from my experience:&lt;/p&gt;
&lt;h3 id=&#34;why-project-structure-matters&#34;&gt;Why Project Structure Matters&lt;/h3&gt;
&lt;h4 id=&#34;navigation-naming-is-hard&#34;&gt;Navigation (Naming is Hard)&lt;/h4&gt;
&lt;p&gt;Naming is notoriously difficult. It&amp;rsquo;s not just about finding the &amp;lsquo;right&amp;rsquo; name initially; the chosen structure and naming conventions must make it easy for developers (including your future self) to quickly understand and navigate the application&amp;rsquo;s key components and decisions.&lt;/p&gt;
&lt;h4 id=&#34;evolution&#34;&gt;Evolution&lt;/h4&gt;
&lt;p&gt;Software inherently evolves. Decisions made early on about structure, even seemingly minor ones, can become problematic over time. While you can prepare for evolution, anticipating every structural change is impossible. In my experience, the most significant struggles often arise from the inorganic growth of a project&amp;rsquo;s structure. No IDE like Intellij or assistants like Copilot can save you from this one, or should I say not yet!?&lt;/p&gt;
&lt;h3 id=&#34;choosing-your-structure-self-explanatory-vs-contextual&#34;&gt;Choosing Your Structure: Self-Explanatory vs. Contextual&lt;/h3&gt;
&lt;p&gt;For a new application, I have categorized the structure into two groups: &amp;ldquo;&lt;strong&gt;Self-explanatory&lt;/strong&gt;&amp;rdquo; and &amp;ldquo;&lt;strong&gt;Contextual&lt;/strong&gt;&amp;rdquo; These are terms that I have come up with, so neither is superior or inferior, simpler or more complex. Their value lies in just how well they support the cohesion of different architectural concepts and the evolution within the context of your specific application and team.&lt;/p&gt;
&lt;h4 id=&#34;tldr&#34;&gt;TL;DR&lt;/h4&gt;
&lt;p&gt;Here&amp;rsquo;s a quick summary to help guide your choice:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Choose Self-Explanatory if:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Your app is small or short-lived&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Team is new to hexagonal architecture&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You want fast on-boarding&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Choose Contextual if:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;You’re building a long-lived application&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You want strong architectural boundaries&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You’re comfortable with a learning curve upfront&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You have an experienced team who communicate, collaborate, and coordinate effectively and support them with mature workflows in CICD, Versioning, etc.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;the-self-explanatory-structure&#34;&gt;The Self-Explanatory Structure&lt;/h3&gt;
&lt;p&gt;As the name suggests, this approach involves naming top-level packages or directories directly after the core concepts of hexagonal architecture: &lt;code&gt;ports&lt;/code&gt;, &lt;code&gt;adapters&lt;/code&gt;, and &lt;code&gt;core&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;![](&lt;a href=&#34;https://lh7-rt.googleusercontent.com/docsz/AD_4nXc509xbXR1DDhMlXQ0ysXkVUn08biWoW7r2QUJoulH2ieue8PzfdU2bObrX0NdQiqjjKyxGUL8a0gye4APJyjK2uJZDXBo9zuXyfENKD1OBAowmHI7wjJeKlaJAbRMvxvdwYYb39g?key=rW1Nepa8mExZNmHN-b6xwzkP&#34;&gt;https://lh7-rt.googleusercontent.com/docsz/AD_4nXc509xbXR1DDhMlXQ0ysXkVUn08biWoW7r2QUJoulH2ieue8PzfdU2bObrX0NdQiqjjKyxGUL8a0gye4APJyjK2uJZDXBo9zuXyfENKD1OBAowmHI7wjJeKlaJAbRMvxvdwYYb39g?key=rW1Nepa8mExZNmHN-b6xwzkP&lt;/a&gt; align=&amp;ldquo;left&amp;rdquo;)&lt;/p&gt;
&lt;p&gt;I experimented with replacing the term &lt;code&gt;core&lt;/code&gt; in a couple of projects because of the industry’s tendency to use &lt;code&gt;core&lt;/code&gt; in so many other places - &lt;code&gt;core java&lt;/code&gt;, &lt;code&gt;hibernate-core&lt;/code&gt;, &lt;code&gt;spring-core&lt;/code&gt; to name a few.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;domain&lt;/code&gt; instead of &lt;code&gt;core&lt;/code&gt;: If the average experience of the team is mostly around SQL, especially the big ones such as Oracle or MSSQL, they often interpret this name as a “database domain.” This confusion can be challenging for the first few sprints or months. I generally avoid using “domain” at the root level when working with a large team. Also, the &lt;code&gt;core&lt;/code&gt; will most probably contain a domain model, and that would look like &lt;code&gt;domain&lt;/code&gt; inside a &lt;code&gt;domain&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;app&lt;/code&gt; or &lt;code&gt;application&lt;/code&gt; instead of &lt;code&gt;core&lt;/code&gt;: I have had seasoned developers question this one. Their inquiries included: “Are we developing a mobile app?” and “Isn’t this whole thing the application? Why have an &lt;code&gt;application&lt;/code&gt; package?”. These terms are not from the hexagonal architecture but from clean and onion architecture patterns and inherit some of the features from those patterns. Whenever I have used &lt;code&gt;application&lt;/code&gt;, &lt;code&gt;ports&lt;/code&gt; sounded more like use cases. Whenever I have used &lt;code&gt;core&lt;/code&gt;, &lt;code&gt;ports&lt;/code&gt; sounded more like domain abstractions or domain services - closer to the business model, and less about orchestration. For a new application, I suggest you pick this only if you like it and the name “core” is not an option.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&#34;trade-offs-of-self-explanatory-sprawl-and-erosion&#34;&gt;Trade-offs of Self-Explanatory: Sprawl and Erosion&lt;/h4&gt;
&lt;p&gt;However, the self-explanatory approach has trade-offs, primarily related to the friction it creates (or rather, lacks) for the architecture&amp;rsquo;s evolution. I have listed two that I have found consistently.&lt;/p&gt;
&lt;h5 id=&#34;trade-off-1-package-sprawl&#34;&gt;Trade-off 1: Package Sprawl&lt;/h5&gt;
&lt;p&gt;Developers (myself included) prefer to focus on solving the core business problem rather than spending excessive time at seemingly trivial structural decisions. Naming a new package often falls into this category - trivial enough that spelling mistakes get into production. I myself have asked this quite a number of times in my career thinking; “What’s in a name?”. My answer nowadays - ask yourself in three months.&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;ve ever looked at a project and wondered about the reason for numerous top-level packages, you&amp;rsquo;ve seen an outcome similar to this approach. The tendency to create a package or directory at the root for various concerns that don&amp;rsquo;t fit neatly into &lt;code&gt;ports&lt;/code&gt;, &lt;code&gt;adapters&lt;/code&gt;, or &lt;code&gt;core&lt;/code&gt; is very strong in this approach.&lt;/p&gt;
&lt;p&gt;This leads to what I call &amp;ldquo;&lt;strong&gt;package surfing&lt;/strong&gt;&amp;rdquo;: and I define it as &lt;strong&gt;the constant need to scroll up and down, checking package declarations to understand where a class lives and its relationship to others&lt;/strong&gt;. Just like a surfer riding waves, you find yourself going up and down in a “sea” of directories, which makes understanding the structure difficult, resulting in poor readability and slows you down.&lt;/p&gt;
&lt;p&gt;For example, it&amp;rsquo;s common to create &lt;code&gt;commons&lt;/code&gt; or &lt;code&gt;utils&lt;/code&gt; packages, and the root seems the easiest place for them to live, at that time! Where do Spring configuration files go? Not in &lt;code&gt;core&lt;/code&gt;, &lt;code&gt;ports&lt;/code&gt;, or &lt;code&gt;adapters&lt;/code&gt;, so let&amp;rsquo;s create a &lt;code&gt;config&lt;/code&gt; package, for now! The list goes on: &lt;code&gt;constants&lt;/code&gt;, &lt;code&gt;dto&lt;/code&gt;, &lt;code&gt;mapper&lt;/code&gt;, &lt;code&gt;exception&lt;/code&gt;, to name a few more. In a fast-paced development environment, these decisions are made quickly, and maintaining a coherent structure becomes difficult. We might think refactoring is easy with modern tools like Intellij and copilots etc., but believe me – they are no match for deep structural issues.&lt;/p&gt;
&lt;h5 id=&#34;trade-off-2-architecture-erosion&#34;&gt;Trade-off 2: Architecture Erosion&lt;/h5&gt;
&lt;p&gt;Another trade-off, one which is not quite obvious but I have seen occurring over longer periods of time, and one which I see as more human-centric than technical, is that this structure inadvertently makes it easier for developers to overlook or violate key architectural principles important for hexagonal architecture.&lt;/p&gt;
&lt;p&gt;Following principles are a couple that can be bypassed easily as the project evolves, gradually eroding architectural integrity:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Anti-Corruption Layer (ACL):&lt;/strong&gt; A pattern used to isolate a system from another system’s model, protecting the integrity of your domain.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Postel&amp;rsquo;s Law:&lt;/strong&gt; &amp;ldquo;Be conservative in what you send, liberal in what you accept.&amp;rdquo; This is used as a guiding principle for interfaces/contracts between boundaries.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Both trade-offs have pretty much nothing to do with the team, architecture, or technology themselves but they are a cumulative side effect of external pressures such as tight deadlines or development friction (or lack of friction). Simply put, this structure lacks the cognitive load or friction that encourages developers to take careful consideration of where code should live in relation to architectural boundaries. And that lack of friction isn&amp;rsquo;t enough to fight against the evolutionary pressure towards disorganization, what we generally call the entropy of a system. Now can we completely stop the teams from bypassing the aforementioned principles by following the contextual structure - it’s hard to say for sure, but we need all the support we can get!&lt;/p&gt;
&lt;h4 id=&#34;when-to-choose-self-explanatory&#34;&gt;When to Choose Self-Explanatory&lt;/h4&gt;
&lt;p&gt;If you like to keep it simple and see how your application evolves, you can choose this one - by all means. If you are developing a small application, go ahead without a doubt. If you are aiming for a short-lived micro-service, and by that, I mean a couple of years maybe, and you do not want to overload the team with all the context and evolutionary principles, please go ahead and adopt this structure. There is a beauty to simplicity, and it is certainly worth fighting for.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Note:&lt;/em&gt; Moving &lt;code&gt;ports&lt;/code&gt; into &lt;code&gt;core&lt;/code&gt; does bring a slight improvement to the structure, but I have seen the sprawl and erosion trade-offs popping up nonetheless.&lt;/p&gt;
&lt;h3 id=&#34;the-contextual-structure&#34;&gt;The Contextual Structure&lt;/h3&gt;
&lt;p&gt;This approach to structuring a project is primarily aimed at slowing down the team just enough so that the structure forces the team to think where a particular component in the application should go. And that is why it is named contextual - you have to apply context before you can start changing the application.&lt;/p&gt;
&lt;p&gt;Let me start by saying this: as soon as you pick this structure - the team’s velocity will take a hit the first few sprints or months. But the structural integrity that this structure provides is a pretty strong one - this supports a controlled evolution, clear boundaries, and better tests. If you have a long-lasting project and you want to stick to hexagonal architecture as long as you can, I highly recommend picking this one.&lt;/p&gt;
&lt;p&gt;There are two varieties that are listed below:&lt;/p&gt;
&lt;h4 id=&#34;contextual-structure-single-module&#34;&gt;Contextual Structure: Single Module&lt;/h4&gt;
&lt;p&gt;The root directories in this variety are &lt;code&gt;core&lt;/code&gt; and &lt;code&gt;infrastructure&lt;/code&gt;. While hexagonal architecture does not prescribe the term &lt;code&gt;infrastructure&lt;/code&gt; explicitly, I started using &lt;code&gt;infrastructure&lt;/code&gt; as a way to separate the concepts right from the beginning. And I took it from my experiences with onion and solid architecture patterns. It also gives us good direction to apply fitness functions - particularly in Java and Python projects. More on that in a later blog post.&lt;/p&gt;
&lt;h5 id=&#34;why-single-module-contextual-is-better&#34;&gt;Why Single Module Contextual is Better&lt;/h5&gt;
&lt;p&gt;One of the key wins here is that this structure allows the team to maintain the purity of the domain. This means that the &lt;code&gt;core&lt;/code&gt; can be decoupled (with a few hacks/tricks, if needed) from all the external concerns, that are neatly contained in &lt;code&gt;infrastructure&lt;/code&gt;. The &lt;code&gt;core&lt;/code&gt; will contain just the &lt;code&gt;ports&lt;/code&gt; and domain services written in pure language-specific features and nothing more. It’s even possible to have no loggers, &lt;code&gt;@Service&lt;/code&gt;, &lt;code&gt;@Component&lt;/code&gt;, etc., within &lt;code&gt;core&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;This clear boundary between &lt;code&gt;core&lt;/code&gt; and &lt;code&gt;infrastructure&lt;/code&gt; not only enforces separation of concerns but also allows for extreme testability and portability. In fact, with careful discipline, the &lt;code&gt;core&lt;/code&gt; module can often be tested and evolved independently of any specific frameworks or technical choices.&lt;/p&gt;
&lt;p&gt;![](&lt;a href=&#34;https://lh7-rt.googleusercontent.com/docsz/AD_4nXegxrLDiF__dqHZ5Bvo17YUphXunlPbeFALtFJUqyr2dvsEP9zALzZuivFTgDFzGaAb3eecMr0AAWWNbFeuBB2YwJVl_iYZko9pBqfGtSDujFDLw1OGud01n0pVrj-fg5PYRHG0xA?key=rW1Nepa8mExZNmHN-b6xwzkP&#34;&gt;https://lh7-rt.googleusercontent.com/docsz/AD_4nXegxrLDiF__dqHZ5Bvo17YUphXunlPbeFALtFJUqyr2dvsEP9zALzZuivFTgDFzGaAb3eecMr0AAWWNbFeuBB2YwJVl_iYZko9pBqfGtSDujFDLw1OGud01n0pVrj-fg5PYRHG0xA?key=rW1Nepa8mExZNmHN-b6xwzkP&lt;/a&gt; align=&amp;ldquo;left&amp;rdquo;)&lt;/p&gt;
&lt;h5 id=&#34;naming-conventions-api-and-spi-vs-inbound-and-outbound&#34;&gt;&lt;strong&gt;Naming Conventions: API and SPI vs Inbound and Outbound&lt;/strong&gt;&lt;/h5&gt;
&lt;p&gt;One of the trade-offs, however, is the ambiguity of the terms &lt;code&gt;inbound&lt;/code&gt; and &lt;code&gt;outbound&lt;/code&gt; for ports and adapters alike. The architecture prescribes terms &lt;code&gt;driven&lt;/code&gt; and &lt;code&gt;driver&lt;/code&gt; for the inbound and outbound ports respectively, but I never found them as nice package names. Since both &lt;code&gt;ports&lt;/code&gt; and &lt;code&gt;adapters&lt;/code&gt; can have &lt;code&gt;inbound&lt;/code&gt; and &lt;code&gt;outbound&lt;/code&gt; qualifiers, I have substituted the port qualifiers with &lt;code&gt;api&lt;/code&gt; and &lt;code&gt;spi&lt;/code&gt; in a few projects.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;API = Application Programming Interface:&lt;/strong&gt; This will contain all the &lt;code&gt;inbound ports&lt;/code&gt; that will be used by various adapters. These are the entry points into the domain and serve as contracts to invoke a capability within the domain.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;SPI = Service Provider Interface:&lt;/strong&gt; A common term in core Java. It’s heavily used in mechanisms like &lt;code&gt;JDBC&lt;/code&gt; and &lt;code&gt;JNDI&lt;/code&gt; to dynamically load extensions at runtime. In this structure, the &lt;code&gt;spi&lt;/code&gt; package contains all the &lt;code&gt;outbound ports&lt;/code&gt; - interfaces defined by the domain that are implemented by &lt;code&gt;outbound adapters&lt;/code&gt;. The dynamic wiring happens in the &lt;code&gt;infrastructure&lt;/code&gt; layer but remains invisible to the domain, preserving its independence and purity.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;Note:&lt;/em&gt; I have seen short forms like &lt;code&gt;in&lt;/code&gt; and &lt;code&gt;out&lt;/code&gt; instead of &lt;code&gt;inbound&lt;/code&gt; and &lt;code&gt;outbound&lt;/code&gt;, and they work great in Java. But if you are using Kotlin, where &lt;code&gt;in&lt;/code&gt; and &lt;code&gt;out&lt;/code&gt; are keywords, this will cause the package declarations to contain a backtick (`) and I just don’t think that’s a good idea!&lt;/p&gt;
&lt;h4 id=&#34;contextual-structure-multi-module&#34;&gt;Contextual Structure: Multi-Module&lt;/h4&gt;
&lt;p&gt;If you&amp;rsquo;re using &lt;code&gt;Gradle&lt;/code&gt; or &lt;code&gt;Maven&lt;/code&gt;, then splitting your project into multiple modules is one of the most practical ways to enforce architectural boundaries in a hexagonal architecture. It’s also the point where things start to smell a lot like Clean or Onion architecture - not just in theory but in the actual structure of your codebase.&lt;/p&gt;
&lt;p&gt;Instead of a single monolithic project where packages and internal directories suggest separation of concerns, a multi-module setup physically enforces it. Modules like &lt;code&gt;core&lt;/code&gt;, &lt;code&gt;app&lt;/code&gt;, and &lt;code&gt;adapters&lt;/code&gt; can’t accidentally reach into each other — unless you explicitly let them. That means tighter boundaries, fewer accidental dependencies, and cleaner domain logic.&lt;/p&gt;
&lt;h5 id=&#34;why-multi-module-contextual-is-better&#34;&gt;Why Multi-Module Contextual is Better&lt;/h5&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;You can’t import &lt;code&gt;infrastructure&lt;/code&gt; logic into your domain “just because it’s convenient.” You’ll have to think about where things belong.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Tests are cleaner. With &lt;code&gt;Spring&lt;/code&gt;, monolith-style projects often rely heavily on &lt;code&gt;@MockBean&lt;/code&gt; soup. But in multi-module setups, you often test real things with fewer mocked dependencies and more focused unit and integration tests.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;It forces interface-driven design. Infra code implements interfaces defined in &lt;code&gt;core&lt;/code&gt; or &lt;code&gt;app&lt;/code&gt;, keeping domain logic pure and decoupled.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h5 id=&#34;common-multi-module-structures&#34;&gt;Common Multi-Module Structures&lt;/h5&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Two-tiered:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;core&lt;/code&gt;: Your domain, use cases, ports. No &lt;code&gt;Spring&lt;/code&gt; here.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;infrastructure&lt;/code&gt;: All adapters, implementations, framework glue. Good for small-to-medium projects or teams starting out. Keeps things separate but still manageable&lt;/p&gt;
&lt;p&gt;![](&lt;a href=&#34;https://cdn.hashnode.com/res/hashnode/image/upload/v1745290443462/b27b4ab9-6fa7-4b80-9f88-507e02b00500.png&#34;&gt;https://cdn.hashnode.com/res/hashnode/image/upload/v1745290443462/b27b4ab9-6fa7-4b80-9f88-507e02b00500.png&lt;/a&gt; align=&amp;ldquo;left&amp;rdquo;)&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Multi-Tiered:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;core&lt;/code&gt;: Pure domain logic, ports, domain models.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;app&lt;/code&gt;: Application layer (use cases, orchestration logic, sometimes &lt;code&gt;Spring&lt;/code&gt; config).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;adapters&lt;/code&gt;: HTTP controllers, database access, message listeners — all implementing ports from &lt;code&gt;core&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;![](&lt;a href=&#34;https://lh7-rt.googleusercontent.com/docsz/AD_4nXfVZh2gFvxgD48ib9BDbhzaukXQ4OIWE-Jge5Xbslt6SKkJebc9OJTayZxBDToYEu-DTooMtUH8W0_A4LvdHZQdHeu5hjQ9rHtsxMrzSYBvYectDJUt9-LQvZ07TVQxpM9DVQD-?key=rW1Nepa8mExZNmHN-b6xwzkP&#34;&gt;https://lh7-rt.googleusercontent.com/docsz/AD_4nXfVZh2gFvxgD48ib9BDbhzaukXQ4OIWE-Jge5Xbslt6SKkJebc9OJTayZxBDToYEu-DTooMtUH8W0_A4LvdHZQdHeu5hjQ9rHtsxMrzSYBvYectDJUt9-LQvZ07TVQxpM9DVQD-?key=rW1Nepa8mExZNmHN-b6xwzkP&lt;/a&gt; align=&amp;ldquo;left&amp;rdquo;)&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Both tiers offer excellent separation and can scale well with large codebases and teams. There are a few considerations give below, however these aren’t deal-breakers - just trade-offs worth knowing and considering. As mentioned earlier, this structure is where we begin stepping into Clean and Onion Architecture territory, which brings along many benefits - ones I won’t cover in detail in this post, but are certainly worth exploring further.&lt;/p&gt;
&lt;h5 id=&#34;considerations-for-multi-module&#34;&gt;Considerations for Multi-Module&lt;/h5&gt;
&lt;p&gt;Here are some factors to consider before adopting a multi-module structure:&lt;/p&gt;
&lt;h6 id=&#34;build--tooling-overhead&#34;&gt;&lt;strong&gt;Build &amp;amp; Tooling Overhead&lt;/strong&gt;&lt;/h6&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Multi-module gradle builds can be slow and flaky without good caching and incremental compilation.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Misconfigured dependencies can lead to circular references, versioning nightmares, and mysterious errors like &lt;code&gt;BeanNotFound&lt;/code&gt; or &lt;code&gt;DuplicateBeanFound&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h6 id=&#34;cicd-maturity&#34;&gt;&lt;strong&gt;CI/CD Maturity&lt;/strong&gt;&lt;/h6&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Does your CI support partial builds, dependency caching, test splitting? If not, you will lose fast feedback loops from your “trusted” pipelines.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Versioning nightmares - imagine you have to hotfix a module, but your &lt;code&gt;core&lt;/code&gt; is intact. Do you bump the whole app, or just the module or the module and &lt;code&gt;core&lt;/code&gt; and &lt;code&gt;app&lt;/code&gt;? Great, all of this documented, remind me where is this documentation /s?&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h6 id=&#34;team-coordination&#34;&gt;&lt;strong&gt;Team Coordination&lt;/strong&gt;&lt;/h6&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;More modules = more boundaries = more coordination = less time to develop.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Changes across modules can slow you down unless teams are aligned and interfaces are stable.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h6 id=&#34;test-complexity&#34;&gt;&lt;strong&gt;Test Complexity&lt;/strong&gt;&lt;/h6&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;This slows down integration testing quite a bit, and in new projects where the interfaces are shaping up, this can result in a refactor loop.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Testing the whole application with the bean and dependency wiring using Spring or an equivalent is trickier. This friction will often result in higher CI costs.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Test architecture and reusable helper methods - object mothers, test doubles, quick and dirty mappers - all take a toll or multiple tolls.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&#34;when-to-choose-multi-module&#34;&gt;When to Choose Multi-Module&lt;/h4&gt;
&lt;p&gt;In summary, a multi-module project structure is a good fit if:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The app is medium to large with complex domain logic.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The team values strict physical boundaries.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;An existing CICD infrastructure with a high degree of maturity exists.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Communication, Collaboration, and Coordination are established capabilities within and between teams.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&#34;when-not-to-choose-multi-module&#34;&gt;When Not to Choose Multi-Module&lt;/h4&gt;
&lt;p&gt;A multi-module structure is not a good fit for:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Apps that are small, in a prototyping phase, or targeting an MVP.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Single or small team targeting high iteration speed.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;CICD processes are not established or are fragile and slow.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;One team who does everything in the project - let’s save them!&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;That wraps up this deep dive into structuring Java projects with hexagonal architecture. Yes, it was a long one, but hopefully, the emphasis on &lt;em&gt;why&lt;/em&gt; structure matters made the length worthwhile. If you have questions, please leave a comment.&lt;/p&gt;
&lt;p&gt;If you found this post helpful, please like and share. It really helps spread the word!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;A few references&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://beyondxscratch.com/2017/08/19/hexagonal-architecture-the-practical-guide-for-a-clean-architecture/&#34;&gt;https://beyondxscratch.com/2017/08/19/hexagonal-architecture-the-practical-guide-for-a-clean-architecture/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.amazon.ca/Clean-Architecture-Craftsmans-Software-Structure/dp/0134494164&#34;&gt;https://www.amazon.ca/Clean-Architecture-Craftsmans-Software-Structure/dp/0134494164&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html&#34;&gt;https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html&lt;/a&gt;&lt;/p&gt;
</description>
      <source:markdown>Understanding Hexagonal Architecture concepts is the first step. Applying it effectively to your codebase through a smart and practical structure is the next critical one. Getting this right means your team will navigate, evolve, and maintain the application with greater ease.

But what does a project structure look like for a Java Hexagonal application, and why does it matter beyond just organizing classes and files? This post dives into practical project structure options, emphasizing how you arrange your code is a fundamental architectural decision.

Let&#39;s start with the fundamental question: Why does a project structure matter? I&#39;ve found two primary reasons, from my experience:

### Why Project Structure Matters

#### Navigation (Naming is Hard)

Naming is notoriously difficult. It&#39;s not just about finding the &#39;right&#39; name initially; the chosen structure and naming conventions must make it easy for developers (including your future self) to quickly understand and navigate the application&#39;s key components and decisions.

#### Evolution

Software inherently evolves. Decisions made early on about structure, even seemingly minor ones, can become problematic over time. While you can prepare for evolution, anticipating every structural change is impossible. In my experience, the most significant struggles often arise from the inorganic growth of a project&#39;s structure. No IDE like Intellij or assistants like Copilot can save you from this one, or should I say not yet!?

### Choosing Your Structure: Self-Explanatory vs. Contextual

For a new application, I have categorized the structure into two groups: &#34;**Self-explanatory**&#34; and &#34;**Contextual**&#34; These are terms that I have come up with, so neither is superior or inferior, simpler or more complex. Their value lies in just how well they support the cohesion of different architectural concepts and the evolution within the context of your specific application and team.

#### TL;DR

Here&#39;s a quick summary to help guide your choice:

* **Choose Self-Explanatory if:**
    
    * Your app is small or short-lived
        
    * Team is new to hexagonal architecture
        
    * You want fast on-boarding
        
* **Choose Contextual if:**
    
    * You’re building a long-lived application
        
    * You want strong architectural boundaries
        
    * You’re comfortable with a learning curve upfront
        
    * You have an experienced team who communicate, collaborate, and coordinate effectively and support them with mature workflows in CICD, Versioning, etc.
        

### The Self-Explanatory Structure

As the name suggests, this approach involves naming top-level packages or directories directly after the core concepts of hexagonal architecture: `ports`, `adapters`, and `core`.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXc509xbXR1DDhMlXQ0ysXkVUn08biWoW7r2QUJoulH2ieue8PzfdU2bObrX0NdQiqjjKyxGUL8a0gye4APJyjK2uJZDXBo9zuXyfENKD1OBAowmHI7wjJeKlaJAbRMvxvdwYYb39g?key=rW1Nepa8mExZNmHN-b6xwzkP align=&#34;left&#34;)

I experimented with replacing the term `core` in a couple of projects because of the industry’s tendency to use `core` in so many other places - `core java`, `hibernate-core`, `spring-core` to name a few.

* `domain` instead of `core`: If the average experience of the team is mostly around SQL, especially the big ones such as Oracle or MSSQL, they often interpret this name as a “database domain.” This confusion can be challenging for the first few sprints or months. I generally avoid using “domain” at the root level when working with a large team. Also, the `core` will most probably contain a domain model, and that would look like `domain` inside a `domain`.
    
* `app` or `application` instead of `core`: I have had seasoned developers question this one. Their inquiries included: “Are we developing a mobile app?” and “Isn’t this whole thing the application? Why have an `application` package?”. These terms are not from the hexagonal architecture but from clean and onion architecture patterns and inherit some of the features from those patterns. Whenever I have used `application`, `ports` sounded more like use cases. Whenever I have used `core`, `ports` sounded more like domain abstractions or domain services - closer to the business model, and less about orchestration. For a new application, I suggest you pick this only if you like it and the name “core” is not an option.
    

#### Trade-offs of Self-Explanatory: Sprawl and Erosion

However, the self-explanatory approach has trade-offs, primarily related to the friction it creates (or rather, lacks) for the architecture&#39;s evolution. I have listed two that I have found consistently.

##### Trade-off 1: Package Sprawl

Developers (myself included) prefer to focus on solving the core business problem rather than spending excessive time at seemingly trivial structural decisions. Naming a new package often falls into this category - trivial enough that spelling mistakes get into production. I myself have asked this quite a number of times in my career thinking; “What’s in a name?”. My answer nowadays - ask yourself in three months.

If you&#39;ve ever looked at a project and wondered about the reason for numerous top-level packages, you&#39;ve seen an outcome similar to this approach. The tendency to create a package or directory at the root for various concerns that don&#39;t fit neatly into `ports`, `adapters`, or `core` is very strong in this approach.

This leads to what I call &#34;**package surfing**&#34;: and I define it as **the constant need to scroll up and down, checking package declarations to understand where a class lives and its relationship to others**. Just like a surfer riding waves, you find yourself going up and down in a “sea” of directories, which makes understanding the structure difficult, resulting in poor readability and slows you down.

For example, it&#39;s common to create `commons` or `utils` packages, and the root seems the easiest place for them to live, at that time! Where do Spring configuration files go? Not in `core`, `ports`, or `adapters`, so let&#39;s create a `config` package, for now! The list goes on: `constants`, `dto`, `mapper`, `exception`, to name a few more. In a fast-paced development environment, these decisions are made quickly, and maintaining a coherent structure becomes difficult. We might think refactoring is easy with modern tools like Intellij and copilots etc., but believe me – they are no match for deep structural issues.

##### Trade-off 2: Architecture Erosion

Another trade-off, one which is not quite obvious but I have seen occurring over longer periods of time, and one which I see as more human-centric than technical, is that this structure inadvertently makes it easier for developers to overlook or violate key architectural principles important for hexagonal architecture.

Following principles are a couple that can be bypassed easily as the project evolves, gradually eroding architectural integrity:

* **Anti-Corruption Layer (ACL):** A pattern used to isolate a system from another system’s model, protecting the integrity of your domain.
    
* **Postel&#39;s Law:** &#34;Be conservative in what you send, liberal in what you accept.&#34; This is used as a guiding principle for interfaces/contracts between boundaries.
    

Both trade-offs have pretty much nothing to do with the team, architecture, or technology themselves but they are a cumulative side effect of external pressures such as tight deadlines or development friction (or lack of friction). Simply put, this structure lacks the cognitive load or friction that encourages developers to take careful consideration of where code should live in relation to architectural boundaries. And that lack of friction isn&#39;t enough to fight against the evolutionary pressure towards disorganization, what we generally call the entropy of a system. Now can we completely stop the teams from bypassing the aforementioned principles by following the contextual structure - it’s hard to say for sure, but we need all the support we can get!

#### When to Choose Self-Explanatory

If you like to keep it simple and see how your application evolves, you can choose this one - by all means. If you are developing a small application, go ahead without a doubt. If you are aiming for a short-lived micro-service, and by that, I mean a couple of years maybe, and you do not want to overload the team with all the context and evolutionary principles, please go ahead and adopt this structure. There is a beauty to simplicity, and it is certainly worth fighting for.

*Note:* Moving `ports` into `core` does bring a slight improvement to the structure, but I have seen the sprawl and erosion trade-offs popping up nonetheless.

### The Contextual Structure

This approach to structuring a project is primarily aimed at slowing down the team just enough so that the structure forces the team to think where a particular component in the application should go. And that is why it is named contextual - you have to apply context before you can start changing the application.

Let me start by saying this: as soon as you pick this structure - the team’s velocity will take a hit the first few sprints or months. But the structural integrity that this structure provides is a pretty strong one - this supports a controlled evolution, clear boundaries, and better tests. If you have a long-lasting project and you want to stick to hexagonal architecture as long as you can, I highly recommend picking this one.

There are two varieties that are listed below:

#### Contextual Structure: Single Module

The root directories in this variety are `core` and `infrastructure`. While hexagonal architecture does not prescribe the term `infrastructure` explicitly, I started using `infrastructure` as a way to separate the concepts right from the beginning. And I took it from my experiences with onion and solid architecture patterns. It also gives us good direction to apply fitness functions - particularly in Java and Python projects. More on that in a later blog post.

##### Why Single Module Contextual is Better

One of the key wins here is that this structure allows the team to maintain the purity of the domain. This means that the `core` can be decoupled (with a few hacks/tricks, if needed) from all the external concerns, that are neatly contained in `infrastructure`. The `core` will contain just the `ports` and domain services written in pure language-specific features and nothing more. It’s even possible to have no loggers, `@Service`, `@Component`, etc., within `core`.

This clear boundary between `core` and `infrastructure` not only enforces separation of concerns but also allows for extreme testability and portability. In fact, with careful discipline, the `core` module can often be tested and evolved independently of any specific frameworks or technical choices.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXegxrLDiF__dqHZ5Bvo17YUphXunlPbeFALtFJUqyr2dvsEP9zALzZuivFTgDFzGaAb3eecMr0AAWWNbFeuBB2YwJVl_iYZko9pBqfGtSDujFDLw1OGud01n0pVrj-fg5PYRHG0xA?key=rW1Nepa8mExZNmHN-b6xwzkP align=&#34;left&#34;)

##### **Naming Conventions: API and SPI vs Inbound and Outbound**

One of the trade-offs, however, is the ambiguity of the terms `inbound` and `outbound` for ports and adapters alike. The architecture prescribes terms `driven` and `driver` for the inbound and outbound ports respectively, but I never found them as nice package names. Since both `ports` and `adapters` can have `inbound` and `outbound` qualifiers, I have substituted the port qualifiers with `api` and `spi` in a few projects.

* **API = Application Programming Interface:** This will contain all the `inbound ports` that will be used by various adapters. These are the entry points into the domain and serve as contracts to invoke a capability within the domain.
    
* **SPI = Service Provider Interface:** A common term in core Java. It’s heavily used in mechanisms like `JDBC` and `JNDI` to dynamically load extensions at runtime. In this structure, the `spi` package contains all the `outbound ports` - interfaces defined by the domain that are implemented by `outbound adapters`. The dynamic wiring happens in the `infrastructure` layer but remains invisible to the domain, preserving its independence and purity.
    

*Note:* I have seen short forms like `in` and `out` instead of `inbound` and `outbound`, and they work great in Java. But if you are using Kotlin, where `in` and `out` are keywords, this will cause the package declarations to contain a backtick (\`) and I just don’t think that’s a good idea!

#### Contextual Structure: Multi-Module

If you&#39;re using `Gradle` or `Maven`, then splitting your project into multiple modules is one of the most practical ways to enforce architectural boundaries in a hexagonal architecture. It’s also the point where things start to smell a lot like Clean or Onion architecture - not just in theory but in the actual structure of your codebase.

Instead of a single monolithic project where packages and internal directories suggest separation of concerns, a multi-module setup physically enforces it. Modules like `core`, `app`, and `adapters` can’t accidentally reach into each other — unless you explicitly let them. That means tighter boundaries, fewer accidental dependencies, and cleaner domain logic.

##### Why Multi-Module Contextual is Better

* You can’t import `infrastructure` logic into your domain “just because it’s convenient.” You’ll have to think about where things belong.
    
* Tests are cleaner. With `Spring`, monolith-style projects often rely heavily on `@MockBean` soup. But in multi-module setups, you often test real things with fewer mocked dependencies and more focused unit and integration tests.
    
* It forces interface-driven design. Infra code implements interfaces defined in `core` or `app`, keeping domain logic pure and decoupled.
    

##### Common Multi-Module Structures

1. **Two-tiered:**
    
    * `core`: Your domain, use cases, ports. No `Spring` here.
        
    * `infrastructure`: All adapters, implementations, framework glue. Good for small-to-medium projects or teams starting out. Keeps things separate but still manageable
        
        ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1745290443462/b27b4ab9-6fa7-4b80-9f88-507e02b00500.png align=&#34;left&#34;)
        
2. **Multi-Tiered:**
    
    * `core`: Pure domain logic, ports, domain models.
        
    * `app`: Application layer (use cases, orchestration logic, sometimes `Spring` config).
        
    * `adapters`: HTTP controllers, database access, message listeners — all implementing ports from `core`.
        
        ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXfVZh2gFvxgD48ib9BDbhzaukXQ4OIWE-Jge5Xbslt6SKkJebc9OJTayZxBDToYEu-DTooMtUH8W0_A4LvdHZQdHeu5hjQ9rHtsxMrzSYBvYectDJUt9-LQvZ07TVQxpM9DVQD-?key=rW1Nepa8mExZNmHN-b6xwzkP align=&#34;left&#34;)
        

Both tiers offer excellent separation and can scale well with large codebases and teams. There are a few considerations give below, however these aren’t deal-breakers - just trade-offs worth knowing and considering. As mentioned earlier, this structure is where we begin stepping into Clean and Onion Architecture territory, which brings along many benefits - ones I won’t cover in detail in this post, but are certainly worth exploring further.

##### Considerations for Multi-Module

Here are some factors to consider before adopting a multi-module structure:

###### **Build &amp; Tooling Overhead**

* Multi-module gradle builds can be slow and flaky without good caching and incremental compilation.
    
* Misconfigured dependencies can lead to circular references, versioning nightmares, and mysterious errors like `BeanNotFound` or `DuplicateBeanFound`.
    

###### **CI/CD Maturity**

* Does your CI support partial builds, dependency caching, test splitting? If not, you will lose fast feedback loops from your “trusted” pipelines.
    
* Versioning nightmares - imagine you have to hotfix a module, but your `core` is intact. Do you bump the whole app, or just the module or the module and `core` and `app`? Great, all of this documented, remind me where is this documentation /s?
    

###### **Team Coordination**

* More modules = more boundaries = more coordination = less time to develop.
    
* Changes across modules can slow you down unless teams are aligned and interfaces are stable.
    

###### **Test Complexity**

* This slows down integration testing quite a bit, and in new projects where the interfaces are shaping up, this can result in a refactor loop.
    
* Testing the whole application with the bean and dependency wiring using Spring or an equivalent is trickier. This friction will often result in higher CI costs.
    
* Test architecture and reusable helper methods - object mothers, test doubles, quick and dirty mappers - all take a toll or multiple tolls.
    

#### When to Choose Multi-Module

In summary, a multi-module project structure is a good fit if:

* The app is medium to large with complex domain logic.
    
* The team values strict physical boundaries.
    
* An existing CICD infrastructure with a high degree of maturity exists.
    
* Communication, Collaboration, and Coordination are established capabilities within and between teams.
    

#### When Not to Choose Multi-Module

A multi-module structure is not a good fit for:

* Apps that are small, in a prototyping phase, or targeting an MVP.
    
* Single or small team targeting high iteration speed.
    
* CICD processes are not established or are fragile and slow.
    
* One team who does everything in the project - let’s save them!
    

### Conclusion

That wraps up this deep dive into structuring Java projects with hexagonal architecture. Yes, it was a long one, but hopefully, the emphasis on *why* structure matters made the length worthwhile. If you have questions, please leave a comment.

If you found this post helpful, please like and share. It really helps spread the word!

**A few references**

[https://beyondxscratch.com/2017/08/19/hexagonal-architecture-the-practical-guide-for-a-clean-architecture/](https://beyondxscratch.com/2017/08/19/hexagonal-architecture-the-practical-guide-for-a-clean-architecture/)

[https://www.amazon.ca/Clean-Architecture-Craftsmans-Software-Structure/dp/0134494164](https://www.amazon.ca/Clean-Architecture-Craftsmans-Software-Structure/dp/0134494164)

[https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html](https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html)
</source:markdown>
    </item>
    
    <item>
      <title>Hexagonal Architecture - Introduction</title>
      <link>https://aravindkunnath.com/2025/04/17/224350/</link>
      <pubDate>Thu, 17 Apr 2025 22:43:50 -0500</pubDate>
      
      <guid>http://aravindkunnath.micro.blog/2025/04/18/224350/</guid>
      <description>&lt;p&gt;&lt;em&gt;You&amp;rsquo;re reading part one of a series on hexagonal architecture. Over the next few articles, I will cover everything that I have encountered so far from the basics to advanced strategies, failures and wtf moments included.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Originally named the &amp;ldquo;Ports and Adapters Architecture,&amp;rdquo; and widely referred to as Hexagonal Architecture first started shaping itself out of ideas that were working behind the scenes as far back as the 1990s, but not until the early 2000s really took shape as a formal framework. That’s what the LLMs tell me anyways, Dr. Alistair Cockburn’s site is down and the first entry in archive.org is in 2009 🥺 . The aim of this architectural style was to further insulate the inside of an application from the outside world - be it databases, user interfaces, or other external systems.&lt;/p&gt;
&lt;p&gt;I must admit, I came across this pattern fairly recently. For a number of early years in my career as software developer, I was highly committed to attempting to master as many programming languages as possible. Language upon language, syntax upon syntax, semi-colons and no semi-colons; in pursuit of the mirage that the more languages I could master, the greater developer I would be. But in time, I stalled at a humbling moment: I was just repeating the same structural patterns, the same mental models, over and over in every new language I acquired. In effect, I wasn&amp;rsquo;t really learning anything. I was merely reimplementing the same application in different dialects. It felt like progress, but it wasn&amp;rsquo;t. What a wake-up call.&lt;/p&gt;
&lt;p&gt;To all coders who read this: mastery is not just knowing everything about the language or many things in many languages; it&amp;rsquo;s learning why we do things the way we do. Learn the context under which architectural and design solutions are best. Learn the problems they were intended to solve. Don’t try to kill a mosquito with a bazooka!&lt;/p&gt;
&lt;p&gt;Which brings me back to hexagonal architecture. Like all architecture styles, its value is not in simply doing it, but knowing when and why you should. The old adage applies once more: &amp;ldquo;It depends.&amp;rdquo; Its relevance is largely dependent on the kind of problem you are attempting to solve, the complexity of your domain, and the kind of boundaries your application needs.&lt;/p&gt;
&lt;p&gt;Since I’ve already tried applying hexagonal architecture in a variety of projects, across different domains and in multiple programming languages, you could say I’ve willingly signed myself up for a fair bit of architectural suffering. And that’s exactly what I want to write about. The good, the bad, and the “what-was-I-thinking” moments that came with it.&lt;/p&gt;
&lt;h1 id=&#34;some-basics&#34;&gt;Some basics&lt;/h1&gt;
&lt;p&gt;The closest analogy that I commonly see in other articles are the use of power outlets and plugs. As long as you have the same prongs, you are guaranteed electricity to charge your phone, if the grid is live. You travel to another country, buy an international adapter. All the concepts remain the same in this architecture - as long as you invoke the same inbound port, be it a REST call or a SOAP call or an undocumented untested protocol defined by a random IBM mainframe, the logic remains untouched and consistent and produces the same outcome. This predictability is a big deal!&lt;/p&gt;
&lt;p&gt;The term &lt;em&gt;hexagon&lt;/em&gt; has no real meaning in the architecture. The author simply found boxes and circles too dull for diagrams and opted for a six-sided shape instead. There’s no deeper symbolic meaning , that I know of, behind the hexagon itself. I have tried to draw this out without a hexagon and it looks great! You are free to try it out, pen and paper anyone?&lt;/p&gt;
&lt;p&gt;Here is a representation of hexagonal architecture without any hexagons in it. The arrows represent information flow or call stack.&lt;/p&gt;
&lt;p&gt;![](&lt;a href=&#34;https://cdn.hashnode.com/res/hashnode/image/upload/v1744942651761/e8884bc9-9ceb-4877-b48d-03510742af60.png&#34;&gt;cdn.hashnode.com/res/hashn&amp;hellip;&lt;/a&gt; align=&amp;ldquo;center&amp;rdquo;)&lt;/p&gt;
&lt;p&gt;What &lt;em&gt;does&lt;/em&gt; matter, though, is the goal of this architecture: to protect the core of your system the application logic, the business rules from the noisy, ever-changing world outside. This means isolating the core from UI frameworks, REST controllers, messaging systems, databases, and all other external concerns.&lt;/p&gt;
&lt;p&gt;In hexagonal architecture, the core interacts with the outside world through clearly defined boundaries: a single entry point and a single exit point, known as the &lt;strong&gt;inbound port&lt;/strong&gt; and &lt;strong&gt;outbound port&lt;/strong&gt;, respectively.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;If something outside the application wants to invoke or use a capability within the core, it goes through the &lt;strong&gt;inbound port&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If the application needs to communicate with or depend on something external like a database or message queue it does so via the &lt;strong&gt;outbound port&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Adapters&lt;/strong&gt; are the components that live on the edge. They’re responsible for translating between the messy, real-world technologies and the clean, intention-driven interfaces defined by the core. Think of them as interpreters: HTTP controllers, File / Disk operations, database connectors, messaging clients - they all act as adapters.&lt;/p&gt;
&lt;h1 id=&#34;the-big-why&#34;&gt;The big WHY?&lt;/h1&gt;
&lt;p&gt;Separation of concerns is an important aspect in software architecture. Mortal humans likes order, boundaries and control, however far fetched that might seem in the world we are in. Hexagonal architecture provides just that, separation of concerns through clear boundaries, an order in the flow of information and layered control of behaviours.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Improved Unit Tests:&lt;/strong&gt; By isolating the core logic, you can test it independently of the complexities and potential instability of external dependencies like databases or UI frameworks. Unit tests become more focused and reliable.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Improved Integration Testing&lt;/strong&gt;: Having clear boundaries between different layers helps to apply narrow integration tests, improves contracts between layers, promotes stubs. This makes it easier to test the interactions between different parts of the system without relying on expensive e2e tests.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Increased Maintainability:&lt;/strong&gt; Changes in the external world (e.g., upgrading a database, switching UI frameworks) are less likely to impact the core application logic, as long as the adapters are updated accordingly. This reduces the risk of introducing bugs and makes maintenance easier.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Enhanced Flexibility:&lt;/strong&gt; The application becomes more adaptable to change. You can swap out external dependencies without rewriting the core logic. For example, you could switch from one database to another by simply implementing a new adapter.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Better Team Collaboration:&lt;/strong&gt; Clear boundaries make it easier for different teams to work on different parts of the application with less risk of interference, mostly at the same time. As long as the boundaries and contracts remain the same, there should not be major conflicts.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In the next article, I will cover a Spring Boot application and its project structure that would help us enable this architecture.&lt;/p&gt;
</description>
      <source:markdown>*You&#39;re reading part one of a series on hexagonal architecture. Over the next few articles, I will cover everything that I have encountered so far from the basics to advanced strategies, failures and wtf moments included.*

Originally named the &#34;Ports and Adapters Architecture,&#34; and widely referred to as Hexagonal Architecture first started shaping itself out of ideas that were working behind the scenes as far back as the 1990s, but not until the early 2000s really took shape as a formal framework. That’s what the LLMs tell me anyways, Dr. Alistair Cockburn’s site is down and the first entry in archive.org is in 2009 🥺 . The aim of this architectural style was to further insulate the inside of an application from the outside world - be it databases, user interfaces, or other external systems.

I must admit, I came across this pattern fairly recently. For a number of early years in my career as software developer, I was highly committed to attempting to master as many programming languages as possible. Language upon language, syntax upon syntax, semi-colons and no semi-colons; in pursuit of the mirage that the more languages I could master, the greater developer I would be. But in time, I stalled at a humbling moment: I was just repeating the same structural patterns, the same mental models, over and over in every new language I acquired. In effect, I wasn&#39;t really learning anything. I was merely reimplementing the same application in different dialects. It felt like progress, but it wasn&#39;t. What a wake-up call.

To all coders who read this: mastery is not just knowing everything about the language or many things in many languages; it&#39;s learning why we do things the way we do. Learn the context under which architectural and design solutions are best. Learn the problems they were intended to solve. Don’t try to kill a mosquito with a bazooka!

Which brings me back to hexagonal architecture. Like all architecture styles, its value is not in simply doing it, but knowing when and why you should. The old adage applies once more: &#34;It depends.&#34; Its relevance is largely dependent on the kind of problem you are attempting to solve, the complexity of your domain, and the kind of boundaries your application needs.

Since I’ve already tried applying hexagonal architecture in a variety of projects, across different domains and in multiple programming languages, you could say I’ve willingly signed myself up for a fair bit of architectural suffering. And that’s exactly what I want to write about. The good, the bad, and the “what-was-I-thinking” moments that came with it.

# Some basics

The closest analogy that I commonly see in other articles are the use of power outlets and plugs. As long as you have the same prongs, you are guaranteed electricity to charge your phone, if the grid is live. You travel to another country, buy an international adapter. All the concepts remain the same in this architecture - as long as you invoke the same inbound port, be it a REST call or a SOAP call or an undocumented untested protocol defined by a random IBM mainframe, the logic remains untouched and consistent and produces the same outcome. This predictability is a big deal!

The term *hexagon* has no real meaning in the architecture. The author simply found boxes and circles too dull for diagrams and opted for a six-sided shape instead. There’s no deeper symbolic meaning , that I know of, behind the hexagon itself. I have tried to draw this out without a hexagon and it looks great! You are free to try it out, pen and paper anyone?

Here is a representation of hexagonal architecture without any hexagons in it. The arrows represent information flow or call stack.

![]([cdn.hashnode.com/res/hashn...](https://cdn.hashnode.com/res/hashnode/image/upload/v1744942651761/e8884bc9-9ceb-4877-b48d-03510742af60.png) align=&#34;center&#34;)

What *does* matter, though, is the goal of this architecture: to protect the core of your system the application logic, the business rules from the noisy, ever-changing world outside. This means isolating the core from UI frameworks, REST controllers, messaging systems, databases, and all other external concerns.

In hexagonal architecture, the core interacts with the outside world through clearly defined boundaries: a single entry point and a single exit point, known as the **inbound port** and **outbound port**, respectively.

* If something outside the application wants to invoke or use a capability within the core, it goes through the **inbound port**.
    
* If the application needs to communicate with or depend on something external like a database or message queue it does so via the **outbound port**.
    

**Adapters** are the components that live on the edge. They’re responsible for translating between the messy, real-world technologies and the clean, intention-driven interfaces defined by the core. Think of them as interpreters: HTTP controllers, File / Disk operations, database connectors, messaging clients - they all act as adapters.

# The big WHY?

Separation of concerns is an important aspect in software architecture. Mortal humans likes order, boundaries and control, however far fetched that might seem in the world we are in. Hexagonal architecture provides just that, separation of concerns through clear boundaries, an order in the flow of information and layered control of behaviours.

* **Improved Unit Tests:** By isolating the core logic, you can test it independently of the complexities and potential instability of external dependencies like databases or UI frameworks. Unit tests become more focused and reliable.
    
* **Improved Integration Testing**: Having clear boundaries between different layers helps to apply narrow integration tests, improves contracts between layers, promotes stubs. This makes it easier to test the interactions between different parts of the system without relying on expensive e2e tests.
    
* **Increased Maintainability:** Changes in the external world (e.g., upgrading a database, switching UI frameworks) are less likely to impact the core application logic, as long as the adapters are updated accordingly. This reduces the risk of introducing bugs and makes maintenance easier.
    
* **Enhanced Flexibility:** The application becomes more adaptable to change. You can swap out external dependencies without rewriting the core logic. For example, you could switch from one database to another by simply implementing a new adapter.
    
* **Better Team Collaboration:** Clear boundaries make it easier for different teams to work on different parts of the application with less risk of interference, mostly at the same time. As long as the boundaries and contracts remain the same, there should not be major conflicts.
    

In the next article, I will cover a Spring Boot application and its project structure that would help us enable this architecture.
</source:markdown>
    </item>
    
  </channel>
</rss>
