<?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 Sid on Medium]]></title>
        <description><![CDATA[Stories by Sid on Medium]]></description>
        <link>https://medium.com/@sid_83671?source=rss-8e5a5004d442------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*AGpcj_cFp3_PXXRbhFU_bA.png</url>
            <title>Stories by Sid on Medium</title>
            <link>https://medium.com/@sid_83671?source=rss-8e5a5004d442------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 23:05:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sid_83671/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[Google Cloud Pub/Sub Request/Reply Between Microservices: Topics, Reply Subscriptions, and Ack…]]></title>
            <link>https://medium.com/@sid_83671/google-cloud-pub-sub-request-reply-between-microservices-topics-reply-subscriptions-and-ack-b6485f827a36?source=rss-8e5a5004d442------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6485f827a36</guid>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[subscription]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Sid]]></dc:creator>
            <pubDate>Tue, 24 Nov 2026 06:04:39 GMT</pubDate>
            <atom:updated>2026-11-24T07:44:56.465Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A-ViIJ-5O7YvD-rlmcCjiQ.png" /></figure><h3>Google Cloud Pub/Sub Request/Reply Between Microservices: Topics, Reply Subscriptions, and Ack Deadlines</h3><h3>TL;DR</h3><ul><li>Google Cloud Pub/Sub has no reply mechanism, and a publish is delivered to every subscription that already exists on the topic, so a service that needs an answer must add a correlation attribute, a reply topic, and a reply subscription that exists before the request is published, or the reply is lost.</li><li>Pub/Sub offers at-least-once delivery by default, so every consumer has to be idempotent. The settings that decide how a request/reply call behaves are the acknowledgment deadline (10 to 600 seconds), the dead-letter policy (5 to 100 delivery attempts), and the subscription retention and expiration periods.</li><li>Message data is capped at 10 MB, and the REST pull method can return an empty response while messages are waiting, so a client that pulls over REST has to poll until its reply arrives or its timeout expires.</li><li>The Graftcode Google Cloud Pub/Sub plugin carries a Graft call over Pub/Sub in two modes: request/reply, where each call carries correlationId and replyTo attributes and the caller reads its own reply subscription, and one-way, where oneWay: true on both sides skips the reply entirely.</li><li>The plugin calls the Pub/Sub JSON REST API with libcurl and ships as a single shared library, so no Google client library is installed on the caller, and the same code path serves the local emulator and production.</li></ul><p>Google Cloud Pub/Sub is the managed messaging service that many teams on Google Cloud use for event ingestion, fan-out to several consumers, and buffering between services. Most of that traffic is one-directional: a service publishes an event and moves on. A different case appears when a service needs the result of work done elsewhere, such as an orchestrator that waits for a scoring service to finish before it writes to a database. Pub/Sub can carry that conversation, but it does not provide the reply half, so the caller has to build it from topics, subscriptions, and message attributes.</p><p>This piece covers how request/reply is built on top of Pub/Sub, which subscription settings decide whether it behaves well, and where duplicate delivery and size limits cause trouble. It then shows how the Google Cloud Pub/Sub plugin for Graftcode carries a typed method call over those same topics, including the configuration for both modes, the IAM permissions each side needs, and a local setup with the Pub/Sub emulator. The AWS equivalent, the Amazon SQS plugin, has its own companion piece, so this one stays with Google Cloud.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bCLCyGHCblp0oSUPY9AkRw.png" /></figure><h3>How Request/Reply Works on Top of Google Cloud Pub/Sub</h3><p>Pub/Sub separates where messages are published from where they are read. A publisher sends to a topic. A subscription is attached to that topic, and subscribers read from the subscription. One topic can have many subscriptions, and each subscription receives its own copy of every message. The plugin’s Readme states the rule that governs replies: a publish to a topic is delivered to every subscription that already exists on that topic, so a subscription created after the publish never sees that message.</p><p>Request/reply therefore needs two topic-and-subscription pairs. The caller publishes the request to a request topic, and the service reads it through a request subscription. The service then publishes the response to a reply topic, and the caller reads it through a reply subscription. Each request carries a correlation identifier so that the caller can match a response to the call that produced it, and it carries the name of the reply topic so that the service knows where to send the answer. Message attributes are the natural home for both values, since they travel alongside the message without changing the body.</p><p>The ordering of setup steps is the part that is easy to get wrong. The reply subscription has to exist before the request goes out, because a response published to a reply topic with no subscription is dropped. The rest of this piece follows from that constraint and from the delivery behavior described next.</p><h3>Why Each Caller Needs Its Own Reply Topic and Subscription</h3><p>Subscribers that read from the same subscription share its messages. Pub/Sub hands each message to one of them, not to all of them. If two caller processes shared a reply subscription, a response meant for the first caller could be delivered to the second, which would not recognize the correlation identifier and would have no way to hand the message back. Any scheme that works around this on the application side adds hand-off logic that has nothing to do with the business problem.</p><p>The simpler arrangement gives every client process a reply topic and a reply subscription of its own. The service learns the reply topic from the replyTo attribute on each request, so it needs no static list of callers and can answer a client that started a minute ago. The cost is a small number of extra Pub/Sub resources per caller process, which is a good reason to create them with deployment tooling in production instead of at runtime.</p><p>The plugin follows this arrangement. Its README tells users to give each client process its own reply topic and reply subscription, and not to share one reply subscription between processes. That rule shapes the configuration shown later, where the client carries replyTopic and replySubscription and the service reads the reply address from the request. Once replies have a reliable route, the next question is what happens to a request when something goes wrong in processing.</p><h3>Acknowledgment Deadlines, Redelivery, and Dead-Letter Topics</h3><p>Pub/Sub tracks whether a subscriber has finished with a message through acknowledgment. According to the subscription overview, Pub/Sub offers at-least-once delivery by default; messages may occasionally arrive more than once or out of order, and a message can even be redelivered after an acknowledgment request returns successfully. The same page states the consequence directly: accommodating more-than-once delivery requires the subscriber to be idempotent. For a request/reply call, an idempotent method leaves the system in the same state whether it runs once or twice with the same input.</p><p>The acknowledgment deadline sets how long Pub/Sub waits before it sends an unacknowledged message again. The subscription properties page gives a default and a minimum of 10 seconds and a maximum of 600 seconds. It also lists two retry policies: retry immediately, which is the default, or retry after an exponential backoff delay with a longest backoff of 600 seconds. A deadline shorter than the slowest call produces duplicate executions of that call, which is one of the most common reasons for surprising behavior in request/reply setups.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kilKeGvqbXHhEgm38guggQ.png" /></figure><p>Messages that never succeed need somewhere to go. A dead-letter topic is configured on the subscription, and the dead-letter topic documentation gives a maximum delivery attempts setting with a default and minimum of 5 and a maximum of 100. The attempt count is approximate, so a message can be forwarded after slightly fewer or more attempts than configured. Pub/Sub also needs publisher and subscriber roles granted to its service account before forwarding works. Without a dead-letter policy, a message that always fails is retried until it expires from retention.</p><p>Google also offers an exactly-once delivery option. The exactly-once delivery page limits it to pull subscriptions and to subscribers that connect in the same region, and it covers redelivery of a message, not the side effects that a handler produces. Treating the handler as idempotent remains the safer design either way. Delivery behavior is only half of the picture, because the way a client reads messages decides how quickly replies arrive.</p><h3>Pull Subscriptions, Polling, and Message Size Limits to Plan Around</h3><p>Pub/Sub offers several ways to read from a subscription. Google’s pull documentation describes StreamingPull, which keeps a long-lived bidirectional connection and is recommended for most use cases, and unary Pull, where each request gets one response. It also warns that a unary response with zero messages does not necessarily indicate that no messages are available. A client built on unary Pull, which is the shape of the REST pull method, therefore has to ask repeatedly and accept some empty answers.</p><p>Size limits shape payload design. Google’s quotas page lists a 10 MB limit on message data, up to 100 attributes per message with a 256-byte limit on attribute keys and a 1,024-byte limit on attribute values, and 7 days of default retention for unacknowledged messages. It also notes that a subscription with no subscriber activity expires, with a default expiration period of 31 days. These last two settings affect services that sit idle: a reply subscription that goes unused for a month can disappear, and a request that waits longer than the retention period is dropped.</p><p>Two practical rules follow. Keep payloads well below the data limit, since the JSON API carries message data as base64, which makes the encoded body about a third larger than the bytes inside it. Set the expiration policy of long-lived subscriptions to never expire when the service must survive quiet periods. With the Pub/Sub side of request/reply laid out, the remaining question is how much of this a team has to write by hand, which is where the Graftcode plugin comes in.</p><h3>Carrying Graft Calls Over Pub/Sub with the Graftcode Plugin</h3><p>The graftcode-extensions repository includes a transport plugin for Google Cloud Pub/Sub. It sends a Graft call through Pub/Sub topics instead of a direct connection to the Gateway. This sits alongside the default transport, like the other broker plugins: a team that already runs on Pub/Sub keeps its topics, subscriptions, IAM, and monitoring, and the plugin reduces the producer and consumer code that would otherwise carry each call. The Gateway still runs the hosted module and exposes its public methods, and the Graft is still the typed interface in the caller.</p><p>The plugin is written in C++ and talks to the Pub/Sub JSON REST API with libcurl. The README explains the choice: the google-cloud-cpp client is built on gRPC, protobuf, and Abseil, which is too heavy for the six-platform release build. OpenSSL signs the service-account token request for production. The release artifact is one shared library, PubSubPlugin.dll on Windows and libPubSubPlugin.so or libPubSubPlugin.dylib elsewhere, with curl, OpenSSL, and the JSON library linked in. Clients do not install any of them separately.</p><p>Request/reply works as follows. In the orchestrator and scoring service example from the introduction, the orchestrator is the client and the scoring service is the module hosted by the Gateway. The client publishes the request to requestTopic with two attributes: correlationId, one value per call, and replyTo, the client’s reply topic. The Gateway pulls requestSubscription, runs the method, and publishes the response to the replyTo topic with the same correlationId. The client pulls its replySubscription until a message with that identifier arrives or rpcTimeoutMs elapses. Because the Gateway reads the reply address from each request, its own configuration needs no reply topic.</p><h3>Configuration for the Gateway and the Client</h3><p>The Gateway side uses a plugin config file. Install the Gateway from a terminal (on Windows, iwr <a href="https://grft.dev/get">https://grft.dev/get</a> | iex; on Linux and macOS, curl -fsSL <a href="https://grft.dev/get">https://grft.dev/get</a> | sh), as a Docker image, or as a binary from the Gateway releases page. The plugin library comes from the extensions releases page, and gg looks for it next to the config file first, then in its working directory. Use a plugin and a Gateway of matching versions, because plugin v1.2.0 introduced a new transport C ABI, so a plugin and a Gateway from different generations may not load together. On Windows, put gg.exe, the hosted module, and PubSubPlugin.dll in one folder, then start the Gateway with — config. The Readme’s emulator example uses the following file:</p><pre>{<br>  &quot;name&quot;: &quot;PubSubPlugin&quot;,<br>  &quot;projectId&quot;: &quot;graftcode-local&quot;,<br>  &quot;emulatorHost&quot;: &quot;localhost:8085&quot;,<br>  &quot;requestTopic&quot;: &quot;graft-requests&quot;,<br>  &quot;ackDeadlineSeconds&quot;: 60,<br>  &quot;autoCreate&quot;: true,<br>  &quot;verifySsl&quot;: false<br>}</pre><pre>.\gg.exe netapp.dll --config pubsubplugin.json</pre><p>The generated package can then be installed from the Graftcode Vision page, served at /GV on the Gateway (the Readme shows <a href="http://localhost:81/GV;">http://localhost:81/GV;</a> check the Gateway log for the actual port on your version). On Linux and macOS the name value is libPubSubPlugin.</p><p>The client side is documented for C# with the Hypertube SDK. The client configuration has no runtime or host keys, because the plugin carries the transport, and each client process needs its own replyTopic:</p><pre>{<br>  &quot;configurations&quot;: {<br>    &quot;graft.nuget.netapp&quot;: {<br>      &quot;plugin&quot;: {<br>        &quot;name&quot;: &quot;PubSubPlugin&quot;,<br>        &quot;projectId&quot;: &quot;graftcode-local&quot;,<br>        &quot;emulatorHost&quot;: &quot;localhost:8085&quot;,<br>        &quot;requestTopic&quot;: &quot;graft-requests&quot;,<br>        &quot;replyTopic&quot;: &quot;graft-replies&quot;,<br>        &quot;rpcTimeoutMs&quot;: 30000,<br>        &quot;ackDeadlineSeconds&quot;: 60,<br>        &quot;autoCreate&quot;: true,<br>        &quot;verifySsl&quot;: false<br>      }<br>    }<br>  }<br>}</pre><pre>using Hypertube.Netcore.Sdk;<br>using Hypertube.Netcore.Sdk.Configuration;<br><br>RuntimeBridge.AddConfig(ConfigPriority.User, configJsonOrPathToFile);<br>var rtmCtx = RuntimeBridge.InitializeRC(&quot;graft.nuget.netapp&quot;);<br>var result = rtmCtx.GetType(&quot;netapp.Calculator&quot;).CreateInstance()<br>    .InvokeInstanceMethod(&quot;Add&quot;, 1, 2).Execute().GetValue();</pre><p>AddConfig accepts a JSON string, a path to a JSON file, or the name of an environment variable that holds either. The key under configurations has to match the name passed to InitializeRC, and only one plugin config should be loaded per process.</p><p>The settings below cover the fields most deployments touch. Defaults come from the Readme and match the values in the plugin’s source.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*HCJiQy7Ovp2AY5f3IwCmKg.png" /></figure><p>Topic and subscription ids are 3 to 255 characters long, start with a letter, and use only letters, digits, -, _, and .. Settings can be written as a flat object, as above, or nested under a pubsub object.</p><h3>What Happens When a Call Fails or Times Out</h3><p>The plugin’s source shows how failures travel, and the behavior differs from what the broker alone would suggest. In the server loop, the Gateway pulls one message per request and finishes handling it before it pulls the next, so a single Gateway process works through requests in sequence. It acknowledges a request only after the method has run and, for request/reply, after the response has been published. If processing throws, returns false, or the reply cannot be published, the request stays unacknowledged and Pub/Sub redelivers it after the acknowledgment deadline.</p><p>A request in request/reply mode that lacks correlationId or a valid replyTo is also left unacknowledged, with a warning in the Gateway log. A dead-letter policy on the request subscription is the way to stop such a message from being retried forever, and the plugin does not change that policy. Because redelivery can happen after the caller has given up, the client treats unmatched replies carefully: it acknowledges every reply it pulls, including ones whose correlation identifier it no longer waits for, so a timed-out call does not leave the reply subscription filling up.</p><p>On the caller’s side, the client code retries a publish that fails with HTTP 404 for up to five seconds, which absorbs the short gap while a topic is created. A permission or not-found error while pulling the reply subscription fails the waiting calls with the HTTP error text, instead of leaving them to wait out the timeout. In the transport layer, a response whose first byte is 255 is thrown on the caller as an exception that carries the rest of the bytes as its message. That is the plugin’s signal for an error reply, and it arrives as a plain exception, not as a type defined by the service.</p><h3>One-Way Calls for Events That Need No Answer</h3><p>Some calls have no useful return value, such as writing an audit record or kicking off a background job. Setting “oneWay”: true on both the client and the Gateway turns the plugin into a fire-and-forget channel. The client omits replyTo and does not wait. The Gateway runs the method, acknowledges the request, and publishes nothing back. A reply topic is not required, and a one-way client needs only requestTopic. The Readme’s one-way client example is the request/reply example without replyTopic and rpcTimeoutMs, with oneWay added.</p><pre>{<br>  &quot;name&quot;: &quot;PubSubPlugin&quot;,<br>  &quot;projectId&quot;: &quot;graftcode-local&quot;,<br>  &quot;emulatorHost&quot;: &quot;localhost:8085&quot;,<br>  &quot;requestTopic&quot;: &quot;graft-requests&quot;,<br>  &quot;oneWay&quot;: true,<br>  &quot;autoCreate&quot;: true,<br>  &quot;verifySsl&quot;: false<br>}</pre><p>One-way mode keeps the delivery properties described earlier. The request is still delivered at least once, so a duplicate execution is possible and the handler has to tolerate it. The oneWay setting has to match on the client and the Gateway, and only one plugin config is allowed per process, so each mode needs its own request topic and its own Gateway. A request/reply Gateway leaves one-way requests unacknowledged, so Pub/Sub redelivers them until they reach a dead-letter topic or expire. With configuration covered, the next step is running the whole arrangement on a laptop before it touches Google Cloud.</p><h3>Local Development with the Pub/Sub Emulator and the Sample Setup</h3><p>Google ships a Pub/Sub emulator, and its documentation describes starting it with gcloud beta emulators pubsub start, the PUBSUB_EMULATOR_HOST variable that points client libraries at it, and the fact that the project id does not need to belong to a real project. The same page lists limits to keep in mind: IAM operations are not supported, configurable message retention is not supported, and subscriptions never expire. Behavior around permissions and expiry therefore needs a test against a real project before launch.</p><p>The plugin treats the emulator and production as one code path. The Readme says the emulator listens on localhost:8085, that PUBSUB_EMULATOR_HOST fills in emulatorHost when it is empty, and that no credentials are sent to the emulator. The emulator does not create topics, so the sample configurations set autoCreate to true, and the plugin creates graft-requests, graft-requests-sub, graft-replies, and graft-replies-sub in the project graftcode-local when the Gateway and the client start.</p><p>For a ready-made environment, the communication-plugin-samples/pubsub folder in the graftcode-extensions repository holds the emulator, a Gateway hosting a sample module, and the plugin configuration. The sample’s run script builds and starts the stack with Docker Compose. It starts three Gateway servers that compete for the same request subscription, which fits how capacity grows: a single Gateway handles one request at a time, and adding Gateway processes on the same subscription adds capacity.</p><h3>Credentials, IAM Roles, and Production Settings Checklist for Google Cloud</h3><p>On Google Cloud, the configuration drops emulatorHost and verifySsl and supplies credentials in one of three ways. The plugin accepts an accessToken (or the PUBSUB_ACCESS_TOKEN variable), a credentialsFile pointing at a service-account JSON key (or GOOGLE_APPLICATION_CREDENTIALS), or the Compute Engine metadata server when neither is set, which suits workloads on Google Cloud that run under an attached service account. A bearer token wins over a key file when both are present.</p><p>Permissions follow the roles each side plays. The Gateway needs pubsub.subscriptions.consume on the request subscription and pubsub.topics.publish on reply topics. A client needs pubsub.topics.publish on the request topic and pubsub.subscriptions.consume on its reply subscription. Google’s access control page maps these permissions to predefined roles: Pub/Sub Publisher holds pubsub.topics.publish, Pub/Sub Subscriber holds pubsub.subscriptions.consume, and creating topics or subscriptions needs the Pub/Sub Editor role or an equivalent custom role. Since autoCreate creates resources, that last requirement is a reason to turn it off in production.</p><p>A short checklist covers the rest of the production changes:</p><ul><li>Set autoCreate to false and create topics, subscriptions, and the dead-letter topic ahead of time, so the runtime identity does not need administrative rights.</li><li>Remove emulatorHost and verifySsl from every production config.</li><li>Set ackDeadlineSeconds above the longest call, and remember that the value in the plugin config applies when the plugin creates a subscription, while a subscription created in advance keeps the deadline it was created with.</li><li>Attach a dead-letter policy to the request subscription, and grant Pub/Sub’s service account the roles it needs on the dead-letter topic.</li><li>Set the expiration policy of request and reply subscriptions to never expire for services that can sit idle for weeks, since the plugin’s create call sets only the name, topic, and deadline, which leaves Google’s defaults in place for everything else.</li><li>Grant the Gateway publish rights on every client’s reply topic, through a project-level role or through per-topic grants that deployment tooling creates together with each client.</li></ul><h3>Where Should You Start with Pub/Sub and Graftcode</h3><p>Pub/Sub carries request/reply once three things are in place: a correlation identifier on every request, a reply topic and subscription for each caller that exist before the first publish, and consumers that tolerate a message arriving twice. The acknowledgment deadline, the dead-letter policy, and the retention and expiration periods decide how that arrangement behaves under failure, and a deadline shorter than the slowest call is the setting most likely to cause surprises. The Graftcode plugin keeps all of this on Google’s side and reduces the code a team writes to use it, since the Graft call, the attributes, the reply routing, and the polling are handled by the plugin.</p><p>The quickest way to evaluate the plugin is the emulator sample: run the communication-plugin-samples/pubsub stack, install the generated package from Graftcode Vision, and make a request/reply call from a .NET client. From there, move the configuration to a real project with autoCreate off, the roles above, and a dead-letter policy attached. The Graftcode Academy covers Graft installation and Gateway setup in detail, and the plugin Readme holds the full configuration reference.</p><h3>FAQs</h3><h3>Does the plugin use the Google Cloud client libraries or streaming pull?</h3><p>No. The plugin calls the Pub/Sub JSON REST API directly with libcurl, using the publish, pull, and acknowledge methods plus topic and subscription creation. Pulls use the unary REST method, which returns immediately when a subscription is empty, so the client polls until its reply arrives or rpcTimeoutMs elapses. The Readme gives the size of the gRPC-based google-cloud-cpp build as the reason for this design.</p><h3>Can several client processes share one reply topic and subscription?</h3><p>No. Each client process needs its own reply topic and its own reply subscription. Subscribers that read from one subscription share its messages, so a reply meant for one process could be delivered to another, which would not match the correlation identifier. The Gateway reads the reply address from the replyTo attribute on each request, so it supports any number of clients without extra configuration.</p><h3>What happens if a call takes longer than the acknowledgment deadline?</h3><p>Pub/Sub redelivers the request when the deadline passes without an acknowledgment, and the method can run a second time while the first run is still in progress. The plugin sets the deadline when it creates a subscription and does not extend it during a call, so ackDeadlineSeconds should be above the longest expected call, and the method should be idempotent. If the first run still publishes a reply after the caller has timed out, the client acknowledges and discards that unmatched reply the next time it pulls its reply subscription.</p><h3>Does the plugin support Pub/Sub exactly-once delivery or ordering keys?</h3><p>The Readme does not mention either feature. It describes the plugin as at-least-once and advises making called operations idempotent, and that is the safe assumption for design. Check with Graftcode before relying on exactly-once delivery or message ordering for a production workload.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6485f827a36" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Claude Code team setup I use so nobody starts in an empty folder]]></title>
            <link>https://medium.com/@sid_83671/the-claude-code-team-setup-i-use-so-nobody-starts-in-an-empty-folder-0df737d37734?source=rss-8e5a5004d442------2</link>
            <guid isPermaLink="false">https://medium.com/p/0df737d37734</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[productivity]]></category>
            <dc:creator><![CDATA[Sid]]></dc:creator>
            <pubDate>Mon, 23 Nov 2026 12:39:56 GMT</pubDate>
            <atom:updated>2026-11-23T12:49:41.662Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*imGwSjJo6PrrRFItyOEH_Q.jpeg" /></figure><p>I do AI adoption work for companies, and these days that mostly means Claude Code. The first week usually goes well. One or two people get hooked. They write a CLAUDE.md, connect a few MCP servers and build a skill or two, and soon they’re getting release notes in the team’s format on the first try.</p><p>Then I look at everyone else. They’re opening Claude Code in an empty folder, and their Claude doesn’t know the product names or that there’s an internal API, so they get generic answers and go back to doing things by hand. Meanwhile the best skill in the company is in ~/.claude/skills/ on one person’s laptop.</p><p>Getting a whole team to use Claude Code well is the hard part of my job, and it mostly comes down to setup. Full disclosure: my company also makes Trina AX, an open-source server for this.</p><h3>What teams try first</h3><h3>A shared repo of skills</h3><p>For a dev team, this is the right first move, and Claude Code is built for it. You commit the setup next to the code:</p><pre>your-repo/<br>├── CLAUDE.md<br>├── .mcp.json<br>└── .claude/<br>    └── skills/<br>        ├── release-notes/<br>        │   └── SKILL.md<br>        └── weekly-report/<br>            └── SKILL.md</pre><p>A skill is a folder with a SKILL.md, and Claude reads the description in its frontmatter to decide when to use it:</p><pre>---<br>name: weekly-report<br>description: Write the weekly status report from this week&#39;s meeting notes and open Linear issues. Use when someone asks for the weekly report or a status update.<br>---<br></pre><pre>Read this week&#39;s notes in docs/meetings/. Pull open issues from Linear.<br>Put blockers first, then what shipped.</pre><p>Everyone who clones the repo gets the CLAUDE.md, the skills and the MCP servers, and changes go through PRs. If your team is all engineers in one codebase, this may be all you need. If the skills span several repos, you can package them as a plugin and have people install it from a team marketplace.</p><p>The trouble starts with people outside engineering. The people I most want running /weekly-report are the PM and the support lead. Neither of them works in GitHub, so a skill that lives in the repo might as well not exist for them.</p><p>.mcp.json has a different problem. The file is shared, but the credentials behind it aren’t:</p><pre>{<br>  &quot;mcpServers&quot;: {<br>    &quot;linear&quot;: {<br>      &quot;type&quot;: &quot;http&quot;,<br>      &quot;url&quot;: &quot;https://mcp.linear.app/mcp&quot;<br>    },<br>    &quot;internal-api&quot;: {<br>      &quot;type&quot;: &quot;http&quot;,<br>      &quot;url&quot;: &quot;https://api.internal.example.com/mcp&quot;,<br>      &quot;headers&quot;: {<br>        &quot;Authorization&quot;: &quot;Bearer ${INTERNAL_API_KEY}&quot;<br>      }<br>    }<br>  }<br>}</pre><p>By default, each person still has to set INTERNAL_API_KEY in their own environment and approve the project’s servers the first time they run claude in the repo. If the variable isn’t set, Claude Code still loads the server with the literal string ${INTERNAL_API_KEY} and warns about it in claude mcp list and /mcp. In practice, a few people never get the internal API working, and they’re the ones who tell me Claude can’t see the data.</p><p>If your company is on Claude Team or Enterprise, a lot of this is covered. Skills, plugins and connectors your admins set up on claude.ai work in claude.ai and Cowork, and they also show up in Claude Code for anyone signed in with their claude.ai account rather than an API key. A shared claude.ai Project gives everyone on it the same files and instructions, though each chat in it stays private unless the person who started it shares it. If your team lives in Slack, Claude Tag (in public beta) gives each channel the tools an admin sets up once, and anyone in a thread can jump into a session a colleague started.</p><h3>A wiki page of prompts</h3><p>The next thing teams try is a Notion or Confluence page called something like “How we use Claude,” full of prompts to copy. The appeal is that everyone can open it.</p><p>It goes stale fast, and people end up pasting last quarter’s version. Even if Claude can read the page through a Notion connector, it still won’t have the files or API access the prompt was written for.</p><h3>Everyone on their own</h3><p>Most teams end up here without ever deciding to. Each person writes their own CLAUDE.md and keeps their good prompts in a notes app. Results swing a lot from person to person, and when your best user goes on vacation or quits, their setup goes with them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AagwvxIb3X4s4qTXAdYd3A.png" /></figure><h3>What needs to be shared</h3><p>When I sit down with the one person whose Claude actually works and write down why, I get roughly the same list every time: their CLAUDE.md and skills, the MCP servers and accounts behind their tools, and the files Claude reads, like the pricing sheet and the past reports it copies the format from.</p><p>Then there’s the session itself, which almost nobody puts on the list. When you’re stuck halfway through a task, that session has a lot of context in it, and by default it lives in a .jsonl file under ~/.claude/projects/ on your laptop. You can /export it and send the text, or copy the file over and run claude — resume with its full path, but then your teammate picks it up on their own machine, with their own folder and MCP setup, which was the problem to begin with. On Team and Enterprise, cloud sessions on claude.ai/code can be shared with your organization, so a teammate can open the link and see how far it got.</p><p>What I want is for the PM to get the real /weekly-report, with the internal API and last quarter’s reports behind it, on a server and API key the company owns. And when someone gets stuck, anyone on the team should be able to open their session and finish it.</p><h3>Setting it up in Trina AX</h3><p><a href="https://github.com/trina-app/trina-ax">Trina AX</a> runs Claude Code and Codex on one server, and the team works in its chat instead of each person setting up Claude Code on their own laptop. I set up the skills, connections and files once, and everyone has them from their first message. The company plugs in its own Claude API key (or an OpenAI key for Codex), and whatever runs on that key is <a href="https://code.claude.com/docs/en/legal-and-compliance#authentication-and-credential-use">billed to the company</a>. It’s AGPL-3.0 and free to self-host.</p><p>Team skills are plain folders on the server’s team drive, each with a SKILL.md using the same name and description frontmatter as above. Save one at skills/weekly-report/SKILL.md and people can pick it by typing /. To bring over existing skills, I point “Bring my skills” at ~/.claude or a project’s .claude folder, and it picks up the skills, commands and any CLAUDE.md inside that folder.</p><p>For tools, I go to Admin › Connected apps and pick an app like Notion or Linear, or add any MCP server by its URL. I either connect it once with a team account for the people who need it, or set it up as a template so each person signs in as themselves. For an internal API with no MCP server, I paste in its base URL and a few notes on which endpoints to call, then choose whether everyone adds their own key or the team shares one. The pricing sheet and past reports go on the team drive. Then I invite the team, and nobody else has to install Claude Code or copy a skill folder.</p><h3>Picking up a teammate’s session</h3><p>Claude Tag does this in Slack threads. In Trina AX it happens in a team project, on a server you can run yourself. A chat started in a team project is shared with its members unless whoever starts it picks “Only me.” When someone is halfway through something and gets stuck, or just goes home, a teammate opens that same chat from the project and keeps going. They see the whole conversation so far, and each new message runs on the server with the permissions of whoever sent it.</p><p>I use it most when someone asks why their draft came out badly. I open the project chat it came from, and reading it usually shows me which skill needs fixing. It also helps when someone’s out sick, since their half-finished work is right there in the project.</p><h3>If you’re moving an existing setup</h3><p>If one person on your team already has a setup that works, this is the order I’d move it in, whatever tool you end up using.</p><ol><li>List what your best user actually relies on. You won’t move all of it, but you need the whole list before you decide what to move.</li><li>their instruction files: every CLAUDE.md (including ~/.claude/CLAUDE.md and CLAUDE.local.md), rules in .claude/rules/ and ~/.claude/rules/, and anything they pull in with @ imports</li><li>their auto memory in ~/.claude/projects/&lt;project&gt;/memory/</li><li>every skill, command and subagent under ~/.claude/ and the project’s .claude/ (skip ~/.claude/skills/synced/, which comes from claude.ai)</li><li>the plugins they have enabled (claude plugin list; skip the @synced ones, which also come from claude.ai) and any hooks in their settings</li><li>the folders they point Claude at, and their MCP servers (claude mcp list in the project)</li><li>Find the duplicates. When a personal skill and a project skill share a name, <a href="https://code.claude.com/docs/en/skills#resolve-skills-that-share-a-name">Claude Code runs the personal one</a>, so a copy someone tweaked for their manager can shadow the team’s version without anyone noticing. Diff the two and merge them before you move anything. The personal copy is often the better one.</li><li>Strip anything machine-specific out of each skill, like absolute paths, commands that need tools only they have installed, and references to files that only exist on their laptop. Read their auto memory too: what’s true for the whole team goes in the shared CLAUDE.md, and the rest stays theirs.</li><li>For each connection, decide whether the team shares one account or everyone signs in as themselves.</li><li>Move over the files their Claude reads most, like templates and past reports.</li><li>Pick one skill that someone outside engineering will use this week, and watch them use it. If they get stuck on the first prompt, fix that skill before you add more.</li></ol><p>Here’s our 80-second product video. It follows a new hire’s first day in Trina AX:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F-Nd5EiLh6z8%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D-Nd5EiLh6z8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F-Nd5EiLh6z8%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/25d205c1757c9c4498a9beb5bfb1b09a/href">https://medium.com/media/25d205c1757c9c4498a9beb5bfb1b09a/href</a></iframe><p>The repo is at <a href="https://github.com/trina-app/trina-ax.">https://github.com/trina-app/trina-ax.</a></p><p>If you’re on Claude Team, have org skills on claude.ai replaced the repo versions for your non-engineers, or do the two drift apart?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0df737d37734" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Playwright MCP for Test Automation: What It Does Well and Where It Breaks]]></title>
            <link>https://medium.com/@sid_83671/playwright-mcp-for-test-automation-what-it-does-well-and-where-it-breaks-44073804a7da?source=rss-8e5a5004d442------2</link>
            <guid isPermaLink="false">https://medium.com/p/44073804a7da</guid>
            <category><![CDATA[mcps]]></category>
            <category><![CDATA[playwright-mcp]]></category>
            <category><![CDATA[ai-agents-in-action]]></category>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[claude-code]]></category>
            <dc:creator><![CDATA[Sid]]></dc:creator>
            <pubDate>Tue, 17 Nov 2026 12:53:12 GMT</pubDate>
            <atom:updated>2026-11-18T05:11:43.821Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*itAZDSQBKY2uUAHMGdnjhg.png" /></figure><p>Playwright MCP is good at one job: letting an AI agent such as Claude Code drive a real browser, read the page, and draft Playwright steps from what it sees. It breaks when those drafts go into CI unreviewed. In my own run, a single product-list snapshot cost 10,720 tokens, and the locator it wrote for one button depended on the product’s price.</p><p>I work as a technical writer with QualityLogic, and during consultations, we often hear one question: “Do you use any AI tools to test?” Some want to hear yes, and others see a yes as a deal-breaker. Underneath, both are asking the same thing: who checks the AI’s work? This post answers that question, with the test data to back it up.</p><h3>What Is Playwright MCP?</h3><p>Model Context Protocol (MCP) is the open standard <a href="https://www.anthropic.com/news/model-context-protocol">Anthropic announced in November 2024</a> for connecting AI assistants to outside tools and data. Playwright MCP is Microsoft’s MCP server for the browser. It hands an agent a set of browser tools and describes each page through <a href="https://playwright.dev/mcp/introduction">structured accessibility snapshots</a>, so no vision model is needed.</p><p>Every element in a snapshot gets a ref, such as e14. The agent picks a ref, the server runs the matching Playwright call, and the response includes the exact code it ran. The returned code is why testers care: each action leaves behind a line of Playwright you can keep.</p><h3>How Do You Set Up Playwright MCP With Claude Code?</h3><p>One command registers the Playwright MCP server with Claude Code:</p><p>claude mcp add playwright npx @playwright/mcp@latest</p><p>That’s the setup from the <a href="https://github.com/microsoft/playwright-mcp">official repository</a>, and it’s all a single-machine Playwright MCP Claude Code setup needs. Adding — scope project writes a .mcp.json file into the repo, so the whole team runs the same configuration. The package is still pre-1.0, so pin a version for anything shared, because tool names and arguments do change. I hit this myself: browser_click in version 0.0.83 takes a target argument, and the ref field older tutorials show no longer validates.</p><h3>Which Tools Does the Playwright MCP Server Expose?</h3><p>My install of @playwright/mcp 0.0.83 loaded 25 core tools. The ones a test workflow leans on are browser_navigate, browser_snapshot, browser_click, browser_type, browser_fill_form, browser_wait_for, and browser_take_screenshot. The documentation’s “70+ tools” figure includes opt-in groups you enable with — caps, such as vision, network, storage, and testing. The testing group adds browser_generate_locator and a set of browser_verify_* assertion tools.</p><h3>How Did I Test Playwright MCP?</h3><p>I ran @playwright/mcp 0.0.83 in headless Chromium and called its tools directly through the MCP TypeScript SDK, with no model in the loop. That way, the numbers describe the server’s output alone, with no model reasoning mixed in. I built three local pages for it:</p><ul><li><strong>A Login Page:</strong> 15 interactive and structural elements, close to a sign-in screen.</li><li><strong>A Product Listing: </strong>60 product cards, each with an image, price, size picker, “Add to cart” button, and details link.</li><li><strong>A Checkout Page:</strong> An off-screen confirmation drawer and a collapsed error panel, both invisible to a real user.</li></ul><p>I counted tokens with the o200k_base tokenizer, so counts for Claude models will differ slightly. It’s a small, controlled test of what the server returns. Model accuracy is a separate question, covered by the practitioner trials cited below.</p><h3>What Does Playwright MCP Do Well?</h3><p>Its strengths show up in one activity: exploring an app you don’t know yet.</p><h3>It Reads the Page Instead of Guessing Selectors</h3><p>Without a browser connection, a coding agent writes selectors from memory. In a <a href="https://www.youtube.com/watch?v=IkJSCmnVnAw">FicusRoot Claude Code lesson</a>, Claude Code alone wrote about 14 tests for a demo banking app, and the presenter’s verdict was blunt: “So, it is guessing the locators.” With Playwright MCP connected, the same agent opened the page and pulled the real field names.</p><p>My run showed the same thing at the code level. Clicking the “Sign in” ref produced page.getByRole(‘button’, { name: ‘Sign in’ }), and typing into the email field produced page.getByRole(‘textbox’, { name: ‘Email’ }).fill(…). Those are role-based locators, the kind Playwright’s own guidance prefers over CSS paths.</p><h3>The Server Is Fast Enough for Exploration</h3><p>Snapshot calls in my run returned in under 100 milliseconds, and clicks took about 0.6 seconds. The first navigation took up to 3.6 seconds while the browser launched. In real sessions, the slow part is the model deciding what to do next. One practitioner at Testomat.io <a href="https://testomat.io/blog/playwright-mcp-claude-code/">reported that running a single scenario through Claude took about seven minutes</a>.</p><h3>It Finds Bugs While It Explores</h3><p>Agents also try inputs a person might not think to try. In the FicusRoot demo, the planner noticed that the transfer form accepted a negative amount, which is a real defect in that demo app. That’s the best use I’ve seen for Playwright MCP: a second check during exploratory testing, with a person deciding which findings are bugs.</p><h3>It Gives You a Head Start on Broken Tests</h3><p>Microsoft added three Test Agents (planner, generator, and healer) in <a href="https://playwright.dev/docs/release-notes">Playwright 1.56</a>, and they run on the same MCP tooling. In Artem Bondar’s <a href="https://bondaracademy.com/blog/playwright-ai-agents-review">hands-on review</a>, the healer fixed both of his failing tests in about 10 minutes. His advice: “If you try one agent, make it the Healer.”</p><h3>Where Does Playwright MCP Break?</h3><p>The first three failures below trace back to the same design choice: the agent sees an accessibility snapshot of the page, and only that.</p><h3>Snapshots Fill the Context Window Fast</h3><p>The login page snapshot cost 276 tokens. The product listing cost 10,720 tokens and carried 487 refs, most of them for links and buttons the test never touched. The 25 tool definitions add another 4,396 tokens to every session before the agent does anything.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EVgH5w82R1tOciGH1jZtVQ.png" /></figure><p>Bar chart of tokens added to context by Playwright MCP: login page snapshot 276 tokens, tool definitions 4,396 tokens, product list snapshot with 60 cards 10,720 tokens.</p><p>Caption: A product grid costs about 39 times more context than a login form. Source: my run of @playwright/mcp 0.0.83, October 2026.</p><p>Those numbers compound, because most tools return a fresh snapshot after each action. Charly Poly, in a post that compares Playwright MCP with Stagehand, measured this across eight sites and <a href="https://itnext.io/why-does-playwright-mcp-use-so-many-tokens-da56b6dbd2db">found median inputs of 12.9k to 14.1k tokens per call</a>. His summary: “Old snapshots don’t disappear, they stay in the conversation history.” On a 12-page form, both of his Playwright MCP setups hit the 40-step limit in all three runs without finishing.</p><p>The <a href="https://playwright.dev/mcp/snapshots">snapshot documentation</a> lists the levers that help:</p><ul><li>browser_find: Returns only matching nodes, which the docs recommend for large pages.</li><li>target and depth: Scope a snapshot to one region of the page.</li><li>— snapshot-mode=none: Stops snapshots from being attached to every response.</li></ul><h3>Generated Locators Can Lock In Brittle Text</h3><p>On the product listing, I clicked the third “Add to cart” button out of 60 identical ones. Playwright MCP had to make the locator unique, and it did that with the card’s visible text, price included.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qp8Y2GIMnO4aUkk1yJLgRg.png" /></figure><p>Playwright MCP output for clicking one of 60 identical Add to cart buttons. The generated locator filters list items by the text ‘Trail Shoe Model 3$43.’, so the price is part of the selector.</p><p>Caption: The generated step works today and fails the day the price moves off $43.99. Source: my run of @playwright/mcp 0.0.83, October 2026.</p><p>Bondar saw related failures in his <a href="https://bondaracademy.com/blog/is-playwright-mcp-worth-it">Playwright MCP trial</a>: a generic locator matched two Delete buttons, and an “Edit Article” button was targeted as a link. An eight-step test took five attempts plus manual fixes. He traces those locator choices to what the agent saw in the accessibility snapshot, which describes elements by role and name.</p><p>The fix is upstream of the agent. Give repeated components a unique accessible name or a test ID, and tell the agent your locator priority in a project instructions file. Then read every generated locator before it gets committed.</p><h3>Hidden UI Shows Up in the Snapshot as if It Were Visible</h3><p>On the checkout page, the snapshot listed “Order confirmed” and “Payment declined” before anything was clicked. The first sat in an off-screen drawer, and the second sat in a zero-height panel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EDY1RS7UVika_4WLrv6gFg.png" /></figure><p>Playwright MCP snapshot of a checkout page listing two paragraphs, Order confirmed and Payment declined, although one sits in an off-screen drawer and the other in a zero-height panel.</p><p>Caption: Both messages read as present to the agent, while a real user sees neither. Source: browser_snapshot output from my run, October 2026.</p><p>That’s a false-pass risk. An agent that reads “Order confirmed” in the snapshot can write toHaveText() checks that pass even though no user ever saw the message, because toHaveText() compares the element’s text and doesn’t check visibility. The Currents team <a href="https://currents.dev/posts/playwright-mcp">tracks this as issue #39955</a>. A Playwright maintainer replied that the right behavior is unclear and gave it a low priority while collecting feedback. Playwright <a href="https://playwright.dev/docs/actionability#visible">treats an element as visible</a> when it has a non-empty bounding box and no visibility:hidden style. So toBeVisible() fails for display:none, visibility:hidden, and zero-size elements, but it still passes for content in an off-screen drawer. For a message the user is supposed to see on screen, use toBeInViewport(), which fails when the element sits outside the viewport.</p><p>The same gap affects accessibility. Off-screen content stays in the accessibility tree, which is why screen readers can still reach it. A stale confirmation message hiding in a drawer can confuse a screen reader user in the same way it confuses the agent.</p><h3>A Test That Confirms Current Behavior Locks In Wrong Behavior</h3><p>An agent writes assertions from what the app does right now. If the transfer form accepts a negative amount and nobody has flagged it, an agent can write a test asserting that the transfer succeeds. That test turns green and protects the bug.</p><p>Two habits reduce this. Write acceptance criteria before the agent runs, so assertions come from what the app should do. And generate tests with a different model from the one that wrote the code, since similar models share the same blind spots. QualityLogic’s CTO, Jim Zuber, covers the bigger version of this problem in <a href="https://www.qualitylogic.com/knowledge-center/verification-debt-why-ais-speed-creates-technical-risk/">verification debt</a>, the cost of never checking the assumptions AI makes when it interprets a loosely worded prompt.</p><h3>Keep Production Credentials Away From the MCP Server</h3><p>browser_run_code_unsafe is part of the core tool set and runs arbitrary JavaScript in the Playwright server process, so treat it as remote code execution. Microsoft states in the <a href="https://github.com/microsoft/playwright-mcp">Playwright MCP README</a> that the server is not a security boundary. It has no authentication option of its own, and by default the browser profile keeps login state between sessions. Run it with — isolated and dedicated test accounts, and keep production credentials out of the browser it controls.</p><h3>Results Drift From One Model or Run to the Next</h3><p>Agent output can vary from one model or run to the next, so write your framework standards down in a shared instructions file that every run starts from. The Playwright healer <a href="https://playwright.dev/docs/test-agents">re-runs a failing test until it passes or its guardrails stop the loop</a>, and it skips the test when it believes the functionality itself is broken. Treat any test the healer skips as a likely app bug for a person to review.</p><p>Run any agent-written spec many times before merging it. The Currents team runs a spec with — repeat-each 25 to flush out timing-dependent failures before they reach the main branch.</p><h3>Should You Use Playwright MCP or the Playwright CLI With Claude Code?</h3><p>Microsoft answers this one in the <a href="https://github.com/microsoft/playwright-mcp">Playwright MCP README</a>. Coding agents may do better with the Playwright CLI plus skills, because CLI calls are more token-efficient and skip the large tool schemas. MCP fits agent loops that need persistent browser state and step-by-step reasoning about the page.</p><p>My read after the test, for any Claude Code Playwright workflow: use Playwright MCP to explore a flow, reproduce a bug report, or work out why a step fails. Use the CLI, or plain Playwright Test files, for anything that lives in the repo and runs in CI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*34YVbR64ZFaDUn0PClHLeg.png" /></figure><p>Comparison infographic matching testing jobs to tools: explore an unknown flow with Playwright MCP, write repo tests with Playwright CLI plus skills, repair a broken test with the healer agent plus review, record a known flow with Playwright Codegen, and decide what to test and sign off the release with a QA engineer.</p><p>Caption: Match the tool to the testing job. Based on Microsoft’s Playwright MCP and CLI documentation, the Playwright 1.56 release notes, and my own runs.</p><h3>Where Do Playwright Test Agents Fit?</h3><p>You install the Test Agents with npx playwright init-agents — loop=claude. Bondar’s timings show what to expect on his test app. The planner ran for 14 minutes and wrote a 1,500-line plan that included steps for fields it never visited. The generator ran for 15 minutes and produced two tests, and both failed. The healer then fixed both.</p><p>So the planner and generator give you a fast first draft that still needs a QA engineer’s edit. The healer is the one Bondar suggests trying first, and it fits a suite you already have.</p><h3>How Does QualityLogic Answer “Do You Use AI Tools to Test?”</h3><p>QualityLogic’s answer is yes. The team uses Claude Code, Playwright is usually where it starts for web automation, and the full list of AI tools it works with is on its <a href="https://www.qualitylogic.com/our-company/technical-capabilities/">technical capabilities page</a>. The more useful part of the answer is what happens around the tool.</p><p>Buyers are right to ask. In <a href="https://survey.stackoverflow.co/2026/ai">Stack Overflow’s 2026 Developer Survey</a>, 48% of developers said they trust AI when they can easily validate its answers. Code volume has gone up, but the capacity to verify it hasn’t. An agent that writes tests faster doesn’t add verification capacity on its own.</p><p>Based on what broke in my run, this is the bar I’d hold agent-written Playwright tests to before trusting them:</p><ul><li><strong>The Strategy Comes First:</strong> A person decides what to test and what “correct” means before any agent opens a browser.</li><li><strong>Every Locator Gets Read:</strong> Text-based filters, positional nth() calls, and anything tied to prices or dates get replaced.</li><li><strong>Assertions Check What the User Sees: </strong>Messages get toBeVisible() and toBeInViewport(), and expected values come from acceptance criteria.</li><li><strong>Specs Earn Their Place in CI:</strong> Repeated runs before merge, and a person reviews any fix a healer applies.</li></ul><p>Automation also needs preconditions before any of this pays off: a stable test environment, a way to set test state, test cases with clear acceptance criteria, and unique identifiers or a resilient locator strategy. Without those, an agent produces brittle tests faster. Paul Morris, QualityLogic’s Director of Engineering, lays out the maintenance side in <a href="https://www.qualitylogic.com/knowledge-center/maintaining-and-scaling-automation-avoid-test-rot-flaky-suites/">avoiding test rot and flaky suites</a>.</p><p>When QualityLogic builds an automation program for the web, <a href="https://www.qualitylogic.com/knowledge-center/automated-qa-testing-speed-cost-efficiency/">Playwright is usually where it starts</a>. Clients own every test script QualityLogic creates, whichever tools helped write it, and the scripts can go straight into the client’s own repository as they’re built. Any test an AI agent drafts on a QualityLogic project is reviewed by a QA engineer before it goes into the client’s suite.</p><h3>When Is Playwright MCP Worth It for Your Team?</h3><p>Playwright MCP earns its place when the job is learning an app quickly:</p><ul><li>Exploring an unfamiliar app or a new feature with well-labeled UI</li><li>Reproducing a bug report step by step and capturing the Playwright code that triggers it</li><li>Drafting first-pass specs that a QA engineer then edits</li><li>Diagnosing a failing step after a UI change</li></ul><p>It struggles with canvas or WebGL interfaces (those need — caps=vision), apps where buttons lack accessible names, long multi-page flows on a tight token budget, and any session that touches production credentials. It also can’t make the release call. Deciding whether behavior is correct is still a QA engineer’s job.</p><p>If your team is weighing where agent-written tests belong in your pipeline, QualityLogic’s <a href="https://www.qualitylogic.com/testing-services/test-automation/">test automation services</a> team builds and maintains automation suites for teams that want them stable over time, with Playwright as its usual starting point for web. You can <a href="https://www.qualitylogic.com/contact/">book a consultation</a> to talk through your current suite.</p><h3>Frequently Asked Questions</h3><h3>Is Playwright MCP Free?</h3><p>Playwright MCP is free and open source from Microsoft, and it installs through npm. The cost comes from model usage, since every snapshot the agent reads counts toward your token bill.</p><h3>How Do I Add Playwright MCP to Claude Code?</h3><p>Run claude mcp add playwright npx @playwright/mcp@latest. Add — scope project to save the configuration in .mcp.json so your team shares it. Pin a version once the setup works, because the package is still pre-1.0.</p><h3>Does Playwright MCP Use Screenshots?</h3><p>By default, Playwright MCP reads accessibility snapshots, which are text descriptions of the page’s elements and roles. Screenshots are available through browser_take_screenshot. Coordinate-based clicking for canvas or custom widgets needs the opt-in — caps=vision group.</p><h3>Can Playwright MCP Run in a CI Pipeline?</h3><p>It can run headless, but the agent loop isn’t deterministic, so it’s a poor fit as a CI test runner. Commit the Playwright Test files the agent helped write, review them, and run those in CI with the standard Playwright runner.</p><h3>Why Does Playwright MCP Use So Many Tokens?</h3><p>Most tools return a full accessibility snapshot after each action, and earlier snapshots stay in the conversation. In my test, a 60-card product page cost 10,720 tokens per snapshot. Scoping snapshots with browser_find, target, or — snapshot-mode=none cuts that down.</p><h3>Which Browsers Does Playwright MCP Support?</h3><p>Playwright MCP supports Chrome, Firefox, WebKit, and Edge, and runs headed by default. Use — headless for unattended runs and — browser to pick the engine.</p><h3>Can Playwright MCP Replace a QA Team?</h3><p>Playwright MCP speeds up exploration, drafting, and locator repair. Deciding what to test, judging whether the app’s behavior is correct, and signing off a release still need a QA engineer. Bondar’s trial needed five attempts plus manual fixes for one eight-step test, which shows where the human time goes.</p><h3>Does QualityLogic Use AI Tools in Testing?</h3><p>QualityLogic’s team works with AI-assisted tools, including Claude Code, and Playwright is usually the starting point for new web automation programs. The full list is on QualityLogic’s <a href="https://www.qualitylogic.com/our-company/technical-capabilities/">technical capabilities page</a>. Any test an AI agent drafts on a QualityLogic project is reviewed by a QA engineer before it goes into the client’s suite, and clients own every test script QualityLogic creates.</p><p><strong>Disclosure: </strong>I’m a technical writer who works with QualityLogic. I ran these tests on local pages I built, with no client code or data, and QualityLogic’s technical team reviewed the findings.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=44073804a7da" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Do You Really Need a Separate MCP Server?]]></title>
            <link>https://medium.com/@sid_83671/do-you-really-need-a-separate-mcp-server-f74d5a9b2f61?source=rss-8e5a5004d442------2</link>
            <guid isPermaLink="false">https://medium.com/p/f74d5a9b2f61</guid>
            <category><![CDATA[mcps]]></category>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[developer-tools]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Sid]]></dc:creator>
            <pubDate>Mon, 19 Oct 2026 06:13:40 GMT</pubDate>
            <atom:updated>2026-11-24T07:45:20.159Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*BXg88F7nzVKIuJST_WYRCw.png" /></figure><h3>TL;DR</h3><p>Teams reach for a hand-written MCP server whenever a service needs to be agent-accessible, yet a study of 116 official servers found that 92% are thin wrappers around existing APIs, so the wrapper becomes upkeep that follows every code change. A standalone server earns its place for third-party APIs, curated tool sets, and resources or prompts. This guide covers what a compliant server contains, those cases, the context cost of tool count, and how Graftcode Gateway exposes hosted public methods as MCP tools, with a checklist to decide.</p><h3>Getting Started: What an MCP Server Is and Contains</h3><p>The Model Context Protocol (MCP) was introduced by Anthropic on 25 November 2024 to replace the custom, per-source integrations that connected AI applications to data and tools, as<a href="https://www.anthropic.com/news/model-context-protocol"> Anthropic’s announcement</a> describes. Adoption followed quickly. According to<a href="https://en.wikipedia.org/wiki/Model_Context_Protocol"> Wikipedia’s summary of the protocol’s history</a>, OpenAI adopted MCP in March 2025, Google DeepMind followed in April 2025, and Anthropic donated the protocol to the Linux Foundation’s Agentic AI Foundation in December 2025. That reach is part of why “we need an MCP server” has become the default answer whenever a service must be reachable by an agent.</p><p>The<a href="https://modelcontextprotocol.io/specification/2026-07-28"> latest specification</a> defines three roles. Hosts are the LLM applications that start connections, clients are connectors inside a host, and servers provide context and capabilities, all exchanged as JSON-RPC 2.0 messages. A server can offer three kinds of primitives: tools, which are functions the model can execute; resources, which are context and data; and prompts, which are templated messages and workflows. An agent discovers tools by sending a tools/list request, receives a name, description, and JSON Schema for each one, and invokes a tool with tools/call.</p><p>Two standard<a href="https://modelcontextprotocol.io/specification/2026-07-28/basic/transports"> transports</a> carry those messages. With stdio, a client launches the server as a subprocess and exchanges newline-delimited messages over the standard streams. With Streamable HTTP, each message is an HTTP POST to a single MCP endpoint, and replies arrive as a JSON object or a request-scoped SSE stream. In this guide, a separate MCP server refers to a standalone program written to sit in front of existing business logic and answer those requests.</p><p>To keep the discussion concrete, this guide follows a hypothetical 12-person SaaS team, called Atlas Support here, that is building a support-triage agent. The agent needs three capabilities that live in three services: order lookup in a Python service, refund calculation in a .NET service, and customer notification in a Node.js service. The team can write one MCP server per service, write a single aggregating server, or let each service expose its own endpoint. Each option puts the tool definitions, security controls, and upkeep in a different place.</p><h3>Why Teams Default to Writing a Standalone MCP Server</h3><p>The usual pattern is the same across most teams: pick an existing service, start a new repository, and write a server that wraps it, with one tool definition per method the agent should reach. This is a reasonable first instinct, because a dedicated server was the only way to speak MCP before frameworks began exposing existing services automatically. The pattern then gets applied uniformly, including to services a team already owns, runs, and exposes through other interfaces. A service with twenty public methods ends up with a second project whose job is to re-describe those twenty methods in MCP’s schema format and keep that description accurate as the service evolves.</p><h3>What a Hand-Written MCP Server Has to Contain</h3><p>The<a href="https://modelcontextprotocol.io/specification/2026-07-28/server/tools"> tools page of the specification</a> shows what a server carries once an agent depends on it:</p><ul><li><strong>Tool definitions</strong>: every tool needs a unique name (the spec recommends 1 to 128 characters), a description, and a JSON Schema inputSchema, with an optional outputSchema and annotations that clients must treat as untrusted unless the server is trusted.</li><li><strong>Protocol handling</strong>: a server that supports tools declares the tools capability and answers tools/list, and it reports failures either as JSON-RPC protocol errors or as tool execution errors marked isError so a model can retry.</li><li><strong>Transport</strong>: a stdio entry point for local use, a Streamable HTTP endpoint for remote clients, or both, which are separate code paths to build and test.</li><li><strong>Security controls</strong>: the spec states that servers must validate all tool inputs, implement access controls, rate limit tool invocations, and sanitize tool outputs.</li><li><strong>Authorization for remote servers</strong>: optional in the spec, but HTTP-based servers that support it should follow its<a href="https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization"> OAuth 2.1 based flow</a>, in which the MCP server acts as a resource server, publishes OAuth 2.0 Protected Resource Metadata, and validates that tokens were issued for it.</li></ul><p>Multiplied across Atlas Support’s three services, that list becomes three tool manifests, three transports, and three sets of security controls, each maintained next to the service it describes. A tool definition is also a second copy of a service’s interface. For an order lookup method, it looks like this:</p><pre>{<br>  &quot;name&quot;: &quot;get_order&quot;,<br>  &quot;description&quot;: &quot;Look up an order by its ID&quot;,<br>  &quot;inputSchema&quot;: {<br>    &quot;type&quot;: &quot;object&quot;,<br>    &quot;properties&quot;: {<br>      &quot;orderId&quot;: { &quot;type&quot;: &quot;string&quot;, &quot;description&quot;: &quot;Order identifier&quot; }<br>    },<br>    &quot;required&quot;: [&quot;orderId&quot;]<br>  }<br>}</pre><p>If the Python method later renames its parameter from orderId to order_id, this definition has to change in the same release, or the agent keeps sending the old field name. A stale definition describes a method that no longer behaves the way its schema claims, and an agent has no way to detect that until a call fails in a way that does not match what it was told to expect. Multiply that by every method a service exposes and every release it ships, and the manifest becomes a standing review item for the team that owns the service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*9xmf-30G0JbMg1GDIvyYcg.png" /></figure><h3>When a Standalone MCP Server Is Still the Right Call</h3><p>Some situations call for a standalone server, and the clearest is wrapping a third-party API. A payments provider or an issue tracker runs outside the team’s control, so there is no service of the team’s own to host under a Gateway, and exposing it to an agent requires writing a server that translates its existing API into MCP’s schema format.</p><p>Curation is the second case. An<a href="https://arxiv.org/abs/2507.16044"> empirical study of 116 official MCP servers</a> found that servers expose a median of 19% of the operations in the API they wrap, so shaping a smaller, task-oriented tool set is common practice and often wise. A refund workflow, for example, may need one calculate_refund tool even when the underlying service has a dozen related methods. Aggregation and server-level policy form the third case. A single server in front of several backends gives an agent one endpoint, one authorization boundary, and one place for OAuth flows, per-call token validation, rate limiting, and audit logging, and teams with strict requirements in those areas typically want direct control over that code.</p><p>Resources and prompts form the fourth case. A server built to hand an agent a document, a schema, or a prompt template supplies something a service’s public methods were never designed to provide. Each of these cases involves genuine translation, curation, or policy work. Many wrappers add only translation from one interface to another for a service the team controls end to end, and that group is where maintenance cost accumulates.</p><h3>When the Wrapper Becomes Duplicated Maintenance Work</h3><p>The same study shows how mechanical most wrappers are. Of the servers it examined, 92% implement tools as thin wrappers around existing APIs, and 88.6% are fully or partially backed by REST APIs. Automated generation from OpenAPI specifications succeeded for 76% of sampled tools at baseline and 94.2% after automated specification repair, and filtering and regrouping cut the median tool count per API by about one-third. Those numbers show that wrapping can be automated, and they also show that the result still needs repair and curation.</p><p>Each generated or hand-written manifest is another artifact that has to track the service it describes. In Atlas Support’s case, three services change on three release schedules, and every signature change needs a matching update in the tool definition. When the two drift apart, the mismatch typically surfaces when a call fails at runtime, and it surfaces to a model that can only read the error text. A wrapper that adds no business logic in this situation adds maintenance cost with little return.</p><h3>Tool Surface Size and Context Cost for Agents</h3><p>Exposure decisions also carry a context cost, because clients pass tool definitions to the model.<a href="https://getunblocked.com/blog/mcp-tool-overload/"> Unblocked</a>, which sells a context-layer product, reports that a 35-tool GitHub MCP server consumed about 26,000 tokens of definitions, roughly 13% of a 200K-token window, and that definitions reload on every turn. The article gathers those figures from other measurements, and it notes that Claude Code now defers MCP tool definitions by default, so the cost is highest in clients that load every schema up front. Treat the numbers as indicative and measure your own client.</p><p>The specification gives servers some help with this. The tools/list operation supports pagination and caching, and servers should return tools in a deterministic order so clients can cache the list and improve prompt cache hit rates. Those features reduce repeated cost, but the main lever remains the size of the tool set itself. Whichever approach Atlas Support picks, someone has to decide which methods an agent can see, and that decision should be explicit. The next section covers how Graftcode Gateway handles it.</p><h3>How Graftcode Gateway Exposes Services as MCP Tools</h3><p>Graftcode Gateway is the runtime (gg) that hosts a service’s modules and exposes their public methods to callers. Every service hosted through the Gateway also becomes an MCP server automatically, as described on the<a href="https://graftcode.com/use-cases/mcp"> Graftcode MCP use-case page</a>, which summarizes the workflow in three steps: keep the existing code, run the Gateway against the project, and add the endpoint to an MCP client configuration. The page positions this as a way to avoid a hand-built MCP server, and it states that existing APIs can continue to exist where they make sense, so the Gateway extends a current setup.</p><h3>Hosting a service and connecting an MCP client</h3><p>For Atlas Support’s Python order service, hosting looks like this, with — modules pointing at the service code:</p><p>gg — runtime python — modules ./order_service.py</p><p>The MCP client then needs only the endpoint URL. Graftcode’s<a href="https://graftcode.com/blog/mcp-hosting"> MCP hosting post</a> shows a Cursor configuration that points at port 81:</p><pre>{<br>  &quot;mcpServers&quot;: {<br>    &quot;order-service&quot;: {<br>      &quot;url&quot;: &quot;http://localhost:81/mcp&quot;<br>    }<br>  }<br>}</pre><p>The use-case page names Claude, Cursor, and ChatGPT and says any MCP-compatible client works, and it lists JavaScript, Python, Ruby, PHP, Java, C#, Groovy, and Kotlin, which covers all three of Atlas Support’s services. Port 81 is the default in the gg v1.2.x examples, where calls from other services arrive on port 80, and gg v1.3.0 serves both on one port, so read the actual ports from the gg startup logs. The same hosted module therefore serves two kinds of callers, other services through installed Grafts and agents through the MCP endpoint, from one set of public methods. The hosting post adds that Cursor connects to the endpoint directly while Claude Desktop uses the mcp-remote package as a stdio bridge.</p><h3>Narrowing the exposed surface with access policies</h3><p>The Gateway exposes public methods automatically, so the surface an agent sees follows the service’s public API. The use-case page says access is enforced at the Gateway, where teams can allow or disable specific classes, methods, properties, and service interfaces, and that methods left unexposed are invisible to agents. In practice, Atlas Support would keep helper types and internal logic non-public, then use access policies to hide administrative methods from the triage agent. That turns the tool surface question from the previous section into a configuration decision on each service.</p><h3>Where a hand-written server still fits better</h3><p>Automatic exposure covers services hosted through a Gateway. A third-party API still needs a hand-written server, since there is no Gateway to point at a system the team does not host. Access policies narrow which of a service’s existing methods are visible and cannot invent a different surface, so a reshaped, task-oriented tool set still calls for a curated server. The use-case page describes public methods becoming MCP tools and says nothing about resources or prompts, so confirm that point with Graftcode before relying on it.</p><p>Graftcode’s own hosting post is candid about further limits. It says a Gateway is less suitable when a team needs custom middleware, per-call token validation, logging, rate limiting, or fine-grained control over tool descriptions and schemas, and that it assumes existing public methods are already the right granularity for agents. The post also describes the local setup without a Project Key as having no authorization layer and suited to local development, while a Project Key provides a stable remote URL with permissions managed in the Graftcode portal. Atlas Support’s refund approval service falls into the first group because auditors want per-call logging and rate limits, so the team would keep a hand-written server there and use Gateway-hosted endpoints for the order and notification services.</p><h3>A Decision Checklist for Your Own Services</h3><p>The decision is per service, and a mix is a reasonable outcome, as Atlas Support’s split shows. A Gateway-hosted MCP endpoint fits a service when these conditions hold:</p><ul><li>The service is owned by your team and already hosted, or can be hosted, under the Gateway in one of its listed languages.</li><li>The tools an agent needs map closely to public methods the service already exposes, at a granularity an agent can use.</li><li>Access policies are enough to control which classes and methods agents can reach.</li><li>The team wants the agent-facing interface to follow the service’s own public methods without a second manifest.</li></ul><p>A hand-written server still fits when these conditions hold:</p><ul><li>The system being wrapped is a third-party API with no internal hosting layer to hook into.</li><li>Agents need a curated, task-shaped tool set that differs from the service’s methods.</li><li>One endpoint must aggregate several backends behind a single authorization boundary.</li><li>Per-call token validation, rate limiting, audit logging, or custom middleware must live in server code, or the server must supply resources or prompts that no method provides.</li></ul><p>A short test sorts the remaining cases. If the honest answer to “what would this MCP server do” is “call our own service and format the response,” the server is translation work that a team writes by hand for a service it controls end to end. Checking the choice costs little: host one service under the Gateway, list its tools from a client, and compare the list with what the agent needs. Atlas Support would run that check first on the order service, since its public methods already map to the lookup task the triage agent performs, and would save the refund approval service for a hand-written server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*ZjcA9yU7yFBxZynUv2aWQQ.png" /></figure><h3>Where Should You Start With Your Own MCP Setup</h3><p>A standalone MCP server is real, necessary work when a service needs translation, whether that is wrapping a third-party API, curating a narrower tool surface, or supplying resources that map to no existing method. It is redundant work when the service is already owned and hosted by your team and the server would only restate methods that exist elsewhere in the system. Graftcode Gateway addresses that second case by exposing hosted public methods as MCP tools automatically, with access policies to narrow what agents can see, while hand-written servers remain the better fit for third-party APIs, custom middleware, per-call controls, and tuned tool schemas.</p><p>Before starting a new MCP server project, check whether the service in question is already hosted somewhere your team controls. If it is, test automatic exposure first: host one service with gg — runtime &lt;your_runtime&gt; — modules &lt;your_backend_library&gt;, add the endpoint to an MCP client such as Cursor, and compare the tool list with the tasks your agent performs. The<a href="https://graftcode.com/use-cases/mcp"> Graftcode MCP use-case page</a> states that trial setup needs no account or credit card, and the<a href="https://academy.graftcode.com/quick-start"> Graftcode Quick Start</a> covers the full setup.</p><h3>FAQs</h3><h3>What is the difference between an MCP server and a regular REST API?</h3><p>MCP is a protocol over JSON-RPC 2.0 with a standard discovery step, tools/list, and a standard schema format, so an AI application can learn at runtime what a server offers and how to call it. REST APIs commonly rely on a separate OpenAPI description or documentation for that purpose. The two are often combined, since the arXiv study found that 88.6% of official MCP servers it examined are fully or partially backed by REST APIs.</p><h3>What does a compliant MCP server have to implement for tools?</h3><p>A server that supports tools declares the tools capability, answers tools/list requests, and handles tools/call. The specification also states that servers must validate tool inputs, implement access controls, rate limit invocations, and sanitize outputs. Authorization is optional, and HTTP-based servers that support it should follow the specification’s OAuth 2.1 based flow, while stdio servers should take credentials from the environment.</p><h3>Do third-party APIs need their own MCP server?</h3><p>Generally yes. A system a team does not host or control cannot be exposed automatically, so reaching it through MCP requires writing a server that translates its existing API into the protocol’s schema format. Some providers publish their own MCP servers, which is worth checking before writing one.</p><h3>Can one MCP server expose tools from multiple underlying services?</h3><p>Yes, because nothing in the protocol limits a server to wrapping a single service. An aggregating server gives an agent one endpoint and one authorization boundary, and it also concentrates change, since every backend’s release can alter the combined tool list. The specification says tool names should be unique within a server, so aggregation also needs a naming scheme that avoids collisions.</p><h3>How many tools can an agent handle before quality drops?</h3><p>Reported thresholds vary by client and model. Unblocked cites secondhand figures of quality slipping around 40 to 50 always-loaded tools, and it also notes that Claude Code now defers tool definitions by default, which weakens that threshold for such clients. The practical approach is to measure token cost and task success with your own client before and after changing the tool set.</p><h3>Does Graftcode remove the need to ever write a hand-written MCP server?</h3><p>No. It reduces the need for one on services your team already hosts through the Graftcode Gateway, and existing REST or gRPC APIs can stay in place. A third-party API, a tool surface that needs real curation beyond narrowing existing methods, and requirements for custom middleware or per-call controls still call for a hand-written server.</p><h3>Does exposing a service through Graftcode require rewriting it?</h3><p>The MCP use-case page says to keep your existing code and run the Gateway against it. Public methods still have to follow the types Graftcode supports, and its documented alpha limitations list wrapper types such as Date, Guid, and TimeSpan as unsupported, so those values need to be passed as strings or integers. Check a service’s public surface against those limits before assuming no changes are needed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f74d5a9b2f61" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Distributed Monolith vs Microservices: How to Get the Migration Right]]></title>
            <link>https://medium.com/@sid_83671/distributed-monolith-vs-microservices-how-to-get-the-migration-right-910750a4fe0c?source=rss-8e5a5004d442------2</link>
            <guid isPermaLink="false">https://medium.com/p/910750a4fe0c</guid>
            <category><![CDATA[cloud-migration]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[medium]]></category>
            <category><![CDATA[monolithic-architecture]]></category>
            <category><![CDATA[microservices]]></category>
            <dc:creator><![CDATA[Sid]]></dc:creator>
            <pubDate>Tue, 29 Sep 2026 13:45:48 GMT</pubDate>
            <atom:updated>2026-11-24T07:45:44.382Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BTh1xDd_8rOtR3xlNHEe3g.png" /></figure><h3>TL;DR</h3><p>A distributed monolith is a system that’s physically distributed but behaviorally coupled: services run in separate processes or containers, but still can’t deploy independently, failures still cascade across boundaries, and schema changes still ripple through the whole system. It forms from four common patterns, lift-and-shift decomposition, shared databases, shared libraries, and hand-written integration code, and fixing it takes three layers of work: domain boundaries, data ownership, and typed contracts enforced at compile time. The integration layer is where most fixes stop short.</p><h3>What Is a Distributed Monolith</h3><p>A distributed monolith is what forms when a team splits a monolith into separate services without fully decoupling them. The services are physically separate, running in different containers, often with separate CI/CD pipelines, but they behave as a single tightly coupled system at runtime. Separate repos are more characteristic of true microservices than of distributed monoliths, in practice, distributed monolith services frequently share a monorepo. The physical separation is real; the behavioral independence isn’t there yet.</p><p>It’s worth distinguishing from two adjacent concepts. A <strong>modular monolith</strong> is a single deployment with clean internal module boundaries, where coupling is contained, testable, and intentional. <strong>True microservices</strong> have independent deployability, isolated failure domains, and enforced contracts between services. A distributed monolith sits between the two, it has the deployment complexity of microservices without yet having the independence, which is exactly the gap the fixes below close.</p><p>In practice, it surfaces as a set of observable symptoms: a change to one service requiring coordinated deploys across three others, a database schema change rippling through five services that read the same tables, a single container failure cascading into services that shouldn’t depend on it, and releases needing lockstep coordination even though every service has its own pipeline. The coupling is still there, it’s just spread across network calls, shared databases, and manually maintained integration contracts instead of living in one codebase. Once it’s visible in this form, it’s also a lot easier to target with a specific fix.</p><h3>The Four Patterns That Create a Distributed Monolith</h3><p>Most distributed monoliths form gradually, and four patterns show up repeatedly across migrations.</p><p><strong>Lift-and-shift decomposition</strong>, the most common pattern, splits the monolith along existing code boundaries (a catalog module becomes a catalog service) rather than around domain boundaries. The services mirror the monolith’s internal structure and inherit its coupling. A catalog service that still depends on the same shared tables as the orders service hasn’t been decoupled, it’s the same dependency with a network hop in between.</p><p><strong>Shared databases</strong> become the hidden coupling layer once multiple services read and write the same tables. Renaming a field in the orders table requires coordinated changes across every service that reads it, regardless of how cleanly those services are otherwise structured.</p><p><strong>Shared libraries</strong> that carry serialization logic, a domain model, or validation used across every service mean any update to that library forces every dependent service to rebuild and redeploy together, a monolith hidden inside the distributed system.</p><p><strong>Integration code recreating the coupling</strong> is the least-discussed pattern and the one that compounds fastest. Every cross-service call typically needs an HTTP endpoint, a hand-written client, matching DTOs on both sides, serialization logic, and manual versioning whenever either side changes. A field rename in the provider breaks the caller at runtime with no compile-time warning, and as the number of service pairs grows, this integration surface grows quadratically.</p><h3>How to Diagnose a Distributed Monolith</h3><p>These symptoms are observable, and each points to a specific type of coupling:</p><ul><li><strong>Lockstep deployments</strong>, a change to one service forcing deploys of two others, point to runtime coupling.</li><li><strong>Cascading failures</strong> with no explicit dependency point to shared infrastructure.</li><li><strong>Schema changes rippling everywhere</strong> point to shared database coupling.</li><li><strong>Growing inter-service parameter lists</strong> point to a service boundary sitting in the wrong place.</li><li><strong>Shared boilerplate across service codebases</strong> points to a hidden shared library.</li><li><strong>Runtime field mismatches</strong> (a rename causing a null or key error) point to uncontrolled integration contracts.</li><li><strong>Integration code growing with every new service pair</strong> points to an integration layer with no systematic contract enforcement.</li></ul><p>The last two are the most diagnostic for the integration layer specifically. If both are present, the coupling is living in the service-to-service calls, and fixing domain boundaries alone won’t resolve it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*0Ot-VejbfmXybC06X9jl-g.png" /></figure><h3>Fixing It: Three Layers of Coupling</h3><p>Each layer is a separate, well-defined problem with its own fix, and skipping one still leaves some coupling in place.</p><p><strong>Layer 1, domain boundaries:</strong> decompose around business capabilities, not code structure. Each service owns its domain completely, logic, data, and interface, and no service reaches into another’s database. Conway’s Law applies directly here, systems reflect the communication structures of the teams that build them, so this fix works best paired with matching org structure. Do this before any extraction.</p><p><strong>Layer 2, database coupling:</strong> each service owns its own data. Use dual-write or Change Data Capture (CDC) during the transition to keep legacy and new schemas in sync, then cut over once the new service’s data is validated. This is the most operationally demanding fix, data migrations take time, but it’s the only real fix for database coupling. Do this after domain boundaries are clear, since data ownership follows domain ownership.</p><p><strong>Layer 3, the integration layer,</strong> is where most remediation efforts stop short. Even with clean domain boundaries and separate databases, the code that lets services actually talk to each other can quietly recreate coupling unless it’s addressed directly. Patterns like Strangler Fig and Anti-Corruption Layer define where boundaries should sit, but the tooling used for cross-service calls determines whether those boundaries stay clean. Three options solve this to different degrees:</p><ul><li><strong>gRPC</strong> enforces contracts via .proto files with compile-time validation through generated stubs. Interface drift surfaces at compile time, but .proto files are a separate artifact to maintain, and that overhead scales with the number of service pairs.</li><li><strong>Event-driven architecture</strong> decouples calls asynchronously via a broker, good for fan-out and audit trails, though it adds broker infrastructure and doesn’t suit request-reply patterns.</li><li><strong>Graftcode</strong> installs a strongly typed Graft via the package manager, no .proto files, no manual code generation. The Graft mirrors the provider’s public interface exactly, and interface changes surface as package updates at compile time.</li></ul><h3>How Graftcode Closes the Integration Layer Gap</h3><p>Graftcode is a cross-runtime communication layer. Instead of writing HTTP clients and DTOs, a service installs a strongly typed Graft via its standard package manager, a generated interface mirroring the provider’s public methods, method names, argument types, and return types, expressed in the calling service’s native type system.</p><p>The protocol underneath is Hypertube, a binary runtime bridge connecting language runtimes directly rather than wrapping HTTP. In Graftcode’s own Performance Lab large-payload benchmark, Hypertube completed the call in 22ms, versus 53ms for gRPC and 1,245ms for REST, roughly 57 times faster than REST and 2.4 times faster than gRPC, with roughly one-eighth the CPU consumption. Industry figures commonly put 30 to 40 percent of backend engineering time toward API plumbing and DTO maintenance, exactly the overhead this replaces.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*5yvUa8MEAnAzRx88Pi1qHQ.png" /></figure><p>REST has no enforced schema by default, so a provider renaming a field surfaces only at runtime, a missing response field can produce a key error or null, a renamed request field can trigger a validation error, and version coordination stays entirely manual. gRPC catches this at compile time but requires maintaining .proto files as a separate artifact. Graftcode generates the typed interface directly from the provider’s public methods, so a changed interface shows up immediately as a package update, with incompatibilities caught at compile time in the calling service rather than as a runtime error in production.</p><p>Without a typed contract, integration code between services typically looks like this:</p><pre># Service A calling Service B, without Graftcode<br><br>import requests<br><br>def call_order_processor(order_id: str, customer_id: str):<br><br>    response = requests.post(<br><br>        &quot;http://order-processor:8080/api/v1/process&quot;,<br><br>        json={&quot;orderId&quot;: order_id, &quot;customerId&quot;: customer_id},<br><br>        headers={&quot;Content-Type&quot;: &quot;application/json&quot;},<br><br>        timeout=5.0<br><br>    )<br><br>    result = response.json()<br><br>    # If order-processor renames &quot;customerId&quot; to &quot;customer_id&quot; on its side,<br><br>    # this request field goes unrecognized. No compile-time warning either way.<br><br>    return result</pre><p>Every field name has to match the provider’s schema exactly, and in a 10-service system spanning multiple languages, maintaining this by hand is close to a full-time job.</p><h3>Gateway, Graft, and GraftConfig</h3><p>Graftcode Gateway runs alongside the provider service and exposes its public methods to callers:</p><pre># Start the Gateway alongside the order processor service<br><br>gg --modules ./order_processor.py</pre><p>The Gateway serves calls on port 80 and Graftcode Vision, live documentation of every exposed method, on port 81.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*3_gJmlghwj4I3c7iv41dCA.png" /></figure><p>A Graft is a strongly typed interface installed via the package manager, with the install command generated by Graftcode Vision:</p><pre>npm install --registry https://grft.dev/&lt;project-id&gt; @graft/nuget-orderprocessor@1.0.0</pre><p>GraftConfig controls whether a call runs in-process or remotely, set via an environment variable, not a code change:</p><pre>const { GraftConfig, OrderProcessor } = require(&quot;@graft/nuget-orderprocessor&quot;);<br><br>// Local development: runs in-process, no network call<br><br>GraftConfig.host = &quot;inMemory&quot;;<br><br>// Production: points to the order processor&#39;s Gateway<br><br>GraftConfig.host = &quot;wss://order-processor:9000/ws&quot;;<br><br>// Strongly typed call, no HTTP client, no DTO, no JSON parsing<br><br>const result = await OrderProcessor.processOrder(orderId, customerId);</pre><p>The calling code doesn’t change between local development and production, only GraftConfig.host does. This maps directly onto a migration path: modules run in-process during development, and when one gets extracted into its own service, a single environment variable change points it to the deployed Gateway, with no code change required. The integration contract is enforced from the start, not retrofitted after a distributed monolith has already formed.</p><h3>Preventing a Distributed Monolith Before It Forms</h3><p>Prevention is meaningfully cheaper than remediation. Four practices go a long way: define domain boundaries before writing extraction code (Event Storming is a practical technique for this); avoid shared databases from day one, with one service owning each table; enforce integration contracts at compile time from the start, whether through .proto files or typed Grafts; and start with a modular monolith, extracting once the domain is understood rather than because microservices sound like the right default.</p><h3>When It Takes More Work to Untangle</h3><p>Some distributed monoliths take longer to work through. Deeply normalized shared databases across 20+ services can mean a genuinely multi-year data migration, though it’s a well-understood project with a clear endpoint. A domain model that’s conceptually off, not just poorly implemented, is worth redesigning before migrating rather than extracting the existing structure. Team structure misaligned with service boundaries tends to pull the coupling back regardless of tooling, per Conway’s Law, so org and architecture changes work best together. And an integration layer that’s grown into hundreds of thousands of lines across shared HTTP client libraries has effectively become a second monolith, worth treating as its own migration project. In these cases, the most pragmatic move is often consolidating back toward a modular monolith, fixing all three layers properly, and extracting again from a clean foundation.</p><h3>Getting Microservices Right</h3><p>A distributed monolith doesn’t form because a team made the wrong architectural call, it forms because a migration addresses one or two of the three coupling layers without addressing all three. The integration layer is where the most value is typically left on the table, and it’s also the most solvable once a team knows to look at it directly. Replacing hand-written HTTP clients and DTOs with contracts enforced at compile time, instead of discovering drift in production, is what turns a distributed monolith into the microservices architecture it was meant to be.</p><p>For teams ready to close the integration layer gap, the Quick Start guide has a working Graftcode example running locally in minutes, no account required.</p><h3>Frequently Asked Questions</h3><h3>What is the difference between a distributed monolith and true microservices?</h3><p>True microservices can be developed, tested, and deployed independently. A distributed monolith has the physical structure of microservices, separate processes and deployments, but retains the tight coupling of a monolith: changes still require coordination, failures still cascade, and releases still need lockstep timing.</p><h3>Is a modular monolith better than a distributed monolith?</h3><p>For most teams at most stages of growth, yes. A modular monolith with clean internal boundaries and enforced interfaces between modules gives most of the architectural benefits of microservices without the operational overhead of a distributed system. Starting there and extracting once the domain is understood is a more reliable path than extracting too early.</p><h3>Can a distributed monolith be fixed without starting over?</h3><p>In most cases, yes, though it takes deliberately addressing all three coupling layers. Domain boundaries can be redefined incrementally with the Strangler Fig pattern, database coupling resolved with dual-write or CDC, and integration coupling resolved by replacing ad hoc HTTP clients with typed interfaces. Starting from scratch is rarely necessary unless the domain model itself needs a genuine rethink.</p><h3>What role does Conway’s Law play in creating distributed monoliths?</h3><p>Conway’s Law states that systems reflect the communication structures of the teams that build them. If teams stay organized around the old monolith’s structure, service boundaries tend to mirror team boundaries rather than domain boundaries, so fixing the architecture without adjusting team structure alongside it means the coupling is likely to reappear.</p><h3>How does Graftcode reduce integration-layer maintenance between services?</h3><p>Graftcode replaces hand-written HTTP clients and DTOs with a strongly typed Graft installed via a package manager, reflecting the provider’s current public interface. When the provider changes a method signature, the incompatibility surfaces as a package update at the latest, caught at compile time, rather than a silent null or key error in production. GraftConfig switches calls between in-process and remote via an environment variable, so the contract is enforced from the start rather than retrofitted later.</p><h3>How much faster is Graftcode than gRPC and REST?</h3><p>In Graftcode’s own Performance Lab large-payload benchmark, calls over Hypertube completed in 22ms, compared to 53ms for gRPC and 1,245ms for REST, roughly 57 times faster than REST and 2.4 times faster than gRPC, with roughly one-eighth the CPU consumption. These are vendor-published figures worth verifying against a team’s own workload before treating them as a guarantee.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=910750a4fe0c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kafka vs RabbitMQ: Choosing the Right Message Broker for Your Stack]]></title>
            <link>https://medium.com/@sid_83671/kafka-vs-rabbitmq-choosing-the-right-message-broker-for-your-stack-64f204c7b0c3?source=rss-8e5a5004d442------2</link>
            <guid isPermaLink="false">https://medium.com/p/64f204c7b0c3</guid>
            <category><![CDATA[full-stack-developer]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[message-broker]]></category>
            <category><![CDATA[medium]]></category>
            <category><![CDATA[developer]]></category>
            <dc:creator><![CDATA[Sid]]></dc:creator>
            <pubDate>Tue, 29 Sep 2026 13:45:36 GMT</pubDate>
            <atom:updated>2026-11-24T07:47:05.819Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KnSfZNhrmzAo3TNl-krzyQ.png" /></figure><h3>TL;DR</h3><p>Kafka and RabbitMQ solve the same category of problem with different architectural bets. Kafka is a distributed append-only log built for high-volume streaming and replay, while RabbitMQ is a push-based broker built for complex routing and low-latency delivery. The right choice depends on six dimensions covered here: throughput, routing, replay, delivery guarantees, operational overhead, and protocol support. This guide also covers when neither tool is needed, and how the integration layer above whichever broker you pick can become its own source of cost.</p><h3>Getting Started: What Message Brokers Actually Solve</h3><p>Services in a monolith call each other through function calls, fast, synchronous, and type-safe. Once those services split into independent processes, that direct call becomes a network call, and network calls fail in ways function calls never do: timeouts, connection drops, slow consumers blocking fast producers, cascading failures across the system.</p><p>A message broker sits between services and changes that failure model. It decouples the producer from the consumer, since the producer emits a message and moves on without knowing who’s consuming it or whether they’re even online. It buffers messages when consumers are slow or temporarily unavailable, and it enables fan-out, letting one message reach many independent consumers without the producer knowing about any of them.</p><p>An event-driven system built around a broker has three roles doing the work:</p><ul><li><strong>Producer</strong>: emits a message when state changes, like a payment service publishing a payment.completed event</li><li><strong>Broker</strong>: stores, routes, and delivers the message, the role Kafka and RabbitMQ both fill</li><li><strong>Consumer</strong>: subscribes to messages and processes them, like a notification service or a billing update.</li></ul><p>What differs between Kafka and RabbitMQ is the architecture underneath those three roles, and that architecture determines what each tool actually does well.</p><h3>How Kafka Works and What It Is Built For</h3><p>Kafka is a distributed, append-only log, not a traditional message queue. When a producer sends a message, it gets written to a topic, specifically to one of that topic’s partitions, which are ordered and immutable sequences of records stored on disk. Kafka doesn’t push messages to consumers. Consumers pull from partitions at their own pace, tracking their position with an offset. When a message gets processed, nothing is deleted. It stays in the log until the configured retention period expires.</p><p>That architecture has real consequences. Replay is native, since a consumer can reset its offset and reprocess an entire topic’s history. Multiple consumer groups are independent, so two separate groups can read the same partition without interfering with each other. Ordering is guaranteed within a partition but not across partitions, and throughput scales directly with the number of partitions added.</p><p>Kafka’s KRaft protocol matured through the 3.x releases and fully replaced ZooKeeper with Kafka 4.0, removing a significant operational dependency. Cluster management is simpler as a result, though partition rebalancing, offset management, and tuning for high-throughput workloads still require real ops investment. Kafka handles 1M or more messages per second under production load, and supports exactly-once semantics through idempotent producers and its transactions API, within Kafka-to-Kafka workflows specifically.</p><p>Kafka fits event sourcing, stream processing, log aggregation, audit trails, real-time analytics pipelines, and any workload where replay or high-volume fan-out is a real requirement, not a nice-to-have.</p><h3>How RabbitMQ Works and What It Is Built For</h3><p>RabbitMQ is a traditional message broker built on AMQP (the Advanced Message Queuing Protocol) and uses a push-based delivery model. The broker delivers messages to consumers as soon as they arrive, rather than waiting for consumers to pull them.</p><p>The core routing mechanism is the exchange. Producers publish to exchanges, not directly to queues, and exchanges route messages to queues based on binding rules:</p><ul><li><strong>Direct exchange</strong>: routes by an exact routing key match</li><li><strong>Fanout exchange</strong>: broadcasts to every bound queue, ignoring the routing key entirely</li><li><strong>Topic exchange</strong>: routes by pattern matching on routing keys, like order.* or #.failed</li><li><strong>Headers exchange</strong>: routes by message header attributes instead of the routing key</li></ul><p>Because this routing logic lives inside the broker, changing routing behavior doesn’t require touching producer or consumer code. RabbitMQ’s standard exchanges route based on message metadata, routing keys, and headers, not by inspecting arbitrary fields inside the message body itself, which is a distinction worth keeping in mind when comparing it to Kafka’s topic-only routing.</p><p>Modern RabbitMQ, version 3.9 and later, supports three queue types: classic queues for transient workloads, quorum queues built on Raft consensus as the recommended production default, and native streams, an append-only log with consumer offsets that brings Kafka-like replay directly into RabbitMQ. A single cluster can serve both traditional queuing and streaming workloads. Throughput typically lands between 40,000 and 100,000 messages per second, well below Kafka’s ceiling, but exactly-once delivery requires application-level deduplication since RabbitMQ doesn’t provide it natively.</p><p>RabbitMQ fits complex metadata-based routing, task queues, background job processing, request-reply patterns, multi-protocol environments, and any workload where per-message latency matters more than raw throughput.</p><h3>Kafka vs RabbitMQ Across Six Practical Dimensions</h3><p><strong>Throughput and latency</strong> are the most cited differences, and for good reason. Kafka handles 1M or more messages per second under load, while RabbitMQ typically tops out between 40,000 and 100,000. The gap is architectural, not incidental: Kafka’s sequential disk writes and pull-based model are built for volume, while RabbitMQ’s push model prioritizes getting individual messages to consumers fast, at the cost of that higher throughput ceiling. Kafka wins on volume. RabbitMQ wins on low-latency individual delivery.</p><p><strong>Message routing</strong> flips the advantage. RabbitMQ’s exchange model handles complex routing natively, by header, routing key, pattern, or destination. Kafka routes by topic and partition key only, and any routing logic beyond that has to live in producer or consumer code. RabbitMQ wins for complex routing. Kafka wins for simple, high-volume fan-out where routing complexity isn’t the problem.</p><p><strong>Message retention and replay</strong> clearly favor Kafka. Kafka retains messages for a configurable window regardless of whether they’ve been consumed, and replay is a first-class feature: reset an offset and reprocess the full history. RabbitMQ deletes messages after acknowledgment by default, and while native streams add replay capability, it’s secondary to the core queuing model rather than built into the foundation. If replay is a hard requirement, Kafka is the stronger default.</p><p><strong>Delivery guarantees</strong> need a specific caveat. Both brokers support at-least-once delivery. Kafka’s idempotent producers combined with its transactions API give exactly-once semantics, but only within its supported transactional workflows: Kafka-to-Kafka reads, processing, and writes. That guarantee doesn’t automatically extend to external side effects like database writes, payment calls, or emails, which still require the consumer to implement idempotency itself regardless of the broker. RabbitMQ requires application-level deduplication to achieve any exactly-once guarantee, whether the side effect is internal or external. Kafka wins for exactly-once guarantees without application-level workarounds, within its supported scope.</p><p><strong>Operational complexity</strong> favors RabbitMQ for most teams. It runs as a single binary with a management UI and is straightforward to operate day-to-day. Kafka’s KRaft protocol removed the ZooKeeper dependency, which helped, but cluster management, partition rebalancing, and consumer group coordination still demand meaningful ops investment. RabbitMQ is significantly easier to run, especially for smaller teams without dedicated platform engineers.</p><p><strong>Protocol and ecosystem support</strong> round out the comparison. RabbitMQ supports AMQP, MQTT, and STOMP, which makes it genuinely useful in multi-protocol environments, particularly IoT. Kafka uses its own binary protocol, and while its ecosystem is rich, it’s Kafka-specific. RabbitMQ wins for any environment where multiple protocols need to coexist.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x9P4N8o9qYtMv7qsh3B_MA.png" /></figure><h3>When You Don’t Need a Broker At All</h3><p>Brokers add real operational overhead, something to deploy, monitor, scale, and keep running. That overhead is justified for genuinely async or high-volume workloads. For others, a broker is the wrong tool for the actual problem.</p><ul><li><strong>Point-to-point service calls.</strong> One service calls one downstream service, with no fan-out and no durability requirement. Teams often wire up RabbitMQ here by default, but the actual problem is cross-language coupling, not async messaging.</li><li><strong>RPC-style request-reply.</strong> Teams use RabbitMQ’s direct reply-to pattern to simulate a synchronous function call between services. It works, but it’s a workaround, a message broker approximating what a direct typed method call would do more cleanly.</li><li><strong>Cross-language in-process communication.</strong> Two modules in different languages that need to call each other. A broker gets introduced purely because the language boundary is hard to cross, not because the workload needs durability or fan-out.</li><li><strong>Monolith-to-microservices extraction.</strong> When a module is pulled out of a monolith, teams wire a broker between it and the rest of the system, when what’s actually needed is controlled switching between in-process and remote calls during the migration itself.</li></ul><p>In all four cases, teams often reach for a broker primarily to bridge a coupling problem between services or languages, even though a broker’s real strengths, buffering, load leveling, retries, durability, temporal decoupling, matter for genuinely async or high-volume workloads specifically. When those properties aren’t actually needed, the broker still adds real operational overhead for a problem it wasn’t chosen to solve.</p><h3>Where Graftcode Fits Alongside Your Broker Stack</h3><p>Graftcode is a cross-runtime communication layer. Services call each other’s public methods through automatically generated interfaces called Grafts, installed as typed packages through standard package managers like npm, pip, NuGet, or Maven, without hand-writing integration code, DTOs, client libraries, or serialization boilerplate. The underlying protocol is Hypertube, a binary runtime bridge that connects language runtimes directly over TCP/IP rather than wrapping HTTP.</p><p>Graftcode doesn’t replace Kafka or RabbitMQ. The broker still handles the routing, fan-out, and durability it was built for. By default, a Graft call runs over a direct connection to the target service’s Gateway, entirely separate from whatever broker delivered the original message. Graftcode also ships an official RabbitMQ plugin that routes a Graft call through RabbitMQ instead of a direct connection, useful when a team wants the call itself to travel through the existing broker infrastructure, though the default direct-connection pattern is what most teams reach for first.</p><p>Here’s where the integration tax actually lands. When Kafka or RabbitMQ is the right choice for true fan-out or event sourcing, the broker handles routing and delivery cleanly. But after a consumer receives a message, it still needs to call downstream services to finish the work, and that downstream call is where hand-written HTTP clients, DTOs, and serialization code pile up. A Python consumer receiving a payment event and needing to notify a Node.js service has to build an HTTP client, match the notification service’s schema field for field, and handle errors the original in-process call never needed. If the Node.js team renames a field on its side, the request from the Python consumer either gets rejected by validation or silently ignored, with no compile-time signal either way.</p><p>With Graftcode, that downstream call becomes a typed method call instead:</p><pre>const { GraftConfig, NotificationService } = require(&quot;@graft/nuget-notificationservice&quot;);<br><br>// Point GraftConfig at the notification service&#39;s Gateway<br>GraftConfig.host = &quot;wss://notification-service:9000/ws&quot;;<br>GraftConfig.stateless = true; // full response in one round trip<br><br>// Kafka consumer loop<br>for await (const message of consumer) {<br>    const { orderId } = JSON.parse(message.value);<br><br>    // Strongly typed remote call, no manual JSON parsing or DTOs on this side<br>    await NotificationService.sendPaymentConfirmation(orderId);<br>}</pre><p>The Kafka consumer routes events exactly as before. Graftcode handles the downstream service call. For local development, pointing GraftConfig.host at inMemory runs the call in-process with no network hop, so no Kafka cluster or broker needs to run locally to test that part of the flow. Production points to the deployed Gateway address instead, and the method call itself never changes between the two states.</p><p>What that replaces is a familiar list for any team that has built this integration by hand: message consumer and downstream client code written per language pair, DTO classes defined on both sides, manual JSON serialization, coordinated versioning across teams, and runtime field-name mismatches that only surface once traffic hits production. With Graftcode, an interface change surfaces as a package update, detected at that point at the latest and at compile time if applied.</p><p>AI-native microservices introduce a cost this comparison wouldn’t have needed a few years ago. When LLMs or agents orchestrate workflows across services, they need to understand each service’s callable surface, and in a Kafka or RabbitMQ-based flow that surface includes more than the message schema itself. An agent working across the codebase also has to read the consumer setup code, the downstream client calls a consumer makes after processing a message, the DTOs on both ends, and the serialization and error-handling logic wrapped around each call. None of that is business logic. It’s integration scaffolding the model has to parse before it can reason about what the service actually does. With Graftcode, an agent sees a method signature instead of that scaffolding:</p><pre>OrderService.getOrderById(orderId: string): Promise&lt;Order&gt;<br>NotificationService.sendPaymentConfirmation(orderId: string): Promise&lt;void&gt;</pre><p>That isn’t the entire interface an agent needs to reason about. Type definitions, semantics, authorization rules, and side-effect behavior still matter and still need to be understood. But the surrounding client setup, serialization, and manual error-handling code that would otherwise sit around that signature is gone, reducing per-call context load in agentic pipelines and compounding into real savings as the number of services and agent interactions grows.</p><h3>When to Consider Alternatives to All Three</h3><p>Neither Kafka, RabbitMQ, nor Graftcode is the right answer for every team, and a few alternatives are worth knowing about before defaulting to one of the three covered here:</p><ul><li><strong>Redis Streams</strong>: an append-only log with consumer groups and replay support, distinct from Redis’s separate Pub/Sub feature which has no persistence. A good fit for teams already running Redis who need lightweight streaming without standing up a dedicated broker.</li><li><strong>AWS SNS plus SQS, or Google Pub/Sub</strong>: the right call for teams on managed cloud infrastructure who don’t want to operate a broker cluster themselves.</li><li><strong>NATS</strong>: built for ultra-low latency, edge computing, and IoT scenarios where its lightweight footprint is the deciding factor.</li><li><strong>Direct HTTP</strong>: still the right choice for simple internal APIs where typing discipline and maintenance overhead genuinely aren’t problems yet.</li></ul><h3>Where Should You Start</h3><p>Kafka and RabbitMQ solve the same category of problem with different architectural bets. Kafka bets on volume, replay, and exactly-once guarantees within its supported transactional workflows. RabbitMQ bets on routing flexibility, push-based delivery, and operational simplicity. The broker decision matters, but for workloads that don’t need fan-out or durable persistence, a broker introduces overhead for a problem a direct runtime communication layer addresses more cleanly; and for workloads where a broker is the right call, the integration layer above it, how services call each other after a message lands, is where the compounding complexity actually lives.</p><p>Start by mapping your workload against the six dimensions covered here: throughput, routing, replay, delivery guarantees, operational overhead, and protocol support, rather than defaulting to whichever broker shows up most often in job postings. To see how Graftcode reduces the integration layer above whichever broker you choose, explore<a href="https://www.graftcode.com/"> Graftcode</a> or go directly to the<a href="https://academy.graftcode.com/"> Graftcode Academy</a> to get started.</p><h3>FAQs</h3><p><strong>1. How large is the Kafka vs RabbitMQ throughput gap in practice?</strong></p><p>Kafka handles 1M or more messages per second under production load, while RabbitMQ typically peaks between 40,000 and 100,000, depending on queue configuration and message size. The gap is real but often irrelevant, since most microservices workloads never approach RabbitMQ’s ceiling. The more useful distinction day-to-day is latency, where RabbitMQ’s push model gets individual messages to consumers faster.</p><p><strong>2. Can RabbitMQ Streams replace Kafka for event sourcing workloads?</strong></p><p>RabbitMQ Native Streams, added in version 3.9, provide an append-only log with consumer offsets that covers basic replay needs. For straightforward event sourcing where a single cluster also handles task queues and routing, Streams is a viable option. Kafka’s partition model still gives finer-grained parallelism and higher throughput that Streams doesn’t match, so for pure high-volume event streaming, Kafka remains the stronger choice.</p><p><strong>3. What is KRaft and how did it change Kafka’s operational model?</strong></p><p>KRaft is the consensus protocol that matured through Kafka’s 3.x releases and fully replaced ZooKeeper with Kafka 4.0. Previously, running Kafka meant operating a separate ZooKeeper cluster alongside the Kafka brokers themselves, two systems to monitor and keep in sync. KRaft moved cluster metadata management into Kafka directly through a Raft-based controller quorum, resulting in fewer moving parts and faster controller failover.</p><p><strong>4. When should a team use Kafka, RabbitMQ, and a tool like Graftcode together?</strong></p><p>Each operates at a different layer. Kafka works well as a streaming backbone for high-volume event pipelines, payment events or user activity feeds. RabbitMQ handles service-level task queues and complex routing, email delivery or priority-based job processing. Graftcode reduces the integration layer above both: the cross-service calls a consumer needs to make after a message lands to actually complete the work.</p><p><strong>5. What is the difference between a message broker and a service mesh?</strong></p><p>A message broker handles asynchronous communication between services, buffering and routing messages so producers and consumers don’t need to be online at the same time. A service mesh operates at the network layer, managing synchronous service-to-service traffic, load balancing, retries, and observability, typically for direct calls rather than queued messages. The two solve adjacent but distinct problems and often coexist in the same architecture.</p><p><strong>6. Is exactly-once delivery ever fully guaranteed by a message broker alone?</strong></p><p>Not for external side effects. Kafka’s idempotent producers and transactions API provide exactly-once semantics within Kafka-to-Kafka workflows specifically: reads, processing, and writes that stay inside Kafka. That guarantee doesn’t automatically extend to a database write, a payment call, or an email send triggered by a consumer. Those external effects still require the consumer to implement its own idempotency, regardless of which broker delivered the message.</p><p><strong>7. What should a team check before deciding it needs a message broker at all?</strong></p><p>Whether the workload genuinely needs fan-out to multiple independent consumers, durable persistence if a consumer is offline, or asynchronous decoupling between producer and consumer. If the pattern is one service calling one downstream service with no durability requirement, a broker often gets introduced to solve a cross-language coupling problem rather than a genuine messaging need, adding operational overhead without addressing what’s actually slowing the team down.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=64f204c7b0c3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Event-Driven Architecture: Patterns, Cross-Service Communication, and Smarter Integration]]></title>
            <link>https://medium.com/@sid_83671/event-driven-architecture-patterns-cross-service-communication-and-smarter-integration-081fe4964167?source=rss-8e5a5004d442------2</link>
            <guid isPermaLink="false">https://medium.com/p/081fe4964167</guid>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[event-driven-architecture]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cross-service]]></category>
            <dc:creator><![CDATA[Sid]]></dc:creator>
            <pubDate>Tue, 29 Sep 2026 13:45:21 GMT</pubDate>
            <atom:updated>2026-11-24T07:43:30.287Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1sSlPMttzCldhisZGTmipA.png" /></figure><h3>TL;DR</h3><p>Event-driven architecture decouples services by having them publish and consume events through a broker rather than calling each other directly, enabling independent scaling, async processing, and loose coupling. Four patterns power most EDA systems: event notification, event-carried state transfer, event sourcing, and CQRS, each trading off payload size, consistency, and query complexity differently. The part that gets expensive fast is cross-service communication itself: writing event publishers and handlers across different languages means maintaining separate integration code, DTOs, and serialization logic for every connection, none of which is business logic.</p><h3>What Is Event-Driven Architecture</h3><p>Modern software systems are built around things happening: a payment clears, an order ships, a sensor threshold trips. Event-driven architecture (EDA) is the approach most teams reach for to handle those moments cleanly. Instead of services calling each other directly, they publish events and react to them independently.</p><p>The difference from request-driven architecture comes down to coupling. In a request-driven call, Service A calls Service B and waits; A has to know where B is, if B is slow, A is slow, and if B is down, A fails. In an event-driven flow, Service A publishes an event without knowing who’s listening, and consumers react independently, asynchronously, on their own schedule.</p><p>Every EDA system has three roles: a <strong>producer</strong> that emits events when state changes (a payment service emitting payment.completed), a <strong>broker</strong> that receives, stores, and routes events (a Kafka topic, AWS SNS, a RabbitMQ exchange), and a <strong>consumer</strong> that subscribes and reacts (a notification service, an inventory updater, an analytics pipeline).</p><p>EDA is the right fit when multiple downstream services need to react to the same state change, when services should be independently deployable and loosely coupled, when the system needs a full audit trail of what happened and when, or when workloads are async and don’t require an immediate response. It’s the wrong fit when operations require a synchronous, low-latency response (auth checks, real-time inventory lookups), when the system is a simple CRUD app with no fan-out requirements, or when the team is small enough that broker overhead outweighs the architectural benefit.</p><h3>The Four Patterns That Power Event-Driven Systems</h3><p>EDA isn’t a single pattern; it’s a family of approaches that sit on a spectrum from simple to complex, and real systems typically combine two or more of them.</p><p><strong>Event notification</strong> keeps payloads lightweight. A producer emits a small signal, “this thing happened,” with minimal payload, and consumers fetch any additional state they need independently. It’s best for triggering downstream reactions when consumers can retrieve state on their own, and the tradeoff is that consumers need a follow-up call to the source, which reintroduces some coupling. An order. placed event carrying only the order ID, with the fulfillment service querying for full order details separately, is a typical example.</p><p><strong>Event-carried state transfer</strong> eliminates that downstream callback by embedding the full relevant state inside the event payload. Consumers get everything they need from the event itself. It’s best for consumers that need to act immediately on the complete state change, and the tradeoff is larger payloads and schema changes that affect every consumer simultaneously. An order. placed event carrying the full order (items, quantities, shipping address, customer ID) is the same example, one layer richer.</p><p><strong>Event sourcing</strong> makes the log the source of truth. Every state change is stored as an immutable event in an append-only log, and current state is derived by replaying the event history rather than read from a database row. It’s best for systems that need full audit trails, time-travel queries, or the ability to rebuild state from scratch; the tradeoff is that querying current state requires replaying or projecting events, and schema versioning needs real discipline. A bank account balance calculated by replaying every deposit and withdrawal event from account creation, rather than stored as a number, is the classic case.</p><p><strong>CQRS</strong> (Command Query Responsibility Segregation) separates the write model, commands that change state, from the read model, projections optimized for queries. Write operations emit events, and read models get built from those events. It’s best for systems where read and write access patterns differ significantly, especially high-read-load services, and the tradeoff is eventual consistency between the two models plus more infrastructure to maintain. CQRS pairs naturally with event sourcing: commands produce events, and events update read-model projections.</p><h3>How Cross-Service Communication Works Inside EDA Systems</h3><p>Understanding the patterns is one thing. What happens between services after an event actually fires is where the real complexity surfaces.</p><p>A typical event flow looks like this: a Python payment service emits payment.completed to a Kafka topic, Kafka routes the event to subscribed consumers, and a Java order service consumes the event and marks the order fulfilled. Writing publishers and handlers across these services in different languages is where the integration complexity starts. Each connection typically needs an event publisher or handler written in the service’s language, a client library in the calling service’s language, DTO definitions matching the event schema on both sides, serialization logic (JSON marshaling and unmarshaling) in both services, manual versioning discipline whenever the schema changes, and updates to every handler when the event structure evolves.</p><p>In a five-service system with four language pairs, that’s a significant ongoing maintenance surface, and none of it is business logic. That surface is the integration layer, and it’s where most of the complexity compounds.</p><h3>Why the Integration Layer Gets Expensive Fast</h3><p>The integration layer isn’t unique to ED; it’s the cost of distributed systems generally. EDA makes it worse because it has more services, more language diversity, and more connection points than a traditional layered architecture. Forrester Research puts the number at roughly 70% of development work going toward integration code, not product features, not business logic, just wiring.</p><p>A few specific problems compound this. <strong>Schema drift</strong> means a producer updates a field name and consumers break silently at runtime rather than at compile time. <strong>Cross-language serialization</strong> means every language pair needs its own DTO mapping; Java-to-Python is a different problem from Java-to-Node.js, which is different again from Go-to-Ruby. <strong>Client library churn</strong> means every dependent handler needs an updated client whenever an event schema changes, with nothing propagating automatically. <strong>Versioning overhead</strong> means breaking changes require coordinated deploys across teams, and that coordination cost is often higher than the cost of the change itself. At real scale, <strong>boilerplate</strong> stops being a cost center and starts feeling like a full-time job; in a system with 20 services, the integration layer alone can take up that much attention.</p><p>Each new service and language pair added to the system multiplies this surface. This is the integration tax, and it’s worth asking whether it needs to exist at all.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*zKYuUJmzzVySxnQsJ3GF-A.png" /></figure><h3>How Graftcode Eliminates the Integration Layer</h3><p>Graftcode is a cross-runtime communication layer. Instead of writing event publishers and handlers manually, defining DTOs, and maintaining client libraries across language pairs, a developer installs a strongly typed Graft via their standard package manager. Graftcode handles the publishing, consuming, and handling layer; the broker underneath still routes the messages, but the integration code disappears.</p><p>The protocol underneath is Hypertube, which uses native runtime integration and binary messaging instead of text-based JSON or XML serialization. Service interactions run up to 70% faster than conventional integration approaches, with roughly one-eighth the CPU consumption of equivalent gRPC or HTTP-based messaging workloads.</p><h3>Three Steps Replace the Entire Integration Layer</h3><p><strong>Step 1: Run the Graftcode Gateway alongside your service.</strong> The Gateway is a lightweight, dependency-free binary that loads your service’s runtime and exposes its public methods to callers. It isn’t a proxy, middleware, or a traffic interceptor, it runs beside your service and makes its interface callable without endpoint definitions, protobuf files, or annotations.</p><pre># Download the Graftcode Gateway binary (Linux example)<br>chmod +x graftcode-gateway<br><br># Start the Gateway; it loads your Java service runtime and exposes public methods<br>./graftcode-gateway \<br>  --project-id your-project-id \<br>  --runtime jvm \<br>  --module ./order-service.jar<br><br># Or run via Docker alongside your service<br>docker run --rm \<br>  -v $(pwd)/order-service.jar:/app/order-service.jar \<br>  -p 9000:9000 \<br>  graftcode/gateway:latest \<br>  --project-id your-project-id \<br>  --runtime jvm \<br>  --module /app/order-service.jar</pre><p>Once the Gateway starts, it analyzes every public class and method in order-service.jar and builds a Unified Graft Model, a language-agnostic representation of the callable interface. That model is what Graftcode uses to generate typed clients for any consuming service, in any supported language, on demand.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*4dFyKDtolkAjV5crZ6DFnQ.png" /></figure><p><strong>Step 2: Install a Graft in the calling service.</strong> From the calling service, point your package manager at the Graftcode registry for your project and install the Graft. The registry URL encodes your project ID, which is how Graftcode knows which Gateway’s Unified Graft Model to generate the client from.</p><pre># Add the Graftcode registry to your npm config<br>npm config set @graft:registry https://grft.dev/your-project-id__graftcode<br><br># Install the Graft, package name encodes the source ecosystem and module name<br>npm install @graft/jvm-OrderService</pre><p>The Graft is a first-class package, mirroring the Java service’s public interface precisely, method signatures, argument types, return types, and errors, all expressed in TypeScript-native types. If the Java service’s interface changes, the Graft package updates and the incompatibility surfaces at compile time rather than at runtime. Teams control when to apply those updates, they show up as standard package version bumps.</p><p><strong>Step 3: Configure GraftConfig and call methods.</strong> GraftConfig controls whether a Graft call runs in-memory or connects to a deployed Gateway, a configuration change, not a code change. The same method calls work in both modes.</p><pre>import { GraftConfig, OrderService } from &quot;@graft/jvm-OrderService&quot;;<br><br>// Remote mode (staging/production), point to the deployed Gateway<br>GraftConfig.host = &quot;tcp://order-service:9000&quot;;<br><br>// In-memory mode (local dev), no network hop<br>// GraftConfig.mode = &quot;in-memory&quot;;<br><br>// Same calling code works in both modes, no other changes required<br>const service = new OrderService();<br><br>// Strongly typed, return type inferred from the Java method signature<br>const order = await service.getOrderById(orderId);<br><br>// Complex return types are Graft references, subsequent calls also execute remotely<br>const invoice = await order.generateInvoice({ currency: &quot;USD&quot; });<br><br>console.log(`Order total: ${invoice.totalAmount}`);</pre><p>The business logic and method calls stay identical either way, only GraftConfig changes.</p><h3>What Graftcode Replaces in a Real EDA System</h3><ul><li>Writing event publishers per language → publishing handled by the Graftcode layer</li><li>Writing event handlers per service → handlers auto-generated via Graft</li><li>Writing DTO classes per language pair → a strongly typed client auto-generated</li><li>Manually versioning schemas across teams → interface changes surface as package updates</li><li>Writing serialization and deserialization code by hand → handled by the Hypertube binary protocol</li><li>Maintaining separate client libraries → one install command per dependency</li></ul><h3>Where Graftcode Fits in the EDA Stack</h3><p>Graftcode handles the publisher and handler layer specifically. The broker, Kafka, RabbitMQ, EventBridge, still routes messages and manages topics. What Graftcode removes is the integration code developers would otherwise write to publish to and consume from those topics. A developer specifies the broker address and topic name in GraftConfig, and Graftcode handles the rest.</p><p>Consider a concrete three-service payment flow: a Python payment service publishes payment.completed to a Kafka topic, a Java order service consumes the event and marks the order fulfilled, and a Node.js notification service consumes the same event and sends a confirmation email. Without Graftcode, that’s publishers and handlers written separately in Python, Java, and Node.js, DTO classes per service pair, serialization logic in every service, and manual version coordination across three teams. With Graftcode, it’s three Graft installs, with publishing and handling configured through GraftConfig, broker address, and topic name, no integration code written, and the broker still routes the messages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*Th7lSA4z91z2UhBb5H_yMA.png" /></figure><h3>Performance: What Hypertube Delivers</h3><p>Graftcode’s Hypertube protocol reports up to 70% faster calls than REST, with up to roughly 8 times lower CPU consumption, compared against gRPC’s typical 2 to 3 times speed improvement and roughly 4 times lower CPU than REST. The gap comes from native runtime integration, Hypertube connects directly to target runtime native layers rather than wrapping HTTP or relying on text-based wire formats, which measurably lowers overhead at both the network and CPU level. These are vendor-published figures worth verifying against a team’s own workload before treating them as a guarantee.</p><p>Graftcode supports more than 20 programming languages across the major package managers, npm, pip, NuGet, Maven, RubyGems, Go Modules, and others. Services written in Python, Java, C#, Node.js, Go, Ruby, PHP, and Kotlin can communicate through Grafts without language-specific integration code, and it works across AWS, Azure, GCP, Kubernetes, and Docker.</p><h3>Best Practices for Keeping Event-Driven Systems Maintainable</h3><p>Building a working EDA system is one thing, keeping it maintainable at scale takes deliberate choices across schema management, failure handling, and observability.</p><p>For <strong>schema management</strong>, use a schema registry (Confluent Schema Registry, AWS Glue) to enforce contracts between producers and consumers, version event schemas explicitly (v1, v2) with backward compatibility supported during migrations, and treat schema changes like API changes, communicated, versioned, and deprecated on a timeline.</p><p>For <strong>idempotency</strong>, design every consumer to handle duplicate events safely, since EDA systems typically deliver events at-least-once. The cleanest approach is deduplicating at the consumer using a unique event ID before taking action.</p><p>For <strong>failure handling</strong>, route failed events to a dead letter queue rather than letting them disappear or block the main queue, and monitor DLQ volume actively, since a spike there is usually the first signal of a downstream problem.</p><p>For <strong>observability</strong>, use distributed tracing tools (OpenTelemetry, Jaeger, Datadog APM) with trace context propagation, a correlation ID passed through every event payload, since a request crossing four services via events produces no single stack trace on its own, and reconstructing the full flow from logs alone is hard without one.</p><p>For <strong>ownership</strong>, give each event type a clear owning team responsible for schema, versioning, and backward compatibility, since schema drift becomes close to inevitable without it. For <strong>separation of concerns</strong>, keep business logic and integration code in different layers: service methods should express business intent, while the communication layer handles transport automatically, which is easier to maintain in practice when the integration layer isn’t hand-written to begin with.</p><h3>When Event-Driven Architecture Is the Wrong Choice</h3><p>EDA has real overhead: a broker to operate, consumers to deploy, schemas to manage, and eventual consistency to reason about. For some systems, that cost isn’t worth paying.</p><p>Skip EDA when latency is critical, operations that require sub-millisecond synchronous responses, auth token validation, or real-time inventory checks don’t fit an async event flow well. Skip it when the system is simple, a CRUD API with a single downstream database and no fan-out requirements gains nothing from a broker in the middle. Skip it when the team is small, EDA adds real operational surface area, and for a two-engineer team, running Kafka or managing EventBridge rules can outweigh any architectural benefit. And skip it when consistency requirements are strict, systems where two operations must succeed or fail together are genuinely harder to implement correctly in an async model.</p><h3>Getting the Integration Layer Right</h3><p>Event-driven architecture changes how distributed systems handle state changes, moving from tight synchronous calls to loosely coupled, reactive flows. The patterns (notification, state transfer, event sourcing, CQRS), the broker, and the cross-service communication layer all need to fit together for the system to hold up at scale.</p><p>The broker handles routing, and the patterns handle semantics. What’s left, the publishers, handlers, and integration code that wire services together across language boundaries, is where the integration tax lands, and it’s also the most solvable part of the picture once a team treats it as its own problem rather than incidental plumbing. Eliminating that layer through runtime bridging is what makes EDA genuinely sustainable as a system grows.</p><p>For teams ready to remove that layer, the Quick Start guide has a working Graftcode example connecting two services locally in minutes, no account required.</p><h3>Frequently Asked Questions</h3><h3>How does event-driven architecture handle eventual consistency across microservices?</h3><p>Eventual consistency is a core tradeoff in EDA. When a producer emits an event and multiple consumers update their own data stores independently, there’s no guarantee all services reflect the same state at the same instant. The standard approach is designing consumers to be idempotent, using event versioning to track causal order, and implementing compensating transactions (sagas) for operations that span multiple services. Tools like Kafka’s log compaction help consumers catch up after downtime without losing state.</p><h3>What is the difference between event sourcing and a traditional database with a changelog?</h3><p>A traditional changelog, like a MySQL binlog, is a side effect of writes, it records what changed but isn’t the system of record. Event sourcing inverts this: events are the primary record, and current state is a derived projection. That means state can be rebuilt at any point in time, new projections can be created retroactively, and exactly what happened and why can be audited, none of which is reliable with a changelog alone.</p><h3>How does Graftcode’s Hypertube protocol differ from gRPC in cross-service communication?</h3><p>gRPC uses HTTP/2 as its transport layer with protobuf serialization, protobuf definitions are written as .proto text files, but the wire format itself is binary. Graftcode also uses binary messaging over Hypertube, the difference is that Graftcode generates the interface directly from public method signatures, with no .proto files, no manual code generation step, and no schema registry required. Incompatibilities surface at compile time when the interface changes.</p><h3>Can event-driven architecture work with monolithic applications, or does it require microservices?</h3><p>EDA doesn’t require microservices. A monolith can publish events internally using an in-process event bus (Spring’s ApplicationEventPublisher, Node’s EventEmitter) and consume them in separate modules, getting the same benefit: decoupled modules reacting to state changes without direct method calls. When the monolith later splits into services, the event contracts are already defined, so the migration is mostly an infrastructure change rather than a logic rewrite.</p><h3>How does Graftcode handle event publishing and consuming without writing integration code??</h3><p>A developer specifies the broker address and topic name in GraftConfig. Graftcode handles the publishing and consuming layer, connecting to the topic, receiving messages, and routing them to the appropriate handler, with no publisher or handler code written manually. The broker still manages routing and fan-out; Graftcode removes the integration layer that otherwise sits between the broker and the business logic.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=081fe4964167" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Developer Experience and Typed Interfaces as a Category]]></title>
            <link>https://medium.com/@sid_83671/developer-experience-and-typed-interfaces-as-a-category-89dff7461d97?source=rss-8e5a5004d442------2</link>
            <guid isPermaLink="false">https://medium.com/p/89dff7461d97</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[developer-experience]]></category>
            <category><![CDATA[api-landscape]]></category>
            <category><![CDATA[user-interface]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Sid]]></dc:creator>
            <pubDate>Wed, 26 Aug 2026 11:50:35 GMT</pubDate>
            <atom:updated>2026-11-24T07:47:39.555Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6kXZFRF53JoetQIpGEsU4Q.png" /></figure><h3>TL;DR</h3><p>Typed interfaces have become their own developer-experience category, moving beyond gRPC’s hand-maintained .proto contracts toward interfaces generated directly from a service’s actual code. The gain isn’t just earlier error-catching, it’s a shorter execution path per call and, increasingly, less inference burden for AI coding tools reading the same boundary repeatedly. Compile-time safety means different things in different languages, and this piece stays precise about that rather than overclaiming. REST and gRPC still fit where they always did; typed interfaces matter most for the internal service calls currently held together by hand-written integration code.</p><p>For years, “developer experience” mostly meant tooling around the edges of a system: better error messages, faster build times, cleaner documentation. The interface between two services was rarely part of that conversation, it was infrastructure, not experience. That’s changed. As systems have grown more distributed and AI coding tools have started reading and writing across service boundaries constantly, the interface between two services has become one of the biggest levers on developer experience there is, and typed interfaces specifically have emerged as a distinct category of tooling built around that lever.</p><p>This piece covers what that category actually is, why it’s gaining ground now specifically, and what it changes at a technical level, not just for the humans writing the calling code, but for the growing share of that code now being written by AI tools reading the same interfaces.</p><h3>Where Typed Interfaces Sit in the API Landscape</h3><p>Every service-to-service call involves an interface, what one service is asking another for, and a transport that carries it. Historically, most systems left that interface implicit: a REST endpoint’s shape was whatever the response happened to be, documented (if at all) separately from the code that produced it, and enforced by nothing except discipline.</p><p>Typed interfaces flip that default. Instead of a caller inferring a request or response shape from documentation, a sample payload, or trial and error, the interface is a first-class artifact: method names, argument types, and return types, checked before the code runs rather than discovered when it fails.</p><p>gRPC was the first widely adopted version of this idea for microservices specifically. A .proto file is the enforced contract, protoc generates typed stubs from it, and a caller uses those stubs directly instead of constructing raw HTTP requests. It’s a real developer experience improvement over untyped REST, a renamed field breaks the build instead of failing silently in production. But it comes with a cost most teams don’t fully account for going in: writing and maintaining the .proto file, running code generation on every interface change, and committing regenerated stubs across every consuming service, every time.</p><p>Graftcode represents a different point in the same category: instead of a schema file that has to be hand-maintained and regenerated, the typed interface, a Graft, is generated directly from a provider service’s actual public methods. There’s no .proto to write by hand and no separate code-generation step for a developer to run; the interface is derived from the running service itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ioBe_hGipPFu3dwyftE96A.png" /></figure><h3>What Changes at the Execution Level, Not Just the Type-Checking Level</h3><p>The developer-experience conversation around typed interfaces usually stops at “the compiler catches mistakes earlier.” That’s real, but it undersells what’s actually different about where each approach sits in a call’s execution path.</p><p>A REST call passes through a full web framework stack before business logic ever runs: request parsing, controller dispatch, JSON serialization and deserialization, DTO mapping, and whatever middleware pipeline sits in front of the handler. A gRPC call trims some of that, protocol framing and a generated stub lookup replace the web framework layer, but still pays for Protobuf marshaling, buffer management, and translating protocol types into runtime types before the actual method body executes.</p><p>A Graft call, by design, skips most of this. There’s no HTTP request to parse and no protocol frame to decode, because invocation intent is represented as native object graphs rather than serialized into a wire format and reconstructed on the other end. There’s no routing layer, because the method is called directly through the generated interface. This isn’t just fewer lines of code for a developer to write, it’s a shorter execution path for every single call, which is why the performance difference between these approaches isn’t just about developer convenience. In one large-payload benchmark test, 5,000 data points per call, all three approaches running on the same runtime over HTTP/2, with network latency excluded to isolate protocol-level cost, this kind of runtime-level integration completed meaningfully faster than both REST and gRPC on the same workload, with REST’s serialization and middleware overhead scaling non-linearly under load in a way the other two approaches don’t.</p><h3>The Type-Checking Story Isn’t the Same in Every Language</h3><p>A caveat worth being explicit about: “compile-time safety” doesn’t mean the same thing everywhere. In a genuinely compiled, statically typed language, Java, C#, TypeScript compiled with tsc, a Graft interface mismatch fails to build, the same way a .proto-generated stub would. In a dynamically typed language like plain JavaScript or Python, there’s no compiler to fail at build time. What actually happens is that an interface change becomes visible as a package update in the consuming service, which the team can review and choose when to apply, and if applied, an incompatibility surfaces as an import or attribute error, or through an optional type checker if one’s in use, not silently at runtime in production with no signal at all.</p><p>This distinction matters for a developer-experience argument specifically, because overstating it, claiming “compile-time safety” as a blanket property regardless of language, is exactly the kind of imprecision that erodes trust with the audience most likely to actually adopt this category of tooling. The honest version is still a real improvement over untyped REST: a reviewable package update and an import-time failure both happen before a request hits production, which is the property that actually matters, even in a language with no compiler to enforce it formally.</p><h3>Where This Category Intersects with AI-Assisted Development</h3><p>Typed interfaces were originally a human developer-experience story, fewer runtime surprises, better autocompletion, safer refactors. They’ve become an AI-assisted-development story for a related but distinct reason: an AI coding tool reading a service’s interface has to do the same job a human does, figure out what a service accepts and returns, except it’s doing that inference at the start of every task, repeatedly, across a session, with no persistent memory of having figured it out last time.</p><p>A wide REST surface, an OpenAPI spec, DTO definitions, an HTTP client implementation, is a lot of text for a model to read and correctly infer intent from, and every token spent on that inference is a token not spent reasoning about the actual task. A typed interface collapses that same information into a method signature: one line communicating what a human developer or an AI tool needs to know, without the surrounding transport-specific scaffolding.</p><p>This shows up concretely in two places. First, in what a pull request actually contains: with an untyped or hand-maintained typed integration, an interface change touches the client, the DTOs, and the business logic across several files, all of which shows up in the diff a reviewer has to read, human or AI-assisted. With a generated Graft, the integration layer isn’t in the repository at all, so it can’t show up in a diff; what changes is the business logic, and nothing else. Second, in the class of bugs an AI tool can introduce: without an enforced contract, a model can generate a plausible-looking call against a service interface it inferred incorrectly, and nothing catches that until the code runs. With a typed interface, that same mistake is either caught immediately or, in dynamic languages, surfaces as a reviewable update rather than a silent runtime failure discovered later.</p><h3>What This Looks Like as a Working Pattern</h3><p>None of this requires abandoning REST or gRPC where they’re already the right fit, REST remains the right default for external-facing APIs with browser or third-party consumers, and gRPC still earns its setup cost for polyglot, high-throughput internal systems that need protocol-level streaming. Typed interfaces as a category, including tools like Graftcode built specifically around this boundary, apply most directly to the internal service-to-service calls where the integration overhead is currently hand-written and where the same interface gets read, by a human, an AI tool, or both, repeatedly over a service’s lifetime.</p><pre>from inference_service import InferenceService<br>from retrieval_service import RetrievalService<br>from summary_service import SummaryService<br><br>def run_agent_loop(query: str, prompt: str, text: str) -&gt; dict:<br>    retrieval = RetrievalService.retrieve(query=query)<br>    inference = InferenceService.run_inference(model=&quot;llama-3&quot;, prompt=prompt, max_tokens=512)<br>    summary = SummaryService.summarize(text=text)<br>    return {&quot;retrieval&quot;: retrieval, &quot;inference&quot;: inference, &quot;summary&quot;: summary}</pre><p>Three service calls, no HTTP clients, no .proto files, no DTO mapping, just the method calls themselves, with the transport, serialization, and contract enforcement handled underneath. Each of InferenceService, RetrievalService, and SummaryService has its own independent Graftcode Gateway, and each call’s GraftConfig determines separately whether it runs in-process locally or against a deployed service in production, switched through an environment variable rather than a code change.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lxJXyJD0WwZCDwKKavSqBQ.png" /></figure><h3>Conclusion</h3><p>Developer experience used to be a conversation about tooling at the edges of a codebase. Typed interfaces have pulled the conversation into the center of it, because the interface between two services turns out to be one of the highest-leverage places to reduce both the manual maintenance burden on human developers and the inference burden on AI tools working across the same boundaries. gRPC proved the value of an enforced contract over REST’s implicit one. What’s changed since is the cost of maintaining that contract, moving from a hand-written schema file and a regeneration cycle to an interface generated directly from the service itself is the next step in the same direction, not a different idea.</p><p>To see how Graftcode fits into this category directly, explore<a href="https://www.graftcode.com/"> Graftcode</a> or go straight to the<a href="https://academy.graftcode.com/"> Graftcode Academy</a> to get started.</p><h3>FAQs</h3><h3>1. What’s the difference between a typed interface and API documentation like OpenAPI or a .proto file?</h3><p>Documentation and a .proto file both describe an interface, but they’re maintained separately from the running code and can drift out of sync with it. A generated typed interface, by contrast, is derived directly from the service’s actual public methods, so it reflects what the service currently does rather than what someone last remembered to document or regenerate.</p><h3>2. Does “compile-time safety” mean the same thing in every programming language?</h3><p>No. In statically typed, compiled languages, an interface mismatch genuinely fails to build. In dynamically typed languages like Python or plain JavaScript, there’s no compiler to enforce this, an interface change instead becomes visible as a package update the consuming team can review, and an incompatibility surfaces as an import or attribute error if applied, rather than at build time. Both are meaningfully better than a silent runtime failure, but they’re not the same guarantee.</p><h3>3. Why does the developer experience of typed interfaces matter more now than it did five years ago?</h3><p>Two trends compound the value of typed interfaces specifically: systems are more distributed than they used to be, so more of a codebase’s total surface area is integration code rather than business logic, and AI coding tools now read and write across those same service boundaries constantly, without the persistent context a human developer builds up over time on a project.</p><h3>4. How is Graftcode’s approach to typed interfaces different from gRPC’s?</h3><p>gRPC requires a hand-written .proto file as the source of truth, with a code-generation step that has to be run and recommitted every time the interface changes. A Graft is generated directly from a provider service’s actual public methods, with no separate schema file for a developer to author or keep in sync by hand.</p><h3>5. Does adopting typed interfaces for internal services mean giving up REST or gRPC entirely?</h3><p>No. REST remains the right choice for external-facing APIs with browser or third-party consumers, and gRPC still fits polyglot, high-throughput systems that need protocol-level streaming. Typed interfaces built around a service boundary, including tools like Graftcode, are typically adopted for the internal service-to-service calls where integration overhead is currently hand-written, not as a wholesale replacement for every protocol already in use.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=89dff7461d97" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SLOs and Error Budgets: The Only Way to Have Honest Reliability Conversations]]></title>
            <link>https://medium.com/@sid_83671/slos-and-error-budgets-the-only-way-to-have-honest-reliability-conversations-817d03a5120b?source=rss-8e5a5004d442------2</link>
            <guid isPermaLink="false">https://medium.com/p/817d03a5120b</guid>
            <category><![CDATA[error-budget]]></category>
            <category><![CDATA[saas]]></category>
            <category><![CDATA[slo]]></category>
            <dc:creator><![CDATA[Sid]]></dc:creator>
            <pubDate>Sat, 11 Apr 2026 09:51:01 GMT</pubDate>
            <atom:updated>2026-04-11T09:51:01.262Z</atom:updated>
            <content:encoded><![CDATA[<p>You ever argue about reliability with product teams?</p><p>Engineering says: “We need to improve stability.”</p><p>Product says: “We need to ship faster.”</p><p>And then nothing gets resolved.</p><p>This is exactly why SLOs (Service Level Objectives) exist.</p><p>An SLO defines: “How reliable does this service need to be?”</p><p>Example:</p><ul><li>99.9% uptime</li><li>95% of requests under 200ms</li></ul><p>It’s not about perfection. It’s about targets.</p><p>Now comes the interesting part: error budgets.</p><p>If your SLO is 99.9%, you’re allowed 0.1% failure.</p><p>That’s your error budget.</p><p>And this changes everything.</p><p>Instead of arguing emotionally, you now have math.</p><p>If you’re within budget:<br> → You can take risks (deploy faster, experiment)</p><p>If you’re exceeding budget:<br> → You slow down, fix reliability</p><p>It creates a balance between:</p><ul><li>Innovation</li><li>Stability</li></ul><p>Without SLOs, reliability discussions are vague.</p><p>With SLOs:</p><ul><li>You define SLIs (metrics that matter)</li><li>You track performance</li><li>You make decisions based on data</li></ul><p>But here’s where teams mess up:</p><p><strong>1. Wrong metrics: </strong>If your SLO is based on CPU usage, you’ve already lost. Users don’t care about CPU. They care about latency and errors.</p><p><strong>2. Unrealistic targets:</strong> 99.999% sounds nice until you realize what it takes to achieve it.</p><p><strong>3. No enforcement: </strong>If you ignore error budgets, SLOs become dashboards no one reads. Good SLO practice:</p><ul><li>Define user-centric SLIs</li><li>Set achievable targets</li><li>Tie error budgets to release policies</li></ul><p>Also, SLOs force prioritization. Not everything needs 99.99% uptime.</p><p>Your payment system? Yes. Your internal dashboard? ummm…probably not.</p><p>SLOs are less about uptime and more about alignment. They turn “we think” into “we agreed.” And in engineering teams, that clarity is rare, and incredibly valuable.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=817d03a5120b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Logs vs Metrics vs Traces: Let’s Stop Treating Them as Silos]]></title>
            <link>https://medium.com/@sid_83671/logs-vs-metrics-vs-traces-lets-stop-treating-them-as-silos-7d1a96673948?source=rss-8e5a5004d442------2</link>
            <guid isPermaLink="false">https://medium.com/p/7d1a96673948</guid>
            <category><![CDATA[logs]]></category>
            <category><![CDATA[trace]]></category>
            <category><![CDATA[silos]]></category>
            <category><![CDATA[metrics]]></category>
            <category><![CDATA[logs-vs-metric]]></category>
            <dc:creator><![CDATA[Sid]]></dc:creator>
            <pubDate>Sat, 04 Apr 2026 11:06:01 GMT</pubDate>
            <atom:updated>2026-04-04T11:06:01.376Z</atom:updated>
            <content:encoded><![CDATA[<p>Tell me I am not the only one because every time there’s an incident, someone asks: “Should we look at logs or metrics?”</p><p>Wrong question!</p><p>You need all three: logs, metrics, and traces. Each gives a different lens. Let’s break it down.</p><p><strong>Metrics:</strong> These are numbers over time:</p><ul><li>CPU usage</li><li>Request rate</li><li>Error percentage</li><li>Latency</li></ul><p>They’re cheap to store and great for:</p><ul><li>Alerting</li><li>Trend analysis</li><li>SLO tracking</li></ul><p>But metrics are aggregated. They lose detail.</p><p>Metrics tell you: “Something is wrong.”</p><p>They don’t tell you why.</p><p><strong>Logs:</strong> These are discrete events:</p><ul><li>Error messages</li><li>Debug info</li><li>Application output</li></ul><p>They’re rich in detail:</p><ul><li>Stack traces</li><li>Context</li><li>Parameters</li></ul><p>Logs tell you:<br> “What exactly happened?”</p><p>But logs are noisy. Without structure and indexing, they’re painful to search.</p><p><strong>Traces: </strong>These track a request across services.</p><p>In microservices, a single request might hit: API to Service A to Service B to Database to Cache.</p><p>Traces show:</p><ul><li>End-to-end latency</li><li>Which service is slow</li><li>Where failures occur</li></ul><p>Traces tell you: “Where is the problem in the flow?”</p><p>Now here’s the key: incidents span all three.</p><p>Examples:</p><ul><li>Metrics show latency spike</li><li>Traces show Service B is slow</li><li>Logs show a database timeout</li></ul><p>If you only have one:</p><ul><li>Metrics: you know it’s bad</li><li>Logs: you’re guessing where to look</li><li>Traces: you know where, but not what</li></ul><p>Together, they give you: Detection to Localization to Explanation</p><p>The real challenge isn’t collecting them. It’s correlating them. You need:</p><ul><li>Shared context (trace IDs, request IDs)</li><li>Centralized storage</li><li>Fast querying across datasets</li></ul><p>Without correlation, you’re manually stitching data during incidents and that’s how MTTR explodes.</p><p>So to summarize, logs, metrics, and traces aren’t alternatives but layers of the same story.</p><p>Until next time folks.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7d1a96673948" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>