<?xml version="1.0" encoding="UTF-8"?>
 <feed xmlns="http://www.w3.org/2005/Atom">
  <title>brijesh</title>
  <subtitle></subtitle>
  <id>https://anirudh.fi/</id>
  <updated>2025-02-20T19:46:24+05:30</updated>
  <link href="https://anirudh.fi/"></link>
  <author>
   <name>Brijesh Wawdhane</name>
   <email>mail@brijesh.dev</email>
  </author>
  <entry>
   <title>Building Argus</title>
   <updated>2024-12-27T00:00:00Z</updated>
   <id>tag:anirudh.fi/,2024-12-27:blog/building-argus</id>
   <link href="https://anirudh.fi/blog/building-argus"></link>
   <summary type="html">&lt;h2&gt;Insights and learnings from creating a logging service&lt;/h2&gt;&#xA;&lt;p&gt;You know that feeling when you start a project thinking &amp;ldquo;this shouldn&amp;rsquo;t be too hard&amp;rdquo; and in reality it is much more complicated but these are good problems to have. That&amp;rsquo;s exactly what happened when I decided to build Argus, a logging service. I had built many small applications before, but I never had to think about scale. This project taught me that logging at scale is a whole different beast - and reminded me why it&amp;rsquo;s so much more fun to learn new technologies when you actually need them rather than because they&amp;rsquo;re trending.&lt;/p&gt;&#xA;&#xA;&lt;h2 id=&#34;starting-simple&#34;&gt;Starting Simple&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I started as simple as possible with Go and a project structure borrowed from melkey. Like all my previous projects, I reached for PostgreSQL without much thought - it wasn&amp;rsquo;t until after implementing authentication that I started questioning this choice as I began thinking about log volumes.&lt;/p&gt;&#xA;&#xA;&lt;h2 id=&#34;the-database-journey&#34;&gt;The Database Journey&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The search for the right database was interesting:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;DynamoDB seemed like too much work to set up and maintain&lt;/li&gt;&#xA;&lt;li&gt;ClickHouse looked promising but felt too costly for the initial scope&lt;/li&gt;&#xA;&lt;li&gt;Then I discovered Cassandra&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What I loved about Cassandra was that CQL felt familiar enough coming from SQL - I didn&amp;rsquo;t have to learn a completely new query language. The distributed nature of Cassandra was fascinating to think about, even though sometimes it was frustrating when things didn&amp;rsquo;t work exactly like PostgreSQL. Understanding why those differences existed due to Cassandra&amp;rsquo;s distributed nature was actually quite enlightening.&lt;/p&gt;&#xA;&#xA;&lt;h2 id=&#34;communication-evolution&#34;&gt;Communication Evolution&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I was already thinking about optimizing for scale, I remembered watching a video about how LinkedIn increased their API performance by 60% using protocol buffers. My first instinct was to use gRPC - I had played with Twirp before but initially dismissed it. After spending time with gRPC and writing a proof of concept, I revisited Twirp&amp;rsquo;s documentation. What sealed the deal was Twirp&amp;rsquo;s ability to provide both HTTP/JSON and HTTP/protobuf endpoints from a single implementation.&lt;/p&gt;&#xA;&#xA;&lt;h2 id=&#34;current-challenges&#34;&gt;Current Challenges&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Now I&amp;rsquo;m tackling background jobs for log analytics in a distributed system. Initially, I thought Go routines would be sufficient, but the distributed nature of the system requires more thought. I&amp;rsquo;m considering approaches like:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Creating a dedicated table for background jobs with task locking&lt;/li&gt;&#xA;&lt;li&gt;Message queues (though I&amp;rsquo;m hesitant to add another storage system)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I&amp;rsquo;m currently leaning toward the locks table approach since I already have Cassandra in place.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another thing I am thinking about is how to send logs from client, Amazon Keyspaces (managed Cassandra), can do 30-row batch inserts at a time. I&amp;rsquo;m now deciding on how often and how many logs to send in a batch.&lt;/p&gt;&#xA;&#xA;&lt;h2 id=&#34;project-structure&#34;&gt;Project Structure&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Argus is split into four main repositories:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;argus-core: The main service handling log ingestion and storage&lt;/li&gt;&#xA;&lt;li&gt;argus-client: A Go client library for easy integration&lt;/li&gt;&#xA;&lt;li&gt;argus-web: The web interface for log visualization and management&lt;/li&gt;&#xA;&lt;li&gt;argus-demo: A sample application demonstrating real-world usage&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2 id=&#34;future-directions&#34;&gt;Future Directions&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;While Argus currently focuses solely on logging, the architecture allows for future expansion. Potential features include:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Distributed tracing integration&lt;/li&gt;&#xA;&lt;li&gt;Metrics collection&lt;/li&gt;&#xA;&lt;li&gt;Log analytics and visualization&lt;/li&gt;&#xA;&lt;li&gt;Custom alert rules&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Building Argus has been an exercise in making pragmatic architectural decisions. While there&amp;rsquo;s still room for improvement, the current version represents a solid foundation for a lightweight, efficient logging service. The key takeaway has been that focusing on core functionality and making decisions based on actual requirements leads to better outcomes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Want to learn more? Check out the &lt;a href=&#34;https://github.com/yourusername/argus&#34; rel=&#34;nofollow&#34;&gt;project documentation&lt;/a&gt; or try the demo application yourself.&lt;/p&gt;&#xA;</summary>
  </entry>
  <entry>
   <title>My terminal setup</title>
   <updated>2024-11-17T00:00:00Z</updated>
   <id>tag:anirudh.fi/,2024-11-17:blog/shell-setup</id>
   <link href="https://anirudh.fi/blog/shell-setup"></link>
   <summary type="html">&lt;h2&gt;A brief overview of my terminal setup.&lt;/h2&gt;&#xA;&lt;p&gt;If you&amp;rsquo;re reading this, you&amp;rsquo;re likely no stranger to the rabbit hole of&#xA;r/unixporn and similar repositories of terminal configurations. I, too,&#xA;have spent considerable time refining my terminal setup, but I&amp;rsquo;ve come to&#xA;adopt the philosophy that the terminal is a tool not a canvas for design&#xA;experiments.&lt;/p&gt;&#xA;&#xA;&lt;h2 id=&#34;terminal-emulator&#34;&gt;Terminal emulator&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;When it comes to terminal emulators, there are several solid options out&#xA;there. I use &lt;a href=&#34;https://sw.kovidgoyal.net/kitty/&#34; rel=&#34;nofollow&#34;&gt;Kitty&lt;/a&gt;, primarily because&#xA;it ticks all the boxes for me, it works well with neovim it’s fast&#xA;(GPU-accelerated) and works seamlessly across different platforms and I&#xA;only need to maintain one config file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have made few adjustments that change the font and use all of the screen&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;font_family      JetBrainsMono Nerd Font&#xA;bold_font        JetBrainsMono Nerd Font&#xA;italic_font      JetBrainsMono Nerd Font&#xA;bold_italic_font JetBrainsMono Nerd Font&#xA;&#xA;macos_traditional_fullscreen no&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2 id=&#34;plugins-and-theme&#34;&gt;Plugins and theme&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;While I used to manually curate my shell plugins (and honestly, it was&#xA;pretty sweet), I&amp;rsquo;ve recently embraced a more practical approach.&#xA;OhMyZsh handles my plugins and Powerlevel10k handles my ZSH theme now -&#xA;it might not be as nice as my previous setup, but it gets the job done&#xA;without the maintenance overhead.&lt;/p&gt;&#xA;&#xA;&lt;h2 id=&#34;functions-and-aliases&#34;&gt;Functions and aliases&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I had a grave of unused aliases and functions copied from others configs, but&#xA;now I only have a few that I use regularly&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;# create a new directory and cd into it&#xA;function mkcd() {&#xA;    mkdir -p &amp;quot;$1&amp;quot; &amp;amp;&amp;amp; cd &amp;quot;$1&amp;quot;&#xA;}&#xA;&#xA;# interactive file select for staging&#xA;function gadd() {&#xA;    git status --short | cut -c 4- | gum choose --no-limit | xargs git add&#xA;}&#xA;&#xA;# interactive commit for conventional commits&#xA;function gcommit() {&#xA;    TYPE=$(gum choose &amp;quot;fix&amp;quot; &amp;quot;feat&amp;quot; &amp;quot;docs&amp;quot; &amp;quot;style&amp;quot; &amp;quot;refactor&amp;quot; &amp;quot;test&amp;quot; &amp;quot;chore&amp;quot; &amp;quot;revert&amp;quot; &amp;quot;batman&amp;quot;)&#xA;    SCOPE=$(gum input --placeholder &amp;quot;scope&amp;quot;)&#xA;    test -n &amp;quot;$SCOPE&amp;quot; &amp;amp;&amp;amp; SCOPE=&amp;quot;($SCOPE)&amp;quot;&#xA;    SUMMARY=$(gum input --value &amp;quot;$TYPE$SCOPE: &amp;quot; --placeholder &amp;quot;Summary of this change&amp;quot;)&#xA;    DESCRIPTION=$(gum write --placeholder &amp;quot;Details of this change&amp;quot;)&#xA;    gum confirm &amp;quot;Commit changes?&amp;quot; &amp;amp;&amp;amp; git commit -S -m &amp;quot;$SUMMARY&amp;quot; -m &amp;quot;$DESCRIPTION&amp;quot;&#xA;}&#xA;&#xA;# select which remote and branch to push to&#xA;function gpush() {&#xA;    REMOTE=$(git remote | gum choose)&#xA;    BRANCH=$(git branch --show-current)&#xA;    git push $REMOTE $BRANCH&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2 id=&#34;clis&#34;&gt;CLIs&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Beyond the basics, there are two CLIs that earn their keep:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;GitHub&amp;rsquo;s &lt;code&gt;gh&lt;/code&gt; cli - because sometimes the browser is overkill&lt;/li&gt;&#xA;&lt;li&gt;My git server CLI - technically not installed on my computer, its sends&#xA;commands over SSH to my git server running &lt;a href=&#34;https://github.com/charmbracelet/soft-serve&#34; rel=&#34;nofollow&#34;&gt;soft-serve&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;This setup isn&amp;rsquo;t about having the coolest or most extensive configuration.&#xA;It&amp;rsquo;s about having exactly what you need and nothing more. These tools work&#xA;for me, but your ideal set of tools might differ based on your specific&#xA;needs and preferences.&lt;/p&gt;&#xA;</summary>
  </entry>
 </feed>