<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ricardo Lüders on Medium]]></title>
        <description><![CDATA[Stories by Ricardo Lüders on Medium]]></description>
        <link>https://medium.com/@rluders?source=rss-8e584f9e09ed------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*erEefnzXyg7CEb8j7ELing.jpeg</url>
            <title>Stories by Ricardo Lüders on Medium</title>
            <link>https://medium.com/@rluders?source=rss-8e584f9e09ed------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 15:19:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rluders/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Amaru, Part 2: From Vision to Architecture — Designing a Distributed AI-Native Production Platform]]></title>
            <link>https://medium.com/@rluders/amaru-part-2-from-vision-to-architecture-designing-a-distributed-ai-native-production-platform-04ba1886d438?source=rss-8e584f9e09ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/04ba1886d438</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Ricardo Lüders]]></dc:creator>
            <pubDate>Thu, 12 Nov 2026 18:42:39 GMT</pubDate>
            <atom:updated>2026-11-12T18:42:39.162Z</atom:updated>
            <content:encoded><![CDATA[<p><em>From an engineering execution concept to a layered architecture for coordinating people, agents, tools, and specialized execution environments.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GUru6xdy1uljDamAG5i-qQ.png" /></figure><p>In my previous article, <a href="https://medium.com/@rluders/amaru-why-im-building-an-engineering-execution-platform-in-the-age-of-ai-agents-c0dc7ac1e511">Amaru: Why I’m Building an Engineering Execution Platform in the Age of AI Agents</a>, I explained why I believe the next challenge in AI-assisted engineering is not simply making agents more capable.</p><p>It is making the work they perform coordinated, observable, recoverable, and composable.</p><p>I discussed why an AI agent should not necessarily own the entire orchestration process, why existing tools such as Hermes, Temporal, and CI/CD systems solve different parts of the problem, and why I believe engineering execution deserves to be treated as a first-class concept.</p><p>Since then, Amaru has evolved.</p><p>The original ideas have become more concrete, and the architecture has taken shape. Some concepts have been refined, responsibilities have been separated, and the boundaries between intelligence, orchestration, execution, and infrastructure have become clearer.</p><p>I now have an architectural model that is much closer to what I envision as the long-term foundation of Amaru.</p><p>I would not call it definitive. Architecture should remain open to revision as implementation exposes problems that diagrams cannot anticipate.</p><p>But it is sufficiently mature to explain how I believe the platform should work.</p><p>This article is about that architecture.</p><p>Not as a collection of technologies or boxes in a diagram, but as a set of responsibilities designed to work together.</p><h3>1. From an Execution Platform to an AI-Native Production Platform</h3><p>One of the most important changes in how I describe Amaru is its positioning.</p><p>I increasingly see it as a <strong>distributed AI-native production platform</strong>.</p><p>The distinction matters.</p><p>Engineering execution was the original problem that motivated the project. However, the underlying coordination problem is not exclusive to software engineering.</p><p>Consider the production of a video game.</p><p>It involves software development, 3D modeling, animation, visual effects, audio production, level design, testing, rendering, and publishing.</p><p>These activities involve different people, tools, agents, and execution environments. Some are predominantly digital and automated. Others depend on specialized applications, hardware, human judgment, or physical resources.</p><p>The same applies to many other domains.</p><p>A scientific research project might involve data processing, simulations, visualization, documentation, and specialized computational environments.</p><p>A media production pipeline might involve image generation, video editing, rendering, review, and distribution.</p><p>An engineering project might involve CAD, simulations, manufacturing preparation, and validation.</p><p>In all these scenarios, the fundamental problem is similar:</p><p><strong>How do we coordinate people, intelligent agents, tools, and execution environments around a production process while preserving context, control, and accountability?</strong></p><p>That is the broader problem Amaru is designed to address.</p><p>The platform should not need to understand every domain in detail. Specialized tools and domain-specific capabilities should provide that knowledge.</p><p>Amaru should provide the infrastructure that allows these participants to work together.</p><h3>2. The Architecture: Separating Responsibilities</h3><p>The current architecture is organized into nine major areas:</p><ol><li>Experience Layer</li><li>Intelligence Layer</li><li>Orchestration Layer</li><li>Control Plane</li><li>Platform Data Layer</li><li>Runtime Layer</li><li>Execution Environments</li><li>Deployment Topologies</li><li>External Ecosystem</li></ol><p>These are architectural boundaries, not necessarily nine independently deployed services or nine mandatory infrastructure components.</p><p>Each layer represents a different responsibility within the platform.</p><p>The central idea is to avoid concentrating intelligence, coordination, infrastructure, and execution in a single component.</p><p>An agent should not need to know how the platform persists execution state. A worker should not need to understand the entire production workflow. A desktop application should not be responsible for keeping an execution alive.</p><p>Likewise, the control plane should not need to perform every operation itself.</p><p>The architecture separates these concerns while providing a common model through which they can interact.</p><p><strong>The complete Amaru architecture:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_90Zs3PLujzZ0-XMCuF0sQ.png" /><figcaption><em>The Amaru Architecture — A distributed AI-native production platform, connecting people, agents, tools, workflows, and execution environments.</em></figcaption></figure><p>The diagram provides an overview of the entire platform, from the interfaces people use to the environments where actual work happens.</p><p>Let’s explore each part.</p><h3>3. The Experience Layer: Where People Interact with Amaru</h3><p>The first layer is the Experience Layer.</p><p>It represents the different ways people and external systems interact with the platform.</p><p>I envision four primary interfaces:</p><ul><li><strong>Amaru Desktop:</strong> A native application focused on everyday production work, monitoring executions, managing projects, interacting with agents, and reviewing results.</li><li><strong>Amaru Web:</strong> Browser-based access for project management, collaboration, administration, and execution monitoring.</li><li><strong>APIs &amp; SDKs:</strong> Programming interfaces for integrations, automation, custom tools, and external systems.</li><li><strong>Users:</strong> Developers, artists, producers, researchers, administrators, and other stakeholders.</li></ul><p>An important architectural decision here is that these interfaces are clients of the platform.</p><p>They should not become independent sources of execution truth.</p><p>A workflow should continue running if the desktop application closes. A developer should be able to inspect an execution through the web interface without depending on the machine where it started.</p><p>Similarly, external applications should be able to interact with Amaru through defined interfaces rather than relying on internal implementation details.</p><p>This creates an important separation:</p><p><strong>The experience layer presents and controls the platform, but it does not own the platform’s execution lifecycle.</strong></p><h3>4. The Intelligence Layer: Introducing Amaru Brain</h3><p>At the center of the architecture is the Intelligence Layer, represented by Amaru Brain.</p><p>This is probably the most recognizable part of the platform.</p><p>Amaru Brain is envisioned as a persistent, orchestrator-oriented AI agent that understands the project context, monitors progress, coordinates agents and workflows, analyzes results, and helps make decisions.</p><p>I deliberately use the term Brain rather than simply calling it another agent.</p><p>Its responsibility is broader than responding to individual requests.</p><p>It should understand what is happening across a production process and help determine what should happen next.</p><p>For example, consider a request to implement a new feature in a software project.</p><p>Amaru Brain might:</p><ul><li>Understand the requested outcome and existing project context.</li><li>Identify the relevant work items and dependencies.</li><li>Determine which capabilities and agents are appropriate.</li><li>Coordinate the execution of individual tasks.</li><li>Monitor progress and analyze results.</li><li>Identify failures, risks, and inconsistencies.</li><li>Propose alternative approaches when necessary.</li><li>Request human intervention when a decision exceeds its authority.</li></ul><p>The current architecture identifies six groups of capabilities:</p><ul><li><strong>Context Awareness: </strong>Understanding project context, available resources, previous decisions, and current execution state.</li><li><strong>Decision Support: </strong>Evaluating alternatives, interpreting results, and helping determine the next appropriate action.</li><li><strong>Orchestration: </strong>Coordinating workflows, agents, and execution activities.</li><li><strong>Event Processing: </strong>Reacting to events and changes in the platform.</li><li><strong>Memory &amp; Learning: </strong>Preserving relevant context and using execution history to improve future decisions.</li><li><strong>Safety &amp; Boundaries: </strong>Operating within explicit permissions, policies, and execution constraints.</li></ul><p>These capabilities are closely related, but they should not be confused with the mechanisms that enforce the platform’s guarantees.</p><p>This is an important distinction carried forward from the first article.</p><p>Amaru Brain provides intelligence. The platform provides control.</p><p>The Brain may decide that an operation is ready to proceed, but the platform must determine whether the operation is permitted.</p><p>It may recommend retrying a failed task, but the execution system must determine whether that retry is safe.</p><p>It may propose a workflow modification, but that does not automatically authorize the modification.</p><p>I do not want an architecture where everything depends on an LLM making the right decision every time.</p><p>I want an intelligent component operating within a system that can enforce its boundaries.</p><h3>5. The Orchestration Layer: Turning Decisions into Execution</h3><p>If the Intelligence Layer determines what should happen, the Orchestration Layer is responsible for how work progresses.</p><p>This layer contains two central concepts:</p><ul><li>State Machines</li><li>Workflows</li></ul><p>They address related but different concerns.</p><p>A workflow describes a production process: its steps, dependencies, conditions, and expected progression.</p><p>A state machine defines the valid states and transitions of an entity participating in that process.</p><p>For example, an execution might transition through states such as pending, scheduled, running, waiting for approval, completed, failed, or cancelled.</p><p>The important point is that these transitions should be governed by explicit rules.</p><p>An agent can propose an action, but it should not arbitrarily change the authoritative state of an execution.</p><p>Similarly, a workflow should be able to combine different types of work:</p><ul><li>Deterministic operations.</li><li>Agent-driven activities.</li><li>External integrations.</li><li>Human approvals.</li><li>Specialized execution tasks.</li></ul><p>A workflow could, for example, require an agent to implement a feature, execute a test suite, request human review, and only then proceed to deployment.</p><p>Another workflow might coordinate asset generation, rendering, visual inspection, and approval.</p><p>This is where the original engineering execution concept becomes more tangible.</p><p>The goal is not to make everything autonomous or to turn every operation into an AI interaction.</p><p>It is to make different forms of work composable within a coherent production process.</p><h3>6. The Control Plane: The Platform’s Authoritative Services</h3><p>The Control Plane is responsible for managing the platform itself.</p><p>It provides the services required to coordinate projects, users, executions, integrations, permissions, and the overall production lifecycle.</p><p>The current architecture identifies eight primary service areas.</p><ul><li><strong>Identity &amp; Access: </strong>Manages users, teams, roles, authentication, and permissions.</li><li><strong>Projects &amp; Work: </strong>Provides the organizational model for projects, work packages, work items, and related resources.</li><li><strong>Execution Coordination: </strong>Coordinates task dispatch, execution tracking, worker availability, and the relationship between workflows and actual execution.</li><li><strong>Artifact Management: </strong>Manages files, versions, lineage, and provenance associated with production activities.</li><li><strong>Reviews &amp; Approvals: </strong>Provides human review mechanisms and approval workflows.</li><li><strong>Integrations Registry: </strong>Maintains information about external providers, tools, and configured integrations.</li><li><strong>Events &amp; Notifications: </strong>Handles system events, logs, and notifications across the platform.</li><li><strong>Policies &amp; Governance: </strong>Defines security boundaries, access rules, and organizational policies.</li></ul><p>These services form the operational foundation of Amaru.</p><p>Their purpose is not to make the platform intelligent. Their purpose is to make the platform manageable, consistent, and governable.</p><p>This distinction is particularly important as the number of agents, integrations, and execution environments grows.</p><p>Without a central authority for permissions, coordination, and state, the platform would eventually become a collection of independent systems with incompatible assumptions.</p><p>The Control Plane is intended to prevent that fragmentation.</p><h3>7. The Platform Data Layer: Preserving the Production History</h3><p>A distributed production platform needs more than transient application state.</p><p>It needs durable storage for the information that makes production understandable.</p><p>The Platform Data Layer provides this foundation.</p><p>The current architecture identifies six components:</p><ul><li><strong>Platform Database: </strong>Stores structured platform data, including projects, executions, workflows, and related entities.</li><li><strong>Artifact Storage: </strong>Stores files, generated assets, reports, builds, and other production outputs.</li><li><strong>Event Store / Job Queue: </strong>Supports event processing, task dispatch, messaging, and scheduling-related operations.</li><li><strong>Secrets &amp; Credentials: </strong>Provides storage and management for API keys, tokens, and other sensitive configuration.</li><li><strong>Cache &amp; Runtime Data: </strong>Supports temporary state, performance optimization, and runtime information.</li><li><strong>Vector Store (Optional): </strong>Provides semantic search and contextual retrieval capabilities where appropriate.</li></ul><p>Not every component has the same persistence requirements.</p><p>A generated 3D model, an execution state transition, an API credential, and a temporary cache entry are fundamentally different kinds of data.</p><p>They should not be forced into the same storage abstraction.</p><p>There is also an important relationship between this layer and the execution history discussed in the first article.</p><p>If an execution fails, the platform should be able to reconstruct what happened.</p><p>Which workflow was used? Which tasks were executed? Which worker performed them? Which artifacts were generated? Which validations ran? Which decisions required approval?</p><p>The objective is to preserve enough information to make production observable and recoverable.</p><p>This is not simply about storing logs.</p><p>It is about maintaining the relationship between the original intent, the process that was executed, and the resulting artifacts.</p><h3>8. The Runtime Layer: Managing Execution as a Platform Capability</h3><p>The Runtime Layer manages the infrastructure required to execute work.</p><p>This is an important separation because coordinating work and performing work are not necessarily the same responsibility.</p><p>The Control Plane determines what needs to happen and maintains the authoritative execution state.</p><p>The Runtime Layer manages the resources and mechanisms required to make that execution possible.</p><p>The architecture currently identifies six areas.</p><ul><li><strong>Monitoring &amp; Observability: </strong>Provides metrics, logs, traces, and execution monitoring.</li><li><strong>Resource Management: </strong>Handles resource consumption, quotas, and optimization.</li><li><strong>Worker Manager: </strong>Manages worker lifecycle and health.</li><li><strong>Environment Discovery: </strong>Discovers available execution environments and their capabilities.</li><li><strong>Execution Scheduler: </strong>Plans and distributes work across available execution resources.</li><li><strong>Runtime API: </strong>Provides the interface through which workers and agents interact with execution services.</li></ul><p>These responsibilities become increasingly important when execution is distributed.</p><p>A task may require a Linux environment, a Windows machine, a GPU, a specific application, or access to specialized hardware.</p><p>The scheduler should be able to consider these requirements rather than simply selecting the first available worker.</p><p>The Runtime Layer provides the mechanisms needed to coordinate those decisions.</p><h3>9. Execution Environments: Work Happens Where It Makes Sense</h3><p>One of the architectural decisions I consider particularly important is the separation between the platform and the environments where actual work happens.</p><p>Not every task belongs in a container.</p><p>Not every agent needs to run on the same machine.</p><p>Not every production process can be reproduced in a generic cloud environment.</p><p>Amaru therefore treats execution environments as an independent architectural concern.</p><p>The current model identifies four broad categories.</p><ul><li><strong>Other Workers: </strong>Remote machines, cloud instances, and specialized execution environments. These can represent different types of workers with different capabilities.</li><li><strong>Container Workers: </strong>Isolated and reproducible execution environments for containerized workloads.</li><li><strong>Windows Workers: </strong>Environments for Windows-specific development, builds, Unreal Engine workloads, and specialized tools.</li><li><strong>Linux Workers: </strong>Environments for development, asset processing, agents, and general-purpose engineering tools.</li></ul><p>The important idea is that these categories describe execution environments, not necessarily different orchestration systems.</p><p>They should participate in the same platform model.</p><p>A workflow could dispatch one task to a container, another to a Windows workstation, and another to a Linux machine.</p><p>Each environment performs the operation it is suited for and returns its results to the platform.</p><p>The platform maintains the relationship between those operations.</p><p>This is what I mean by distributed execution.</p><p>It is not simply spawning more agents or opening more remote terminals.</p><p>It is coordinating heterogeneous execution resources while preserving a coherent production lifecycle.</p><h3>10. The External Ecosystem: Integrating Instead of Reinventing</h3><p>Amaru is not intended to recreate every tool used in production.</p><p>Its value depends partly on its ability to integrate with the existing ecosystem.</p><p>The architecture therefore treats external providers and services as an explicit part of the platform.</p><p>The current diagram identifies several categories:</p><ul><li>LLM Providers.</li><li>Image Generation.</li><li>Video Generation.</li><li>3D Generation.</li><li>Motion Extraction.</li><li>Code &amp; Development Tools.</li><li>Cloud Services.</li><li>Design &amp; Media Tools.</li><li>Communication.</li><li>Other APIs &amp; Services.</li></ul><p>These integrations are not all the same.</p><p>Some provide intelligence. Others generate assets, execute operations, manage infrastructure, or facilitate collaboration.</p><p>I want to preserve the distinction between connectors, plugins, and capabilities.</p><p>Connectors provide communication with external systems.</p><p>Plugins extend the platform through supported extension contracts.</p><p>Capabilities describe the operations that workflows and workers can actually perform.</p><p>For example, an image generation provider might be integrated through a connector, exposed through a plugin, and made available as a capability that a workflow can invoke.</p><p>This separation is important because an integration should not automatically become a privileged part of the platform core.</p><p>It also helps preserve provider independence.</p><p>If a particular model provider becomes expensive, unavailable, or unsuitable for a task, the architecture should allow alternatives without requiring the entire production system to be redesigned.</p><p>The same principle applies to development tools, cloud providers, and specialized applications.</p><p>Amaru should coordinate the ecosystem, not attempt to own every component of it.</p><h3>11. Deployment Topologies: One Platform, Different Operational Models</h3><p>A distributed platform also needs to adapt to different infrastructure and organizational requirements.</p><p>Not everyone wants to operate the same environment.</p><p>Some users prefer a fully managed cloud experience. Others need complete control over their infrastructure. Some will require a combination of both.</p><p>The architecture currently defines three deployment topologies.</p><h4><strong>A. Amaru Cloud</strong></h4><p>A platform managed by Amaru.</p><p>Users access the platform through web or desktop clients, while remote workers provide execution resources.</p><p>This model prioritizes accessibility and reduced operational overhead.</p><h4><strong>B. Amaru Self-Hosted</strong></h4><p>The platform runs on infrastructure controlled by the user or organization.</p><p>Users retain control over infrastructure, execution resources, network access, and operational policies.</p><p>Local workers can execute tasks within that environment.</p><h4><strong>C. Amaru Hybrid</strong></h4><p>A combination of cloud-managed platform services and privately controlled execution environments.</p><p>For example, the Amaru Cloud Platform could manage projects, orchestration, and shared services while private runtime workers execute sensitive or specialized workloads within an organization’s infrastructure.</p><p>The important architectural objective is to avoid creating three fundamentally different products.</p><p>These deployment models should share the same underlying platform concepts and execution model.</p><p>The infrastructure may change. The operational responsibilities may differ. But the fundamental way work is represented and coordinated should remain consistent.</p><p>That is easier to describe than to implement, of course.</p><p>Authentication, networking, connectivity, secrets, availability, and failure recovery become considerably more complex in distributed and hybrid deployments.</p><p>Still, these concerns should be addressed as part of the architecture rather than treated as afterthoughts.</p><h3>12. A Practical Example: Coordinating a Game Production Workflow</h3><p>The architecture becomes easier to understand when applied to a real production scenario.</p><p>Imagine a game development team wants to implement a new gameplay mechanic and produce the assets required to support it.</p><p>The work might involve:</p><ol><li>Understanding the requirements and existing project.</li><li>Implementing the gameplay mechanic.</li><li>Generating or creating placeholder assets.</li><li>Running the game build.</li><li>Executing automated gameplay tests.</li><li>Capturing visual evidence.</li><li>Reviewing the result.</li><li>Producing final assets.</li><li>Running the relevant validations again.</li></ol><p>How would Amaru coordinate this?</p><p>A developer interacts with Amaru through the Desktop or Web experience.</p><p>Amaru Brain interprets the request, examines the project context, and proposes an execution plan.</p><p>The Orchestration Layer represents that plan as a workflow with explicit steps, dependencies, and approval requirements.</p><p>The Control Plane manages the project, permissions, execution records, and coordination.</p><p>The Runtime Layer identifies appropriate execution resources.</p><p>A coding agent might work inside a Linux environment. An asset-generation capability might use an external provider. A Windows worker might execute an Unreal Engine build.</p><p>Each task produces outputs that are associated with the corresponding execution.</p><p>The platform tracks progress, processes events, and preserves the resulting artifacts.</p><p>If the build fails, Amaru Brain can analyze the available evidence and propose a correction.</p><p>If a visual review requires human judgment, the workflow can pause for approval.</p><p>Once the required conditions are satisfied, the workflow proceeds.</p><p>Notice what happened here.</p><p>No single agent needed to perform every operation.</p><p>No single machine needed to host the entire production process.</p><p>No individual interface needed to own the workflow.</p><p>And the platform did not need to implement a game engine, an asset generator, or a source control system.</p><p>Its responsibility was to coordinate the production process.</p><p>That is the architecture working as intended.</p><h3>13. The Architecture Is a Direction, Not a Promise</h3><p>There is something I want to make explicit.</p><p>A complete architectural diagram can create the impression that all its components already exist.</p><p>They do not.</p><p>The diagram represents the current architectural direction and the responsibilities I believe the platform will eventually need.</p><p>Some components are more clearly defined than others. Some will evolve during implementation. Some may be simplified, combined, or replaced.</p><p>I consider that a healthy part of the process.</p><p>There is a significant difference between having a coherent architectural model and having a production-ready implementation.</p><p>The first helps guide decisions. The second must be demonstrated through actual execution.</p><p>I also do not want to fall into the trap of implementing every box simply because it appears in the diagram.</p><p>The architecture should support the vision, but the implementation must be driven by validated needs.</p><p>The first milestone is not a complete distributed production platform.</p><p>It is a working platform capable of representing work, coordinating execution, managing workers, and preserving meaningful execution history.</p><p>From there, more advanced capabilities can be introduced as real workflows demand them.</p><p>If a component does not create value or provide a necessary boundary, it deserves to be questioned.</p><p>Architecture is not valuable because it is elaborate.</p><p>It is valuable when it makes a system easier to understand, operate, extend, and trust.</p><h3>14. What Comes Next?</h3><p>With the architectural boundaries becoming clearer, the next challenge is implementation.</p><p>I want to validate the architecture through increasingly complex production scenarios.</p><p>The initial focus is on establishing the platform foundation:</p><ul><li>The core domain model.</li><li>The relationship between projects, work, workflows, and executions.</li><li>The orchestration and state management mechanisms.</li><li>Worker registration and lifecycle management.</li><li>Runtime coordination.</li><li>Artifact and execution history.</li><li>Identity, permissions, and security boundaries.</li></ul><p>Once these foundations are working together, the platform can expand into more specialized execution environments, richer integrations, additional AI capabilities, and different deployment models.</p><p>I also expect the architecture to change as these components meet real operational constraints.</p><p>A diagram cannot reveal every failure mode of a distributed system. A well-designed abstraction can still be wrong when confronted with actual workloads.</p><p>That is why I want implementation to challenge the architecture continuously.</p><p>The goal is not to prove that the diagram was right.</p><p>The goal is to build a system that works.</p><h3>15. Engineering, Creation, and Production — Orchestrated</h3><p>Looking back at the first article, the original question remains:</p><p>What would engineering look like if AI agents were not isolated assistants, but replaceable participants in a coherent production system?</p><p>I now see that question as part of something broader.</p><p>What would production look like if people, intelligent agents, tools, and specialized execution environments could collaborate through a common platform?</p><p>A platform where intelligence does not need to own infrastructure.</p><p>Where workflows do not depend on a single agent.</p><p>Where execution does not depend on a single machine.</p><p>Where integrations can evolve independently.</p><p>Where the history of what happened is preserved.</p><p>And where autonomy remains something people can direct, inspect, and govern.</p><p>That is the architecture I am trying to build with Amaru.</p><p>It is ambitious, and there is still a considerable amount of engineering between this model and a mature product.</p><p>But the direction is becoming clearer.</p><p><strong>Amaru is not an attempt to build another AI assistant. It is an attempt to build the production infrastructure that allows people, agents, and tools to work together at scale.</strong></p><p>Engineering work, creative production, and intelligent automation.</p><p>One platform.</p><p>One coherent execution model.</p><p><strong>Amaru — From idea to real-world production.</strong></p><p><strong>Explore the project:</strong> <a href="https://github.com/rluders/amaru">github.com/rluders/amaru</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=04ba1886d438" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Amaru: Why I’m Building an Engineering Execution Platform in the Age of AI Agents]]></title>
            <link>https://medium.com/@rluders/amaru-why-im-building-an-engineering-execution-platform-in-the-age-of-ai-agents-c0dc7ac1e511?source=rss-8e584f9e09ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/c0dc7ac1e511</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[ai-development]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Ricardo Lüders]]></dc:creator>
            <pubDate>Thu, 29 Oct 2026 15:43:51 GMT</pubDate>
            <atom:updated>2026-10-29T15:43:51.978Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Why not just use an AI agent as an orchestrator? Why not use Hermes? What is missing between an AI that can do the work and a system that can reliably coordinate it?</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GUru6xdy1uljDamAG5i-qQ.png" /></figure><p>AI agents are getting remarkably good at engineering tasks.</p><p>They can explore a codebase, implement a feature, fix a bug, write tests, inspect logs, operate a browser, invoke tools, and delegate work to other agents. With the right context and permissions, a single agent can accomplish in minutes what might previously have taken an engineer an afternoon.</p><p>So why build another platform around them?</p><p>Why not use Claude Code, Codex, Hermes, an agent framework, a collection of scripts, or a workflow engine? Why introduce another system that needs to be developed, operated, and maintained?</p><p>These are not rhetorical questions. They are the questions I have been asking myself while building Amaru.</p><p>My starting point is simple: <strong>I don’t think the next major engineering challenge is only making agents better at performing tasks. It is making the work delegated to those agents reliable, observable, recoverable, and composable across an entire engineering process.</strong></p><p>That is the problem I want Amaru to explore.</p><p>This article is an attempt to explain why, compare the alternatives, and describe the kind of system I believe is worth building.</p><h3>1. The problem changes when agents become capable</h3><p>For years, engineering automation has focused on making individual operations more efficient.</p><p>We built scripts to automate repetitive tasks, CI pipelines to validate changes, deployment systems to release software, project management tools to organize work, and development environments to help engineers write code.</p><p>AI agents introduce something different: we can now delegate increasingly complex work expressed in terms of goals rather than explicit sequences of commands.</p><p>Instead of writing a script that says:</p><ol><li>Open this file.</li><li>Replace this function.</li><li>Run this test.</li><li>Update this configuration.</li><li>Commit the result.</li></ol><p>We can ask an agent to implement a feature, investigate a failure, or prepare a migration. The agent determines many of the intermediate steps.</p><p>This is powerful. But it also changes the nature of the coordination problem.</p><p>Consider a seemingly ordinary engineering task:</p><blockquote><em>Implement a feature, verify its behavior, update the documentation, and prepare the changes for review.</em></blockquote><p>Depending on the project, completing that task might involve:</p><ul><li>Understanding the project’s architecture and current state.</li><li>Inspecting issues, requirements, and previous decisions.</li><li>Selecting the appropriate model and agent.</li><li>Creating an isolated working environment.</li><li>Assigning independent investigation or implementation tasks.</li><li>Coordinating changes across multiple repositories.</li><li>Running tests in a particular environment.</li><li>Starting a GPU-intensive process or a specialized application.</li><li>Collecting logs, artifacts, screenshots, or test reports.</li><li>Requesting human approval at the right moment.</li><li>Recovering from an interrupted execution.</li><li>Preserving the relationship between the original request and the final result.</li></ul><p>An agent can perform many of these operations. A collection of agents can perform even more.</p><p>But who owns the overall execution?</p><p>Where does the authoritative state live? What happens if a worker disappears halfway through? How does another agent know whether it can safely continue? What evidence proves that the work was completed? Which actions require approval? How do we distinguish a successful execution from a successful engineering outcome?</p><p>These questions become increasingly important as work becomes longer, more distributed, and less deterministic.</p><p>A conversation is not necessarily a workflow. A tool call is not necessarily a durable operation. A successful agent response is not necessarily proof that the requested outcome has been achieved.</p><p><strong>The gap I am interested in exists between the ability to perform a task and the ability to coordinate that task as part of a larger engineering system.</strong></p><p>That is where Amaru begins.</p><h3>2. Why not just use an AI agent as the orchestrator?</h3><p>This is probably the most important question.</p><p>A capable agent can plan, reason, choose tools, delegate subtasks, inspect results, and revise its approach. Why introduce a separate orchestration layer? Why not simply give one powerful agent access to everything and let it coordinate the rest?</p><p>For many workflows, that is a perfectly reasonable solution.</p><p>If I want an agent to investigate a bug, modify a small codebase, run tests, and report back, a single agent may be all I need. Adding another platform would introduce unnecessary complexity.</p><p>The argument for Amaru begins when the execution itself becomes a persistent engineering concern.</p><h3>Reasoning and control are different responsibilities</h3><p>An agent is good at interpreting ambiguous instructions and deciding what to do next. But the system responsible for execution has other responsibilities that should not depend entirely on the agent remembering what happened.</p><p>For example:</p><ul><li>An execution should have an identity independent of a conversation.</li><li>Its state should survive a process restart.</li><li>A task should not silently become complete because an agent says it is complete.</li><li>A worker should not be able to grant itself additional permissions.</li><li>An interrupted operation should have explicit recovery behavior.</li><li>A human approval should be recorded as part of the execution history.</li><li>Results should remain available even after the original agent session has ended.</li><li>The system should know which environment executed a task and which artifacts it produced.</li></ul><p>These are properties of the execution system, not merely properties of the model.</p><p>An agent can help manage them, but it should not be the sole authority responsible for maintaining them.</p><h3>An agent can make decisions; the platform can enforce invariants</h3><p>Imagine an agent is asked to deploy an application.</p><p>The agent can decide that the deployment is ready. It can inspect test results, review the changes, and recommend proceeding.</p><p>But the ability to deploy should be determined by policy. If production deployment requires approval, the agent’s confidence should not override that requirement.</p><p>Similarly, an agent might decide to retry a failed operation. The platform needs to know whether the operation is safe to retry, whether a previous attempt produced side effects, and whether the retry should reuse or create an execution environment.</p><p>The distinction is not that agents are unreliable and software is reliable. Platforms can have bugs, too. The distinction is that some guarantees are easier to define, test, and enforce in explicit system logic than in a model’s reasoning process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*92Uku9xBEWB7XIXApymXdg.png" /></figure><p>This table describes the architectural distinction I want to establish, not a claim that every agent runtime lacks these capabilities. Some agent systems already provide persistence, permissions, delegation, and recovery mechanisms. The question is how those capabilities fit into a larger, durable engineering execution model.</p><h3>The important nuance</h3><p>I do not want to remove the agent from the orchestration process.</p><p>I want to avoid making an LLM the only component capable of keeping the process coherent.</p><p>An agent should be able to reason about a workflow, adapt to unexpected situations, and propose a different approach. The platform should preserve the execution’s identity, enforce its boundaries, and record what actually happened.</p><p><strong>Amaru is not intended to replace intelligent orchestration with rigid automation. It is intended to give intelligent orchestration a reliable execution substrate.</strong></p><h3>3. Why not use Hermes?</h3><p>Hermes is a particularly relevant comparison because it already addresses many of the problems associated with autonomous agents.</p><p>The <a href="https://hermes-agent.nousresearch.com/docs/user-guide/features/overview">Hermes Agent</a> project includes persistent memory, reusable skills, tool integrations, browser automation, scheduled tasks, subagent delegation, and support for remote execution environments. Its ecosystem also includes plugins, MCP integrations, multiple model providers, and messaging interfaces.</p><p>Those are substantial capabilities. Anyone evaluating Amaru should evaluate Hermes seriously rather than assume that a new platform is automatically necessary.</p><p>So why build Amaru instead of adopting Hermes?</p><p>The answer is not that Hermes cannot orchestrate work. It can. The answer is that <strong>Hermes and Amaru start from different architectural centers of gravity.</strong></p><p>Hermes is an agent system designed to make an AI assistant capable, extensible, persistent, and useful across different contexts. Amaru is being designed around the lifecycle of engineering work: defining it, executing it, coordinating its dependencies, preserving its state, collecting evidence, and integrating the result into an engineering process.</p><p>These goals overlap, but they are not identical.</p><h3>A comparison of architectural emphasis</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pC-57n4x3IeU-nWUE8ILIA.png" /></figure><p>The comparison describes primary emphasis, not a checklist of features that one project has and the other does not. Hermes evolves quickly, and its actual capabilities should be checked against its current documentation.</p><h3>Could Hermes itself orchestrate Amaru?</h3><p>Potentially, yes.</p><p>In fact, this is an important distinction: <strong>Amaru does not need to win an argument against Hermes to justify existing.</strong></p><p>If Hermes is the right agent for a particular task, it could make sense to use Hermes within an Amaru-managed workflow, provided an appropriate integration is available. Another workflow might use Claude Code, Codex, a custom agent, or deterministic scripts.</p><p>The platform should not require every task to use the same agent.</p><p>Consider a workflow that involves investigating a bug, implementing a fix, testing it, and preparing a pull request. Hermes could be a suitable agent for investigation or implementation. A specialized test runner could execute the test suite. A CI provider could run the canonical validation. A human could approve the final change.</p><p>Amaru’s job would be to coordinate the lifecycle and preserve the relationship between these activities.</p><p>That does not mean every integration already exists. It means the architecture should make room for multiple execution providers rather than treating one agent as the entire platform.</p><h3>When would I choose Hermes directly?</h3><p>I would choose Hermes directly when the primary need is an autonomous assistant with memory, skills, tool access, messaging integrations, scheduled tasks, and agent-driven delegation.</p><p>I would consider Amaru when the primary need is to coordinate engineering work across multiple tasks, agents, tools, environments, and execution histories.</p><p>There is also a third possibility: use both.</p><p>A useful engineering ecosystem does not need one universal tool to absorb every responsibility. It needs clear boundaries and reliable ways for specialized tools to cooperate.</p><p>That is the model I want Amaru to support.</p><h3>4. The alternatives are not wrong. They solve different parts of the problem.</h3><p>The temptation when building a new platform is to compare it against every existing category and claim to replace them all.</p><p>I do not think that is a useful way to approach Amaru.</p><p>AI coding assistants, workflow engines, CI/CD systems, project management tools, agent frameworks, and automation scripts solve different problems. Some already provide capabilities that Amaru should reuse rather than recreate.</p><p>The more useful question is: where does each tool stop being the complete answer?</p><h3>Comparison across the engineering stack</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FawL7EEyO4NRtB-G1kKKZg.png" /></figure><p>These distinctions are not absolute. Temporal can orchestrate complex business processes. LangGraph can maintain state. CI/CD systems can trigger other systems. Project management platforms increasingly offer automation and AI features.</p><p>The point is not that these tools are incapable of expanding into adjacent territory.</p><p>The point is that combining them into a coherent engineering execution system requires someone to define the shared model, lifecycle, integration contracts, and operating experience.</p><p>That is the space Amaru is trying to occupy.</p><h3>Why not just use scripts?</h3><p>Scripts remain one of the best tools in engineering.</p><p>If a task is deterministic, a script is often preferable to an agent. It is faster, cheaper, easier to test, and more predictable.</p><p>I do not want Amaru to turn every shell command into an AI interaction.</p><p>The problem appears when the script becomes one step in a longer process involving dynamic decisions, multiple workers, approvals, and external systems. At that point, we need to know which steps ran, what they produced, which failed, and how to resume safely.</p><p>A script can still perform the operation. Amaru would provide the context in which that operation participates.</p><p><strong>The goal is not to replace scripts with agents. It is to make deterministic tools and intelligent agents composable parts of the same execution system.</strong></p><h3>Why not just use Temporal or another workflow engine?</h3><p>This is a more serious architectural question.</p><p>A durable workflow engine already solves important problems: persistent execution, timers, retries, failure handling, and orchestration across long-running processes.</p><p>Those capabilities are directly relevant to Amaru.</p><p>But an engineering execution platform also needs a domain model for work packages, work items, workflows, executions, tasks, artifacts, agents, tools, and execution environments. It needs to connect that model to source control, issue trackers, development environments, and human review.</p><p>One possible architecture would be to build Amaru on top of an existing workflow engine. Another would be to implement a smaller execution core tailored to the product’s needs.</p><p>The correct choice depends on operational complexity, recovery guarantees, deployment constraints, and the cost of maintaining the abstraction.</p><p>Amaru should not build a workflow engine from scratch merely because it can. It should own the engineering-specific concepts that create its value and reuse infrastructure wherever doing so is the better engineering decision.</p><h3>5. The missing abstraction is engineering execution</h3><p>If Amaru is not simply an agent, a workflow engine, a project tracker, or a CI system, what is it?</p><p>The central abstraction is <strong>engineering execution</strong>.</p><p>I want a system where work can be defined independently of the agent that performs it, the workflow that governs it, and the machine on which it runs.</p><p>That sounds like a small distinction. It has significant consequences.</p><p>Consider four related concepts:</p><ul><li><strong>Work Package:</strong> A coherent unit of engineering work within a project.</li><li><strong>Work Item:</strong> A specific piece of work, optionally associated with a Work Package.</li><li><strong>Workflow:</strong> A defined process describing how work should progress.</li><li><strong>Execution:</strong> A particular attempt to run that process, with its own state and history.</li></ul><p>Tasks, artifacts, approvals, and execution environments belong within this broader model.</p><p>The separation matters because the same work item may be executed more than once, through different workflows, with different agents or environments. An execution may fail and require another attempt. The workflow may change without rewriting the historical record of an earlier execution.</p><p>The model should preserve these distinctions instead of collapsing everything into a chat session or a single status field.</p><h3>Definition, process, and history</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8pZ82pSAj-teHN9zXdgmkw.png" /></figure><p>This model is not valuable because every project needs more entities. It is valuable if these distinctions make the system easier to reason about, recover, audit, and extend.</p><p>If the product cannot demonstrate that value through real workflows, the model should be simplified.</p><h3>Why the execution record matters</h3><p>Imagine an agent completes a task and reports that everything passed.</p><p>That statement is useful, but it is not the same thing as a durable execution record.</p><p>A stronger record could tell us:</p><ul><li>Which workflow and version were used.</li><li>Which agent or worker performed each task.</li><li>Which environment was selected.</li><li>Which tools were invoked.</li><li>Which validation commands ran.</li><li>Which artifacts were produced.</li><li>Which steps failed or were retried.</li><li>Which decisions required human intervention.</li><li>Which completion criteria were actually satisfied.</li></ul><p>Not every field needs to be available from day one. The important point is that execution history should be a first-class concern.</p><p>This creates the foundation for debugging, accountability, reproducibility, and eventually better measurement of engineering performance.</p><h3>6. Why plugins, connectors, and capabilities need to be separate concepts</h3><p>An extensible platform can easily become a collection of integrations held together by special cases.</p><p>One connector knows how to create an issue. Another knows how to start a worker. A plugin adds a button to the interface. A script calls an API directly. An agent has its own private tool configuration.</p><p>This works until the system needs to coordinate those capabilities in a common workflow.</p><p>I want Amaru’s extensibility model to distinguish three related concepts.</p><h3>Connectors: communicate with external systems</h3><p>Connectors provide integration with systems that already own part of the engineering process.</p><p>Examples include:</p><ul><li>GitHub or another source control and collaboration platform.</li><li>Issue trackers and project management systems.</li><li>CI/CD providers.</li><li>Model providers and agent runtimes.</li><li>Artifact storage and observability systems.</li><li>Remote execution infrastructure.</li></ul><p>A connector should translate between Amaru’s domain and the external system’s API, events, and data model. It should not silently make Amaru the source of truth for data that belongs elsewhere.</p><p>For example, GitHub can remain authoritative for pull requests, reviews, and repository state. Amaru can maintain the execution history that explains which workflow prepared a change and which validations were performed.</p><p>The integration connects these responsibilities without forcing one system to replace the other.</p><h3>Plugins: extend the platform</h3><p>Plugins are a broader extension mechanism.</p><p>Depending on the supported contracts, a plugin could contribute user interface elements, integration adapters, new capabilities, or specialized behavior.</p><p>The goal is to avoid making every new integration a permanent change to the platform’s core.</p><p>But extensibility is not an excuse to expose unrestricted access to everything. A plugin that can execute commands, access files, or control a remote machine introduces a security boundary. Its permissions need to be explicit, understandable, and enforceable.</p><p>A plugin architecture is only useful if its contracts remain stable enough for independent extensions to be built and maintained.</p><h3>Capabilities: describe what can actually be done</h3><p>A capability represents an operation the platform can make available to a workflow or agent.</p><p>Examples might include inspecting a repository, executing a test suite, generating an asset, or requesting a deployment.</p><p>The capability should have a defined contract: what inputs it accepts, what outputs it produces, what permissions it requires, and how its execution is represented.</p><p>This creates a useful separation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mh4yA1_JnRt34BcOdlygig.png" /></figure><p>These are architectural intentions, not a claim that every extension contract is already implemented.</p><p>The objective is to make integrations reusable and execution governable without hard-coding the behavior of every agent or tool into the core.</p><h3>Why this matters for agent independence</h3><p>Suppose tomorrow I want to replace one coding agent with another.</p><p>If the entire workflow is built around one agent’s private conventions, that change may require redesigning the process.</p><p>If the workflow depends on explicit capabilities and defined outputs, the platform has a better chance of substituting the execution provider without changing the whole system.</p><p>This does not mean agents are interchangeable in every respect. They differ in tools, context handling, model capabilities, cost, and reliability. The platform must account for those differences.</p><p>The goal is to avoid coupling the entire engineering lifecycle to a single provider.</p><h3>7. Why desktop, self-hosted, and cloud are part of the same design</h3><p>A platform that coordinates engineering work eventually has to answer a practical question: where does the work run?</p><p>The answer cannot always be “on the server.”</p><p>Engineering work frequently depends on local files, proprietary repositories, development tools, operating-system-specific environments, GPUs, licenses, or applications that are difficult to reproduce in a generic cloud runner.</p><p>At the same time, a desktop application is not a sufficient home for workflows that should continue running after the laptop closes.</p><p>This leads to an architectural principle: <strong>the interface, the control plane, and the execution environment should be related, but they should not be the same thing.</strong></p><h3>Desktop is a client, not the platform’s only runtime</h3><p>I want Amaru to have a dedicated desktop experience, alongside a web interface.</p><p>The desktop application should make engineering work accessible from the developer’s daily environment. It can provide a convenient way to inspect projects, follow executions, interact with agents, review artifacts, and manage workflows.</p><p>But the desktop application should not be the only place where authoritative execution state lives.</p><p>If a workflow must continue overnight, survive a desktop restart, or coordinate workers on another machine, its lifecycle cannot depend on a UI process remaining open.</p><p>The desktop client should be able to disconnect and reconnect without becoming the owner of the work it is displaying.</p><h3>Self-hosted and cloud should share the same platform model</h3><p>I do not want separate products with incompatible behavior: one for local users, another for self-hosted installations, and a third for cloud customers.</p><p>The intended direction is a common Amaru Platform that can be operated in different deployment configurations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IJSWsLyV71STEYrrZgePlQ.png" /></figure><p>These are deployment goals, not a statement that every configuration is currently production-ready.</p><p>The important design question is whether they can share the same execution model rather than becoming separate implementations that drift over time.</p><h3>Execution environments: the control plane does not need to do every job</h3><p>Consider a small development setup.</p><p>A compact server could host the Amaru control plane. A Linux workstation could handle ordinary development tasks. A Windows machine or virtual machine could run a tool that requires Windows. A GPU workstation could execute graphics, simulation, or Unreal Engine workloads.</p><p>The platform would coordinate these environments through authenticated workers and explicit execution contracts.</p><p>The control plane would decide what needs to happen and track the execution. The appropriate worker would perform the operation in its own environment and return results.</p><p>This is a particularly important distinction for engineering tasks that depend on real applications rather than just source code.</p><p>A build might need a specific operating system. A game project might need Unreal Engine and GPU access. A graphics task might depend on a local application, licensed software, or large assets. A hardware test might need access to a physical device.</p><p>A generic container cannot always replace these environments.</p><h3>What distributed execution should mean</h3><p>Distributed execution should not simply mean spawning more agents.</p><p>It should mean being able to coordinate work across multiple execution environments while preserving a coherent view of the overall task.</p><p>That requires answering questions such as:</p><ul><li>Which environments are available and compatible with a task?</li><li>Which worker is authorized to execute a given capability?</li><li>How does a worker authenticate to the platform?</li><li>What happens when a worker disconnects?</li><li>How are logs and artifacts associated with the correct execution?</li><li>How are retries handled when the previous attempt may have partially completed?</li><li>Which secrets and credentials are available to the worker?</li><li>How does the platform distinguish a lost worker from a completed operation?</li></ul><p>These are real engineering problems. They are also reasons not to treat distributed execution as a thin layer of remote shell commands.</p><p>The objective is not to make every task distributed. It is to make distribution possible when the work requires it.</p><h3>8. Why I care about game development, graphics, and specialized tools</h3><p>Software engineering is the obvious starting point for an engineering execution platform, but it is not the only environment where this model could be useful.</p><p>Consider a game development pipeline.</p><p>A game project may involve code, level design, asset creation, animation, shaders, builds, automated tests, performance profiling, and visual review. These tasks use different tools and often require different execution environments.</p><p>A coding agent might implement a gameplay mechanic. Another agent might investigate a rendering issue. A worker might run an Unreal Engine build. A separate environment might execute automated gameplay tests or render a sequence for visual inspection.</p><p>The work is related, but the tools and environments are not interchangeable.</p><p>A useful execution system could coordinate these steps, preserve the outputs, and make dependencies explicit.</p><p>For example:</p><ol><li>Implement a prototype mechanic using placeholder geometry.</li><li>Run a build and automated validation.</li><li>Capture evidence from a test scene.</li><li>Review the result.</li><li>Generate or replace the placeholder assets after the mechanic is validated.</li><li>Run the relevant validation again.</li></ol><p>The value is not that Amaru needs to understand every detail of game development. It is that the platform could coordinate the workflow while specialized tools perform the actual work.</p><p>The same reasoning applies to graphics, CAD, simulations, infrastructure, data pipelines, and other environments where meaningful work crosses the boundary between code and specialized software.</p><p>This is why I do not want to define Amaru too narrowly as a coding-agent manager.</p><p>The broader opportunity is to coordinate engineering work wherever that work happens.</p><h3>9. What would the product actually do?</h3><p>Architecture becomes meaningful only when it produces a useful experience.</p><p>For Amaru, I want the product to make it possible to understand and control engineering work without needing to reconstruct the story from terminal windows, chat sessions, CI logs, and scattered artifacts.</p><p>That suggests several connected areas of functionality.</p><h3>Work management and execution</h3><p>The platform should provide a coherent view of projects, work packages, work items, workflows, executions, and tasks.</p><p>A developer should be able to understand what needs to happen, what is currently running, what has failed, what is waiting for approval, and what has actually been completed.</p><p>This does not require replacing GitHub Issues, Jira, or Linear. Those systems can remain the place where work is planned and prioritized. Amaru can coordinate the execution of selected work and connect the results back to those systems.</p><h3>Workflow authoring and reuse</h3><p>Workflows should make recurring engineering processes explicit.</p><p>A workflow could describe a sequence of steps, dependencies, validation requirements, and approval boundaries. Some steps could be deterministic scripts. Others could involve an agent making decisions within a defined scope.</p><p>Reusable workflows would make it possible to improve a process once and apply that improvement to subsequent work.</p><p>The important distinction is between a reusable process and a prompt that happens to be copied from one conversation to another.</p><h3>Agent and provider integration</h3><p>The platform should be able to work with different agent runtimes and model providers through supported integrations.</p><p>That includes accounting for differences in capabilities, configuration, context, cost, and execution requirements.</p><p>The goal is not to abstract away every provider difference. It is to avoid making the entire system dependent on one provider’s lifecycle.</p><h3>Evidence and observability</h3><p>Execution should produce more than a final message.</p><p>Where supported, the platform should retain relevant logs, artifacts, validation results, status transitions, and decisions. These records should help developers understand what happened and diagnose failures.</p><p>A useful interface would show not just that a task failed, but where it failed, which environment was involved, what evidence is available, and what options exist for recovery.</p><h3>Human approvals and permissions</h3><p>Not every action should have the same level of autonomy.</p><p>Reading a repository, editing a local file, modifying a shared branch, and deploying to production carry different risks.</p><p>The platform should make it possible to define permissions and approval boundaries appropriate to the action. Human intervention should be part of the execution model, not an improvised interruption in a chat.</p><h3>A desktop and web experience</h3><p>The desktop client should provide convenient access to the platform and its execution environments. The web client should support access without requiring the user to be at a particular workstation.</p><p>Both should reflect the same underlying work and execution state.</p><p>The intention is to make Amaru useful as an everyday engineering tool, rather than a backend orchestration service that developers must manage entirely through APIs.</p><h3>10. What I would measure: engineering outcomes, not agent activity</h3><p>A system can be very active without being productive.</p><p>It can launch many agents, consume a large number of tokens, execute thousands of tool calls, and generate a considerable volume of logs while making little progress toward an accepted engineering outcome.</p><p>This is one reason I think execution history matters.</p><p>If Amaru records the relationship between work, attempts, validation, and outcomes, it could eventually help answer questions such as:</p><ul><li>How often is work accepted on the first attempt?</li><li>Which stages produce the most rework?</li><li>How often do agents need human intervention?</li><li>Which workflows fail most frequently?</li><li>How much time is spent waiting for an environment or approval?</li><li>Which execution providers work best for a particular kind of task?</li><li>What is the cost of an accepted result, including retries and validation?</li><li>Which changes to a workflow improve the outcome?</li></ul><p>These are goals for future measurement, not metrics I am claiming Amaru already provides.</p><p>The distinction is important because optimizing token consumption alone can lead to the wrong decisions. A cheaper execution that produces an incorrect result may be more expensive once rework is included. A slower workflow that consistently produces verifiable results may be preferable to a faster one that frequently requires manual correction.</p><p>I want to evaluate automation in terms of the work it successfully completes, not just the activity it generates.</p><p>This also creates a possible feedback loop: observe execution, identify recurring failures, suggest workflow improvements, review those suggestions, and then update the process.</p><p>The system should help engineers improve how work is done, not merely increase the volume of work delegated to agents.</p><h3>11. The architecture should stay smaller than the vision</h3><p>There is a danger in a project like this.</p><p>Once you start imagining multiple agents, plugin ecosystems, desktop applications, remote workers, cloud deployments, workflow builders, analytics, and integrations, it becomes easy to build an elaborate platform before proving that the core idea is useful.</p><p>I do not want Amaru to become an exercise in infrastructure for its own sake.</p><p>The architecture needs to support the long-term direction, but the product should grow through concrete, validated workflows.</p><p>The intended technical direction is a Go-based platform for APIs, orchestration, and workers; a React and TypeScript experience for web and desktop; and a desktop host built around Tauri and Rust. Plugins are intended to use explicit contracts, with the platform retaining responsibility for durable state and execution coordination.</p><p>That is a proposed technical foundation, not evidence that every subsystem or deployment mode is already complete.</p><p>A sensible sequence is to establish the core model and execution lifecycle, prove that a local workflow can run and recover reliably, and only then expand into more complex environments and deployment models.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K_ceknrb3QGIj9okaa_Wrw.png" /></figure><p>This sequence is a direction, not a promise of a fixed delivery schedule.</p><p>The principle is to validate the smallest useful execution system before committing to the complexity of a distributed platform.</p><h3>12. The hardest question: why build this instead of simply using what already exists?</h3><p>Because using existing tools and building a platform are not mutually exclusive.</p><p>Amaru should use existing agents, source control systems, CI providers, workflow infrastructure, and execution environments wherever they make sense. It should not recreate a mature product simply to keep everything under one roof.</p><p>But integrating existing tools is not the same as having a coherent system for coordinating the work that flows through them.</p><p>Today, a sufficiently capable engineer can assemble a powerful setup using an agent, a few scripts, GitHub, CI/CD, a workflow engine, and remote machines. That may be the best solution for many people.</p><p>The question is what happens when this arrangement becomes a repeatable part of an engineering organization.</p><p>Who owns the workflow? Where is execution state stored? How are capabilities exposed consistently? How are approvals enforced? How do we preserve evidence across tools? How can another developer inspect or resume the work? How do we move from one agent or environment to another without rebuilding the entire process?</p><p>Some teams already have excellent answers. Others will build their own internal systems. Some will decide that the additional abstraction is not worth the cost.</p><p>Amaru is an attempt to make this layer explicit and reusable.</p><p>I am not assuming that every engineering team needs it. I am exploring whether a dedicated execution platform can make complex, agent-assisted work easier to coordinate and operate than a collection of disconnected mechanisms.</p><p>That is a hypothesis to validate, not a conclusion that the architecture alone can prove.</p><h3>13. What Amaru is not trying to be</h3><p>It is worth being explicit about the boundaries.</p><p>Amaru is not intended to replace:</p><ul><li><strong>AI coding agents.</strong> They remain responsible for reasoning and performing many of the tasks.</li><li><strong>GitHub, Jira, or Linear.</strong> Existing systems can remain authoritative for source control, planning, issues, and collaboration.</li><li><strong>CI/CD systems.</strong> They continue to provide build, test, and deployment infrastructure.</li><li><strong>Specialized development tools.</strong> IDEs, terminals, game engines, graphics applications, and other tools remain essential.</li><li><strong>Human engineering judgment.</strong> Some decisions require context, accountability, or risk acceptance that should not be delegated automatically.</li><li><strong>Scripts and deterministic automation.</strong> These remain the right choice for many operations.</li></ul><p>Instead, Amaru aims to connect these components through a shared model of engineering work and execution.</p><p>This is a narrower proposition than replacing the engineering toolchain. It is also a more demanding one than merely adding another interface for chatting with an agent.</p><p>The platform must earn its place by making coordination, state, recovery, integration, and evidence materially better.</p><p>If it does not, then the extra layer is unnecessary.</p><h3>14. The vision: engineering work, orchestrated</h3><p>The way we build software is changing.</p><p>AI agents can already do useful work, and their capabilities will continue to evolve. More tasks will be delegated. More tools will become accessible through APIs. More specialized environments will become available to automated workers.</p><p>But increasing the capability of individual agents does not automatically solve the coordination problem.</p><p>As work becomes more autonomous, the systems around it need to become better at preserving context, coordinating execution, enforcing boundaries, and verifying results.</p><p>That is the opportunity I see in Amaru.</p><p>I want a developer to be able to define a piece of engineering work, choose or reuse a workflow, let the appropriate agents and tools perform their roles, and inspect a durable record of what happened. I want the same process to work across a local machine, a self-hosted installation, or a cloud-managed platform, with specialized workers where necessary.</p><p>I want integrations to be replaceable, workflows to be reusable, and execution history to outlive individual agent sessions.</p><p>Most importantly, I want autonomy to remain something engineers can direct and govern, rather than something they must either fully trust or avoid.</p><p>There is no guarantee that this needs to become a separate platform. There is no guarantee that Amaru is the right architecture. Existing systems may evolve to cover more of this space, and some of the best solutions may emerge as integrations between tools rather than another product.</p><p>Those are possibilities worth taking seriously.</p><p>But I think the question is worth exploring:</p><p><strong>What would engineering look like if AI agents were not isolated assistants, but replaceable workers in a coherent, observable, and durable execution system?</strong></p><p>That is the question I am trying to answer with Amaru.</p><p>Not by making every tool an agent. Not by forcing every process into a workflow engine. And not by assuming one autonomous assistant should own the entire engineering lifecycle.</p><p>Instead, by building the layer that allows people, agents, tools, workflows, and environments to work together while keeping engineering work understandable and under human direction.</p><p><strong>Engineering work, orchestrated.</strong></p><p>Explore the project: <a href="https://github.com/rluders/amaru">github.com/rluders/amaru</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c0dc7ac1e511" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop Copy-Pasting Service Lifecycle Code in Go]]></title>
            <link>https://medium.com/@rluders/stop-copy-pasting-service-lifecycle-code-in-go-56e619345048?source=rss-8e584f9e09ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/56e619345048</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[golang-tutorial]]></category>
            <dc:creator><![CDATA[Ricardo Lüders]]></dc:creator>
            <pubDate>Wed, 10 Jun 2026 17:50:09 GMT</pubDate>
            <atom:updated>2026-06-10T17:50:09.890Z</atom:updated>
            <content:encoded><![CDATA[<p>Every Go team eventually writes the same code.</p><p>Not business logic.</p><p>Not domain logic.</p><p>Lifecycle code.</p><p>The code that starts services, handles OS signals, propagates cancellation, exposes health checks, and gracefully shuts everything down when it’s time to stop.</p><p>At first, it seems harmless.</p><p>You have an HTTP server, a few routes, and a simple main.go.</p><p>Then the service grows.</p><p>You add a background worker.</p><p>A scheduler.</p><p>A Kafka consumer.</p><p>A metrics endpoint.</p><p>And before long, your application is spending a surprising amount of code managing itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hgpE9zEizAk-3w9z" /><figcaption>Photo by <a href="https://unsplash.com/@adigold1?utm_source=medium&amp;utm_medium=referral">Adi Goldstein</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>The Problem Nobody Talks About</h3><p>Most discussions about Go architecture focus on routers, dependency injection, package structure, or observability.</p><p>But every production service has another concern: lifecycle management.</p><p>Questions start appearing that have nothing to do with the business domain:</p><ul><li>What happens if a worker fails?</li><li>How does that failure propagate?</li><li>When should readiness become unhealthy?</li><li>Which component shuts down first?</li><li>How long should shutdown be allowed to take?</li><li>How do you stop accepting traffic before terminating the process?</li></ul><p>None of these questions are unique to a particular application.</p><p>Yet almost every service ends up solving them independently.</p><h3>The Typical Evolution of a Service</h3><p>A simple HTTP service is easy to manage.</p><p>One server starts.</p><p>One server stops.</p><p>Life is good.</p><p>Then reality arrives.</p><p>Now the application contains:</p><ul><li>An HTTP API</li><li>A background worker</li><li>A periodic cleanup job</li><li>A message consumer</li></ul><p>Suddenly, startup and shutdown become coordination problems.</p><p>If a worker crashes, should the API continue serving traffic?</p><p>If a scheduler panics, should the process keep running?</p><p>If the application is shutting down, when should Kubernetes stop routing requests to it?</p><p>Most teams solve these problems by gradually adding more code to main.go.</p><p>A little signal handling here.</p><p>A cancellation channel there.</p><p>A readiness flag somewhere else.</p><p>Eventually, every service develops its own homemade lifecycle framework.</p><h3>Looking for the Common Pattern</h3><p>After building enough services, I noticed something interesting.</p><p>The HTTP server, worker, scheduler, and consumer all shared the same lifecycle.</p><p>They could start.</p><p>They could stop.</p><p>That’s really all that mattered.</p><p>Once you view them through that lens, a surprisingly small abstraction emerges:</p><pre>type Runner interface {<br>    Name() string<br>    Start(ctx context.Context) error<br>    Stop(ctx context.Context) error<br>}</pre><p>An HTTP server is a Runner.</p><p>A worker is a Runner.</p><p>A scheduler is a Runner.</p><p>Anything that participates in the application’s lifecycle is a Runner.</p><p>The orchestration logic no longer needs to understand implementation details. It only needs to know how to start and stop components.</p><h3>Why Shutdown Is More Important Than Startup</h3><p>Most engineers spend far more time thinking about startup than shutdown.</p><p>Production systems tend to teach the opposite lesson.</p><p>Shutdown is where reliability lives.</p><p>Consider a service that depends on a database.</p><p>If the database connection disappears while requests are still being processed, failures become inevitable.</p><p>A clean shutdown sequence stops consumers before providers. The API stops accepting requests before the dependencies it relies on begin shutting down.</p><p>That sounds obvious, but it’s surprisingly easy to get wrong when lifecycle management is spread across multiple goroutines, channels, and signal handlers.</p><p>Good shutdown behavior is not an implementation detail.</p><p>It’s part of the architecture.</p><h3>Readiness Is a Lifecycle Concern</h3><p>One of the most common mistakes I see is treating readiness as a health check.</p><p>It’s actually a lifecycle signal.</p><p>A process can be alive and still be unable to safely serve traffic.</p><p>Maybe it’s still starting.</p><p>Maybe it’s waiting for dependencies.</p><p>Maybe it’s in the middle of shutting down.</p><p>In all of those situations, the process exists, but it should not receive requests.</p><p>That’s why readiness should be tied directly to the lifecycle of the application.</p><p>When startup completes, the service becomes ready.</p><p>When shutdown begins, it becomes not ready before anything starts stopping.</p><p>That small transition gives load balancers and orchestrators an opportunity to drain traffic gracefully.</p><h3>Failure Should Be Contagious</h3><p>Another lesson that repeatedly surfaced in production systems is that partial failure is often worse than complete failure.</p><p>Imagine a background worker responsible for processing critical messages.</p><p>If that worker dies unexpectedly while the API continues running, is the system actually healthy?</p><p>Technically, the process is alive.</p><p>Operationally, it may already be broken.</p><p>For many applications, the safest behavior is to propagate failure.</p><p>When a critical component fails, the application should begin a coordinated shutdown rather than continue operating in an unknown state.</p><p>This dramatically simplifies reasoning about system behavior.</p><p>The service is either healthy or shutting down.</p><p>There is no ambiguous middle ground.</p><h3>Extracting the Lifecycle Layer</h3><p>After solving the same problem repeatedly across different projects, I decided to extract the lifecycle concerns into a small library called Lane.</p><p>The goal was intentionally narrow.</p><p>Lane is not a framework.</p><p>It doesn’t perform dependency injection.</p><p>It doesn’t manage configuration.</p><p>It doesn’t dictate project structure.</p><p>It simply coordinates the lifecycle of components that implement a common contract.</p><p>Using it looks like this:</p><pre>l := lane.New(log)<br>l.AddRunner(<br>    runners.NewHTTPRunner(&quot;api&quot;, server, log),<br>    runners.NewWorkerRunner(&quot;processor&quot;, process, log),<br>    runners.NewSchedulerRunner(&quot;cleanup&quot;, 5*time.Minute, cleanup, log),<br>)<br>if err := l.Run(context.Background()); err != nil {<br>    log.Error(&quot;application failed&quot;, &quot;error&quot;, err)<br>}</pre><p>Behind that single call, startup, readiness, signal handling, failure propagation, and graceful shutdown are coordinated automatically.</p><p>The service code stays focused on what it was actually built to do.</p><h3>Keep the Abstraction Small</h3><p>One lesson I’ve learned from building Go systems is that infrastructure abstractions are most useful when they remain small.</p><p>The best abstractions remove repetitive complexity without taking ownership away from the application.</p><p>Lane doesn’t know anything about your database.</p><p>It doesn’t know anything about your configuration.</p><p>It doesn’t know anything about your architecture.</p><p>It only knows that applications are made of components with a lifecycle.</p><p>And that turns out to be enough.</p><p>Sometimes the most valuable library isn’t the one that adds capabilities.</p><p>It’s the one that removes 200 lines of code you’ve been rewriting in every service for years.</p><p><strong>The repository:<br></strong>👉 <a href="https://github.com/rluders/lane">https://github.com/rluders/lane</a></p><p>If you’ve ever copied signal handling, readiness checks, or graceful shutdown code from one service to another, take a look at Lane. The library is small by design, but more importantly, it embodies a pattern that has simplified every Go service I’ve built in recent years.</p><p>I’d also be interested to hear how others approach this problem. Lifecycle management is one of those concerns every production service has, yet it’s rarely discussed as an architectural building block. Share your thoughts, challenge the approach, or tell me what I’m missing.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=56e619345048" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Still Deploy Microservices. I Just Stopped Designing Around Them.]]></title>
            <link>https://medium.com/@rluders/i-still-deploy-microservices-i-just-stopped-designing-around-them-482e1447974a?source=rss-8e584f9e09ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/482e1447974a</guid>
            <category><![CDATA[discovery]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[microservices]]></category>
            <dc:creator><![CDATA[Ricardo Lüders]]></dc:creator>
            <pubDate>Tue, 02 Jun 2026 00:43:47 GMT</pubDate>
            <atom:updated>2026-06-02T00:43:47.382Z</atom:updated>
            <content:encoded><![CDATA[<p>For most of my career, I thought architecture was primarily a problem of decomposition.</p><p>The challenge was always the same: take a growing system and break it into smaller pieces. If the monolith became difficult to maintain, split it. If a service became too large, split it again. If a team became a bottleneck, introduce another bounded context and assign ownership elsewhere.</p><p>Like many engineers, I spent years refining my understanding of service boundaries, domain-driven design, event-driven systems, and independent deployments. These ideas solved real problems. They still do.</p><p>What I failed to notice, however, was that as systems grew, the services themselves gradually became less important than the capabilities they provided.</p><p>At first, that distinction seemed almost philosophical.</p><p>Eventually, I realized it was architectural.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bHu9-KGdUbUqXRHR" /><figcaption>Photo by <a href="https://unsplash.com/@coltonsturgeon?utm_source=medium&amp;utm_medium=referral">Colton Sturgeon</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>The Question I Couldn’t Answer</h3><p>The realization didn’t arrive during a production incident. No database failed. No Kubernetes cluster melted down. There was no dramatic postmortem that forced everyone back into a conference room.</p><p>Instead, it emerged through a series of small observations that only became meaningful when viewed together.</p><p>One of them started with a surprisingly simple question.</p><p>Someone asked:</p><blockquote><em>Who owns this permission?</em></blockquote><p>The permission was called:</p><pre>course.publish</pre><p>At first glance, it seemed like a trivial question. The permission existed in the authorization layer. The frontend used it to determine which actions should be visible. The Course Service enforced it before allowing content to be published. Documentation referenced it. Tests depended on it.</p><p>The permission was clearly important.</p><p>The strange thing was that nobody could confidently answer who owned it.</p><p>Everyone depended on it.</p><p>Nobody seemed responsible for it.</p><p>At first, I dismissed this as an organizational issue. Maybe ownership had become blurry over time. Maybe documentation had fallen behind. But the more I looked, the more I realized this wasn’t an isolated case.</p><p>It was a symptom of something deeper.</p><h3>The Assessments Problem</h3><p>Around the same time, our platform was growing rapidly.</p><p>Every few months, a new capability would emerge. Sometimes it was a relatively small feature. Other times it represented an entirely new domain within the business.</p><p>The pattern was always the same.</p><p>Imagine the product team decides to introduce Assessments. Instructors should be able to create quizzes. Students should be able to complete them. Results should be automatically graded.</p><p>The architectural conversation starts almost immediately.</p><blockquote><em>We need an Assessments Service.</em></blockquote><p>So we build one.</p><p>It gets its own repository. Its own database. Its own deployment pipeline. Its own APIs.</p><p>Something like:</p><pre>POST /assessments<br>GET /assessments/{id}<br>POST /assessments/{id}/publish</pre><p>If you stop there, the architecture appears complete.</p><p>The service exists.</p><p>The APIs work.</p><p>The database schema is deployed.</p><p>Everything looks exactly like a modern microservice architecture is supposed to look.</p><p>Except anyone who has worked on a growing platform knows that’s not where the work ends.</p><p>Because the platform itself still has no idea that Assessments exists.</p><p>Permissions need to be added:</p><pre>{<br>  &quot;permissions&quot;: [<br>    &quot;assessment.read&quot;,<br>    &quot;assessment.create&quot;,<br>    &quot;assessment.publish&quot;<br>  ]<br>}</pre><p>The frontend navigation needs updating:</p><pre>{<br>  &quot;menu&quot;: [<br>    {<br>      &quot;label&quot;: &quot;Assessments&quot;,<br>      &quot;path&quot;: &quot;/assessments&quot;<br>    }<br>  ]<br>}</pre><p>Analytics systems need new event definitions.</p><p>Dashboards require new metrics.</p><p>Feature flags need configuration.</p><p>Audit logs need new event types.</p><p>Documentation has to be updated.</p><p>Operational tooling needs awareness of an entirely new domain.</p><p>By the time the first student completes a quiz, a surprising amount of effort has gone into teaching the rest of the platform that assessments exist at all.</p><p>And after seeing this pattern enough times, I found myself asking a different question.</p><p>Why is all of this information scattered across the system?</p><p>Why doesn’t the capability own it?</p><h3>What Microservices Solved — And What They Didn’t</h3><p>To be clear, I am not arguing against microservices.</p><p>Microservices solved real problems.</p><p>They gave us independent deployments.</p><p>Independent scaling.</p><p>Clearer ownership.</p><p>Fault isolation.</p><p>Technology flexibility.</p><p>Those benefits are real and significant.</p><p>But over time I started noticing that microservices solved deployment coupling much better than they solved capability coupling.</p><p>Our systems had become extremely good at infrastructure discovery.</p><p>We knew where services lived.</p><p>We knew how to deploy them.</p><p>We knew how to scale them.</p><p>We knew how to monitor them.</p><p>If I wanted to know where the Course Service was running, I could find the answer in seconds.</p><p>If I wanted to know:</p><ul><li>Which capability owned a permission</li><li>Which capability published an event</li><li>Which capability owned a screen in the frontend</li><li>Which capability introduced a menu entry</li><li>Which capability depended on another capability</li></ul><p>the answer was often spread across repositories, dashboards, configuration files, documentation, and tribal knowledge.</p><p>The platform understood infrastructure remarkably well.</p><p>It understood capabilities surprisingly poorly.</p><p>And that felt backwards.</p><p>Because users do not care about services.</p><p>The business does not care about services.</p><p>Product managers do not care about services.</p><p>They care about courses.</p><p>Assessments.</p><p>Certificates.</p><p>Billing.</p><p>Identity.</p><p>Capabilities.</p><p>Only architects spend their days thinking about deployment units.</p><h3>The Pattern Hiding in Plain Sight</h3><p>Once I started looking for solutions, I began noticing the same pattern everywhere.</p><p>Not in microservice frameworks.</p><p>In ecosystems.</p><p>Consider how VS Code extensions work.</p><p>An extension doesn’t require developers to manually modify the editor every time it is installed. The extension arrives carrying information about itself. It declares commands, menus, views, settings, and capabilities.</p><p>The platform discovers it.</p><p>The same thing happens in IntelliJ plugins.</p><p>The same thing happens in Shopify apps.</p><p>The same thing happens in Atlassian Marketplace applications.</p><p>The same thing happens in Salesforce.</p><p>Perhaps most surprisingly, the same thing happens in Kubernetes.</p><p>Kubernetes is often described as a container orchestrator, but one of the reasons it became so successful is that it behaves more like a platform kernel than a deployment tool. New capabilities enter the ecosystem through metadata. Controllers discover resources. Operators extend behavior. Everything revolves around contracts and discoverability.</p><p>The more examples I studied, the more I realized they were all solving variations of the same problem.</p><p>How does a new capability enter an ecosystem?</p><p>Traditional microservice architectures answer a different question:</p><p>How do I deploy a new service?</p><p>Those questions sound similar.</p><p>They are not.</p><p>Deploying a service is an infrastructure concern.</p><p>Introducing a capability is a platform concern.</p><h3>Before and After</h3><p>The easiest way to explain what changed is to compare how we used to add functionality with how we add it now.</p><p>Originally, introducing a new capability looked something like this:</p><pre>Create assessment-service<br><br>Create APIs<br>Create database<br>Create migrations<br><br>Update authorization service<br><br>Register permissions<br><br>Update frontend<br>Add routes<br>Add sidebar menu<br><br>Update analytics<br><br>Register events<br><br>Update dashboards<br>Update documentation<br>Update onboarding<br>Update feature flags</pre><p>Nothing on this list is particularly difficult.</p><p>The problem is that every new capability requires touching half a dozen unrelated systems.</p><p>The platform has no understanding of the capability itself.</p><p>Every integration point must be updated manually.</p><p>Today, we start from a different place.</p><p>Instead of introducing a service and then teaching the platform about it, we introduce a module that describes itself.</p><p>Something like:</p><pre>name: assessments<br>version: 1.0.0<br>provides:<br>  - assessments<br>permissions:<br>  - assessment.read<br>  - assessment.create<br>  - assessment.publish<br>events:<br>  publishes:<br>    - assessment.created<br>    - assessment.completed<br>frontend:<br>  menu:<br>    - label: Assessments<br>      route: /assessments</pre><p>This is not simply configuration.</p><p>It is a declaration of identity.</p><p>The module is saying:</p><ul><li>This is who I am.</li><li>This is what I provide.</li><li>These are my permissions.</li><li>These are my events.</li><li>These are my UI contributions.</li></ul><p>The responsibility shifts.</p><p>The platform becomes responsible for discovery.</p><p>The capability becomes responsible for description.</p><h3>A Platform Built Around Capabilities</h3><p>One misconception I frequently encounter is that this approach replaces microservices.</p><p>It doesn’t.</p><p>The services are still there.</p><p>The containers are still there.</p><p>The databases are still there.</p><p>Kubernetes is still there.</p><p>Operationally, very little changes.</p><p>The difference is that services stop being the primary architectural abstraction.</p><p>Capabilities become the primary abstraction.</p><p>A capability can still be implemented by multiple services:</p><pre>Assessments Module<br>├── assessment-api<br>├── assessment-worker<br>├── assessment-scheduler<br>└── assessment-indexer</pre><p>Multiple deployment units.</p><p>One capability.</p><p>The architecture stops asking:</p><blockquote><em>Where is the Assessment Service?</em></blockquote><p>And starts asking:</p><blockquote><em>Who provides Assessments?</em></blockquote><p>That shift sounds subtle.</p><p>In practice, it changes how ownership, discoverability, permissions, events, and user interfaces evolve across the platform.</p><h3>The Frontend Surprise</h3><p>One of the most unexpected benefits appeared on the frontend.</p><p>Many organizations split their backend into dozens of microservices and then accidentally rebuild a monolith in the browser.</p><p>The backend becomes distributed.</p><p>The frontend becomes the place where everything reconnects.</p><p>Menus become hardcoded.</p><p>Routes become hardcoded.</p><p>Permissions become hardcoded.</p><p>The coupling simply moves.</p><p>In a capability-driven platform, the frontend becomes more like a shell.</p><p>Instead of defining every menu centrally:</p><pre>const menu = [<br>  { label: &quot;Courses&quot; },<br>  { label: &quot;Certificates&quot; },<br>  { label: &quot;Assessments&quot; }<br>];</pre><p>the shell asks the platform:</p><pre>registry.getExtensions(&quot;sidebar&quot;);</pre><p>which returns:</p><pre>[<br>  {<br>    &quot;module&quot;: &quot;courses&quot;,<br>    &quot;label&quot;: &quot;Courses&quot;<br>  },<br>  {<br>    &quot;module&quot;: &quot;assessments&quot;,<br>    &quot;label&quot;: &quot;Assessments&quot;<br>  }<br>]</pre><p>The shell provides extension points.</p><p>Capabilities provide functionality.</p><p>The relationship begins to resemble an operating system more than a traditional web application.</p><h3>Is This Actually New?</h3><p>Not really.</p><p>And that’s precisely why I find it interesting.</p><p>I am not claiming to have invented a revolutionary architecture.</p><p>If anything, I arrived late to a conversation that has been happening for decades.</p><p>People familiar with OSGi will recognize parts of this.</p><p>People familiar with Eclipse plugins will recognize parts of this.</p><p>People working with Kubernetes Operators will recognize parts of this.</p><p>People building Salesforce or Shopify ecosystems will recognize parts of this.</p><p>The idea itself is not new.</p><p>What I find interesting is applying these principles consistently to modern cloud-native business platforms.</p><p>Most systems eventually accumulate:</p><ul><li>Service discovery</li><li>Permission catalogs</li><li>Event registries</li><li>UI extension points</li><li>Metadata systems</li><li>Developer portals</li></ul><p>The question is not whether these concepts will appear.</p><p>The question is whether they emerge accidentally over years of growth or whether they are designed intentionally from the beginning.</p><h3>The Tradeoffs</h3><p>This approach is not free.</p><p>It introduces complexity.</p><p>You need a registry.</p><p>You need metadata.</p><p>You need contracts.</p><p>You need governance.</p><p>You need discovery mechanisms.</p><p>A startup with three services probably does not need any of this.</p><p>In many situations, a straightforward microservice architecture is absolutely the right choice.</p><p>The goal is not to eliminate complexity.</p><p>The goal is to move complexity into structures that scale with the ecosystem.</p><p>Because complexity does not disappear.</p><p>It accumulates.</p><p>The only real choice is where it accumulates.</p><h3>What Changed For Me</h3><p>Interestingly, very little changed operationally.</p><p>I still deploy containers.</p><p>I still run Kubernetes.</p><p>I still maintain independent services.</p><p>I still have separate databases.</p><p>Nothing changed at the infrastructure layer.</p><p>What changed was the abstraction layer above it.</p><p>I stopped treating deployment units as the center of the architecture.</p><p>I started treating capabilities as the center of the architecture.</p><p>Because after years of building distributed systems, I came to a conclusion that now feels obvious.</p><p>Organizations evolve through capabilities.</p><p>Products evolve through capabilities.</p><p>Users experience capabilities.</p><p>Services merely implement them.</p><p>And if architecture exists to support the evolution of a product, perhaps the most important thing in the system should not be the deployment unit.</p><p>Perhaps it should be the capability itself.</p><p>I still deploy microservices.</p><p>I just stopped designing around them.</p><p>Microservices taught us how to decompose systems.</p><p>I’m not yet convinced they’ve taught us how to grow ecosystems.</p><p>That’s the problem I’m currently exploring.</p><p>If you’ve built platforms at scale, I’d love to hear where you agree, where you disagree, and which patterns you’ve seen emerge over time.</p><p>Because the more systems I study, the more I suspect that the most interesting architectural decisions happen one layer above the services themselves.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=482e1447974a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Shared Library Trap: How Microservices Quietly Rebuild the Monolith]]></title>
            <link>https://medium.com/@rluders/the-shared-library-trap-how-microservices-quietly-rebuild-the-monolith-2bcf314b82c6?source=rss-8e584f9e09ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/2bcf314b82c6</guid>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[monolithic-architecture]]></category>
            <category><![CDATA[modular-architecture]]></category>
            <category><![CDATA[microservices]]></category>
            <dc:creator><![CDATA[Ricardo Lüders]]></dc:creator>
            <pubDate>Thu, 28 May 2026 21:01:59 GMT</pubDate>
            <atom:updated>2026-05-28T21:01:59.426Z</atom:updated>
            <content:encoded><![CDATA[<p>Somewhere right now, a developer is staring at two suspiciously similar functions in different repositories and saying:</p><blockquote><em>“This violates DRY.”</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HjcTAOKmkvThCZpF" /><figcaption>Photo by <a href="https://unsplash.com/@imlst?utm_source=medium&amp;utm_medium=referral">Valery Fedotov</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>And so begins the ritual.</p><p>A new repository appears:shared-common-platform-core-utils</p><p>Three months later, nobody knows who owns it, every service depends on v2.14.7-hotfix-final-v2, and changing one helper function requires a migration plan, cross-team coordination, and a Slack thread long enough to qualify as historical literature.</p><p>Your microservices architecture has quietly become a distributed hostage situation.</p><h3>The Misunderstood Goal of Microservices</h3><p>Many teams adopt microservices believing the architecture is primarily about:</p><ul><li>smaller repositories</li><li>independent deployments</li><li>isolated infrastructure</li><li>cleaner abstractions</li></ul><p>But those are implementation details.</p><p>The real goal is independent change.</p><p>Martin Fowler warned about this years ago:</p><blockquote><em>“The commonest mistake with microservices is to split too finely.”</em></blockquote><p>Yet many organizations hear “microservices” and immediately split repositories, APIs, and deployments while centralizing decision-making into shared abstractions and platform dependencies.</p><p>The result is not autonomy.</p><p>It is distributed dependency management.</p><p>Inside a monolith, duplication is often a design smell. Repeated logic usually signals poor boundaries or missing abstractions.</p><p>But microservices are not a single application.</p><p>That distinction changes everything.</p><p>In distributed systems, the larger problem is usually not duplication.</p><p>It is coupling.</p><p>And sometimes a little duplication is exactly what buys you freedom.</p><p>Sandi Metz captured this perfectly:</p><blockquote><em>“It is cheaper to manage temporary duplication than to recover from the wrong abstraction.”</em></blockquote><p>That sentence has probably prevented more architectural damage than entire enterprise review boards.</p><h3>The Email Validation Problem</h3><p>Imagine two services:</p><ul><li>billing-service</li><li>notification-service</li></ul><p>Both validate email addresses.</p><p>A developer notices the duplicated regex and extracts a shared package: github.com/company/platform-utils/email</p><p>Everyone feels responsible and efficient.</p><p>Six months later:</p><ul><li>billing requires stricter validation</li><li>notifications must support legacy addresses</li><li>marketing imports the library for CSV ingestion</li><li>normalization behavior gets added</li><li>another service starts failing because “technically invalid” emails are now rejected</li></ul><p><strong>Congratulations! You saved twelve duplicated lines and introduced organizational coupling.</strong></p><p>This is the part many teams miss:</p><p>In a microservice architecture, duplication can actually be healthy.</p><p>Those repeated lines of code often mean teams can:</p><ul><li>deploy independently</li><li>evolve independently</li><li>make domain-specific decisions</li><li>avoid synchronized release cycles</li></ul><p>The goal of microservices is not aesthetic purity.</p><p>The goal is reducing coordination cost.</p><p>Sam Newman emphasizes this repeatedly in <em>Building Microservices</em>: team autonomy is the point of the architecture. Elegant coupling is still coupling.</p><h3>The Difference Between Shared Mechanics and Shared Decisions</h3><p>To be clear, shared libraries are not inherently bad.</p><p>Some things absolutely should be shared.</p><p>Infrastructure mechanisms benefit from consistency:</p><ul><li>logging</li><li>tracing</li><li>metrics</li><li>retry behavior</li><li>authentication primitives</li><li>HTTP clients</li><li>protobuf generators</li><li>observability tooling</li></ul><p>These standardize mechanics rather than business decisions.</p><p>The problems begin when teams start sharing domain behavior.</p><p>Business rules rarely stay universal for long.</p><p>Pricing logic, customer validation, workflow orchestration, and domain models evolve differently across contexts because the services themselves exist for different reasons.</p><p>What begins as a “clean abstraction” slowly accumulates:</p><ul><li>optional fields</li><li>compatibility hacks</li><li>feature flags</li><li>migration layers</li><li>edge-case behavior</li></ul><p>Eventually nobody fully understands the abstraction anymore, yet every service depends on it.</p><p>This is especially visible with shared DTOs.</p><p>A team creates:</p><pre>type Customer struct {<br>    ID    string<br>    Name  string<br>    Email string<br>}</pre><p>Another service imports it.</p><p>Then another.</p><p>Soon:</p><ul><li>one service needs Phone</li><li>another wants Locale</li><li>another renames Name</li><li>another cannot migrate because of legacy integrations</li></ul><p>Your services are now independently deployed but operationally synchronized.</p><p>You have achieved distributed monolith enlightenment.</p><h3>Bounded Contexts Matter More Than DRY</h3><p>This is fundamentally a bounded context problem.</p><p>A customer in billing is not necessarily the same concept as a customer in marketing, analytics, fraud detection, or support.</p><p>The fields may overlap.</p><p>The business meaning often does not.</p><p>When teams force multiple domains to share the same abstraction simply because the data “looks similar,” they unintentionally create coupling between unrelated evolutionary paths.</p><p>The issue is not reuse itself.</p><p>The issue is assuming different domains will evolve identically.</p><p>They rarely do.</p><p>Strategic duplication across bounded contexts is often cheaper than forcing a shared abstraction across domains with different requirements, timelines, and incentives.</p><h3>The Hidden Cost: Temporal Coupling</h3><p>The most dangerous coupling is rarely compile-time coupling.</p><p>It is temporal coupling.</p><p>If Service A cannot evolve until:</p><ul><li>Service B approves a change</li><li>a shared library publishes a new version</li><li>migrations are coordinated</li><li>compatibility reviews are completed</li><li>another team returns from PTO</li></ul><p>then the system is coupled regardless of how many Kubernetes clusters appear in the architecture diagram.</p><p>Microservices are supposed to reduce coordination costs.</p><p>Shared business abstractions often increase them dramatically.</p><p>Conway’s Law explains why this happens:</p><blockquote><em>“Organizations which design systems … are constrained to produce designs which are copies of the communication structures of these organizations.”</em></blockquote><p>If teams cannot operate independently, services will not operate independently either.</p><p>Shared abstractions create organizational gravity.</p><p>Every reusable “core library” introduces:</p><ul><li>ownership ambiguity</li><li>upgrade coordination</li><li>release dependencies</li><li>compatibility negotiations</li><li>cross-team synchronization</li></ul><p>The architecture diagram still says “microservices.”</p><p>Reality says:</p><blockquote><em>“Please wait until Platform Team approves the migration.”</em></blockquote><h3>Duplication Has Costs Too</h3><p>None of this means duplication is free.</p><p>Uncontrolled duplication can create:</p><ul><li>inconsistent security behavior</li><li>divergent validation rules</li><li>repeated bugs</li><li>fragmented operational practices</li><li>onboarding complexity</li></ul><p>The goal is not “copy-paste everything.”</p><p>The goal is understanding where shared evolution is genuinely desirable.</p><p>That distinction matters.</p><p>Some duplication is accidental and should be eliminated.</p><p>Some duplication is strategic and protects autonomy.</p><p>The skill is learning the difference.</p><h3>What Should Be Shared?</h3><p>As a general rule:</p><h4>Good candidates for sharing</h4><ul><li>infrastructure primitives</li><li>transport protocols</li><li>observability tooling</li><li>authentication mechanisms</li><li>retry libraries</li><li>serialization contracts</li><li>platform tooling</li></ul><p>These create consistency without centralizing domain decisions.</p><h4>Dangerous candidates for sharing</h4><ul><li>business rules</li><li>domain models</li><li>validation semantics</li><li>workflows</li><li>orchestration logic</li><li>cross-domain DTOs</li><li>pricing logic</li><li>customer behavior models</li></ul><p>These tend to evolve differently across contexts and become coordination bottlenecks over time.</p><h3>Complexity Is the Real Enemy</h3><p>John Ousterhout argues in <em>A Philosophy of Software Design</em> that complexity is the primary enemy of maintainability.</p><p>And complexity in distributed systems rarely comes from a few duplicated lines of code.</p><p>It usually comes from:</p><ul><li>dependency graphs</li><li>hidden assumptions</li><li>synchronized releases</li><li>unclear ownership</li><li>cross-team coordination</li></ul><p>Duplication is visible.</p><p>Coupling spreads silently.</p><p>One is usually local and manageable.</p><p>The other becomes architecture archaeology.</p><h3>The Real Question</h3><p>Microservices were supposed to help teams move independently.</p><p>Yet many organizations quietly rebuild monolith coupling through:</p><ul><li>shared DTOs</li><li>shared business libraries</li><li>shared workflows</li><li>shared release cycles</li><li>centralized abstractions</li><li>platform dependency chains</li></ul><p>All while congratulating themselves on having “decoupled services.”</p><p>So the next time someone says:</p><blockquote><em>“We should abstract this into a common package.”</em></blockquote><p>Ask one question first:</p><blockquote><em>Are we removing duplication — <br>or merely distributing the monolith?</em></blockquote><p>This article is a follow up from my previous: <a href="https://medium.com/@rluders/the-utils-black-hole-how-to-keep-your-go-code-from-spiraling-into-chaos-4d1151f60ffc">The </a><a href="https://medium.com/@rluders/the-utils-black-hole-how-to-keep-your-go-code-from-spiraling-into-chaos-4d1151f60ffc">utils Black Hole: How to Keep Your Go Code from Spiraling Into Chaos</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2bcf314b82c6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Got Tired of Rebuilding Authorization From Scratch, So I Built Canery (Tips)]]></title>
            <link>https://medium.com/@rluders/got-tired-of-rebuilding-authorization-from-scratch-so-i-built-canery-tips-6a7d81dd2adf?source=rss-8e584f9e09ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a7d81dd2adf</guid>
            <category><![CDATA[go]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[authorization]]></category>
            <category><![CDATA[golang]]></category>
            <dc:creator><![CDATA[Ricardo Lüders]]></dc:creator>
            <pubDate>Sun, 12 Apr 2026 01:53:25 GMT</pubDate>
            <atom:updated>2026-04-12T01:57:36.572Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kwCeNpvyn0uRIZMS.png" /></figure><p>In the <a href="https://medium.com/@rluders/got-tired-of-rebuilding-authorization-from-scratch-so-i-built-canery-b3de0d867144">previous article</a>, I tell you about <a href="https://github.com/rluders/canery">Canery</a> the authorization library that I created. However, I forgot to told you that it is just an very simple library, and yes, using it directly everywhere, it <em>will</em> feel verbose:</p><pre>ok, err := authorizer.<br>    For(canery.Actor(&quot;user&quot;, userID)).<br>    Can(canery.Action(&quot;delete&quot;)).<br>    Target(canery.Resource(&quot;document&quot;, documentID)).<br>    In(canery.Scope(&quot;project&quot;, projectID)).<br>    Check(ctx)</pre><p>Do that across your codebase and it gets ugly fast.</p><p>The fix is simple: <strong>don’t expose Canery to your application</strong>.</p><p>Wrap it.</p><h3>Step 1: Create an authorization layer</h3><pre>type AuthorizationService struct {<br>    auth canery.Authorizer<br>}</pre><h3>Step 2: Move checks into domain methods</h3><pre>func (a *AuthorizationService) CanDeleteDocument(<br>    ctx context.Context,<br>    userID, projectID, documentID string,<br>) (bool, error) {<br>    return a.auth.Check(ctx, canery.Request{<br>        Subject:  canery.Actor(&quot;user&quot;, userID),<br>        Action:   canery.Action(&quot;delete&quot;),<br>        Resource: canery.Resource(&quot;document&quot;, documentID),<br>        Scope:    canery.Scope(&quot;project&quot;, projectID),<br>    })<br>}</pre><h3>Step 3: Use it everywhere else</h3><pre>ok, err := authz.CanDeleteDocument(ctx, user.ID, doc.ProjectID, doc.ID)<br>if err != nil {<br>    return err<br>}<br>if !ok {<br>    return ErrForbidden<br>}</pre><p>That’s it.</p><h3>Why this is better than boolean checks</h3><p>Instead of this:</p><pre>if !isProjectMember(user.ID, project.ID) {<br>    return ErrForbidden<br>}<br><br>if !hasPermission(user.ID, &quot;delete_document&quot;) {<br>    return ErrForbidden<br>}</pre><p>You get:</p><pre>ok, _ := authz.CanDeleteDocument(...)</pre><p>Cleaner, centralized, and consistent.</p><h3>Optional: make it even nicer</h3><pre>package projectauthz<br><br>const DeleteDocument = canery.Action(&quot;delete&quot;)<br>func User(id string) canery.Subject {<br>    return canery.Actor(&quot;user&quot;, id)<br>}<br>func Document(id string) canery.ResourceRef {<br>    return canery.Resource(&quot;document&quot;, id)<br>}<br>func Project(id string) canery.ScopeRef {<br>    return canery.Scope(&quot;project&quot;, id)<br>}</pre><p>Now inside your service:</p><pre>a.auth.<br>    For(projectauthz.User(userID)).<br>    Can(projectauthz.DeleteDocument).<br>    Target(projectauthz.Document(documentID)).<br>    In(projectauthz.Project(projectID)).<br>    Check(ctx)</pre><h3>The point</h3><p>Canery is not your app’s API. It’s your <strong>authorization engine</strong>.</p><p>Your app should speak in business terms:</p><pre>authz.CanDeleteDocument(...)<br>authz.CanInviteMember(...)<br>authz.CanEditProject(...)</pre><p>That’s how you get clean code <em>and</em> a real authorization model.</p><p>Hope it helps you to use Canery in your projects and make your code way more clean and explicit.</p><p>Also, let me know if are using the library, and how you are using it in your projects. I would love to see how people are using it and the solutions created around it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a7d81dd2adf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Got Tired of Rebuilding Authorization From Scratch, So I Built Canery]]></title>
            <link>https://medium.com/@rluders/got-tired-of-rebuilding-authorization-from-scratch-so-i-built-canery-b3de0d867144?source=rss-8e584f9e09ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/b3de0d867144</guid>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[authorization]]></category>
            <category><![CDATA[go]]></category>
            <dc:creator><![CDATA[Ricardo Lüders]]></dc:creator>
            <pubDate>Fri, 10 Apr 2026 13:22:22 GMT</pubDate>
            <atom:updated>2026-04-12T01:55:04.200Z</atom:updated>
            <content:encoded><![CDATA[<p>Authorization is one of those problems that looks simple — until you actually try to make it reusable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pWJVzbQP9FexMSfE5seXoQ.png" /></figure><p>At the beginning, it’s just a question: “Can this user delete this document?”</p><p>And for a while, that’s easy to answer. But then reality shows up.</p><p>You need to know if the user belongs to the project. Whether the document actually lives inside that project. Whether permissions are direct or inherited through groups. And suddenly, what used to be a simple check is now spread across handlers, services, repositories, and random helper functions.</p><p>I’ve rebuilt this logic more times than I’d like to admit. Every time slightly different. Every time slightly worse.</p><p>That’s what led me to build <a href="https://github.com/rluders/canery">Canery</a>.</p><h3>The Problem Isn’t Complexity — It’s Lack of Shape</h3><p>The real issue with authorization isn’t that it’s complex. It’s that it usually has no consistent structure.</p><p>Most codebases evolve into something like this:</p><pre>if document.ProjectID != projectID {<br>    return false<br>}<br><br>if user.ID == document.OwnerID {<br>    return true<br>}<br><br>if isProjectAdmin(user.ID, projectID) {<br>    return true<br>}</pre><p>It works… until it doesn’t.</p><p>As your system grows, this logic spreads everywhere. It becomes tightly coupled to your domain, hard to test, and nearly impossible to reuse.</p><p>There’s no center. Just conditionals.</p><h3>The Core Idea Behind Canery</h3><p>Instead of trying to model the domain, Canery does something much simpler:</p><p>It models the <strong>question</strong>.</p><p>Every authorization check is reduced to four parts:</p><ul><li>Who is acting (subject)</li><li>What they want to do (action)</li><li>What they are acting on (resource)</li><li>Where it happens (scope)</li></ul><p>That’s it.</p><p>Here’s what that looks like in practice:</p><pre>ok, err := authorizer.Check(ctx, canery.Request{<br>    Subject:  canery.Actor(&quot;user&quot;, userID),<br>    Action:   canery.Action(&quot;delete&quot;),<br>    Resource: canery.Resource(&quot;document&quot;, documentID),<br>    Scope:    canery.Scope(&quot;project&quot;, projectID),<br>})</pre><p>No domain assumptions. No magic. Just a clear, explicit request.</p><h3>Making It Read Like the Question You’re Asking</h3><p>If you prefer something more expressive, there’s also a fluent API:</p><pre>ok, err := authorizer.<br>    For(canery.Actor(&quot;user&quot;, userID)).<br>    Can(canery.Action(&quot;delete&quot;)).<br>    Target(canery.Resource(&quot;document&quot;, documentID)).<br>    In(canery.Scope(&quot;project&quot;, projectID)).<br>    Check(ctx)</pre><p>Under the hood, it’s the same thing.</p><p>The goal isn’t abstraction — it’s readability.</p><h3>Getting More Than Just True or False</h3><p>In real systems, a boolean is rarely enough.</p><p>You usually want to know <em>why</em> something was allowed or denied.</p><pre>decision, err := authorizer.CheckDecision(ctx, canery.Request{<br>    Subject:  canery.Actor(&quot;user&quot;, userID),<br>    Action:   canery.Action(&quot;delete&quot;),<br>    Resource: canery.Resource(&quot;document&quot;, documentID),<br>    Scope:    canery.Scope(&quot;project&quot;, projectID),<br>})<br><br>if decision.Allowed {<br>    fmt.Println(decision.Source) // &quot;direct&quot; or &quot;group&quot;<br>} else {<br>    fmt.Println(decision.Reason) // &quot;no matching permission&quot;<br>}</pre><p>This becomes extremely useful when debugging or building user-facing feedback.</p><h3>Debugging the Evaluation Flow</h3><p>When things get more complex, you can inspect how the decision was made:</p><pre>decision, trace, err := authorizer.CheckTrace(ctx, request)<br><br>for _, step := range trace.Steps {<br>    fmt.Println(step.Name, step.Result)<br>}</pre><p>No forced logging. No hidden behavior.</p><p>You decide what to do with that information.</p><h3>Checking Multiple Permissions at Once</h3><p>A very common scenario in APIs and UIs:</p><p>“Can this user view, update, or delete this resource?”</p><p>Instead of issuing multiple checks:</p><pre>result, err := authorizer.<br>    For(canery.Actor(&quot;user&quot;, userID)).<br>    CanMany(<br>        canery.Action(&quot;view&quot;),<br>        canery.Action(&quot;update&quot;),<br>        canery.Action(&quot;delete&quot;),<br>    ).<br>    Target(canery.Resource(&quot;document&quot;, documentID)).<br>    In(canery.Scope(&quot;project&quot;, projectID)).<br>    Check(ctx)<br><br>canUpdate, _ := result.Allowed(canery.Action(&quot;update&quot;))</pre><p>This is especially useful for building permission-aware UIs.</p><h3>The Architecture That Makes It Work</h3><p>The key design decision is simple:</p><p><strong>The core doesn’t know your domain.</strong></p><p>Instead, it depends on interfaces like:</p><ul><li>MembershipReader</li><li>GroupReader</li><li>PermissionReader</li><li>ResourceScopeResolver</li></ul><p>That’s where your application plugs in.</p><p>So instead of forcing your system into a predefined model, Canery adapts to <em>your</em> data model.</p><p>A common pattern is to build a thin adapter layer:</p><pre>package projectauthz<br><br>import &quot;github.com/rluders/canery&quot;<br><br>const EditDocument = canery.Action(&quot;edit&quot;)<br><br>func User(id string) canery.Subject {<br>    return canery.Actor(&quot;user&quot;, id)<br>}<br><br>func Project(id string) canery.ScopeRef {<br>    return canery.Scope(&quot;project&quot;, id)<br>}<br><br>func Document(id string) canery.ResourceRef {<br>    return canery.Resource(&quot;document&quot;, id)<br>}</pre><p>Which lets your application code read naturally:</p><pre>ok, err := authorizer.<br>    For(projectauthz.User(userID)).<br>    Can(projectauthz.EditDocument).<br>    Target(projectauthz.Document(documentID)).<br>    In(projectauthz.Project(projectID)).<br>    Check(ctx)</pre><p>That’s where the balance happens:</p><ul><li>Generic core</li><li>Domain-specific language outside</li></ul><h3>The Repository</h3><p>If you want to explore the code:</p><p>👉 <a href="https://github.com/rluders/canery">https://github.com/rluders/canery</a></p><p>This fits naturally when:</p><ul><li>permissions are scoped</li><li>users can inherit permissions via groups</li><li>resources belong to contexts (projects, workspaces, etc.)</li><li>you want reuse across services</li></ul><p>It’s especially useful for SaaS backends and internal platforms.</p><h3>Final Thoughts</h3><p>I didn’t build Canery because authorization is hard.</p><p>I built it because I was tired of solving it differently every time.</p><p>What I wanted was something small, explicit, and reusable. A way to answer a simple question: “Can this actor perform this action on this resource in this scope?”</p><p>Without leaking domain concepts. Without turning into a framework.</p><p>Just a clean core that gives your system a stable center again.</p><p><strong>Before you go…</strong> I wrote a follow up article to show you how to avoid extra verbosity to your code when using Canery. You can read it here:</p><p><a href="https://medium.com/@rluders/got-tired-of-rebuilding-authorization-from-scratch-so-i-built-canery-tips-6a7d81dd2adf?postPublishedType=initial">https://medium.com/@rluders/got-tired-of-rebuilding-authorization-from-scratch-so-i-built-canery-tips-6a7d81dd2adf?postPublishedType=initial</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b3de0d867144" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Observability for Developers — Part 0: The Blind System]]></title>
            <link>https://medium.com/@rluders/observability-for-developers-part-0-the-blind-system-62d7753c078f?source=rss-8e584f9e09ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/62d7753c078f</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[observability]]></category>
            <category><![CDATA[golang]]></category>
            <dc:creator><![CDATA[Ricardo Lüders]]></dc:creator>
            <pubDate>Sun, 14 Dec 2025 14:25:43 GMT</pubDate>
            <atom:updated>2025-12-14T14:25:43.165Z</atom:updated>
            <content:encoded><![CDATA[<h3>Observability for Developers — Part 0: The Blind System</h3><p><em>From a blind distributed system to real, actionable visibility</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2YWbAwnEL50PjRK5" /><figcaption>Photo by <a href="https://unsplash.com/@feneek?utm_source=medium&amp;utm_medium=referral">Sergey Semin</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Introduction</h3><p>Observability is rarely a problem when systems are small.</p><p>A request comes in, a function runs, a response goes out. If something breaks, the stack trace usually tells you where to look. The system explains itself almost by accident.</p><p>That changes as soon as systems become distributed.</p><p>Once requests cross service boundaries, once asynchronous events enter the picture, once timing and partial failures become normal rather than exceptional, understanding what a system is doing stops being trivial. And yet, this is often the moment when observability is introduced as an afterthought — something to “add later,” usually through tools rather than design.</p><p>This series exists to challenge that approach.</p><p>Instead of starting with observability solutions, dashboards, or agents, we start with a system that has none of those things. A system that works, behaves correctly, and produces results — but offers very little help when you try to understand <em>why</em> it behaves the way it does.</p><p>The goal of this series, <strong>Observability for Developers</strong>, is to explore observability as a gradual, intentional design process. One that starts from developer pain, not from tooling checklists. One that treats observability as a way of thinking about systems, not merely as an operational concern.</p><p>To make that exploration concrete, every part of this series is tied to a real codebase: <a href="https://github.com/rluders/obs-tutorial"><strong>https://github.com/rluders/obs-tutorial</strong></a></p><p>Each phase of the journey lives in its own Git branch, with its own commit history and README. This allows the system to be examined at each stage of its evolution, making it possible to see exactly what changed, when it changed, and why it mattered.</p><p>Part 0 represents the starting point of that journey.</p><p>It introduces the system in its most honest form: functional, distributed, containerized — and almost completely blind.</p><p>Before we can talk about observability, we need to experience the absence of it.</p><h3>Why Observability Should Be Taught Backwards</h3><p>Most observability material assumes that the reader already agrees on the destination.</p><p>You are shown traces, metrics, dashboards, and correlations as if their value were self-evident. The system is already instrumented, already visible, already explainable. The only remaining task is to learn how to wire the tools together.</p><p>The problem with this approach is not that it is wrong, but that it skips the most important part of the learning process: understanding <strong>what life looks like without observability</strong>.</p><p>Developers do not struggle with observability because they lack dashboards. They struggle because, at some point, the system stops answering questions they used to be able to answer intuitively. Something becomes slower. Something fails intermittently. An event disappears. And suddenly, reasoning about the system turns into speculation.</p><p>Teaching observability “forwards” hides that moment.</p><p>By contrast, teaching observability backwards starts exactly where most real systems already are. The system works. The architecture looks reasonable. Logs exist. Yet, when you try to answer simple questions — <em>what happened to this request?</em>, <em>where did time go?</em>, <em>which service was responsible?</em> — the system remains silent.</p><p>That silence is the real problem observability is meant to solve.</p><p>In this series, we start from that silence.</p><p>Part 0 deliberately avoids introducing any observability mechanisms. There are no request identifiers, no structured logs, no traces, no metrics. The system is allowed to behave naturally, without being observed. This creates a kind of controlled discomfort: everything functions, but nothing explains itself.</p><p>That discomfort is pedagogically important.</p><p>When observability tools are introduced too early, they often feel decorative. Logs become prettier, traces become colorful, dashboards become impressive — but their necessity is never fully internalized. By starting from a blind system, every improvement introduced later must justify itself by reducing uncertainty, shortening debugging time, or answering questions that previously had no clear answer.</p><p>This also mirrors how observability usually enters real projects. Rarely is it designed upfront in its entirety. More often, it is introduced reactively, in response to pain. A production incident. A performance regression. An intermittent failure no one can reproduce locally.</p><p>By teaching observability backwards, we align the learning process with that lived experience. Instead of presenting observability as a checklist of features, we treat it as an evolving response to specific limitations in how the system can be understood.</p><p>The system in this series is intentionally simple, but the blindness it exhibits is not artificial. It is the natural state of a distributed system that has not yet been designed to explain itself. That is precisely why it is a useful starting point.</p><p>Before we can learn how to observe systems, we need to understand what it feels like when we cannot.</p><h3>A System That Exists Outside the Article</h3><p>It would be easy to describe this system purely in prose.</p><p>A few diagrams, a couple of flow descriptions, maybe some pseudo-code. That approach is common, and it works well enough when the goal is to explain an idea in isolation.</p><p>But observability is not learned in isolation.</p><p>It is learned by running systems, triggering requests, breaking things, and trying — often unsuccessfully — to understand what just happened. For that reason, this series is anchored to a real, executable codebase that exists independently of the articles themselves.</p><p>The repository for this project lives at <a href="https://github.com/rluders/obs-tutorial"><strong>https://github.com/rluders/obs-tutorial</strong></a></p><p>Every part of the series corresponds to a concrete state of that repository. Each phase lives on its own Git branch, with its own README and a single conceptual change applied to the system. This allows the reader to do something that is rarely possible with tutorial content: move backward and forward through the evolution of the same system.</p><p>You can check out Part 0, run it locally, and experience the system in its blind state. Later, you can switch to Part 1 and see exactly what changed when logging became more intentional. You can inspect diffs, read commit messages, and correlate changes in code with changes in behavior.</p><p>This is not an accidental choice. Observability is deeply tied to cause and effect. When improvements are introduced gradually and preserved in version control, it becomes much easier to reason about <em>why</em> a particular observability technique exists and <em>what problem it was meant to solve</em>.</p><p>The repository also enforces a certain discipline in how the system is presented. The code must compile. Containers must build. Services must actually communicate. There is no room for hand-waving. If an idea cannot be demonstrated in a running system, it does not belong in the series.</p><p>In Part 0, this grounding is especially important. The system you will find in the repository at this stage is intentionally unremarkable. It follows standard Go conventions. It uses a minimal set of dependencies. It avoids clever abstractions. There is nothing about it that would immediately signal “observability tutorial.”</p><p>That ordinariness is the point.</p><p>By starting from a system that looks like something you might encounter — or even build yourself — the lessons that follow are easier to transfer to real projects. The repository is not a showcase of best practices; it is a controlled environment in which the consequences of design decisions can be observed over time.</p><p>As the series progresses, the codebase will change. New concepts will be introduced. Instrumentation will be added. Signals will emerge. But the system itself will remain recognizable, and its history will remain intact.</p><p>Observability, in this sense, is not just something we add to the system. It is something we learn by watching the system change.</p><h3>Boring Domain on Purpose</h3><p>One of the easiest ways to make a system difficult to understand is to make its domain complex.</p><p>Business rules pile up. Edge cases multiply. Terminology becomes specialized. Before long, it becomes unclear whether confusion comes from the system’s behavior or from the domain itself.</p><p>For a series about observability, that kind of ambiguity is counterproductive.</p><p>The domain used in this project is deliberately uninteresting. Orders are created. Payments are processed. Notifications are sent. There are no discounts, no retries, no fraud checks, no state machines hidden behind clever abstractions. Each service performs a single, easily describable action and then emits an event.</p><p>This simplicity is not a shortcut; it is a constraint.</p><p>By keeping the domain shallow, we ensure that any difficulty in understanding the system comes from <strong>distribution</strong>, not from business logic. If a request is slow, the cause cannot be hidden in a complex pricing algorithm. If an event goes missing, it cannot be explained away by obscure validation rules. The only remaining source of confusion is the way the system is structured and observed.</p><p>This distinction matters because observability problems are often misdiagnosed as domain problems. When a system is hard to reason about, developers may assume that the logic itself is flawed or overly complicated. In reality, the logic may be simple, but its execution path is opaque.</p><p>In this project, there is nowhere for that opacity to hide.</p><p>Each service is intentionally small. The order service accepts an HTTP request and publishes an event. The payment service reacts to that event and publishes another. The notification service reacts to the final event and produces a side effect. If you understand these three steps conceptually, you understand the entire business flow.</p><p>And yet, even with that clarity, the system is still difficult to observe.</p><p>That tension is exactly what we want to expose.</p><p>By choosing a boring domain, we remove excuses. When the system becomes hard to debug, we cannot blame complexity in requirements or unclear business rules. The only remaining explanation is the lack of visibility into how the system behaves at runtime.</p><p>This creates a clean experimental setup. As observability features are introduced later in the series, their impact becomes immediately apparent. Improvements in understanding cannot be attributed to better domain modeling or clearer logic; they can only be attributed to better signals.</p><p>In other words, the domain stays simple so that the system’s behavior does not.</p><h3>Event-Driven by Default</h3><p>If observability is about understanding how a system behaves over time, then asynchronous boundaries are where that understanding first begins to break down.</p><p>Synchronous calls are deceptively comforting. A request enters a service, a function calls another function — or another service — and a response eventually comes back. Errors propagate naturally. Stack traces feel meaningful. Timing, while not always obvious, at least follows a linear path.</p><p>As soon as events enter the picture, that linearity disappears.</p><p>In this system, services do not call each other directly. The order service does not wait for payment to complete. The payment service does not know whether a notification will ever be sent. Each service publishes an event and moves on.</p><p>From an architectural perspective, this is a reasonable and often desirable choice. It reduces coupling, improves resilience, and allows services to evolve independently. But from an observability perspective, it introduces a fundamental challenge: <strong>causality becomes implicit rather than explicit</strong>.</p><p>Consider a single line of code in the order service:</p><pre>nc.Publish(&quot;order.created&quot;, payload)</pre><p>From the point of view of that service, this is the end of the story. The order has been created, the event has been emitted, and the service can return a response. What happens next is someone else’s responsibility.</p><p>From the point of view of the system as a whole, however, this is only the beginning. That event may trigger payment processing, which may trigger a notification, which may or may not succeed. None of that context is visible at the moment the event is published.</p><p>At this stage of the system, there is no way to connect these pieces reliably. The payment service receives an event, processes it, and emits another event. The notification service does the same. Each step happens independently, often at different times, potentially on different machines.</p><p>Without explicit observability signals, the system loses its narrative.</p><p>You can see that <em>something</em> happened in each service. You can see that events were published and consumed. But you cannot reconstruct the story of a single order as it moves through the system. There is no shared identifier, no timing context, and no way to know whether one event caused another or merely happened around the same time.</p><p>This is not a flaw in event-driven architecture. It is an inherent property of it.</p><p>Asynchronous systems trade immediacy for flexibility. In doing so, they also trade away many of the implicit guarantees that make synchronous systems easier to reason about. Observability, in this context, becomes the mechanism through which those guarantees are reintroduced — not at the code level, but at the level of signals.</p><p>In Part 0, we intentionally avoid doing that work. Events flow freely, but silently. Each service operates in isolation, unaware of the larger execution path it participates in.</p><p>This makes the system an ideal environment for exploring observability. The moment we begin to introduce correlation, tracing, and structured signals in later parts of the series, the impact will be immediately visible. What was once a collection of disconnected actions will begin to form a coherent story.</p><p>For now, the system remains event-driven — and narratively fragmented.</p><h3>Structural Decisions</h3><p>Before any observability mechanisms are introduced, the system already makes a number of structural decisions that might look, at first glance, like “best practices.” The code is organized, the repository is clean, the build process is explicit. None of these choices make the system observable — but all of them influence how observable it can become later.</p><p>Each service follows a conventional Go project layout, separating the executable entry point from internal packages. The intent here is not architectural sophistication, but clarity. When a service starts, it is immediately obvious where execution begins and which parts of the code are meant to be reusable versus private to the service.</p><p>This distinction matters once observability enters the picture. Instrumentation tends to spread quickly. If boundaries are unclear, it becomes difficult to reason about where cross-cutting concerns such as logging or tracing should live. A clean layout does not give you observability, but a chaotic one makes observability harder to apply without collateral damage.</p><p>The repository itself is structured as a monorepo. This is not a recommendation for all systems, nor is it a requirement for observability. It is a pragmatic choice for this series. By keeping all services in a single repository, changes introduced in later parts can be compared directly. Shared utilities can evolve alongside services, and the reader can inspect differences across phases without juggling multiple repositories or versions.</p><p>A similar logic applies to the build strategy. All services are built using a single Dockerfile, parameterized by service name. This avoids subtle discrepancies between service images and ensures that differences in behavior across services are not accidentally introduced at the build layer.</p><p>A build command like:</p><pre>go build -o order-service ./cmd</pre><p>is intentionally explicit. It makes the entry point clear and enforces a consistent structure across services. Again, this does not add observability. It simply removes a source of ambiguity.</p><p>These structural decisions are often mistaken for observability work because they improve developer experience. The code feels cleaner. The system feels more predictable. But predictability is not visibility.</p><p>At this stage, the system still cannot explain itself. Requests still disappear into asynchronous boundaries. Logs still lack context. Execution paths still fragment across services without a unifying narrative.</p><p>What these decisions do provide is a stable foundation. When observability features are introduced later, it will be clear which changes are responsible for which improvements. There will be no need to untangle architectural cleanup from instrumentation logic.</p><p>In other words, structure prepares the ground, but it does not tell the story.</p><p>That story remains incomplete — and largely invisible.</p><h3>The Illusion of “Having Logs”</h3><p>At first glance, the system does not appear completely silent.</p><p>Each service produces log output. Messages are printed when events are received, when work is done, and when something goes wrong. From a distance, it feels like there is already some level of observability in place.</p><p>This is where the illusion begins.</p><p>Consider a log statement like this:</p><pre>log.Println(&quot;processed payment for order&quot;, order.OrderID)</pre><p>It looks reasonable. It even feels helpful. It tells you that a payment was processed and associates that action with an order identifier. If you see this line in the logs, you might reasonably conclude that the payment step succeeded.</p><p>The problem is not that this log line is wrong. The problem is that it exists in isolation.</p><p>When this message appears, there is no reliable way to connect it back to the original HTTP request that created the order. There is no way to know how long payment processing took relative to other steps. There is no way to tell whether a notification was eventually sent for the same order. The log tells you <em>something happened</em>, but not <em>how it fits into the larger execution path</em>.</p><p>In a single-process application, this kind of logging can be surprisingly effective. Context is implicit. Execution is linear. A log line usually appears close to the code that caused it, and the call stack provides meaning almost for free.</p><p>In a distributed, event-driven system, that implicit context disappears.</p><p>Logs are produced by different services, running in different containers, often at different times. Even when they reference the same domain identifier, there is no guarantee that those references are complete, consistent, or sufficient to reconstruct the flow of a single request.</p><p>As the system stands in Part 0, logs answer only the simplest questions: <em>Did this service do something?</em> They do not answer the questions developers actually care about when debugging: <em>Why did this happen?</em>, <em>What triggered it?</em>, <em>What happened before and after?</em></p><p>The presence of logs can therefore be misleading. They create a sense of visibility without providing real insight. Developers may spend time scanning log output, trying to mentally correlate messages across services, only to realize that the information needed to draw firm conclusions simply isn’t there.</p><p>This is not a failure of logging as a concept. It is a consequence of using logs without structure, without shared context, and without an explicit notion of causality.</p><p>In later parts of the series, logging will become one of the most powerful observability tools available to us. But that transformation will require more than printing messages. It will require logs to carry meaning, identity, and relationships.</p><p>For now, logs exist — but they do not tell a story.</p><h3>What You Still Cannot Answer</h3><p>At this point, the system is doing exactly what it was designed to do.</p><p>Orders are accepted. Events are published. Payments are processed. Notifications are sent. From a functional perspective, there is little reason to be concerned.</p><p>And yet, the moment you try to understand the system beyond its surface behavior, the limitations become obvious.</p><p>If an order takes longer than expected, there is no clear way to determine where time was spent. Was the delay introduced during payment processing? Was the event delivery slow? Did notification handling block for some reason? The system offers no reliable way to answer these questions.</p><p>If a customer reports that they never received a notification, the investigation quickly turns speculative. You can check whether the order was created. You can check whether payment was processed. You might even see log lines suggesting that both happened. But there is no definitive way to confirm whether these actions were part of the same execution path or merely coincidental.</p><p>Failures are even harder to reason about. When something breaks, the system does not tell you whether the failure was isolated or systemic. It does not tell you whether it affected one request or many. It does not tell you whether it happened before or after a particular event was emitted.</p><p>In practice, this means that debugging becomes an exercise in reconstruction. Developers piece together partial evidence from logs, timestamps, and intuition, hoping that the picture they assemble reflects reality closely enough to act on.</p><p>Sometimes it does. Often, it does not.</p><p>These unanswered questions are not edge cases. They are the normal questions developers ask when systems grow beyond a single process. The fact that the system cannot answer them is not a flaw in its logic, but a consequence of its invisibility.</p><p>This is the state many systems reach long before observability is treated as a first-class concern. Everything works — until understanding becomes more important than functionality alone.</p><p>Part 0 ends here, not because the system is complete, but because its limitations are now fully visible.</p><p>The next step is not to replace the system or redesign it. The next step is to help it explain itself.</p><h3>Conclusion</h3><p>By the end of Part 0, nothing is broken.</p><p>The system runs. Requests succeed. Events flow through the system and produce the expected outcomes. From a purely functional point of view, there is little to criticize.</p><p>And yet, the system remains difficult to understand.</p><p>What Part 0 reveals is not a failure of implementation, but a limitation of perspective. The system performs work, but it does not explain that work. It reacts to inputs, but it does not describe the relationships between those reactions. It behaves correctly, but it remains largely silent about <em>how</em> and <em>why</em> it behaves the way it does.</p><p>This silence is the defining characteristic of a blind system.</p><p>By deliberately starting here, we establish a baseline that mirrors the reality of many production systems. Observability is rarely absent because developers are careless; it is absent because systems often grow faster than their ability to explain themselves. The result is a gap between what the system does and what developers can confidently reason about.</p><p>Part 0 does not attempt to close that gap. It exists to make it visible.</p><p>Understanding observability begins not with tools or standards, but with the recognition that functionality alone is not enough. A system that cannot be understood cannot be trusted, maintained, or evolved with confidence.</p><p>This is the state from which observability becomes meaningful.</p><h3>Hey there 👋</h3><p>If this system feels familiar, that is not a coincidence. It likely resembles systems you have already built or supported — systems that work, but demand intuition and guesswork when something goes wrong.</p><p>The complete code for this phase is available in the repository:</p><p><a href="https://github.com/rluders/obs-tutorial"><strong>https://github.com/rluders/obs-tutorial</strong></a></p><p>Check out the branch corresponding to Part 0, run the system locally, and take a moment to experience its behavior firsthand. Trigger requests. Watch events flow. Try to answer the questions raised in this article using only what the system currently provides.</p><p>In the next part of the series, we will take the first deliberate step toward closing the visibility gap. We will not introduce tracing or metrics yet. Instead, we will focus on something far more fundamental: <strong>intentional logging</strong>.</p><p>Follow the repository, continue with the next article, and build observability the same way systems are built — incrementally, deliberately, and with purpose.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62d7753c078f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Messy Logs to Mastery: Logging]]></title>
            <link>https://medium.com/@rluders/how-i-learned-to-stop-worrying-and-build-a-clean-go-microservice-76c508bfcf93?source=rss-8e584f9e09ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/76c508bfcf93</guid>
            <category><![CDATA[logging-and-monitoring]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[observability]]></category>
            <dc:creator><![CDATA[Ricardo Lüders]]></dc:creator>
            <pubDate>Wed, 19 Nov 2025 21:25:23 GMT</pubDate>
            <atom:updated>2025-11-19T21:28:24.014Z</atom:updated>
            <content:encoded><![CDATA[<p>(With slog Logging, an Internal Event Bus, and Layers That Don’t Hate Each Other)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*p0sl4nxme4dA_eeE" /><figcaption>Photo by <a href="https://unsplash.com/@danielforsman?utm_source=medium&amp;utm_medium=referral">Daniel Forsman</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>A few months ago, I inherited a Go microservice that I can only describe as “held together by duct tape and optimism.” The kind of service where logs looked like:</p><pre>starting...<br>doing thing<br>oops, invalid character</pre><p>When something went wrong, debugging felt like archaeology.<br> There were no request IDs, no structure, no correlation. Errors just floated in the void like stray particles.</p><p>I wanted better.<br>I wanted clarity.<br>I wanted logs that <em>meant something</em>.</p><p>And most importantly, I wanted architecture that didn’t make me cry on Fridays.</p><p>This article is the microservice I wish that system had been.</p><p>A clean, layered Go service with:</p><ul><li>Handlers</li><li>Services</li><li>Repositories</li><li>An internal event bus (just to explain how to handle other layers)</li><li>And structured logging with log/slog</li><li>Designed from the ground up for clarity and debuggability</li></ul><p>No frameworks.<br>No magic.<br>Just Go.</p><p>Let’s build it together.</p><h3>The Early Realization: slog Changes Everything</h3><p>When Go 1.21 introduced log/slog, it didn’t just give us better logs —<br> it gave us a <em>better way to think about logging altogether</em>.</p><p>For years, the community patched around the old log package:</p><ul><li>Logrus</li><li>Zap</li><li>Zerolog</li><li>Custom wrappers</li><li>Global singletons</li><li>“Logger in every struct” patterns</li><li>Multi-level DI frameworks just for logging</li></ul><p>And despite all those libraries and clever wrappers we tried over the years, logs still came out messy, unstructured, and frustratingly context-poor. You could grep them, pretty-print them, ship them to some observability platform… but the fundamental problem remained: logs had no sense of <em>where</em> they belonged.</p><p>That changed with slog.</p><p>slog didn’t just give us a faster or cleaner logger — it gave us a new way to think about logging entirely. Suddenly, logging wasn’t about “which logger object do I have access to right now?” but about something far more important:</p><p><strong>What context am I in?</strong></p><p>If you’re inside an HTTP request, the logger naturally picks up the request ID and anything else the handler attaches. If you’re processing an internal event, the logger carries the event’s metadata and the lineage of the request that triggered it. If you’re inside a background job, you create a job-specific logger that stays consistent across that worker’s lifetime.</p><p>Context becomes the thread that ties the entire flow together — the storyline your logs can follow from beginning to end.</p><p>And that shift in mindset is the foundation of the architecture we’re about to build.</p><h3>The Vision: A Microservice That Makes Sense</h3><p>I wanted a service that looked like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*i4mVmFSOiNNGQN30ImYB7g.png" /></figure><p>And logs that stitched the entire story together.</p><p>If request <strong>1234</strong> creates a user and that triggers a &quot;user.created&quot; event, I want to see <em>everything</em> related to request <strong>1234</strong> — from the HTTP handler, into the service layer, through the repository, and finally inside the event listener — <strong>in one chronological chain</strong>.</p><p>That’s not just a nice-to-have. It becomes absolutely essential the moment your system grows beyond the “toy project” stage.</p><p>Because once you have <strong>multiple users hitting your endpoints</strong>, multiple goroutines running concurrently, background workers firing off tasks, and events bouncing around your system, logs stop being linear. They become a messy, interleaved stream of text.</p><p>Without correlation, you’re left guessing:</p><ul><li><em>Which logs belong to this request?</em></li><li><em>Which user triggered this event?</em></li><li><em>Did this failure come from the same flow or another simultaneous one?</em></li></ul><p>A single request ID carried through the entire flow turns that chaos into a story. It lets you debug with confidence, trace the full lifecycle of an operation, and even audit behaviour when something suspicious happens.</p><p><strong>That’s the goal. </strong>Let’s build it!</p><h3>Project Structure</h3><pre>.<br>├── cmd/<br>│   └── api/<br>│       └── main.go<br>├── internal/<br>│   ├── logger/<br>│   │   └── logger.go<br>│   ├── eventbus/<br>│   │   └── eventbus.go<br>│   ├── user/<br>│   │   ├── handler.go<br>│   │   ├── service.go<br>│   │   ├── repository.go<br>│   │   └── model.go</pre><p>No frameworks. No tangled dependency trees. Just Go’s standard library doing what it does best. The whole service stays lightweight enough that you could drop it onto a tiny machine — even something as humble as a Raspberry Pi — and it would run without breaking a sweat.</p><h3>Logging: The Beating Heart of the Story</h3><p>When things go wrong (and they do), your logs become your best friend. But only if you treat them well.</p><p>Here’s how I structure mine:</p><ul><li>A <strong>root logger</strong> with global metadata</li><li>Contextual loggers per request</li><li>Context propagation everywhere</li><li>No logger fields on structs</li><li>No global magical state beyond the root</li></ul><p>Let’s set that up.</p><pre>// internal/logger/logger.go<br>package logger<br><br>import (<br>    &quot;context&quot;<br>    &quot;log/slog&quot;<br>    &quot;os&quot;<br>)<br><br>var Log *slog.Logger<br><br>func Init(env string, level slog.Leveler) {<br>    handler := slog.NewJSONHandler(os.Stdout, &amp;slog.HandlerOptions{<br>        Level:     level,<br>        AddSource: true,<br>    })<br><br>    Log = slog.New(handler).With(<br>        slog.String(&quot;env&quot;, env),<br>        slog.String(&quot;service&quot;, &quot;user-api&quot;),<br>    )<br>}</pre><p>Now the magic trick: <strong>injecting contextual loggers into </strong><strong>context.Context</strong>. Right after the <em>Init </em>we can include:</p><pre>type ctxKey struct{}<br><br>func WithLogger(ctx context.Context, log *slog.Logger) context.Context {<br>    return context.WithValue(ctx, ctxKey{}, log)<br>}<br><br>func FromContext(ctx context.Context) *slog.Logger {<br>    if ctx == nil {<br>        return Log<br>    }<br>    if l, ok := ctx.Value(ctxKey{}).(*slog.Logger); ok {<br>        return l<br>    }<br>    return Log<br>}</pre><p>From here on, every handler, service, or listener can simply call:</p><pre>log := logger.FromContext(ctx)</pre><p>And boom: rich metadata — automatically included.</p><h3>Building an Internal Event Bus</h3><p>I wanted events. But, for this example, I did <em>not</em> want Kafka or anything fancy.</p><p>So I built a tiny pub/sub bus right inside the process.</p><pre>// internal/eventbus/eventbus.go<br>package eventbus<br><br>import (<br>    &quot;context&quot;<br>    &quot;sync&quot;<br>)<br><br>type Event struct {<br>    Name    string<br>    Payload any<br>    Ctx     context.Context<br>}<br><br>type Handler func(Event)<br><br>type Bus struct {<br>    mu       sync.RWMutex<br>    handlers map[string][]Handler<br>}<br><br>func New() *Bus {<br>    return &amp;Bus{<br>        handlers: make(map[string][]Handler),<br>    }<br>}<br><br>func (b *Bus) Publish(evt Event) {<br>    b.mu.RLock()<br>    defer b.mu.RUnlock()<br><br>    if hs, ok := b.handlers[evt.Name]; ok {<br>        for _, h := range hs { h(evt) }<br>    }<br>}<br><br>func (b *Bus) Subscribe(eventName string, handler Handler) {<br>    b.mu.Lock()<br>    defer b.mu.Unlock()<br><br>    b.handlers[eventName] = append(b.handlers[eventName], handler)<br>}</pre><p>It’s synchronous for now. If you want async, just wrap go h(evt).</p><h3>A Simple Domain Model</h3><pre>// internal/user/model.go<br>package user<br><br>type User struct {<br>    ID    string `json:&quot;id&quot;`<br>    Name  string `json:&quot;name&quot;`<br>    Email string `json:&quot;email&quot;`<br>}</pre><p>Straightforward. We don’t need to add any complexity here.</p><h3>Repository Layer</h3><p>We’ll build an in-memory repository, enough for the demonstration but with clear separation.</p><pre>// internal/user/repository.go<br>package user<br><br>import (<br>    &quot;context&quot;<br>    &quot;errors&quot;<br>    &quot;sync&quot;<br>)<br><br>var ErrNotFound = errors.New(&quot;user not found&quot;)<br><br>type Repository interface {<br>    Create(ctx context.Context, u User) (User, error)<br>    GetByID(ctx context.Context, id string) (User, error)<br>}<br><br>type InMemoryRepository struct {<br>    mu    sync.RWMutex<br>    store map[string]User<br>}<br><br>func NewInMemoryRepository() *InMemoryRepository {<br>    return &amp;InMemoryRepository{<br>        store: make(map[string]User),<br>    }<br>}<br><br>func (r *InMemoryRepository) Create(ctx context.Context, u User) (User, error) {<br>    r.mu.Lock()<br>    defer r.mu.Unlock()<br>    r.store[u.ID] = u<br>    return u, nil<br>}<br><br>func (r *InMemoryRepository) GetByID(ctx context.Context, id string) (User, error) {<br>    r.mu.RLock()<br>    defer r.mu.RUnlock()<br><br>    u, ok := r.store[id]<br>    if !ok {<br>        return User{}, ErrNotFound<br>    }<br>    return u, nil<br>}</pre><p><strong>Repositories don’t log</strong>. They fail silently and let higher layers decide what to do.</p><h3>The Service Layer — Where the Story Lives</h3><p>Here’s where things start to feel alive:</p><ul><li>Create a user</li><li>Log context-rich actions</li><li>Publish an event</li><li>Make the system react</li></ul><pre>// internal/user/service.go<br>package user<br><br>import (<br>    &quot;context&quot;<br><br>    &quot;github.com/google/uuid&quot;<br>    &quot;github.com/rluders/go-logging-tutorial/internal/eventbus&quot;<br>    &quot;github.com/rluders/go-logging-tutorial/internal/logger&quot;<br>)<br><br>const EventUserCreated = &quot;user.created&quot;<br><br>type Service struct {<br>    repo Repository<br>    bus  *eventbus.Bus<br>}<br><br>func NewService(repo Repository, bus *eventbus.Bus) *Service {<br>    return &amp;Service{repo: repo, bus: bus}<br>}<br><br>func (s *Service) CreateUser(ctx context.Context, name, email string) (User, error) {<br>    log := logger.FromContext(ctx).With(&quot;op&quot;, &quot;user.create&quot;)<br><br>    id := uuid.New().String()<br>    u := User{ID: id, Name: name, Email: email}<br><br>    log.Info(&quot;creating user&quot;, &quot;email&quot;, email)<br><br>    u, err := s.repo.Create(ctx, u)<br>    if err != nil {<br>        log.Error(&quot;create user failed&quot;, &quot;error&quot;, err)<br>        return User{}, err<br>    }<br><br>    log.Info(&quot;user created&quot;, &quot;user_id&quot;, u.ID)<br><br>    s.bus.Publish(eventbus.Event{<br>        Name: EventUserCreated,<br>        Ctx:  ctx,<br>        Payload: map[string]any{<br>            &quot;user_id&quot;: u.ID,<br>            &quot;email&quot;:   u.Email,<br>        },<br>    })<br><br>    return u, nil<br>}<br><br>func (s *Service) GetUser(ctx context.Context, id string) (User, error) {<br>    log := logger.FromContext(ctx).With(&quot;op&quot;, &quot;user.get&quot;, &quot;user_id&quot;, id)<br><br>    u, err := s.repo.GetByID(ctx, id)<br>    if err != nil {<br>        if err == ErrNotFound {<br>            log.Info(&quot;user not found&quot;)<br>        } else {<br>            log.Error(&quot;get user failed&quot;, &quot;error&quot;, err)<br>        }<br>        return User{}, err<br>    }<br><br>    log.Info(&quot;user found&quot;)<br>    return u, nil<br>}</pre><p>This pattern — using context-based loggers + event publishing — is the heart of the architecture.</p><h3>The Handler Layer: The Boundary to the World</h3><p>This is how each request gets layered logging.</p><p>Handlers:</p><ul><li>Accept input</li><li>Validate</li><li>Call the service</li><li>Craft responses</li></ul><p>They don’t own business logic.</p><pre>// internal/user/handler.go<br>package user<br><br>import (<br>    &quot;encoding/json&quot;<br>    &quot;net/http&quot;<br><br>    &quot;github.com/rluders/go-logging-tutorial/internal/logger&quot;<br>)<br><br>type Handler struct {<br>    svc *Service<br>}<br><br>func NewHandler(svc *Service) *Handler {<br>    return &amp;Handler{svc: svc}<br>}<br><br>func (h *Handler) RegisterRoutes(mux *http.ServeMux) {<br>    mux.HandleFunc(&quot;POST /users&quot;, h.createUser)<br>    mux.HandleFunc(&quot;GET /users/&quot;, h.getUser)<br>}<br><br>type createUserRequest struct {<br>    Name  string `json:&quot;name&quot;`<br>    Email string `json:&quot;email&quot;`<br>}<br><br>func (h *Handler) createUser(w http.ResponseWriter, r *http.Request) {<br>    ctx := r.Context()<br>    log := logger.FromContext(ctx).With(&quot;handler&quot;, &quot;createUser&quot;)<br><br>    var req createUserRequest<br>    if err := json.NewDecoder(r.Body).Decode(&amp;req); err != nil {<br>        log.Warn(&quot;invalid body&quot;, &quot;error&quot;, err)<br>        http.Error(w, &quot;invalid body&quot;, 400)<br>        return<br>    }<br><br>    user, err := h.svc.CreateUser(ctx, req.Name, req.Email)<br>    if err != nil {<br>        log.Error(&quot;service error&quot;, &quot;error&quot;, err)<br>        http.Error(w, &quot;internal error&quot;, 500)<br>        return<br>    }<br><br>    w.Header().Set(&quot;Content-Type&quot;, &quot;application/json&quot;)<br>    w.WriteHeader(201)<br>    _ = json.NewEncoder(w).Encode(user)<br>}<br><br>func (h *Handler) getUser(w http.ResponseWriter, r *http.Request) {<br>    ctx := r.Context()<br>    log := logger.FromContext(ctx).With(&quot;handler&quot;, &quot;getUser&quot;)<br><br>    id := r.URL.Path[len(&quot;/users/&quot;):]<br>    if id == &quot;&quot; {<br>        http.Error(w, &quot;missing id&quot;, 400)<br>        return<br>    }<br><br>    user, err := h.svc.GetUser(ctx, id)<br>    if err != nil {<br>        if err == ErrNotFound {<br>            http.Error(w, &quot;not found&quot;, 404)<br>            return<br>        }<br>        log.Error(&quot;service error&quot;, &quot;error&quot;, err)<br>        http.Error(w, &quot;internal error&quot;, 500)<br>        return<br>    }<br><br>    w.Header().Set(&quot;Content-Type&quot;, &quot;application/json&quot;)<br>    _ = json.NewEncoder(w).Encode(user)<br>}</pre><h3>Logging Middleware: Injecting a Request ID</h3><p>This is where request correlation begins.</p><p>Every HTTP request gets a contextual logger with:</p><ul><li>request_id</li><li>method</li><li>path</li></ul><pre>// cmd/api/main.go<br>package main<br><br>import (<br>    &quot;log&quot;<br>    &quot;log/slog&quot;<br>    &quot;math/rand&quot;<br>    &quot;net/http&quot;<br>    &quot;time&quot;<br><br>    &quot;github.com/rluders/go-logging-tutorial/internal/eventbus&quot;<br>    &quot;github.com/rluders/go-logging-tutorial/internal/logger&quot;<br>    &quot;github.com/rluders/go-logging-tutorial/internal/user&quot;<br>)<br><br>func main() {<br>    logger.Init(&quot;local&quot;, slog.LevelDebug)<br><br>    bus := eventbus.New()<br>    repo := user.NewInMemoryRepository()<br>    svc := user.NewService(repo, bus)<br>    h := user.NewHandler(svc)<br><br>    mux := http.NewServeMux()<br>    h.RegisterRoutes(mux)<br><br>    registerEventListeners(bus)<br><br>    srv := &amp;http.Server{<br>        Addr:    &quot;:8080&quot;,<br>        Handler: loggingMiddleware(mux),<br>    }<br><br>    logger.Log.Info(&quot;starting server&quot;, &quot;addr&quot;, srv.Addr)<br><br>    if err := srv.ListenAndServe(); err != nil &amp;&amp;<br>        err != http.ErrServerClosed {<br>        log.Fatal(err)<br>    }<br>}<br><br>func loggingMiddleware(next http.Handler) http.Handler {<br>    return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {<br>        requestID := randomRequestID()<br><br>        log := logger.Log.With(<br>            &quot;request_id&quot;, requestID,<br>            &quot;method&quot;, r.Method,<br>            &quot;path&quot;, r.URL.Path,<br>        )<br><br>        ctx := logger.WithLogger(r.Context(), log)<br><br>        log.Info(&quot;request started&quot;)<br>        defer log.Info(&quot;request finished&quot;)<br><br>        next.ServeHTTP(w, r.WithContext(ctx))<br>    })<br>}<br><br>func randomRequestID() string {<br>    return time.Now().Format(&quot;20060102150405&quot;) + &quot;-&quot; + randomString(6)<br>}<br><br>func randomString(n int) string {<br>    letters := []rune(&quot;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789&quot;)<br>    b := make([]rune, n)<br>    for i := range b {<br>        b[i] = letters[rand.Intn(len(letters))]<br>    }<br>    return string(b)<br>}</pre><h3>Registering Event Listeners</h3><p>This is where the service becomes <em>reactive</em>.</p><pre>func registerEventListeners(bus *eventbus.Bus) {<br>    bus.Subscribe(user.EventUserCreated, func(evt eventbus.Event) {<br>        log := logger.FromContext(evt.Ctx).With(<br>            &quot;listener&quot;, &quot;user.created.handler&quot;,<br>            &quot;event&quot;, user.EventUserCreated,<br>        )<br><br>        payload := evt.Payload.(map[string]any)<br><br>        log.Info(&quot;handling user.created&quot;,<br>            &quot;user_id&quot;, payload[&quot;user_id&quot;],<br>            &quot;email&quot;, payload[&quot;email&quot;],<br>        )<br>    })<br>}</pre><p>We’ve now stitched a complete story together: <em>HTTP Request → Handler → Service → Event → Listener</em></p><p>All sharing the same logger context.</p><h3>Final Result: A Clean, Testable, Structured Go Microservice</h3><p>You now have a microservice that is:</p><p><strong>✔ Clean: </strong>Layers don’t leak responsibilities.</p><p><strong>✔ Observable: </strong>Every request is traceable through every layer.</p><p><strong>✔ Extensible: </strong>Want Kafka later? Swap internal bus for a real one.</p><p><strong>✔ Idiomatic: </strong>Uses context, slog, standard libs, and Go’s natural patterns.</p><p><strong>✔ Maintainable: </strong>Future you won’t curse past you.</p><h3>Extra: Gold Tips for Logging in Go</h3><p>Here are some hard-earned, field-tested lessons for logging in real Go services — the kind that actually help when production catches fire:</p><h4>1. Every request deserves its own logger.</h4><p>Don’t use the global logger directly in handlers. Derive a contextual logger with request metadata and pass it down via context.Context.</p><h4>2. Log events, not narration.</h4><ul><li>Avoid noisy logs like “starting function X”.</li><li>Prefer semantic events: &quot;user.create.started&quot;, &quot;billing.charge.failed&quot;</li><li>Your logs should read like a story, not a diary.</li></ul><h4>3. Always log structured fields — never embed data in text.</h4><p><strong>Good:</strong></p><pre>log.Info(&quot;user created&quot;, &quot;user_id&quot;, id, &quot;email&quot;, email)</pre><p>Bad:</p><pre>log.Infof(&quot;created user %s with email %s&quot;, id, email)</pre><p>Fields make logs parseable, searchable, and cheap to ingest.</p><h4>4. Pass error as a field, not a string.</h4><ul><li>slog handles error formatting for you.</li><li>Don’t wrap errors in text.</li></ul><h4>5. Don’t log inside repositories.</h4><ul><li>Repositories don’t know the context.</li><li>They don’t know the request ID.</li><li>They don’t know whether an error is expected or not.</li><li>Let services add meaning and context in the log.</li></ul><h4>6. Emit less logs, but better logs.</h4><ul><li>Most teams log too much.</li><li>Fewer logs with better metadata beats noisy logs any day — and costs way less in Datadog/ELK.</li></ul><h4>7. Don’t log request bodies or sensitive data.</h4><ul><li>Especially emails, addresses, tokens, IDs, credit cards, or session data.</li><li>If you must, mask it.</li></ul><h4>8. Use log levels strategically.</h4><ul><li>Debug: help developers</li><li>Info: meaningful system events</li><li>Warn: expected but undesirable</li><li>Error: unexpected errors that need attention</li></ul><p>Overusing Error devalues the meaning of real failures.</p><h4>9. Don’t swallow errors after logging.</h4><ul><li>Logging is not error handling.</li><li>If something fails, return the error <em>and</em> log the context.</li></ul><h4>10. Prefer log.With() over building strings.</h4><p>Chaining fields builds a narrative across layers:</p><pre>log := log.With(&quot;user_id&quot;, userID, &quot;op&quot;, &quot;payment.process&quot;)</pre><p>Now everyone downstream inherits that context automatically.</p><h3>Before You Go</h3><p>This whole project started because I inherited a service that made debugging feel like detective work. Maybe you’ve walked into a similar codebase — one where the logs whisper instead of speak, the layers blur together, and the domain logic hides in dark corners.</p><p>If this guide helped you see a clearer way forward, consider giving it a clap or sharing it with someone who might be fighting the same battle.</p><p>And if you’d like to dive even deeper into how architecture and domain design shape the soul of a Go service, I invite you to explore two related pieces I wrote:</p><p>👉 <strong>When the Business Domain Becomes the Missing Dependency</strong><br> <a href="https://medium.com/@rluders/when-the-business-domain-becomes-the-missing-dependency-fd2c870bb958">https://medium.com/@rluders/when-the-business-domain-becomes-the-missing-dependency-fd2c870bb958</a></p><p>👉 <strong>Demystifying Clean Architecture in Go: Separating Fact from Fiction</strong><br> <a href="https://medium.com/@rluders/demystifying-clean-architecture-in-go-separating-fact-from-fiction-26fc8e81b99b">https://medium.com/@rluders/demystifying-clean-architecture-in-go-separating-fact-from-fiction-26fc8e81b99b</a></p><p>They expand on the philosophy behind clean layering, good boundaries, and why so many Go projects get “architecture” wrong at the root.</p><p>If you want a follow-up to <em>this</em> article — tracing, async event buses, real database wiring, or a full production skeleton — let me know in the comments.</p><p>I’d love to turn this into a series and keep building it with you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76c508bfcf93" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[When the Business Domain Becomes the Missing Dependency]]></title>
            <link>https://medium.com/@rluders/when-the-business-domain-becomes-the-missing-dependency-fd2c870bb958?source=rss-8e584f9e09ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd2c870bb958</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[observability]]></category>
            <category><![CDATA[cloud-native]]></category>
            <category><![CDATA[software-architecture]]></category>
            <dc:creator><![CDATA[Ricardo Lüders]]></dc:creator>
            <pubDate>Fri, 14 Nov 2025 13:34:54 GMT</pubDate>
            <atom:updated>2025-11-14T13:34:54.591Z</atom:updated>
            <content:encoded><![CDATA[<p>A story about how cloud-native engineering breaks when we understand systems but not the business they serve.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UUjlzJMpnymbNZ_a" /><figcaption>Photo by <a href="https://unsplash.com/@dallehj?utm_source=medium&amp;utm_medium=referral">Daniel Jensen</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3><strong>Introduction</strong></h3><p>If you’ve worked long enough with cloud-native systems, you’ve probably experienced that strange moment when everything looks healthy and yet nothing is working. Dashboards are green, services are up, autoscalers are stable, but a critical business flow is silently failing. Maybe checkout completion drops, maybe sign-in latency grows just enough to frustrate users, maybe an external provider starts throttling requests. None of these events are immediately obvious in the traditional “CPU, memory, pod count” view of the system. Everything is fine, until it isn’t.</p><p>This is the moment when the gap between engineering and the business domain becomes impossible to ignore. Modern systems give us an astonishing level of insight into infrastructure. We can trace calls across distributed services, instrument runtimes, analyze logs in real time, and replay traffic patterns with almost surgical precision. But none of that matters if we lack a clear understanding of what actually constitutes success for the business. Without that clarity, observability becomes nothing more than the systematic collection of technical signals. DDD turns into a catalog of patterns. Architecture decisions devolve into guesses, influenced more by trends than by context.</p><p>The truth is that cloud-native engineering is no longer just about building scalable systems. It’s about building systems that faithfully represent how a business creates and delivers value. And that means engineers need to understand the domain deeply enough to know what is supposed to happen, not just what the code does. The critical paths of the business — the flows that keep the company alive — must shape our telemetry, our models, and even the technologies we choose.</p><p>This article is a reflection on that gap. It’s about the times when we built the right system the wrong way, when we chose the right technology for the wrong problem, and when we instrumented everything except what mattered. We’ll look at how a lack of domain understanding weakens observability, leads to poor architectural choices, and turns DDD into ceremony. And we’ll explore how reconnecting engineering to the domain changes everything: how systems become easier to reason about, how failures become easier to detect, how decisions become more deliberate.</p><p>This isn’t a discussion about perfection. It’s about adequacy — about choosing the architecture and instrumentation that <em>fit</em> the domain, not the ones that simply look good in a diagram. Because in complex systems, adequacy grounded in domain understanding is far more valuable than theoretical correctness.</p><h3>Development</h3><h4>1. When Observability becomes an archive instead of a lens</h4><p>If you’ve ever opened your monitoring dashboards during an incident and realized that none of the panels actually reflect what users are experiencing, you already know the problem. Modern observability systems let us zoom in on the smallest technical detail, but that doesn’t help when the real question is simple: <em>Why is the business flow breaking?</em></p><p>The irony is that cloud-native tooling gives us incredible visibility into the infrastructure. Distributed traces show us hop by hop. Logs expose behavior line by line. Metrics quantify everything from queue depth to GC pauses. But if none of these signals represent what the business actually needs to succeed, they become noise. One of the recurring lessons from the SRE community is that understanding the system requires understanding what “good” looks like for the user — not just for the machine.</p><p>Cloud-native systems create indirection everywhere: retries, backpressure, message queues, autoscalers. Without domain context, telemetry only describes movement, not purpose. It records what happened, but not what <em>failed to happen</em>. And when we lose sight of that, observability stops being a lens and becomes an archive.</p><h4>2. DDD without Domain knowledge is just API design with extra steps</h4><p>Although observability and DDD live in completely different layers of a system, they break for the same underlying reason: a lack of understanding about how the business actually works.</p><p>Teams often adopt DDD expecting that its patterns will reveal the domain, but patterns don’t reveal anything on their own. They only give shape to what the team already understands. Without that understanding, bounded contexts are just boxes drawn for aesthetic symmetry, and ubiquitous language becomes a glossary of renamed database tables.</p><p>This is a common failure mode: the code looks clean, the abstractions look intentional, the diagrams look professional — yet the system behaves nothing like the business. It behaves like a simplified version of the business, imagined by the development team under time pressure.</p><p>The heart of DDD has always been collaboration and discovery. The techniques people associate with it — aggregations, events, contexts — only make sense when they emerge from discussions about the domain. When the domain remains abstract or misunderstood, these patterns turn into accidental complexity. The system becomes harder to evolve because it’s structured around assumptions rather than truths.</p><h4>3. Architectural decisions aren’t about technology — They’re about consequences</h4><p>Cloud-native architectures expand the menu of what’s possible, but more options don’t make decisions easier. If anything, they make it easier to make the wrong choice for the right reasons. You can choose event-driven architectures because they’re elegant, microservices because they’re popular, or serverless because it seems cost-efficient — and still end up with an architecture that is fundamentally misaligned with the domain.</p><p>The most common architectural failures I’ve seen weren’t caused by picking “bad” technology. They were caused by picking something that didn’t match the domain’s rate of change, its consistency requirements, or its operational realities. In other words, architecture failed not because of technology, but because of consequences the team didn’t anticipate.</p><p>Architecture is never neutral. When you pick microservices, you’re choosing operational complexity. When you pick a monolith, you’re choosing structural coupling. When you pick event-driven flows, you’re choosing eventual consistency and message semantics. These trade-offs only make sense when you understand what the business is trying to achieve. Without that anchor, architecture becomes an exercise in preference.</p><h4>4. Cloud-Native Complexity Demands Domain-Native Thinking</h4><p>As cloud-native systems grow, they create a kind of distributed fog. Services interact in ways no single person can fully describe. Behavior emerges from retries, timeouts, partial failures, and automation. And because everything is asynchronous, there’s rarely a single place where “the truth” lives.</p><p>This is why domain understanding becomes so critical. It gives the team a map — something stable to navigate the chaos. Cloud-native patterns amplify both strengths and weaknesses. When the domain is well-understood, the system can evolve rapidly, even autonomously. When the domain is unclear, every new feature introduces unpredictable side effects.</p><p>I’ve seen teams rely on logs from other teams just to understand their own flows. I’ve seen bounded contexts that accidentally overlapped, causing changes in one area to break another. These aren’t technology problems. They’re domain clarity problems. And no amount of cloud-native tooling fixes that.</p><h4>5. When Engineering and Domain Finally Meet</h4><p>Every organization eventually encounters a moment where the technology is sophisticated but the outcomes are disappointing. You have all the right tools, all the right platforms, all the right practices — and yet the business metrics don’t improve. This is usually the moment when the team realizes they’ve been optimizing the wrong things.</p><p>The shift happens when engineers begin asking questions rooted in the domain instead of the stack. What does success look like for this workflow? Which parts of the system actually matter for customer experience? What would happen if this service fails? Does the architecture reflect the real boundaries of the business?</p><p>When teams start asking these questions, everything changes. Observability becomes about understanding behavior, not collecting metrics. DDD becomes about modeling reality, not organizing code. Architecture becomes a set of deliberate, context-aware decisions, not a collection of patterns stitched together.</p><p>This is when engineering stops being reactive and becomes anticipatory. Problems become visible before they become failures. Trade-offs become informed rather than accidental. And the system begins to behave like an extension of the business rather than a parallel universe running on YAML and hope.</p><h4>Lessons Learned</h4><p>After years building distributed systems, refactoring architectures that aged faster than they should, and watching teams fight incidents that dashboards never warned them about, a few lessons have stayed with me. The first is that technology rarely saves us from ourselves. Tools get better every year, but the mistakes remain the same: misunderstanding the domain, modeling too early, instrumenting too late, choosing architectures for the wrong reasons, and assuming that complexity equals sophistication.</p><p>Another lesson is that systems behave exactly as they are designed, but never exactly as we expect. The difference between design and expectation is almost always domain knowledge. When we understand the business flow, surprises become fewer and failures become explainable. When we don’t, even the most advanced cloud-native stack turns into a black box.</p><p>Most importantly, I’ve learned that engineering is not just the act of building; it’s the act of listening. Listening to the domain, to the people who operate it daily, to the outcomes that matter. When we listen well, the system aligns. When we don’t, everything else becomes noise.</p><h3>Conclusion</h3><p>Modern software engineering loves its tools, patterns, and architectures. We celebrate new frameworks, compare benchmarks, automate everything we can and wrap the rest in Kubernetes. But none of that changes a simple truth that becomes clearer the longer you work in this industry: systems don’t fail because they lack technology; they fail because they lack understanding.</p><p>Cloud-native architectures make this even more apparent. They expose how deeply intertwined our systems are with the business models they support. When that model is misunderstood, every decision downstream inherits the confusion. Observability becomes a catalog of machine behavior without meaning. DDD becomes a rearrangement of ideas that never connected to reality. Architecture becomes the pursuit of elegance instead of adequacy.</p><p>But when the domain is understood — truly understood, in conversations that don’t start with API designs or event schemas — everything aligns. You know what matters, so you know what to observe. You know how the business thinks, so models and contexts follow naturally. You know the trade-offs the organization can tolerate, so architectural decisions become grounded rather than aspirational.</p><p>The systems we build start to look less like collections of services stitched together and more like living representations of how the business works. Boundaries make sense. Failures make sense. The signals we collect tell stories we can understand. Engineering becomes less about reacting to incidents and more about shaping behavior intentionally.</p><p>None of this means building perfect systems. Perfection doesn’t exist in distributed architecture, and the best engineers know better than to chase it. What does exist — and what we often overlook — is the idea of fitness. A system that is <em>adequate</em> for its domain is far more resilient, maintainable, observable, and evolvable than a system that is theoretically perfect but contextually naive. Adequacy emerges from clarity, and clarity emerges from the domain.</p><p>The work, therefore, is not merely technical. It’s conversational, collaborative, exploratory. It’s in workshops where sticky notes tell stories. It’s in failures that reveal hidden assumptions. It’s in the uncomfortable “why” questions that uncover the real boundaries of the business. This is where engineering becomes less about engines and more about alignment.</p><p>When engineering listens to the domain, the domain begins to speak through the system. And once that happens, observability becomes insight rather than noise, DDD becomes structure rather than ceremony, and architecture becomes a narrative rather than a diagram. The system finally makes sense — not because it is simple, but because it is aligned.</p><h3>Author’s Note</h3><p>Writing about software has always been my way of making sense of it. I don’t pretend to have the definitive answers, and I’m not interested in prescribing architectures or stacks. What interests me is the space where systems and people intersect — the misunderstandings, the subtle assumptions, the moments where we think we’re building technology but we’re actually modeling a business we barely understand.</p><p>If there’s one thread running through this piece, it’s that engineering becomes meaningful when we stop trying to guess what the business needs and start learning how it truly works. Everything else — tools, patterns, cloud-native trends — becomes easier once the domain stops being a mystery.</p><p><strong>Thanks for reading. If this sparked a memory, a disagreement, or even just a question, that’s exactly the kind of conversation I hope to encourage.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd2c870bb958" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>