<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Musings of an Anonymous Geek</title>
	<atom:link href="http://protocolostomy.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://protocolostomy.com</link>
	<description>Made with only the finest 1&#039;s and 0&#039;s</description>
	<lastBuildDate>Tue, 14 Jul 2026 19:08:02 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>
<site xmlns="com-wordpress:feed-additions:1">2259962</site>	<item>
		<title>After Testing Cmux &#8211; Back to iTerm2</title>
		<link>https://protocolostomy.com/2026/07/14/after-testing-cmux-back-to-iterm2/</link>
					<comments>https://protocolostomy.com/2026/07/14/after-testing-cmux-back-to-iterm2/#respond</comments>
		
		<dc:creator><![CDATA[jonesy]]></dc:creator>
		<pubDate>Tue, 14 Jul 2026 19:08:00 +0000</pubDate>
				<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[ai]]></category>
		<category><![CDATA[tools]]></category>
		<guid isPermaLink="false">https://protocolostomy.com/?p=1084</guid>

					<description><![CDATA[<p>I heard about cmux right after I heard about, and started using, Ghostty &#8211; a terminal application written (in Rust) by Mitchell Hashimoto (of Hashicorp fame). I&#8217;d had mixed feelings about Ghostty, but figured it would probably go through pretty fast iterations and improvement, so I kept it around. I was pretty convinced I didn&#8217;t...</p>
The post <a href="https://protocolostomy.com/2026/07/14/after-testing-cmux-back-to-iterm2/">After Testing Cmux – Back to iTerm2</a> first appeared on <a href="https://protocolostomy.com">Musings of an Anonymous Geek</a>.]]></description>
										<content:encoded><![CDATA[<p class="wp-block-paragraph">I heard about <a href="https://cmux.com">cmux</a> right after I heard about, and started using, <a href="https://ghostty.org">Ghostty</a> &#8211; a terminal application written (in Rust) by Mitchell Hashimoto (of Hashicorp fame). I&#8217;d had mixed feelings about Ghostty, but figured it would probably go through pretty fast iterations and improvement, so I kept it around. I was pretty convinced I didn&#8217;t really need cmux per se, but thought the vertical tabs on the sidebar with more than just a window title could be useful. Ya gotta try, right? </p>



<p class="wp-block-paragraph">So, I gave it a shot. I used it for probably 2-3 months. It&#8217;s a fine tool, as is Ghostty, but these things are mostly solving issues I don&#8217;t really have. I&#8217;m not someone who uses vim or emacs as my primary IDE, and I don&#8217;t need to run a command in 50 separate terminal windows simultaneously (er, anymore, ask me about my first beowulf cluster in 2003!). I also don&#8217;t switch my working context across terminal panes in a single window, I do it at the macos desktop level (using <a href="https://www.getspacejump.com" title="">SpaceJump</a>, which I recently found and is helpful for that). I have a desktop per project, and each desktop has the terminal windows, browser windows, documentation, and IDE windows for just that project (I have 12 desktops, currently). </p>



<p class="wp-block-paragraph">Ultimately, I gave iTerm2 another shot after a long time (years, actually) just using the native macos Terminal application. It turns out that iTerm2 actually has vertical tabs, which is nice. Also, the TUIs for Codex and Claude Code both set pretty good window titles, and notifications happen exactly like they did in cmux. I had issues with the cmux in-terminal browser, so I never used it, so in all, I can&#8217;t say I&#8217;m really missing a whole lot from not using cmux. </p>



<p class="wp-block-paragraph">This in no way is a knock on cmux, or anyone who uses it. I&#8217;m also not advocating that others not use whatever they want. I&#8217;m just recording my current mindset. At some point I&#8217;m sure it&#8217;ll change or I&#8217;ll go in another direction, which makes posts like this interesting in a historical chronology context. </p>The post <a href="https://protocolostomy.com/2026/07/14/after-testing-cmux-back-to-iterm2/">After Testing Cmux – Back to iTerm2</a> first appeared on <a href="https://protocolostomy.com">Musings of an Anonymous Geek</a>.]]></content:encoded>
					
					<wfw:commentRss>https://protocolostomy.com/2026/07/14/after-testing-cmux-back-to-iterm2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1084</post-id>	</item>
		<item>
		<title>My AI Status &#8211; Mid-2026</title>
		<link>https://protocolostomy.com/2026/07/12/my-ai-status-mid-2026/</link>
					<comments>https://protocolostomy.com/2026/07/12/my-ai-status-mid-2026/#respond</comments>
		
		<dc:creator><![CDATA[jonesy]]></dc:creator>
		<pubDate>Sun, 12 Jul 2026 19:43:39 +0000</pubDate>
				<category><![CDATA[AI]]></category>
		<category><![CDATA[Big Ideas]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[ai]]></category>
		<guid isPermaLink="false">https://protocolostomy.com/?p=1082</guid>

					<description><![CDATA[<p>I&#8217;ve been using LLMs for lots of things for the past 4 years now, but I rarely have blogged about any of it. It&#8217;s such a fast-moving space that I figured I should start being more diligent about tracking the evolution of AI and my use of it. Quick Historical Summary I started using LLMs...</p>
The post <a href="https://protocolostomy.com/2026/07/12/my-ai-status-mid-2026/">My AI Status – Mid-2026</a> first appeared on <a href="https://protocolostomy.com">Musings of an Anonymous Geek</a>.]]></description>
										<content:encoded><![CDATA[<p class="wp-block-paragraph">I&#8217;ve been using LLMs for lots of things for the past 4 years now, but I rarely have blogged about any of it. It&#8217;s such a fast-moving space that I figured I should start being more diligent about tracking the evolution of AI and my use of it. </p>



<h2 class="wp-block-heading">Quick Historical Summary</h2>



<p class="wp-block-paragraph">I started using LLMs in 2022 with the release of ChatGPT. I was pretty quickly fascinated by it and my mind exploded with ideas and questions. By early 2023 I was training my own model, because I discovered the term &#8220;training&#8221; before I knew what &#8220;RAG&#8221; was. Lots of manual labor, embeddings, vector databases, laptops were crashed&#8230; I loved every minute of it. Improvements to every single part of the AI ecosystem seemed to happen overnight. Between 2023 and early 2026 I tried to build the same IOS app three times. The first time I was cut &amp; pasting code from ChatGPT into XCode, there were no coding agents, the code was pretty bad, the training data cutoff was forever ago, etc. The third time, the training cutoff was just a couple months ago, the code was pretty good, everything from code implementation to pushing PRs was done by an agent, and that attempt actually tested out and I put it in the app store. In the same period, I went from AI being forbidden at one job, to it being required at another job, to now being at a place that trusts engineers to make things happen, which turns out to be the most effective approach I&#8217;ve seen. Maybe I should write about that. </p>



<h2 class="wp-block-heading">Today</h2>



<p class="wp-block-paragraph">I am a software engineer who started their career focused on systems/network/data infrastructure. I co-authored a book about Linux system administration, and one about Python development, to give an idea about the sort of things I like to get into. I&#8217;m lucky to have been able to mold a career around not just being <em>either</em> a sysadmin <em>or</em> a developer, but landing in environments where I was able to wear lots of hats and add value in both of those spaces. My current environment allows for that, too. </p>



<p class="wp-block-paragraph">I&#8217;m using AI in a lot of different contexts as a result. I use it in monorepos and small repos. I use it for infrastructure, software engineering, data engineering, research &amp; ideation, and any other category of task that comes up. I use it with Golang, Python, Typescript, Javascript, Terraform (HCL), bash &amp; zsh, awk &amp; sed, regexes, SQL, Scala, and jq. I use it against various SaaS APIs, I use it to draft communication, create slide decks, etc. </p>



<p class="wp-block-paragraph">I have also used it to obviate the need to use external vendors for various things, and I expect that to continue. I find that to be the most interesting result of using AI: the idea that it&#8217;s possible to skip having expense report line items for github repo backups or security awareness training, because you can now build those things using some terraform, or Google Workspace tools, in a matter of hours. </p>



<h2 class="wp-block-heading">Tooling</h2>



<p class="wp-block-paragraph">TL;DR &#8211; I have used Claude Code since it came out. I started using Codex when that came out, but it hasn&#8217;t been able to pull me over from Claude Code as my daily driver. However, Sol 5.6 just came out a week or so ago, and it is pretty amazing. Just in time as Anthropic is about to (probably) make Fable prohibitively expensive. I use some other stuff for various non-daily tasks, but these are really my main tools.</p>



<p class="wp-block-paragraph">The AI tooling landscape is just breathtaking. The speed with which things have appeared, disappeared, merged with other things, spawned whole new cottage industries, etc., is astounding. If everyone actually made use of only those tools specific to their role and using AI within it, we would run out of space on our hard drives for tools. </p>



<p class="wp-block-paragraph">I use relatively few tools, and I think this is due to having used AI for so long and having built up a reasonably mature set of markdown files (hooks, rules, skills, etc) that dictate how AI tools will behave. I do try hard to keep up with the evolution of tooling, and I do adopt new tools for various one-off projects, PoCs, and small tasks, only to find myself thinking that they&#8217;re kind of redundant, don&#8217;t work very well, use up too many tokens, etc. I think I&#8217;ve gotten the most benefit from: </p>



<ul class="wp-block-list">
<li>Iterating on my local configurations (skills, rules, AGENTS.md, etc)</li>



<li>Keeping up with the Claude Code and Codex changelogs</li>



<li>Experimenting with open weight models in LM Studio</li>



<li>Talking to friends in other industries, companies, with other side projects, etc about their own use of AI</li>
</ul>



<p class="wp-block-paragraph">As I&#8217;m writing, I guess I&#8217;m also concluding that an awful lot of the AI tooling space consists of noise from fledgling efforts to ride the wave, sell you something, and achieve an exit. For open source tooling, some genuinely want to solve a problem and sit on the same side of the table as their users, but others quickly evolved into commercial offerings that were then bought out by those whose motives are less clear and whose track records make them less trustworthy to me. </p>



<h2 class="wp-block-heading">What I&#8217;m Missing</h2>



<p class="wp-block-paragraph">Two really critical things: </p>



<ol class="wp-block-list">
<li>A really good way to manage many agents across many separate, independent projects that each require a diverse set of tasks (setting up a database, validating a schema, creating a new github repo, writing code across multiple repos, implementing terraform for new infrastructure, writing documentation, etc). I have a visual model for this in mind that I tried to implement with AI, but it didn&#8217;t go great. That was a year ago, though. It might be a no-brainer with today&#8217;s models, which is crazy to think about. </li>



<li>Infrastructure in particular is a challenge, because the model for infrastructure changes doesn&#8217;t naturally align with how code changes happen. Code can be implemented locally, and then have a suite of thousands of tests that can locally confirm that not only does your new code do what you expect, but it doesn&#8217;t cause any existing code to break. And those tests can run locally too. And typically if those tests all pass, surprises after deploying to prod should be exceedingly rare. And, if there is an issue, you can revert to the last known-good version of the code in a flash. The whole coding ecosystem is built around making this easy. Almost none of this is true for infrastructure, so I find that infrastructure tasks require more bot-sitting, I trust everything a lot less, I have to review every little thing, it&#8217;s very difficult to account for everything up front in the prompt, or even in my precious markdown rules/skills, etc. </li>
</ol>



<p class="wp-block-paragraph">I&#8217;m doing some work on both of these things, but they aren&#8217;t really my primary job, so time on them is limited. But even though there is tooling that seems to want to solve these problems, I just don&#8217;t find them to be very&#8230; desirable, for one reason or another. </p>



<p class="wp-block-paragraph">For #1 what I really want is something that kinda looks like Linear but when I move a ticket from &#8216;Planned&#8217; to &#8216;In Progress&#8217;, that triggers an agent to pick up the task and execute on it, and it moves the ticket to &#8216;ready for review&#8217; when it&#8217;s done, so I can review it (for now &#8211; later I&#8217;d have the option of delegating review to a bot that could be authorized to go all the way through merging and deployment, potentially). </p>



<p class="wp-block-paragraph">For #2, I shouldn&#8217;t really need something as heavy as Atlantis or SpaceLift, but at the same time, the current features of GitHub are an awkward fit &#8212; it&#8217;s just always obvious that GitHub was built for code and not infrastructure, so from that perspective I understand why these large, heavyweight tools exist. Terraform&#8217;s own quirks don&#8217;t help, either, though it&#8217;s very obviously light years beyond where Chef &amp; Puppet left off, but now they&#8217;re putting some useful stuff in their cloud-only product, etc. OpenTofu is definitely in my future. </p>



<h2 class="wp-block-heading">The Future</h2>



<p class="wp-block-paragraph">The rest of my year is probably going to be spent: </p>



<ul class="wp-block-list">
<li>Building AI infrastructure in AWS </li>



<li>Building infrastructure that&#8217;s not AI-specific but is used for projects in the AI space</li>



<li>Preparing for scale, mostly focused on the infrastructure space</li>



<li>Preparing for frontier model pricing to become kind of insane (so, experimenting with replicating existing functionality using non-frontier models, which I&#8217;m already doing, it&#8217;s just lower on the priority list for the moment)</li>
</ul>



<p class="wp-block-paragraph">If anyone wants to connect on any of this let me know. If you just want me to write more about any of this, let me know. If you just think I should stop sleeping on your favorite tool, let me know that too! It&#8217;s certainly more than a small possibility that I don&#8217;t know about every tool and I&#8217;m happy to hear about more! </p>The post <a href="https://protocolostomy.com/2026/07/12/my-ai-status-mid-2026/">My AI Status – Mid-2026</a> first appeared on <a href="https://protocolostomy.com">Musings of an Anonymous Geek</a>.]]></content:encoded>
					
					<wfw:commentRss>https://protocolostomy.com/2026/07/12/my-ai-status-mid-2026/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1082</post-id>	</item>
		<item>
		<title>AI Means Changing Your Sales Approach</title>
		<link>https://protocolostomy.com/2026/02/10/ai-means-changing-your-sales-approach/</link>
					<comments>https://protocolostomy.com/2026/02/10/ai-means-changing-your-sales-approach/#respond</comments>
		
		<dc:creator><![CDATA[jonesy]]></dc:creator>
		<pubDate>Tue, 10 Feb 2026 16:58:04 +0000</pubDate>
				<category><![CDATA[AI]]></category>
		<category><![CDATA[ai]]></category>
		<guid isPermaLink="false">https://protocolostomy.com/?p=1079</guid>

					<description><![CDATA[<p>Three weeks ago, I made an appointment to get a demo of a product I already knew I wanted to buy, because I had used it at another employer. No matter, the site would not let me sign us up until I got a demo and spoke to a sales drone. Last week, before that...</p>
The post <a href="https://protocolostomy.com/2026/02/10/ai-means-changing-your-sales-approach/">AI Means Changing Your Sales Approach</a> first appeared on <a href="https://protocolostomy.com">Musings of an Anonymous Geek</a>.]]></description>
										<content:encoded><![CDATA[<p class="wp-block-paragraph">Three weeks ago, I made an appointment to get a demo of a product I already knew I wanted to buy, because I had used it at another employer. No matter, the site would not let me sign us up until I got a demo and spoke to a sales drone. Last week, before that demo could actually happen, I used Claude to actually just create an internal tool that is good enough to just cancel the demo. It&#8217;s an internal security awareness training program. It&#8217;s now managed with an audit log in google sheets, a quiz in google forms, auto-generated completion certs using an appscript attached to the form submission action. It took maybe 3-4 hours to get together. It has so far not ever failed or had a hiccup. </p>



<p class="wp-block-paragraph">Yesterday morning, I priced out a solution for doing backups of the repositories in our GitHub organization. It was the classic cable TV problem: It was expensive, and the only way to get the features I wanted was to upgrade to a plan that would have me paying for all kinds of stuff I don&#8217;t need just to get the one thing I do. Yesterday afternoon, I started testing a homegrown solution that Claude helped me build, complete with a docker image, python code, terraform code to deploy it all, a README suitable for anyone either using or managing the service, etc. </p>



<p class="wp-block-paragraph">It actually is already a new world. It&#8217;s not just coming, it&#8217;s here, and companies need to start thinking hard not only about what their customers want and need, but what they&#8217;re competing with. I&#8217;m not sure it&#8217;s possible to understand what you&#8217;re competing with if you don&#8217;t have an internal capability around AI. Just six months ago it might&#8217;ve still been true that the bar for creating &#8220;good enough&#8221; solutions internally was too high for a lot of customers. The list of products for which that&#8217;s still true is shrinking quite rapidly!  </p>The post <a href="https://protocolostomy.com/2026/02/10/ai-means-changing-your-sales-approach/">AI Means Changing Your Sales Approach</a> first appeared on <a href="https://protocolostomy.com">Musings of an Anonymous Geek</a>.]]></content:encoded>
					
					<wfw:commentRss>https://protocolostomy.com/2026/02/10/ai-means-changing-your-sales-approach/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1079</post-id>	</item>
		<item>
		<title>What AI Portends</title>
		<link>https://protocolostomy.com/2026/02/10/what-ai-portends/</link>
					<comments>https://protocolostomy.com/2026/02/10/what-ai-portends/#respond</comments>
		
		<dc:creator><![CDATA[jonesy]]></dc:creator>
		<pubDate>Tue, 10 Feb 2026 15:59:43 +0000</pubDate>
				<category><![CDATA[AI]]></category>
		<category><![CDATA[Big Ideas]]></category>
		<category><![CDATA[Leadership]]></category>
		<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[ai]]></category>
		<category><![CDATA[future]]></category>
		<category><![CDATA[history]]></category>
		<guid isPermaLink="false">https://protocolostomy.com/?p=1077</guid>

					<description><![CDATA[<p>It&#8217;s funny how humans have the same conversations over and over again across generations. When I was a kid in the 70s, the old folks talked about kids watching too much TV and it turning their brains to mush. In the 90&#8217;s parents talked about kids being obsessed with Gameboys and consoles and it turning...</p>
The post <a href="https://protocolostomy.com/2026/02/10/what-ai-portends/">What AI Portends</a> first appeared on <a href="https://protocolostomy.com">Musings of an Anonymous Geek</a>.]]></description>
										<content:encoded><![CDATA[<p class="wp-block-paragraph">It&#8217;s funny how humans have the same conversations over and over again across generations. When I was a kid in the 70s, the old folks talked about kids watching too much TV and it turning their brains to mush. In the 90&#8217;s parents talked about kids being obsessed with Gameboys and consoles and it turning their brains to mush. In the 2010s parents talk about kids staring at phones all day and it turning their brains to mush. Same conversation. Still the world turns. </p>



<p class="wp-block-paragraph">We do the same thing in the technology space. In the 80s, there were folks talking about computers taking all of the jobs. In the 90s, there were folks talking about the internet taking all of the jobs. In the 2010s people talked about AWS taking all of the jobs. Today we&#8217;re talking about AI taking all of the jobs. Still the world turns. </p>



<p class="wp-block-paragraph">Whether kids brains were ever turned to mush is, perhaps, debatable. But regarding various technologies taking all of the jobs, we have data on that, and it&#8217;s provably false. Well, at least it&#8217;s false from a raw employment perspective. It&#8217;s absolutely true that certain <em>roles</em> ceased to exist, but the people in those roles migrated to other, possibly brand new roles. </p>



<p class="wp-block-paragraph">That&#8217;s not to say there weren&#8217;t other impacts on peoples&#8217; lives &amp; careers, though: for those who saw computers and decided not to learn about them and how they could be adopted in their work, they eventually became seen as complacent, or in the way, or behind the times, etc., and those folks (and I&#8217;m speaking from my own observations of family members way back in the day) had trouble finding jobs, eventually, and when they did find work, it was with a company that was still doing everything manually, because (for example) the owner found it cheaper to hire people than migrate to computers because computers made filing clerks in very low demand. Sounds like a great place. </p>



<p class="wp-block-paragraph">Something similar happened when AWS adoption was building steam back in 2008-2010. There were only a few services back then. The concept of a VPC was brand new, for example, as I recall. I thought it was great and was getting real work done with these new tools, where I could write code to deploy an EC2 instance, and store files in S3, etc. At that time I was a member of a lot of system administration groups and Linux user groups, and there was a meeting where someone took an informal poll that showed that less than half of the folks in the room wrote code on a regular basis. </p>



<p class="wp-block-paragraph">That really shook me. I was friends with almost everyone in the room. I also could plainly see that AWS was getting bigger faster &#8211; not slowing down, or plateauing. Within the next meeting or two I put together a talk that more or less begged everyone in attendance to learn to code in whatever language fit their brain. To take their shell scripts and port them to Python, or Perl, or Ruby, or anything. Any language would do. &#8220;The reality is&#8221;, I said, &#8220;that Amazon is creating APIs to allow developers to do your job.&#8221; A couple of smirks, a couple of knowing nods of agreements &#8211; from coders. &#8220;It&#8217;s not that there won&#8217;t be any jobs&#8221; I continued, &#8220;It&#8217;s that the jobs that are left are going to be the ones we all hate doing now, like changing printer toner.&#8221; </p>



<p class="wp-block-paragraph">It has been nearly 20 years since I gave that talk. LinkedIn is a thing. There were probably 30 people in attendance at that talk, all locals, and the people who smirked are verifiably either not working in technology <em>at all</em>, or are working in tiny 1-man shops that require a physical presence and require them to change printer toner. </p>



<p class="wp-block-paragraph">So, I tell you all of that so I can tell you this: I don&#8217;t think AI is anything to panic about. There are realities, though, that history tells us are likely coming, though. What history also tells us is that the folks who wind up landing on their feet are those who learn to adopt the new technology. The ones who wind up having a difficult time staying afloat are those who are complacent in their roles, think that AI could never replace them, or who try to foster anti-AI cultures, or the like. And, like computers, and the internet, and AWS, it&#8217;s not that there won&#8217;t be any jobs. It&#8217;s just that you might not want the jobs left in the wake of AI. </p>The post <a href="https://protocolostomy.com/2026/02/10/what-ai-portends/">What AI Portends</a> first appeared on <a href="https://protocolostomy.com">Musings of an Anonymous Geek</a>.]]></content:encoded>
					
					<wfw:commentRss>https://protocolostomy.com/2026/02/10/what-ai-portends/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1077</post-id>	</item>
		<item>
		<title>Auditing Your Data Migration To ClickHouse Using ClickHouse Local</title>
		<link>https://protocolostomy.com/2024/01/21/auditing-your-data-migration-to-clickhouse-using-clickhouse-local/</link>
					<comments>https://protocolostomy.com/2024/01/21/auditing-your-data-migration-to-clickhouse-using-clickhouse-local/#respond</comments>
		
		<dc:creator><![CDATA[jonesy]]></dc:creator>
		<pubDate>Sun, 21 Jan 2024 15:04:23 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://protocolostomy.com/?p=1072</guid>

					<description><![CDATA[<p>I&#8217;ve been developing a quick and dirty data migration routine to get terabytes of data stored in AWS S3 as parquet files into our ClickHouse Cloud cluster. I&#8217;m really happy that I took some time to read up on the clickhouse local command, which is included in any installation of ClickHouse. Not only was this...</p>
The post <a href="https://protocolostomy.com/2024/01/21/auditing-your-data-migration-to-clickhouse-using-clickhouse-local/">Auditing Your Data Migration To ClickHouse Using ClickHouse Local</a> first appeared on <a href="https://protocolostomy.com">Musings of an Anonymous Geek</a>.]]></description>
										<content:encoded><![CDATA[<p class="wp-block-paragraph">I&#8217;ve been developing a quick and dirty data migration routine to get terabytes of data stored in AWS S3 as parquet files into our ClickHouse Cloud cluster. I&#8217;m really happy that I took some time to read up on the <code>clickhouse local</code> command, which is included in any installation of ClickHouse.</p>



<p class="wp-block-paragraph">Not only was this tool instrumental in getting the data migrated, but it also allowed me to very easily craft a way to quickly compare numbers between the source and destination to make sure everything I expected to be migrated was actually migrated. </p>



<h2 class="wp-block-heading">The Mess I Made</h2>



<p class="wp-block-paragraph">It&#8217;s important to know that engineers with 25+ years of experience do dumb things sometimes. It&#8217;s also important to know that having decades of experience does not make you immune to fatigue, and really nobody should be working from 7AM until midnight. It&#8217;s not heroic. It&#8217;s unhealthy and problematic on a bunch of different levels. With that in mind, here&#8217;s the dopy stuff I did after working too late after too many hours:</p>



<p class="wp-block-paragraph">Initially, after I migrated a subset of the data, I did a more manual, hacky check for consistency just using command line tools, manually querying each source in different terminal windows &amp; eyeballing the output. I wanted a nicer way to view that data, so I created a one-liner using <code>awk</code>, <code>paste</code>, and <code>column</code> commands. That looked like this:</p>



<pre class="wp-block-code"><code>paste count_clicks.txt count_clicks_parquet.txt | column -t | awk '
NR==1{
  printf(
    "%12s %18s %18s %12s %12s \n", 
    "date", 
    "clickhouse_count", 
    "warehouse_count", 
    "diff", 
    "pct-diff"
  )
}
{
  printf(
    "%12s %18d %18d %12d %12.4f%%\n", 
    $1, 
    $2, 
    $4, 
    $4-$2, 
    (100-($2/$4)*100)
  )
}'</code></pre>



<p class="wp-block-paragraph">A quick overview of what&#8217;s happening there:</p>



<ul class="wp-block-list">
<li>NR==1 means the first record (NR==2 would mean the second record, etc). If the record number is one, awk will output what&#8217;s in the first set of curly braces. The <code>printf</code> function takes a format spec in the first argument. My format spec lays out 5 columns of either 12 or 18 characters. All of those columns will hold strings, hence the &#8216;s&#8217; in <code>%12s</code>. Then I have a bunch of hard-coded strings, which become the column headers. If you forget to put <code>NR==1</code> in there, they&#8217;ll print on every row. Ask me how I know! </li>



<li>The second set of brackets specs out what will be printed in the rest of the rows. In this case, I have column widths that match up with those of the column headers, and then I have the columns in the output of the earlier parts of the command pipeline: 
<ul class="wp-block-list">
<li>$1 is the date column</li>



<li>$2 is the count from the S3 data source</li>



<li>$4 is the count from the ClickHouse data source</li>



<li>$4-$2 shows the difference between the two data sources, and </li>



<li>The last column shows the percent difference between the two sources</li>
</ul>
</li>
</ul>



<p class="wp-block-paragraph">The output looks something like this:</p>



<pre class="wp-block-code"><code>        date   clickhouse_count    warehouse_count         diff     pct-diff
  2023-12-01               1471               2445           74        0.017%
  2023-12-02               1665               1700           35        0.038%
  2023-12-03               4496               4537           41        0.045%
  2023-12-04               1650               1705           55        0.047%
  2023-12-05               1154               1237           83        0.069%
  2023-12-06               2777               2865           88        0.074%
  2023-12-07               9244               9293           49        0.041%</code></pre>



<p class="wp-block-paragraph">The data here is made up to give an idea of what the output looks like. </p>



<p class="wp-block-paragraph">So, I had this issue where my data audit showed a mismatch. I did a little work, very late at night, and went to bed thinking I had straightened it all out. When I woke up the next day, my well-rested brain and eyes caught a problem: I copied output from my queries of the two sources into two separate files, and mis-labeled the data, and then compared data in a completely different window with that, and&#8230;. well, it was a mess, and I didn&#8217;t fix anything. </p>



<p class="wp-block-paragraph">I was up too late working for sure, but I also had a messy process. I should&#8217;ve and could&#8217;ve done better. </p>



<h2 class="wp-block-heading">Fresh Eyes, Fresh (and better) Ideas</h2>



<p class="wp-block-paragraph">Revisiting my work from the night before was painful. As soon as I looked at my process at a high level (by scrolling through my terminal window history) I almost immediately said &#8220;this is insane. ClickHouse Local should be able to query both sources. I shouldn&#8217;t need to copy/paste and introduce levels of indirection that leave room for errors like this.&#8221; </p>



<p class="wp-block-paragraph">I was right. Using ClickHouse Local, you can query a ClickHouse Cloud instance using the <code>remoteSecure</code> function, and query the S3 data using the <code>s3</code> function, which also lets me pass in the file format as an argument. So there&#8217;s support for my data sources and formats.</p>



<p class="wp-block-paragraph">On top of that, ClickHouse supports Common Table Expressions (CTEs), so I can craft a query where I name the output from two separate sub select statements (one to each data source), and then write a third <code>SELECT</code> that references the two named result sets as if they were tables. </p>



<p class="wp-block-paragraph">Below, <code>s3_count</code> and <code>ch_count</code> are named result sets. The last <code>SELECT</code> queries those two named result sets. </p>



<pre class="wp-block-code"><code>clickhouse local --query "
WITH s3_count AS (
  SELECT 
    toDate(time) AS day, 
    count() AS num_events 
  FROM s3('https://s3-endpoint/2023/12/**/*.parquet', 'Parquet')  
  GROUP BY day 
  ORDER BY day
), 
ch_count AS (
  SELECT 
    toDate(time) AS day, 
    count() AS num_events 
  FROM remoteSecure('clickhouse-instance-hostname:9440', 'db.tablename', 'clickhouse-user', 'clickhouse-password') 
  WHERE toYYYYMM(timestamp) = '202312' 
  GROUP BY day ORDER BY day
) 
SELECT 
  s3.day AS date, 
  s3.num_events AS s3_count,  
  ch.num_events AS ch_count, 
  ch_count - s3_count AS diff  
FROM s3_count AS s3 
LEFT JOIN ch_count AS ch 
ON s3.day = ch.day;"</code></pre>



<p class="wp-block-paragraph">The output has a couple of quirks: for some reason, I guess possibly related to querying multiple sources, or using CTEs maybe, the output columns are not ordered according to my query, and there is no header line to tell me which column is which. It looks like this:</p>



<pre class="wp-block-code"><code>2023-02-01	40	2778	2738
2023-02-02	43	4413	4370
2023-02-03	26	7024	6998
2023-02-04	54	3079	3025</code></pre>



<h2 class="wp-block-heading">Conclusion</h2>



<p class="wp-block-paragraph">So, this is not something I&#8217;d paste as-is into a slide deck and present to an executive team. However, <code>clickhouse local</code> in this case did give me a (relatively) quick way to verify the consistency (and quantify the inconsistency) between my data sources. Once the data was moved, I wasted probably an hour with <code>awk</code> and friends, but was able to recover the next morning and throw together the <code>clickhouse local</code> solution in maybe just another hour of reading docs, debugging the query, and running test queries. Hope this helps. </p>The post <a href="https://protocolostomy.com/2024/01/21/auditing-your-data-migration-to-clickhouse-using-clickhouse-local/">Auditing Your Data Migration To ClickHouse Using ClickHouse Local</a> first appeared on <a href="https://protocolostomy.com">Musings of an Anonymous Geek</a>.]]></content:encoded>
					
					<wfw:commentRss>https://protocolostomy.com/2024/01/21/auditing-your-data-migration-to-clickhouse-using-clickhouse-local/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1072</post-id>	</item>
	</channel>
</rss>
