<?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"><channel><title><![CDATA[Arpit's Blog]]></title><description><![CDATA[Arpit's Blog]]></description><link>https://arpitrathore.com</link><generator>RSS for Node</generator><lastBuildDate>Tue, 12 May 2026 12:05:09 GMT</lastBuildDate><atom:link href="https://arpitrathore.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Redis Cheatsheet]]></title><description><![CDATA[Install Redis cli
$ brew install redis-cli

General
PING               # Test connection, returns PONG
AUTH <password>    # Authenticate with password
SELECT <db>        # Switch to a specific database (default is 0)
DBSIZE             # Get total nu...]]></description><link>https://arpitrathore.com/redis-cheatsheet</link><guid isPermaLink="true">https://arpitrathore.com/redis-cheatsheet</guid><category><![CDATA[Redis]]></category><dc:creator><![CDATA[Arpit Rathore]]></dc:creator><pubDate>Mon, 22 Sep 2025 03:11:56 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1758510672174/34b7e264-de11-4633-ba0d-d15549dca1e4.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-install-redis-cli">Install Redis cli</h2>
<pre><code class="lang-bash">$ brew install redis-cli
</code></pre>
<h2 id="heading-general">General</h2>
<pre><code class="lang-bash">PING               <span class="hljs-comment"># Test connection, returns PONG</span>
AUTH &lt;password&gt;    <span class="hljs-comment"># Authenticate with password</span>
SELECT &lt;db&gt;        <span class="hljs-comment"># Switch to a specific database (default is 0)</span>
DBSIZE             <span class="hljs-comment"># Get total number of keys in the current DB</span>
FLUSHDB            <span class="hljs-comment"># Remove all keys from the current DB</span>
FLUSHALL           <span class="hljs-comment"># Remove all keys from all DBs</span>
KEYS &lt;pattern&gt;     <span class="hljs-comment"># Find keys matching a pattern (use with caution in production)</span>
SCAN 0 MATCH &lt;p&gt;   <span class="hljs-comment"># Incrementally iterate keys (safer than KEYS)</span>
TYPE &lt;key&gt;         <span class="hljs-comment"># Get data type of a key</span>
TTL &lt;key&gt;          <span class="hljs-comment"># Get remaining time to live of a key</span>
EXPIRE &lt;key&gt; &lt;s&gt;   <span class="hljs-comment"># Set a key’s expiration in seconds</span>
PERSIST &lt;key&gt;      <span class="hljs-comment"># Remove the expiration from a key</span>
</code></pre>
<hr />
<h2 id="heading-strings">Strings</h2>
<pre><code class="lang-bash">SET &lt;key&gt; &lt;val&gt;            <span class="hljs-comment"># Set value</span>
GET &lt;key&gt;                  <span class="hljs-comment"># Get value</span>
MSET k1 v1 k2 v2           <span class="hljs-comment"># Set multiple keys</span>
MGET k1 k2                 <span class="hljs-comment"># Get multiple keys</span>
INCR &lt;key&gt;                 <span class="hljs-comment"># Increment integer value</span>
DECR &lt;key&gt;                 <span class="hljs-comment"># Decrement integer value</span>
APPEND &lt;key&gt; &lt;val&gt;         <span class="hljs-comment"># Append value to existing key</span>
STRLEN &lt;key&gt;               <span class="hljs-comment"># Get length of value</span>
</code></pre>
<hr />
<h2 id="heading-hashes">Hashes</h2>
<pre><code class="lang-bash">HSET &lt;key&gt; &lt;field&gt; &lt;val&gt;   <span class="hljs-comment"># Set field in a hash</span>
HGET &lt;key&gt; &lt;field&gt;         <span class="hljs-comment"># Get field value</span>
HMSET &lt;key&gt; f1 v1 f2 v2    <span class="hljs-comment"># Set multiple fields</span>
HMGET &lt;key&gt; f1 f2          <span class="hljs-comment"># Get multiple fields</span>
HGETALL &lt;key&gt;              <span class="hljs-comment"># Get all fields and values</span>
HDEL &lt;key&gt; &lt;field&gt;         <span class="hljs-comment"># Delete a field</span>
HLEN &lt;key&gt;                 <span class="hljs-comment"># Number of fields</span>
HKEYS &lt;key&gt;                <span class="hljs-comment"># Get all field names</span>
HVALS &lt;key&gt;                <span class="hljs-comment"># Get all values</span>
HEXISTS &lt;key&gt; &lt;field&gt;      <span class="hljs-comment"># Check if field exists</span>
</code></pre>
<hr />
<h2 id="heading-lists">Lists</h2>
<pre><code class="lang-bash">LPUSH &lt;key&gt; &lt;val&gt;          <span class="hljs-comment"># Push value to head</span>
RPUSH &lt;key&gt; &lt;val&gt;          <span class="hljs-comment"># Push value to tail</span>
LPOP &lt;key&gt;                 <span class="hljs-comment"># Remove and return first element</span>
RPOP &lt;key&gt;                 <span class="hljs-comment"># Remove and return last element</span>
LRANGE &lt;key&gt; 0 -1          <span class="hljs-comment"># Get all elements</span>
LLEN &lt;key&gt;                 <span class="hljs-comment"># Get list length</span>
LINDEX &lt;key&gt; &lt;i&gt;           <span class="hljs-comment"># Get element at index</span>
LREM &lt;key&gt; &lt;count&gt; &lt;val&gt;   <span class="hljs-comment"># Remove elements equal to value</span>
LTRIM &lt;key&gt; &lt;start&gt; &lt;end&gt;  <span class="hljs-comment"># Keep a sublist</span>
</code></pre>
<hr />
<h2 id="heading-sets">Sets</h2>
<pre><code class="lang-bash">SADD &lt;key&gt; &lt;val&gt;           <span class="hljs-comment"># Add member</span>
SREM &lt;key&gt; &lt;val&gt;           <span class="hljs-comment"># Remove member</span>
SMEMBERS &lt;key&gt;             <span class="hljs-comment"># Get all members</span>
SISMEMBER &lt;key&gt; &lt;val&gt;      <span class="hljs-comment"># Check if member exists</span>
SCARD &lt;key&gt;                <span class="hljs-comment"># Get number of members</span>
SINTER key1 key2           <span class="hljs-comment"># Intersection</span>
SUNION key1 key2           <span class="hljs-comment"># Union</span>
SDIFF key1 key2            <span class="hljs-comment"># Difference</span>
</code></pre>
<hr />
<h2 id="heading-sorted-sets">Sorted Sets</h2>
<pre><code class="lang-bash">ZADD &lt;key&gt; &lt;score&gt; &lt;val&gt;   <span class="hljs-comment"># Add member with score</span>
ZRANGE &lt;key&gt; 0 -1          <span class="hljs-comment"># Get all members by score (lowest to highest)</span>
ZREVRANGE &lt;key&gt; 0 -1       <span class="hljs-comment"># Get all members (highest to lowest)</span>
ZRANK &lt;key&gt; &lt;val&gt;          <span class="hljs-comment"># Get rank of member</span>
ZREVRANK &lt;key&gt; &lt;val&gt;       <span class="hljs-comment"># Get reverse rank</span>
ZSCORE &lt;key&gt; &lt;val&gt;         <span class="hljs-comment"># Get score of member</span>
ZCARD &lt;key&gt;                <span class="hljs-comment"># Number of members</span>
ZREM &lt;key&gt; &lt;val&gt;           <span class="hljs-comment"># Remove member</span>
</code></pre>
<hr />
<h2 id="heading-transactions">Transactions</h2>
<pre><code class="lang-bash">MULTI          <span class="hljs-comment"># Start transaction</span>
EXEC           <span class="hljs-comment"># Execute transaction</span>
DISCARD        <span class="hljs-comment"># Cancel transaction</span>
WATCH &lt;key&gt;    <span class="hljs-comment"># Watch key for changes</span>
UNWATCH        <span class="hljs-comment"># Stop watching keys</span>
</code></pre>
<hr />
<h2 id="heading-pubsub">Pub/Sub</h2>
<pre><code class="lang-bash">PUBLISH &lt;chan&gt; &lt;msg&gt;       <span class="hljs-comment"># Publish message</span>
SUBSCRIBE &lt;chan&gt;           <span class="hljs-comment"># Subscribe to channel</span>
PSUBSCRIBE &lt;pattern&gt;       <span class="hljs-comment"># Subscribe to channel pattern</span>
UNSUBSCRIBE &lt;chan&gt;         <span class="hljs-comment"># Unsubscribe</span>
</code></pre>
<hr />
<h2 id="heading-persistence-and-config">Persistence and Config</h2>
<pre><code class="lang-bash">SAVE                       <span class="hljs-comment"># Save DB synchronously</span>
BGSAVE                     <span class="hljs-comment"># Save DB asynchronously</span>
CONFIG GET &lt;param&gt;         <span class="hljs-comment"># Read config</span>
CONFIG SET &lt;param&gt; &lt;val&gt;   <span class="hljs-comment"># Update config</span>
INFO                       <span class="hljs-comment"># Get server info</span>
MONITOR                    <span class="hljs-comment"># Stream all commands (debugging)</span>
</code></pre>
<hr />
<h2 id="heading-advanced-topics">Advanced Topics</h2>
<ul>
<li><p>Replication: <code>SLAVEOF host port</code> (deprecated, use <code>REPLICAOF</code>)</p>
</li>
<li><p>Cluster: <code>CLUSTER NODES</code>, <code>CLUSTER INFO</code></p>
</li>
<li><p>Security: Use <code>ACL LIST</code>, <code>ACL SETUSER</code></p>
</li>
<li><p>Performance: Prefer <code>SCAN</code> over <code>KEYS</code> in production</p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[InfluxDB3 cheatsheet]]></title><description><![CDATA[InfluxDB 3 client: influxctl
influxctl is the official command-line tool for managing and interacting with InfluxDB 3 clusters. Think of it as your Swiss Army knife for database setup, bucket management, and query execution.
This cheatsheet gives you...]]></description><link>https://arpitrathore.com/influxdb3-cheatsheet</link><guid isPermaLink="true">https://arpitrathore.com/influxdb3-cheatsheet</guid><category><![CDATA[InfluxDB]]></category><dc:creator><![CDATA[Arpit Rathore]]></dc:creator><pubDate>Tue, 16 Sep 2025 06:58:30 GMT</pubDate><content:encoded><![CDATA[<h1 id="heading-influxdb-3-client-influxctl">InfluxDB 3 client: <code>influxctl</code></h1>
<p><a target="_blank" href="https://docs.influxdata.com/influxdb3/"><code>influxctl</code></a> is the official command-line tool for managing and interacting with InfluxDB 3 clusters. Think of it as your Swiss Army knife for database setup, bucket management, and query execution.</p>
<p>This cheatsheet gives you a quick reference for the most useful commands, so you don’t need to dig into the docs every time.</p>
<hr />
<h2 id="heading-installation">Installation</h2>
<pre><code class="lang-bash">brew install influxdata/tap/influxctl   <span class="hljs-comment"># macOS</span>
apt-get install influxctl               <span class="hljs-comment"># Debian/Ubuntu (if repo available)</span>
</code></pre>
<p>Check version:</p>
<pre><code class="lang-bash">influxctl version
</code></pre>
<hr />
<h2 id="heading-authentication-amp-config">Authentication &amp; Config</h2>
<p>Set up your connection profile:</p>
<pre><code class="lang-bash">influxctl config create --host https://cluster-url --org my-org --token my-super-secret-token --active
</code></pre>
<p>List and manage configs:</p>
<pre><code class="lang-bash">influxctl config list
influxctl config switch my-org
influxctl config delete old-org
</code></pre>
<hr />
<h2 id="heading-buckets">Buckets</h2>
<p>Buckets are where data is stored.</p>
<p>Create a bucket:</p>
<pre><code class="lang-bash">influxctl bucket create --name my-bucket --retention 30d
</code></pre>
<p>List buckets:</p>
<pre><code class="lang-bash">influxctl bucket list
</code></pre>
<p>Delete a bucket:</p>
<pre><code class="lang-bash">influxctl bucket delete --name my-bucket
</code></pre>
<hr />
<h2 id="heading-users-amp-orgs">Users &amp; Orgs</h2>
<p>Create a user:</p>
<pre><code class="lang-bash">influxctl user create --name arpit --password <span class="hljs-string">'securepass'</span>
</code></pre>
<p>List users:</p>
<pre><code class="lang-bash">influxctl user list
</code></pre>
<p>Manage orgs:</p>
<pre><code class="lang-bash">influxctl org list
influxctl org create --name team-analytics
</code></pre>
<hr />
<h2 id="heading-writing-data">Writing Data</h2>
<p>Write line protocol data directly:</p>
<pre><code class="lang-bash"><span class="hljs-built_in">echo</span> <span class="hljs-string">"weather,location=delhi temperature=32.5"</span> | influxctl write --bucket my-bucket
</code></pre>
<p>Write from a file:</p>
<pre><code class="lang-bash">influxctl write --bucket my-bucket --file data.lp
</code></pre>
<hr />
<h2 id="heading-querying-data">Querying Data</h2>
<p>Run a SQL query:</p>
<pre><code class="lang-bash">influxctl query <span class="hljs-string">"SELECT * FROM weather LIMIT 10"</span>
</code></pre>
<p>Export results as JSON:</p>
<pre><code class="lang-bash">influxctl query <span class="hljs-string">"SELECT * FROM weather"</span> --format json
</code></pre>
<p>Save to CSV:</p>
<pre><code class="lang-bash">influxctl query <span class="hljs-string">"SELECT time,temperature FROM weather"</span> --format csv &gt; out.csv
</code></pre>
<hr />
<h2 id="heading-tokens">Tokens</h2>
<p>List tokens:</p>
<pre><code class="lang-bash">influxctl auth list
</code></pre>
<p>Create a read-only token:</p>
<pre><code class="lang-bash">influxctl auth create --read-bucket my-bucket
</code></pre>
<hr />
<h2 id="heading-advanced">Advanced</h2>
<ul>
<li><p><strong>Profiles for multiple clusters</strong><br />  Easily switch between dev, staging, prod.</p>
<pre><code class="lang-bash">  influxctl config create --host https://staging-url --org staging --token token123
  influxctl config switch staging
</code></pre>
</li>
<li><p><strong>Debug connection issues</strong></p>
<pre><code class="lang-bash">  influxctl ping
  influxctl health
</code></pre>
</li>
<li><p><strong>Retention policies</strong></p>
<pre><code class="lang-bash">  influxctl bucket update --name my-bucket --retention 7d
</code></pre>
</li>
</ul>
<hr />
<h2 id="heading-tips">Tips</h2>
<ul>
<li><p>Keep multiple configs for different clusters and switch quickly with <code>influxctl config switch</code>.</p>
</li>
<li><p>Use <code>--format json</code> + <code>jq</code> for scriptable queries.</p>
</li>
<li><p>Automate backups by exporting queries into CSV on cron.</p>
</li>
</ul>
<hr />
<p>With this cheatsheet, you should be able to cover most daily tasks in InfluxDB 3 with just <code>influxctl</code>.</p>
]]></content:encoded></item><item><title><![CDATA[Linux cheatsheet]]></title><description><![CDATA[Here is an extended and fully annotated version of the Linux Cheatsheet blog in Markdown, with:

Brief descriptions for each command

An Advanced Topics section covering cron, systemd, firewalld, SELinux, and more



Linux Cheat sheet
System Informat...]]></description><link>https://arpitrathore.com/linux-cheatsheet</link><guid isPermaLink="true">https://arpitrathore.com/linux-cheatsheet</guid><category><![CDATA[Linux]]></category><dc:creator><![CDATA[Arpit Rathore]]></dc:creator><pubDate>Wed, 09 Jul 2025 08:37:41 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1754455559862/9cadbb9e-4a8d-4299-a885-ebf70697dac4.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Here is an <strong>extended and fully annotated version</strong> of the <strong>Linux Cheatsheet</strong> blog in Markdown, with:</p>
<ul>
<li><p><strong>Brief descriptions</strong> for each command</p>
</li>
<li><p>An <strong>Advanced Topics</strong> section covering <code>cron</code>, <code>systemd</code>, <code>firewalld</code>, <code>SELinux</code>, and more</p>
</li>
</ul>
<hr />
<h1 id="heading-linux-cheat-sheet">Linux Cheat sheet</h1>
<h2 id="heading-system-information">System Information</h2>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Command</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td><code>uname -a</code></td><td>Show kernel version and system architecture</td></tr>
<tr>
<td><code>hostname</code></td><td>Display system hostname</td></tr>
<tr>
<td><code>uptime</code></td><td>Show how long the system has been running</td></tr>
<tr>
<td><code>whoami</code></td><td>Show the currently logged-in user</td></tr>
<tr>
<td><code>id</code></td><td>Display user ID and group information</td></tr>
<tr>
<td><code>lsb_release -a</code></td><td>Display Linux distribution info (Debian-based)</td></tr>
<tr>
<td><code>cat /etc/os-release</code></td><td>Show OS information (universal method)</td></tr>
</tbody>
</table>
</div><hr />
<h2 id="heading-file-and-directory-management">File and Directory Management</h2>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Command</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td><code>ls -l</code></td><td>List files with details</td></tr>
<tr>
<td><code>ls -a</code></td><td>Include hidden files</td></tr>
<tr>
<td><code>pwd</code></td><td>Show current directory</td></tr>
<tr>
<td><code>cd /path/to/dir</code></td><td>Change to target directory</td></tr>
<tr>
<td><code>mkdir newdir</code></td><td>Create a new directory</td></tr>
<tr>
<td><code>touch file.txt</code></td><td>Create an empty file</td></tr>
<tr>
<td><code>cp source dest</code></td><td>Copy file or directory</td></tr>
<tr>
<td><code>mv old new</code></td><td>Rename or move a file/directory</td></tr>
<tr>
<td><code>rm file.txt</code></td><td>Delete a file</td></tr>
<tr>
<td><code>rm -r dir</code></td><td>Recursively delete a directory and its contents</td></tr>
</tbody>
</table>
</div><hr />
<h2 id="heading-file-permissions">File Permissions</h2>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Command</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td><code>chmod 755 file</code></td><td>Set permissions (owner: rwx, group/others: rx)</td></tr>
<tr>
<td><code>chown user:group file</code></td><td>Change file ownership</td></tr>
<tr>
<td><code>ls -l file</code></td><td>Show file permissions</td></tr>
</tbody>
</table>
</div><p>Shorthand permission examples:</p>
<pre><code class="lang-bash">chmod u+x script.sh     <span class="hljs-comment"># Add execute to user</span>
chmod go-rw file.txt    <span class="hljs-comment"># Remove read/write from group and others</span>
</code></pre>
<hr />
<h2 id="heading-user-management">User Management</h2>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Command</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td><code>adduser arpit</code></td><td>Add new user</td></tr>
<tr>
<td><code>passwd arpit</code></td><td>Set/change password for a user</td></tr>
<tr>
<td><code>deluser arpit</code></td><td>Delete a user</td></tr>
<tr>
<td><code>usermod -aG sudo arpit</code></td><td>Add user to the sudo group</td></tr>
<tr>
<td><code>groups</code></td><td>Show current user's groups</td></tr>
</tbody>
</table>
</div><hr />
<h2 id="heading-package-management">Package Management</h2>
<h3 id="heading-debianubuntu">Debian/Ubuntu</h3>
<pre><code class="lang-bash">sudo apt update               <span class="hljs-comment"># Update package index</span>
sudo apt upgrade              <span class="hljs-comment"># Upgrade installed packages</span>
sudo apt install &lt;pkg&gt;        <span class="hljs-comment"># Install package</span>
sudo apt remove &lt;pkg&gt;         <span class="hljs-comment"># Remove package</span>
sudo apt purge &lt;pkg&gt;          <span class="hljs-comment"># Remove including config files</span>
</code></pre>
<h3 id="heading-amazon-linux-rhel-centos">Amazon Linux / RHEL / CentOS</h3>
<pre><code class="lang-bash">sudo yum update               <span class="hljs-comment"># Update packages</span>
sudo yum install &lt;pkg&gt;        <span class="hljs-comment"># Install package</span>
sudo yum remove &lt;pkg&gt;         <span class="hljs-comment"># Remove package</span>
</code></pre>
<hr />
<h2 id="heading-common-utility-installation">Common Utility Installation</h2>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Utility</td><td>Description</td><td>Debian-based</td><td>RHEL-based</td></tr>
</thead>
<tbody>
<tr>
<td><code>curl</code></td><td>Transfer data from URLs</td><td><code>sudo apt install curl</code></td><td><code>sudo yum install curl</code></td></tr>
<tr>
<td><code>dnsutils</code></td><td>DNS tools: <code>dig</code>, <code>nslookup</code></td><td><code>sudo apt install dnsutils</code></td><td><code>sudo yum install bind-utils</code></td></tr>
<tr>
<td><code>git</code></td><td>Version control system</td><td><code>sudo apt install git</code></td><td><code>sudo yum install git</code></td></tr>
<tr>
<td><code>htop</code></td><td>Interactive process viewer</td><td><code>sudo apt install htop</code></td><td><code>sudo yum install htop</code></td></tr>
<tr>
<td><code>iproute2</code></td><td>Modern networking commands</td><td><code>sudo apt install iproute2</code></td><td><code>sudo yum install iproute</code></td></tr>
<tr>
<td><code>jq</code></td><td>JSON processor</td><td><code>sudo apt install jq</code></td><td><code>sudo yum install jq</code></td></tr>
<tr>
<td><code>net-tools</code></td><td>Legacy networking commands</td><td><code>sudo apt install net-tools</code></td><td><code>sudo yum install net-tools</code></td></tr>
<tr>
<td><code>netcat</code></td><td>TCP/UDP networking tool</td><td><code>sudo apt install netcat</code></td><td><code>sudo yum install nc</code></td></tr>
<tr>
<td><code>nmap</code></td><td>Network scanner</td><td><code>sudo apt install nmap</code></td><td><code>sudo yum install nmap</code></td></tr>
<tr>
<td><code>python3</code></td><td>Python interpreter</td><td><code>sudo apt install python3</code></td><td><code>sudo yum install python3</code></td></tr>
<tr>
<td><code>pip3</code></td><td>Python package manager</td><td><code>sudo apt install python3-pip</code></td><td><code>sudo yum install python3-pip</code></td></tr>
<tr>
<td><code>screen</code></td><td>Terminal multiplexer</td><td><code>sudo apt install screen</code></td><td><code>sudo yum install screen</code></td></tr>
<tr>
<td><code>telnet</code></td><td>Test TCP connectivity</td><td><code>sudo apt install telnet</code></td><td><code>sudo yum install telnet</code></td></tr>
<tr>
<td><code>tmux</code></td><td>Terminal multiplexer</td><td><code>sudo apt install tmux</code></td><td><code>sudo yum install tmux</code></td></tr>
<tr>
<td><code>tree</code></td><td>Show directory tree</td><td><code>sudo apt install tree</code></td><td><code>sudo yum install tree</code></td></tr>
<tr>
<td><code>unzip</code></td><td>Extract <code>.zip</code> files</td><td><code>sudo apt install unzip</code></td><td><code>sudo yum install unzip</code></td></tr>
<tr>
<td><code>wget</code></td><td>Download files from web</td><td><code>sudo apt install wget</code></td><td><code>sudo yum install wget</code></td></tr>
<tr>
<td><code>zip</code></td><td>Compress files into <code>.zip</code></td><td><code>sudo apt install zip</code></td><td><code>sudo yum install zip</code></td></tr>
</tbody>
</table>
</div><hr />
<h2 id="heading-process-management">Process Management</h2>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Command</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td><code>ps aux</code></td><td>List all processes</td></tr>
<tr>
<td><code>top</code></td><td>Real-time view of processes</td></tr>
<tr>
<td><code>htop</code></td><td>Enhanced interactive process viewer</td></tr>
<tr>
<td><code>kill PID</code></td><td>Terminate a process by PID</td></tr>
<tr>
<td><code>kill -9 PID</code></td><td>Force kill a process</td></tr>
<tr>
<td><code>pkill name</code></td><td>Kill processes by name</td></tr>
<tr>
<td><code>jobs</code></td><td>List background jobs</td></tr>
<tr>
<td><code>bg</code></td><td>Resume a job in the background</td></tr>
<tr>
<td><code>fg</code></td><td>Bring background job to foreground</td></tr>
</tbody>
</table>
</div><hr />
<h2 id="heading-networking">Networking</h2>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Command</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td><code>ip a</code></td><td>Show IP addresses</td></tr>
<tr>
<td><code>ip r</code></td><td>Show routing table</td></tr>
<tr>
<td><code>ping host</code></td><td>Ping a host</td></tr>
<tr>
<td><code>traceroute host</code></td><td>Trace route to a host</td></tr>
<tr>
<td><code>netstat -tulnp</code></td><td>Show listening ports</td></tr>
<tr>
<td><code>ss -tuln</code></td><td>Show socket status</td></tr>
<tr>
<td><code>curl ifconfig.me</code></td><td>Show public IP address</td></tr>
<tr>
<td><code>host domain.com</code></td><td>DNS lookup</td></tr>
<tr>
<td><code>dig domain.com</code></td><td>Detailed DNS info</td></tr>
</tbody>
</table>
</div><hr />
<h2 id="heading-disk-usage">Disk Usage</h2>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Command</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td><code>df -h</code></td><td>Show free space on mounted filesystems</td></tr>
<tr>
<td><code>du -sh *</code></td><td>Show size of directories/files in current dir</td></tr>
<tr>
<td><code>lsblk</code></td><td>Show block devices (disks, partitions)</td></tr>
<tr>
<td><code>mount</code></td><td>Show mounted file systems</td></tr>
</tbody>
</table>
</div><hr />
<h2 id="heading-searching-and-grep">Searching and Grep</h2>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Command</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td><code>find . -name "*.log"</code></td><td>Find files by name pattern</td></tr>
<tr>
<td><code>grep "pattern" file.txt</code></td><td>Search for a pattern in a file</td></tr>
<tr>
<td><code>grep -r "pattern" /dir</code></td><td>Recursive search</td></tr>
<tr>
<td><code>locate filename</code></td><td>Quickly find files (needs <code>updatedb</code>)</td></tr>
<tr>
<td><code>updatedb</code></td><td>Update <code>locate</code> database</td></tr>
</tbody>
</table>
</div><hr />
<h2 id="heading-compression-and-archiving">Compression and Archiving</h2>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Command</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td><code>tar -cvf archive.tar dir/</code></td><td>Create a tar archive</td></tr>
<tr>
<td><code>tar -xvf archive.tar</code></td><td>Extract tar archive</td></tr>
<tr>
<td><code>tar -czvf archive.tar.gz dir/</code></td><td>Create a compressed tar.gz</td></tr>
<tr>
<td><code>tar -xzvf archive.tar.gz</code></td><td>Extract tar.gz</td></tr>
<tr>
<td><code>zip archive.zip file</code></td><td>Create a zip archive</td></tr>
<tr>
<td><code>unzip archive.zip</code></td><td>Extract a zip archive</td></tr>
</tbody>
</table>
</div><hr />
<h2 id="heading-system-monitoring">System Monitoring</h2>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Command</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td><code>uptime</code></td><td>Show system load and uptime</td></tr>
<tr>
<td><code>free -h</code></td><td>Show memory usage</td></tr>
<tr>
<td><code>vmstat</code></td><td>System performance metrics</td></tr>
<tr>
<td><code>iostat</code></td><td>CPU and I/O usage (from <code>sysstat</code> package)</td></tr>
<tr>
<td><code>sar -u 1 3</code></td><td>CPU usage over 3 seconds</td></tr>
<tr>
<td>`dmesg</td><td>tail`</td></tr>
</tbody>
</table>
</div><hr />
<h2 id="heading-miscellaneous">Miscellaneous</h2>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Command</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td><code>alias ll='ls -la'</code></td><td>Create a custom shortcut</td></tr>
<tr>
<td><code>history</code></td><td>Show command history</td></tr>
<tr>
<td><code>!!</code></td><td>Run previous command again</td></tr>
<tr>
<td><code>!100</code></td><td>Run command number 100 from history</td></tr>
<tr>
<td><code>Ctrl + R</code></td><td>Reverse search in history</td></tr>
<tr>
<td><code>clear</code></td><td>Clear the terminal</td></tr>
<tr>
<td><code>man ls</code></td><td>Show manual for <code>ls</code></td></tr>
<tr>
<td><code>which bash</code></td><td>Show full path of command</td></tr>
</tbody>
</table>
</div>]]></content:encoded></item><item><title><![CDATA[Milestone: 1 year of leetcode]]></title><description><![CDATA[1 Year on LeetCode: Lessons, Struggles, and Growth
Exactly one year ago, I made a commitment — to open LeetCode daily, without excuses, and start solving problems that once made me uncomfortable. What started as a casual attempt to improve my DSA ski...]]></description><link>https://arpitrathore.com/milestone-1-year-of-leetcode</link><guid isPermaLink="true">https://arpitrathore.com/milestone-1-year-of-leetcode</guid><category><![CDATA[DSA]]></category><category><![CDATA[leetcode]]></category><category><![CDATA[leetcodedaily]]></category><dc:creator><![CDATA[Arpit Rathore]]></dc:creator><pubDate>Mon, 30 Jun 2025 06:59:56 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1751267452626/6775faaa-7ac6-4952-b6dd-01378d820af3.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="heading-1-year-on-leetcode-lessons-struggles-and-growth">1 Year on LeetCode: Lessons, Struggles, and Growth</h3>
<p>Exactly one year ago, I made a commitment — to open LeetCode <em>daily</em>, without excuses, and start solving problems that once made me uncomfortable. What started as a casual attempt to improve my DSA skills has become one of the most consistent habits I’ve developed.</p>
<p>Today marks <strong>365 days of learning, struggling, failing, debugging, and growing</strong>. Here's what the journey has looked like, what I learned, and what I wish I knew when I started.</p>
<hr />
<h2 id="heading-why-i-started">Why I Started</h2>
<p>Like many developers, I was familiar with the basics of data structures and algorithms — arrays, trees, hash maps, dynamic programming. But interviews at top companies are a different game. I needed consistency, confidence, and clarity.</p>
<p>LeetCode offered a structured and measurable way to build those skills. It felt like the gym for my brain — and I wanted to show up <em>every day</em>.</p>
<hr />
<h2 id="heading-lessons-learned">Lessons Learned</h2>
<h3 id="heading-1-consistency-beats-intensity">1. <strong>Consistency Beats Intensity</strong></h3>
<p>You don't need to solve 5 problems a day. Solve <em>one</em> — but understand it deeply. The compound effect of daily effort is real.</p>
<h3 id="heading-2-hard-problems-are-teachers-in-disguise">2. <strong>Hard Problems Are Teachers in Disguise</strong></h3>
<p>Some problems took me hours. But those were the ones that taught me <em>why</em> an approach worked (or failed). If you’re struggling, it means you’re learning.</p>
<h3 id="heading-3-patterns-are-everything">3. <strong>Patterns Are Everything</strong></h3>
<p>After 100+ problems, patterns start to emerge:</p>
<ul>
<li><p>Sliding window for subarrays</p>
</li>
<li><p>Two pointers for sorted arrays</p>
</li>
<li><p>Recursion with memoization for DP</p>
</li>
<li><p>Hashing for fast lookups</p>
</li>
</ul>
<p>Once you recognize the pattern, the problem becomes familiar, not frightening.</p>
<h3 id="heading-4-editorials-and-discussions-are-gold">4. <strong>Editorials and Discussions Are Gold</strong></h3>
<p>Reading others' approaches changed my thinking. It made me write cleaner, more optimized code — and sometimes, taught me simpler solutions I overlooked.</p>
<h3 id="heading-5-debugging-is-a-superpower">5. <strong>Debugging is a Superpower</strong></h3>
<p>LeetCode helped me <em>trust</em> my code. I became faster at finding bugs and understanding edge cases. It’s an underrated benefit of daily practice.</p>
<hr />
<h2 id="heading-what-i-wish-i-knew-earlier">What I Wish I Knew Earlier</h2>
<ul>
<li><p><strong>You don’t have to do everything in order</strong>. Jump around. Try new tags. Challenge yourself.</p>
</li>
<li><p><strong>Read problem statements carefully</strong>. Most WA (wrong answers) come from misreading the constraints.</p>
</li>
<li><p><strong>Don’t avoid hard problems</strong>. Attempt them — even if it means failing. That failure is part of the growth curve.</p>
</li>
<li><p><strong>Use a notebook or Obsidian/Notion</strong> to record insights. Rewriting the logic in your own words helps retention immensely.</p>
</li>
</ul>
<hr />
<h2 id="heading-my-toolkit">My Toolkit</h2>
<ul>
<li><p><strong>Language:</strong> Java</p>
</li>
<li><p>Visualization/Dry run: Physical notebook, Excalidraw</p>
</li>
<li><p><strong>Platform:</strong> LeetCode + some occasional practice on Codeforces &amp; GeeksforGeeks</p>
</li>
<li><p><strong>Tracking:</strong> Google Sheets + LeetCode Stats + Obsidian Notes</p>
</li>
</ul>
<hr />
<h2 id="heading-final-thoughts">Final Thoughts</h2>
<p>One year on LeetCode didn’t just make me better at solving problems. It:</p>
<ul>
<li><p>Sharpened my thinking</p>
</li>
<li><p>Improved my coding speed</p>
</li>
<li><p>Boosted my confidence in interviews</p>
</li>
<li><p>Made me a more thoughtful developer</p>
</li>
</ul>
<p>To anyone thinking of starting — start today. You don’t need to go fast. Just don’t stop.</p>
<p>Here’s to another year of curiosity, code, and continuous learning.</p>
]]></content:encoded></item><item><title><![CDATA[Git Cheatsheet]]></title><description><![CDATA[Git Cheatsheet – The Ultimate Guide
Whether you're just getting started with Git or you're a seasoned developer, having a handy cheatsheet saves time and avoids Googling the same commands over and over again. This guide is organized into Basic, Inter...]]></description><link>https://arpitrathore.com/git-cheatsheet</link><guid isPermaLink="true">https://arpitrathore.com/git-cheatsheet</guid><category><![CDATA[cheatsheet]]></category><category><![CDATA[Git]]></category><dc:creator><![CDATA[Arpit Rathore]]></dc:creator><pubDate>Fri, 20 Jun 2025 11:54:43 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1751271476728/34ad0f43-8b45-49c9-bed6-120ee99f1307.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-git-cheatsheet-the-ultimate-guide">Git Cheatsheet – The Ultimate Guide</h1>
<p>Whether you're just getting started with Git or you're a seasoned developer, having a handy cheatsheet saves time and avoids Googling the same commands over and over again. This guide is organized into <strong>Basic</strong>, <strong>Intermediate</strong>, and <strong>Advanced</strong> sections to cover all levels of Git usage.</p>
<hr />
<h2 id="heading-basic-git-commands">Basic Git Commands</h2>
<p>These commands help you set up a repository and perform everyday version control tasks.</p>
<h3 id="heading-setup">Setup</h3>
<pre><code class="lang-bash">git config --global user.name <span class="hljs-string">"Your Name"</span>
git config --global user.email <span class="hljs-string">"you@example.com"</span>
git config --global init.defaultBranch main
</code></pre>
<h3 id="heading-create-or-clone-repository">Create or Clone Repository</h3>
<pre><code class="lang-bash">git init                         <span class="hljs-comment"># Initialize a new Git repo</span>
git <span class="hljs-built_in">clone</span> https://github.com/user/repo.git  <span class="hljs-comment"># Clone an existing repo</span>
</code></pre>
<h3 id="heading-stage-amp-commit">Stage &amp; Commit</h3>
<pre><code class="lang-bash">git status                       <span class="hljs-comment"># See changes</span>
git add file.txt                 <span class="hljs-comment"># Stage a file</span>
git add .                        <span class="hljs-comment"># Stage all changes</span>
git commit -m <span class="hljs-string">"message"</span>          <span class="hljs-comment"># Commit staged changes</span>
</code></pre>
<h3 id="heading-branching-basics">Branching Basics</h3>
<pre><code class="lang-bash">git branch                       <span class="hljs-comment"># List branches</span>
git switch main                  <span class="hljs-comment"># Switch to branch 'main'</span>
git switch -c new-feature        <span class="hljs-comment"># Create and switch to 'new-feature'</span>
git merge main                   <span class="hljs-comment"># Merge 'main' into current branch</span>
</code></pre>
<hr />
<h2 id="heading-intermediate-git-commands">Intermediate Git Commands</h2>
<p>Useful when working in teams and collaborating via remote repositories.</p>
<h3 id="heading-remote-repos">Remote Repos</h3>
<pre><code class="lang-bash">git remote -v                    <span class="hljs-comment"># Show remotes</span>
git remote add origin URL        <span class="hljs-comment"># Add remote repo</span>
git push -u origin main          <span class="hljs-comment"># Push first time with upstream</span>
git push                         <span class="hljs-comment"># Push commits</span>
git pull                         <span class="hljs-comment"># Fetch and merge from origin</span>
git fetch                        <span class="hljs-comment"># Fetch changes without merging</span>
</code></pre>
<h3 id="heading-working-with-files">Working with Files</h3>
<pre><code class="lang-bash">git rm file.txt                  <span class="hljs-comment"># Remove a tracked file</span>
git mv old.txt new.txt           <span class="hljs-comment"># Rename or move file</span>
git restore file.txt             <span class="hljs-comment"># Discard local changes</span>
git restore --staged file.txt    <span class="hljs-comment"># Unstage a file</span>
</code></pre>
<h3 id="heading-view-history">View History</h3>
<pre><code class="lang-bash">git <span class="hljs-built_in">log</span>                          <span class="hljs-comment"># Full commit history</span>
git <span class="hljs-built_in">log</span> --oneline --graph        <span class="hljs-comment"># Compact and visual log</span>
git diff                         <span class="hljs-comment"># View unstaged changes</span>
git diff --staged                <span class="hljs-comment"># View staged changes</span>
git blame file.txt               <span class="hljs-comment"># Show who last modified each line</span>
</code></pre>
<hr />
<h2 id="heading-advanced-git-commands">Advanced Git Commands</h2>
<p>Commands for rewriting history, debugging, and working with complex workflows.</p>
<h3 id="heading-rewriting-history">Rewriting History</h3>
<pre><code class="lang-bash">git commit --amend               <span class="hljs-comment"># Edit the last commit</span>
git rebase -i HEAD~3             <span class="hljs-comment"># Interactive rebase last 3 commits</span>
git reflog                       <span class="hljs-comment"># Show all history (even deleted commits)</span>
</code></pre>
<h3 id="heading-cleanups-amp-resets">Cleanups &amp; Resets</h3>
<pre><code class="lang-bash">git stash                        <span class="hljs-comment"># Temporarily save changes</span>
git stash pop                    <span class="hljs-comment"># Reapply saved changes</span>
git reset HEAD~1                 <span class="hljs-comment"># Undo last commit (keep changes)</span>
git reset --hard HEAD~1          <span class="hljs-comment"># Delete last commit and changes</span>
git clean -fd                    <span class="hljs-comment"># Remove untracked files and folders</span>
</code></pre>
<h3 id="heading-undo-merge-or-rebase">Undo Merge or Rebase</h3>
<pre><code class="lang-bash">git merge --abort                <span class="hljs-comment"># Abort a merge</span>
git rebase --abort               <span class="hljs-comment"># Abort a rebase</span>
</code></pre>
<h3 id="heading-cherry-pick-amp-bisect">Cherry Pick &amp; Bisect</h3>
<pre><code class="lang-bash">git cherry-pick &lt;commit&gt;         <span class="hljs-comment"># Apply a specific commit</span>
git bisect start                 <span class="hljs-comment"># Start binary search for bugs</span>
git bisect bad                   <span class="hljs-comment"># Mark current commit as bad</span>
git bisect good &lt;commit&gt;         <span class="hljs-comment"># Mark known good commit</span>
git bisect reset                 <span class="hljs-comment"># End bisect session</span>
</code></pre>
<hr />
<h2 id="heading-common-git-bash-aliases-for-speed">Common Git Bash Aliases for Speed</h2>
<p>Typing full Git commands repeatedly can be tedious. These aliases make common tasks faster and easier. Add them to your <code>~/.bashrc</code> or <code>~/.zshrc</code>.</p>
<h3 id="heading-bash-aliases">Bash Aliases</h3>
<pre><code class="lang-bash"><span class="hljs-built_in">alias</span> gs=<span class="hljs-string">"git status"</span>
<span class="hljs-built_in">alias</span> ga=<span class="hljs-string">"git add"</span>
<span class="hljs-built_in">alias</span> gaa=<span class="hljs-string">"git add ."</span>
<span class="hljs-built_in">alias</span> gc=<span class="hljs-string">"git commit -m"</span>
<span class="hljs-built_in">alias</span> gcm=<span class="hljs-string">"git commit -m"</span>
<span class="hljs-built_in">alias</span> gsw=<span class="hljs-string">"git switch"</span>
<span class="hljs-built_in">alias</span> gswc=<span class="hljs-string">"git switch -c"</span>
<span class="hljs-built_in">alias</span> gb=<span class="hljs-string">"git branch"</span>
<span class="hljs-built_in">alias</span> gm=<span class="hljs-string">"git merge"</span>
<span class="hljs-built_in">alias</span> gp=<span class="hljs-string">"git push"</span>
<span class="hljs-built_in">alias</span> gpl=<span class="hljs-string">"git pull"</span>
<span class="hljs-built_in">alias</span> gl=<span class="hljs-string">"git log --oneline --graph --decorate"</span>
<span class="hljs-built_in">alias</span> gd=<span class="hljs-string">"git diff"</span>
<span class="hljs-built_in">alias</span> gds=<span class="hljs-string">"git diff --staged"</span>
<span class="hljs-built_in">alias</span> gr=<span class="hljs-string">"git restore"</span>
<span class="hljs-built_in">alias</span> grs=<span class="hljs-string">"git restore --staged"</span>
<span class="hljs-built_in">alias</span> gstash=<span class="hljs-string">"git stash"</span>
<span class="hljs-built_in">alias</span> gpop=<span class="hljs-string">"git stash pop"</span>
<span class="hljs-built_in">alias</span> grh=<span class="hljs-string">"git reset --hard"</span>
<span class="hljs-built_in">alias</span> gundo=<span class="hljs-string">"git reset --soft HEAD~1"</span>
</code></pre>
<h3 id="heading-example-usage">Example Usage</h3>
<pre><code class="lang-bash">gs           <span class="hljs-comment"># git status</span>
gaa          <span class="hljs-comment"># git add .</span>
gcm <span class="hljs-string">"msg"</span>    <span class="hljs-comment"># git commit -m "msg"</span>
gswc feat-x  <span class="hljs-comment"># git switch -c feat-x</span>
</code></pre>
<h3 id="heading-reload-the-shell">Reload the Shell</h3>
<pre><code class="lang-bash"><span class="hljs-built_in">source</span> ~/.bashrc    <span class="hljs-comment"># or ~/.zshrc</span>
</code></pre>
<hr />
<h2 id="heading-optional-git-aliases-in-git-config">Optional: Git Aliases in Git Config</h2>
<p>Prefer aliases within Git itself? Add these:</p>
<pre><code class="lang-bash">git config --global alias.st status
git config --global alias.ci commit
git config --global alias.sw switch
git config --global alias.br branch
git config --global alias.lg <span class="hljs-string">"log --oneline --graph --decorate"</span>
</code></pre>
<p>Use them like:</p>
<pre><code class="lang-bash">git st
git sw main
git lg
</code></pre>
<hr />
<h2 id="heading-final-thoughts">Final Thoughts</h2>
<p>This cheatsheet covers the most essential Git commands for day-to-day development and collaboration. As your workflow becomes more advanced, these quick references will help you stay productive and efficient.</p>
<p>Happy coding!</p>
]]></content:encoded></item><item><title><![CDATA[Java DSA cheatsheet]]></title><description><![CDATA[Data Structures
1. Arrays
int[] arr = new int[10];
arr[1] = 34;
arr[1] = 35;

int i = arr[1];
int size = arr.length;

// Fill array with a value
Arrays.fill(arr, -1);

// Sort
Arrays.sort(arr); // Ascending
Arrays.sort(arr, (a, b) -> b - a); // Desce...]]></description><link>https://arpitrathore.com/java-cheatsheet</link><guid isPermaLink="true">https://arpitrathore.com/java-cheatsheet</guid><category><![CDATA[DSA]]></category><category><![CDATA[Collection Framework]]></category><dc:creator><![CDATA[Arpit Rathore]]></dc:creator><pubDate>Sat, 17 May 2025 06:59:12 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1751273392824/1be4f5c2-4140-4e8c-b23c-8609dce6a83b.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-data-structures">Data Structures</h1>
<h2 id="heading-1-arrays">1. Arrays</h2>
<pre><code class="lang-java"><span class="hljs-keyword">int</span>[] arr = <span class="hljs-keyword">new</span> <span class="hljs-keyword">int</span>[<span class="hljs-number">10</span>];
arr[<span class="hljs-number">1</span>] = <span class="hljs-number">34</span>;
arr[<span class="hljs-number">1</span>] = <span class="hljs-number">35</span>;

<span class="hljs-keyword">int</span> i = arr[<span class="hljs-number">1</span>];
<span class="hljs-keyword">int</span> size = arr.length;

<span class="hljs-comment">// Fill array with a value</span>
Arrays.fill(arr, -<span class="hljs-number">1</span>);

<span class="hljs-comment">// Sort</span>
Arrays.sort(arr); <span class="hljs-comment">// Ascending</span>
Arrays.sort(arr, (a, b) -&gt; b - a); <span class="hljs-comment">// Descending</span>

<span class="hljs-comment">// Create array using a range. Useful for printing array index</span>
<span class="hljs-keyword">int</span>[] range = IntStream.range(<span class="hljs-number">0</span>, <span class="hljs-number">10</span>).toArray();
</code></pre>
<h2 id="heading-2-character">2. Character</h2>
<pre><code class="lang-java"><span class="hljs-keyword">char</span> c1 = <span class="hljs-string">'a'</span>;
<span class="hljs-keyword">char</span>[] arr = <span class="hljs-string">"test"</span>.toCharArray();
<span class="hljs-keyword">char</span> c2 = str.charAt(<span class="hljs-number">2</span>);

<span class="hljs-comment">// Character</span>
Character.toLowerCase(c)
Character.isLowerCase(c);

Character.toUpperCase(c)
Character.isUpperCase(c);

Character.isLetter(c)
Character.isDigit(c)
Character.isAlphabetic(c);
Character.isLetterOrDigit(c)
</code></pre>
<h2 id="heading-3-string-amp-stringbuilder">3. String &amp; StringBuilder</h2>
<pre><code class="lang-java"><span class="hljs-comment">// String</span>
String str = <span class="hljs-keyword">new</span> String();
str = <span class="hljs-string">"abc"</span>;
<span class="hljs-keyword">int</span> size = str.length();
<span class="hljs-keyword">char</span>[] arr = str.toCharArray();
String sub = str.substring(<span class="hljs-number">1</span>, <span class="hljs-number">3</span>); <span class="hljs-comment">//[a, b)</span>
str.toLowerCase();
str.toUpperCase();
str.replaceAll(<span class="hljs-string">"a"</span>, <span class="hljs-string">"z"</span>);

<span class="hljs-comment">// String Builder</span>
StringBuilder sb = <span class="hljs-keyword">new</span> StringBuilder();
sb.append(<span class="hljs-string">"hellohowareyou?"</span>); <span class="hljs-comment">// Returns StringBuilder</span>
sb.insert(<span class="hljs-number">2</span>, <span class="hljs-string">"z"</span>);            <span class="hljs-comment">// Returns StringBuilder</span>
sb.delete(<span class="hljs-number">1</span>, <span class="hljs-number">3</span>)               <span class="hljs-comment">// [from, to) | Returns StringBuilder</span>
sb.deleteCharAt(<span class="hljs-number">0</span>);           <span class="hljs-comment">// Returns StringBuilder</span>
sb.reverse();                 <span class="hljs-comment">// Returns StringBuilder</span>

sb.substring(<span class="hljs-number">1</span>);              <span class="hljs-comment">// Returns String</span>
sb.substring(<span class="hljs-number">3</span>, <span class="hljs-number">5</span>);           <span class="hljs-comment">// [from, to) | Returns String</span>
</code></pre>
<h2 id="heading-4-list-amp-arraylist">4. List &amp; ArrayList</h2>
<pre><code class="lang-java">List&lt;Integer&gt; list = <span class="hljs-keyword">new</span> ArrayList&lt;&gt;();
list.add(<span class="hljs-number">5</span>);
list.addAll(List.of(<span class="hljs-number">6</span>, <span class="hljs-number">7</span>, <span class="hljs-number">8</span>, <span class="hljs-number">9</span>, <span class="hljs-number">10</span>));

<span class="hljs-comment">// Index based</span>
list.remove(<span class="hljs-number">3</span>);
list.set(<span class="hljs-number">0</span>, <span class="hljs-number">9</span>);
list.get(<span class="hljs-number">0</span>);

<span class="hljs-keyword">int</span> size = list.size();
list.clear();
list.isEmpty();

<span class="hljs-comment">// Inefficient - O(n)</span>
list.contains(<span class="hljs-number">77</span>);
list.indexOf(<span class="hljs-number">10</span>);

Integer[] arr = list.toArray(<span class="hljs-keyword">new</span> Integer[<span class="hljs-number">0</span>]);
<span class="hljs-keyword">int</span>[] arrPrimitive = list.stream().mapToInt(Integer::intValue).toArray();

<span class="hljs-comment">// Sort O(nlog(n))</span>
Collections.sort(list);
Collections.sort(list, (a, b) -&gt; b - a);
Collections.sort(personList, (p1, p2) -&gt; p2.age - p1.age);
</code></pre>
<h2 id="heading-5-stack">5. Stack</h2>
<pre><code class="lang-java">Stack&lt;Integer&gt; st = <span class="hljs-keyword">new</span> Stack&lt;&gt;();
st.push(<span class="hljs-number">1</span>);
st.pop();

st.peek();
</code></pre>
<h2 id="heading-6-queue-amp-deque">6. Queue &amp; Deque</h2>
<pre><code class="lang-java"><span class="hljs-comment">// -----------------Queue-----------------</span>
Queue&lt;Integer&gt; q = <span class="hljs-keyword">new</span> LinkedList&lt;&gt;();
q.add(<span class="hljs-number">1</span>);
q.remove();
q.peek();


<span class="hljs-comment">// Without exception</span>
q.offer(<span class="hljs-number">2</span>);
q.poll()

<span class="hljs-comment">// -----------------Deque-----------------</span>

Deque&lt;Integer&gt; dq = <span class="hljs-keyword">new</span> LinkedList&lt;&gt;();
dq.addFirst(<span class="hljs-number">1</span>);
dq.addLast(<span class="hljs-number">2</span>);

<span class="hljs-keyword">int</span> f1 = dq.getFirst();
<span class="hljs-keyword">int</span> l1 = dq.getLast();

<span class="hljs-keyword">int</span> f2 = dq.removeFirst();
<span class="hljs-keyword">int</span> l2 = dq.removeLast();
</code></pre>
<h2 id="heading-7-priorityqueue">7. PriorityQueue</h2>
<pre><code class="lang-java"><span class="hljs-comment">// Basics</span>
PriorityQueue&lt;Integer&gt; pq = <span class="hljs-keyword">new</span> PriorityQueue&lt;&gt;();
PriorityQueue&lt;Integer&gt; maxPQ = <span class="hljs-keyword">new</span> PriorityQueue&lt;&gt;(Comparator.reverseOrder());

<span class="hljs-comment">// Add/Offer</span>
pq.add(<span class="hljs-number">5</span>);

<span class="hljs-comment">// Remove/Poll</span>
Integer item = pq.remove();

<span class="hljs-comment">// Return without removing</span>
Integer item = pq.peek();

<span class="hljs-comment">// -----------------Inefficient-----------------</span>
<span class="hljs-comment">// Contains</span>
<span class="hljs-keyword">boolean</span> exists = pq.contains(<span class="hljs-number">5</span>);

<span class="hljs-comment">// Remove specific object</span>
pq.remove(<span class="hljs-number">5</span>);

<span class="hljs-comment">//--------------Custom comparators--------------------</span>

<span class="hljs-comment">// Max heap</span>
PriorityQueue&lt;Integer&gt; maxHeap = <span class="hljs-keyword">new</span> PriorityQueue&lt;&gt;(Comparator.reverseOrder());

<span class="hljs-comment">// Based on string length</span>
PriorityQueue&lt;String&gt; strPQByLength = <span class="hljs-keyword">new</span> PriorityQueue&lt;&gt;((s1, s2) -&gt; s2.length() - s1.length());

<span class="hljs-comment">// Lexicographical Order</span>
PriorityQueue&lt;String&gt; strPQLexi = <span class="hljs-keyword">new</span> PriorityQueue&lt;&gt;();

<span class="hljs-comment">// Reverse Lexicographical Order</span>
PriorityQueue&lt;String&gt; strPQLexiDesc = <span class="hljs-keyword">new</span> PriorityQueue&lt;&gt;(Comparator.reverseOrder());

<span class="hljs-comment">// ----------------Custom Objects------------------</span>

<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Person</span> </span>{
    String name;
    <span class="hljs-keyword">int</span> age;
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-title">Person</span><span class="hljs-params">(String name, <span class="hljs-keyword">int</span> age)</span> </span>{
        <span class="hljs-keyword">this</span>.name = name;
        <span class="hljs-keyword">this</span>.age = age;
    }
}

<span class="hljs-comment">// Based on age in descending order</span>
PriorityQueue&lt;Person&gt; personPQ = <span class="hljs-keyword">new</span> PriorityQueue&lt;&gt;((p1, p2) -&gt; p2.age - p1.age);
</code></pre>
<h1 id="heading-formulas">Formulas</h1>
<h2 id="heading-arrays">Arrays</h2>
<h3 id="heading-1d-to-2d-and-2d-to-1d-array">1d to 2d and 2d to 1d array</h3>
<pre><code class="lang-java"><span class="hljs-comment">// Convert 1d array arr to 2d array of size mxn</span>
<span class="hljs-keyword">int</span>[][] matrix = <span class="hljs-keyword">new</span> <span class="hljs-keyword">int</span>[m][n];
<span class="hljs-keyword">for</span>(<span class="hljs-keyword">int</span> i=<span class="hljs-number">0</span>; i&lt;arr.length; i++) {
    <span class="hljs-keyword">int</span> row = i/n;
    <span class="hljs-keyword">int</span> col = i%n;
    matrix[row][col] = arr[i];
}
</code></pre>
<pre><code class="lang-java"><span class="hljs-keyword">int</span>[][] matrix = <span class="hljs-keyword">new</span> <span class="hljs-keyword">int</span>[m][n];
<span class="hljs-keyword">int</span> idx = r*cols + cols;l.<span class="hljs-number">07</span>
</code></pre>
<h1 id="heading-concepts">Concepts</h1>
<h2 id="heading-subarray-substring-subsequence-and-subsets">Subarray, substring, subsequence and subsets</h2>
<div class="hn-table">
<table>
<thead>
<tr>
<td><strong>Term</strong></td><td></td><td>Use When</td><td>Key Method</td></tr>
</thead>
<tbody>
<tr>
<td><strong>Subset</strong></td><td></td><td>Combination of elements, any order</td><td>Backtracking</td></tr>
<tr>
<td><strong>Subsequence</strong></td><td>2^n</td><td>Keep order, skip allowed</td><td>Include/exclude recursion</td></tr>
<tr>
<td><strong>Subarray</strong></td><td></td><td>Continuous portion of array</td><td>Nested loops (start → end)</td></tr>
<tr>
<td><strong>Substring</strong></td><td></td><td>Continuous portion of string</td><td><code>substring(i, j)</code> in loops</td></tr>
</tbody>
</table>
</div>]]></content:encoded></item><item><title><![CDATA[Reflecting on 2024: A Year of Growth and Achievement]]></title><description><![CDATA[As 2024 comes to a close, I find myself reflecting on a year filled with challenges, growth, and milestones. This year has been a transformative one, not just professionally but also personally. Here’s a look back at the highlights of my journey in 2...]]></description><link>https://arpitrathore.com/reflecting-on-2024-a-year-of-growth-and-achievement</link><guid isPermaLink="true">https://arpitrathore.com/reflecting-on-2024-a-year-of-growth-and-achievement</guid><category><![CDATA[2024]]></category><dc:creator><![CDATA[Arpit Rathore]]></dc:creator><pubDate>Sun, 12 Jan 2025 06:51:29 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1736664651611/45f60216-eecc-445b-87b5-b75b6dacf65f.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>As 2024 comes to a close, I find myself reflecting on a year filled with challenges, growth, and milestones. This year has been a transformative one, not just professionally but also personally. Here’s a look back at the highlights of my journey in 2024.</p>
<h3 id="heading-professional-milestones-five-certifications-achieved">Professional Milestones: Five Certifications Achieved</h3>
<p>One of my key goals this year was to upskill and deepen my expertise in cloud computing and related technologies. I’m thrilled to share that I successfully earned <strong>five professional certifications</strong>:</p>
<ol>
<li><p><a target="_blank" href="https://www.credly.com/badges/5b9edb46-eb40-44f4-b953-7caa4c53ae29"><strong>SAA-C03: AWS Certified Solutions Architect – Associate</strong></a></p>
<ul>
<li>This certification strengthened my ability to design and deploy scalable, secure, and highly available systems on AWS. It was a deep dive into cloud architecture best practices, and passing it was a significant achievement.</li>
</ul>
</li>
<li><p><a target="_blank" href="https://www.credly.com/badges/05dfbd0a-2d6c-42ba-9f6c-7ebf0b33998b"><strong>SAP-C02: AWS Certified Solutions Architect – Professional</strong></a></p>
<ul>
<li>Taking my cloud expertise to the next level, this advanced certification tested my skills in complex cloud architecture and cutting-edge AWS services. It was a rigorous process, but incredibly rewarding.</li>
</ul>
</li>
<li><p><a target="_blank" href="https://www.credly.com/badges/28e50664-766e-4696-ad6c-cc0e287e0793"><strong>HashiCorp Certified: Terraform Associate</strong></a></p>
<ul>
<li>Infrastructure as Code (IaC) has become a critical part of modern DevOps, and earning this certification allowed me to master Terraform’s functionality for automating infrastructure deployments efficiently.</li>
</ul>
</li>
<li><p><a target="_blank" href="https://www.credly.com/badges/e76707eb-3467-43b6-b1d0-457c2dcc9b9a"><strong>ANS-C01: AWS Certified Advanced Networking – Specialty</strong></a></p>
<ul>
<li>Networking is the backbone of cloud solutions, and this certification deepened my understanding of building secure and scalable network architectures in AWS.</li>
</ul>
</li>
<li><p><a target="_blank" href="https://www.credly.com/badges/ecee4cdb-4576-4617-96f1-4db12092ebd4"><strong>SCS-C02: AWS Certified Security – Specialty</strong></a></p>
<ul>
<li>Security has always been a priority in my professional work, and this certification sharpened my ability to secure workloads, manage data protection, and implement compliance measures on AWS.</li>
</ul>
</li>
</ol>
<p>These certifications have not only boosted my technical knowledge but also enhanced my confidence in tackling complex projects. The preparation involved late nights, sometimes early mornings, and countless hours of studying—a reminder that persistence and dedication truly pay off. I was traveling a lot on long route trains last year and there was nothing good to watch, so I watched Udemy videos. That helped a lot.</p>
<h3 id="heading-personal-highlights-a-life-changing-addition">Personal Highlights: A Life-Changing Addition</h3>
<p>2024 wasn’t just about professional growth. On a personal note, this year blessed me with one of the most incredible experiences of my life: the birth of my son. Becoming a parent has been a life-changing journey, teaching me patience, adaptability, and unconditional love. Balancing my professional aspirations with the joys (and challenges) of parenthood has been a rewarding and humbling experience.</p>
<h3 id="heading-lessons-learned">Lessons Learned</h3>
<ol>
<li><p><strong>Time Management is Key</strong></p>
<ul>
<li>Juggling certification preparation, work responsibilities, and family life required meticulous planning and prioritization. I learned to make the most of every moment.</li>
</ul>
</li>
<li><p><strong>Consistency Beats Intensity</strong></p>
<ul>
<li>Progress often comes from small, consistent efforts rather than big, unsustainable pushes. Whether it was studying for exams or spending quality time with my family, consistency was my secret weapon.</li>
</ul>
</li>
<li><p><strong>Celebrate Small Wins</strong></p>
<ul>
<li>Each milestone, big or small, deserves recognition. Celebrating the small victories kept me motivated throughout the year.</li>
</ul>
</li>
</ol>
<h3 id="heading-looking-ahead">Looking Ahead</h3>
<p>As I step into 2025, I’m excited to build on the foundation laid this year. My goals include:</p>
<ul>
<li><p>Applying the knowledge gained from my certifications to real-world projects.</p>
</li>
<li><p>Exploring emerging trends in cloud technology, such as AI/ML integrations and sustainability-focused cloud solutions.</p>
</li>
<li><p>Continuing to grow as a parent and cherishing every moment with my son.</p>
</li>
</ul>
<h3 id="heading-final-thoughts">Final Thoughts</h3>
<p>2024 was a year of growth, learning, and transformation. I’m grateful for the opportunities I had, the lessons I learned, and the support of my family, friends, and colleagues. Here’s to a bright and promising 2025—may it bring new challenges, achievements, and unforgettable memories!</p>
]]></content:encoded></item><item><title><![CDATA[BYO: Building a wc CLI Tool with Java and GraalVM 21]]></title><description><![CDATA[Building a wc CLI Tool with Java and GraalVM 21
Creating command-line tools with Java can be both powerful and efficient, especially when paired with GraalVM's ability to compile Java applications into native executables. In this blog post, we’ll bui...]]></description><link>https://arpitrathore.com/byo-building-a-wc-cli-tool-with-java-and-graalvm-21</link><guid isPermaLink="true">https://arpitrathore.com/byo-building-a-wc-cli-tool-with-java-and-graalvm-21</guid><category><![CDATA[GraalVM]]></category><dc:creator><![CDATA[Arpit Rathore]]></dc:creator><pubDate>Wed, 08 Jan 2025 18:30:00 GMT</pubDate><content:encoded><![CDATA[<h1 id="heading-building-a-wc-cli-tool-with-java-and-graalvm-21">Building a <code>wc</code> CLI Tool with Java and GraalVM 21</h1>
<p>Creating command-line tools with Java can be both powerful and efficient, especially when paired with GraalVM's ability to compile Java applications into native executables. In this blog post, we’ll build a simple <code>wc</code> (word count) CLI tool in Java that counts lines, words, and characters in a file. We’ll then use GraalVM 21 to compile it into a native executable for faster startup and lower memory usage.</p>
<h2 id="heading-overview-of-the-wc-tool">Overview of the <code>wc</code> Tool</h2>
<p>The <code>wc</code> command in Unix-like systems outputs the number of lines, words, and characters in a file. Our Java implementation will replicate this functionality and support file input.</p>
<hr />
<h2 id="heading-step-1-writing-the-java-code">Step 1: Writing the Java Code</h2>
<p>Here’s the complete Java code for the <code>wc</code> tool:</p>
<pre><code class="lang-java"><span class="hljs-keyword">package</span> com.arpitrathore.byo;

<span class="hljs-keyword">import</span> java.io.IOException;
<span class="hljs-keyword">import</span> java.nio.file.Files;
<span class="hljs-keyword">import</span> java.nio.file.Paths;
<span class="hljs-keyword">import</span> java.util.Arrays;

<span class="hljs-comment">/**
 * Word count
 */</span>
<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">App</span> </span>{

  <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">main</span><span class="hljs-params">(String[] args)</span> </span>{
    <span class="hljs-keyword">if</span> (args.length &lt; <span class="hljs-number">1</span>) {
      System.out.println(<span class="hljs-string">"Usage: java WC &lt;filename&gt;"</span>);
      System.exit(<span class="hljs-number">1</span>);
    }

    String filePath = args[<span class="hljs-number">0</span>];

    <span class="hljs-keyword">try</span> {
      String content = Files.readString(Paths.get(filePath));
      <span class="hljs-keyword">long</span> lineCount = content.lines().count() - <span class="hljs-number">1</span>; <span class="hljs-comment">//wc actually counts number of new line character</span>
      <span class="hljs-keyword">long</span> wordCount = Arrays.stream(content.split(<span class="hljs-string">"\\s+"</span>)).filter(word -&gt; !word.isBlank()).count();
      <span class="hljs-keyword">long</span> charCount = content.length();

      System.out.printf(<span class="hljs-string">"%7d %7d %7d %s%n"</span>, lineCount, wordCount, charCount, filePath);
    } <span class="hljs-keyword">catch</span> (IOException e) {
      System.err.println(<span class="hljs-string">"Error reading file: "</span> + e.getMessage());
      System.exit(<span class="hljs-number">1</span>);
    }
  }
}
</code></pre>
<h3 id="heading-key-features-of-the-code">Key Features of the Code</h3>
<ul>
<li><p><strong>File Reading</strong>: The <code>Files.readString</code> method reads the file content as a single string.</p>
</li>
<li><p><strong>Line Count</strong>: The <code>content.lines()</code> method streams the lines and counts them.</p>
</li>
<li><p><strong>Word Count</strong>: Splits the content by whitespace and filters out empty strings.</p>
</li>
<li><p><strong>Character Count</strong>: Simply uses the <code>length()</code> method on the string.</p>
</li>
<li><p><strong>Unix-like Output</strong>: Outputs results in the format: <code>lines words characters filename</code>.</p>
</li>
</ul>
<hr />
<h2 id="heading-step-2-compiling-and-running-the-program-with-maven">Step 2: Compiling and Running the Program with Maven</h2>
<p>We’ll use Maven for dependency management and to build the project. Additionally, we’ll use the <code>native-maven-plugin</code> to create a native executable.</p>
<h3 id="heading-maven-project-setup">Maven Project Setup</h3>
<p>Create a <code>pom.xml</code> file for your project:</p>
<pre><code class="lang-xml"><span class="hljs-meta">&lt;?xml version="1.0" encoding="UTF-8"?&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">project</span>
  <span class="hljs-attr">xsi:schemaLocation</span>=<span class="hljs-string">"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"</span>
  <span class="hljs-attr">xmlns</span>=<span class="hljs-string">"http://maven.apache.org/POM/4.0.0"</span>
  <span class="hljs-attr">xmlns:xsi</span>=<span class="hljs-string">"http://www.w3.org/2001/XMLSchema-instance"</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">modelVersion</span>&gt;</span>4.0.0<span class="hljs-tag">&lt;/<span class="hljs-name">modelVersion</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">groupId</span>&gt;</span>com.arpitrathore.byo<span class="hljs-tag">&lt;/<span class="hljs-name">groupId</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">artifactId</span>&gt;</span>02-wc<span class="hljs-tag">&lt;/<span class="hljs-name">artifactId</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">version</span>&gt;</span>1.0-SNAPSHOT<span class="hljs-tag">&lt;/<span class="hljs-name">version</span>&gt;</span>

  <span class="hljs-tag">&lt;<span class="hljs-name">properties</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">maven.compiler.source</span>&gt;</span>21<span class="hljs-tag">&lt;/<span class="hljs-name">maven.compiler.source</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">maven.compiler.target</span>&gt;</span>21<span class="hljs-tag">&lt;/<span class="hljs-name">maven.compiler.target</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">native-maven-plugin.version</span>&gt;</span>0.10.4<span class="hljs-tag">&lt;/<span class="hljs-name">native-maven-plugin.version</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">main.class</span>&gt;</span>com.arpitrathore.byo.App<span class="hljs-tag">&lt;/<span class="hljs-name">main.class</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">image.name</span>&gt;</span>ar-wc<span class="hljs-tag">&lt;/<span class="hljs-name">image.name</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">properties</span>&gt;</span>

  <span class="hljs-tag">&lt;<span class="hljs-name">profiles</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">profile</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">id</span>&gt;</span>native<span class="hljs-tag">&lt;/<span class="hljs-name">id</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">build</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">plugins</span>&gt;</span>
          <span class="hljs-tag">&lt;<span class="hljs-name">plugin</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">groupId</span>&gt;</span>org.graalvm.buildtools<span class="hljs-tag">&lt;/<span class="hljs-name">groupId</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">artifactId</span>&gt;</span>native-maven-plugin<span class="hljs-tag">&lt;/<span class="hljs-name">artifactId</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">version</span>&gt;</span>${native-maven-plugin.version}<span class="hljs-tag">&lt;/<span class="hljs-name">version</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">extensions</span>&gt;</span>true<span class="hljs-tag">&lt;/<span class="hljs-name">extensions</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">executions</span>&gt;</span>
              <span class="hljs-tag">&lt;<span class="hljs-name">execution</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-name">id</span>&gt;</span>build-native<span class="hljs-tag">&lt;/<span class="hljs-name">id</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-name">phase</span>&gt;</span>package<span class="hljs-tag">&lt;/<span class="hljs-name">phase</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-name">goals</span>&gt;</span>
                  <span class="hljs-tag">&lt;<span class="hljs-name">goal</span>&gt;</span>compile-no-fork<span class="hljs-tag">&lt;/<span class="hljs-name">goal</span>&gt;</span>
                <span class="hljs-tag">&lt;/<span class="hljs-name">goals</span>&gt;</span>
              <span class="hljs-tag">&lt;/<span class="hljs-name">execution</span>&gt;</span>
            <span class="hljs-tag">&lt;/<span class="hljs-name">executions</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">configuration</span>&gt;</span>
              <span class="hljs-tag">&lt;<span class="hljs-name">mainClass</span>&gt;</span>${main.class}<span class="hljs-tag">&lt;/<span class="hljs-name">mainClass</span>&gt;</span>
              <span class="hljs-tag">&lt;<span class="hljs-name">imageName</span>&gt;</span>${image.name}<span class="hljs-tag">&lt;/<span class="hljs-name">imageName</span>&gt;</span>
              <span class="hljs-tag">&lt;<span class="hljs-name">agent</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-name">enabled</span>&gt;</span>true<span class="hljs-tag">&lt;/<span class="hljs-name">enabled</span>&gt;</span>
              <span class="hljs-tag">&lt;/<span class="hljs-name">agent</span>&gt;</span>
            <span class="hljs-tag">&lt;/<span class="hljs-name">configuration</span>&gt;</span>
          <span class="hljs-tag">&lt;/<span class="hljs-name">plugin</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">plugins</span>&gt;</span>
      <span class="hljs-tag">&lt;/<span class="hljs-name">build</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">profile</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">profiles</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">project</span>&gt;</span>
</code></pre>
<h3 id="heading-building-and-running-the-project">Building and Running the Project</h3>
<ol>
<li><p><strong>Compile the Java Code</strong>:</p>
<pre><code class="lang-bash"> $ mvn clean package -Pnative
</code></pre>
</li>
<li><p><strong>Run the Program and compare it with linux</strong> <code>wc</code>:</p>
<pre><code class="lang-bash"> $ ./target/ar-wc pom.xml                                                                                                   main main
      49      51    1626 pom.xml
 $ wc pom.xml                                                                                                               main main
      49   51 1626 pom.xml
</code></pre>
</li>
</ol>
<h2 id="heading-source-code">Source Code</h2>
<p>Entire source code used in this blog can be found here: <a target="_blank" href="https://github.com/arpitrathore/build-your-own/tree/main/02-wc">link</a></p>
<hr />
<h2 id="heading-conclusion">Conclusion</h2>
<p>Building CLI tools with Java and GraalVM opens up a world of possibilities for efficient and portable applications. This <code>wc</code> tool is a simple example that demonstrates how you can leverage GraalVM to enhance Java’s capabilities. Try extending the tool with additional features, such as flag-based options (<code>-l</code> for lines, <code>-w</code> for words, etc.) or support for multiple files.</p>
<p>Let me know how you’ve used GraalVM for your projects!</p>
]]></content:encoded></item><item><title><![CDATA[BYO: Exploring Java with GraalVM 21 and Native Maven Plugin]]></title><description><![CDATA[Java remains a powerhouse in the programming world, celebrated for its cross-platform capabilities, extensive ecosystem, and strong community support. But in recent years, there's been a growing emphasis on reducing application startup times and memo...]]></description><link>https://arpitrathore.com/byo-exploring-java-with-graalvm-21-and-native-maven-plugin</link><guid isPermaLink="true">https://arpitrathore.com/byo-exploring-java-with-graalvm-21-and-native-maven-plugin</guid><category><![CDATA[GraalVM]]></category><dc:creator><![CDATA[Arpit Rathore]]></dc:creator><pubDate>Mon, 06 Jan 2025 18:30:00 GMT</pubDate><content:encoded><![CDATA[<p>Java remains a powerhouse in the programming world, celebrated for its cross-platform capabilities, extensive ecosystem, and strong community support. But in recent years, there's been a growing emphasis on reducing application startup times and memory footprint—areas where Java's traditional JVM (Java Virtual Machine) falls short compared to natively compiled languages. This is where <strong>GraalVM</strong> and the <strong>native-maven-plugin</strong> shine, making Java a formidable contender in the realm of cloud-native and resource-efficient applications.</p>
<h4 id="heading-what-is-graalvm">What is GraalVM?</h4>
<p>GraalVM is a high-performance runtime that extends the Java Virtual Machine to support multiple programming languages, including JavaScript, Python, and Ruby. One of its standout features is the ability to compile Java applications into native executables. By compiling ahead-of-time (AOT), GraalVM eliminates the need for a JVM during runtime, resulting in significantly faster startup times and reduced memory usage.</p>
<p>The recent LTS version, <strong>GraalVM 21</strong>, builds upon its predecessors with enhanced features, improved performance, and better tooling support, making it an excellent choice for developers looking to optimize their Java applications.</p>
<h4 id="heading-native-maven-plugin-simplifying-native-builds">Native Maven Plugin: Simplifying Native Builds</h4>
<p>The <strong>native-maven-plugin</strong> is a bridge between Maven—Java’s most popular build tool—and GraalVM’s native-image capabilities. This plugin streamlines the process of compiling Java code into a native executable, automating many of the configurations and optimizations required for successful builds.</p>
<p>With the native-maven-plugin, developers can integrate GraalVM’s native-image generation directly into their Maven build lifecycle, making it easier to produce lightweight, high-performance native binaries.</p>
<h4 id="heading-why-use-graalvm-and-native-maven-plugin-together">Why Use GraalVM and Native Maven Plugin Together?</h4>
<p>The combination of GraalVM and the native-maven-plugin addresses many challenges faced by modern Java developers:</p>
<ol>
<li><p><strong>Reduced Startup Time:</strong> Native executables compiled by GraalVM start in milliseconds, a significant improvement over JVM-based applications.</p>
</li>
<li><p><strong>Lower Memory Usage:</strong> Native binaries use less memory, making them ideal for resource-constrained environments.</p>
</li>
<li><p><strong>Simplified Deployment:</strong> With no JVM dependency, native binaries can be deployed as standalone executables, simplifying distribution.</p>
</li>
<li><p><strong>Cloud-Native Compatibility:</strong> Faster startup and lower resource usage align with the demands of containerized applications and serverless architectures.</p>
</li>
</ol>
<h4 id="heading-getting-started-with-graalvm-and-native-maven-plugin">Getting Started with GraalVM and Native Maven Plugin</h4>
<p>Bare minimum pom.xml</p>
<pre><code class="lang-xml"><span class="hljs-meta">&lt;?xml version="1.0" encoding="UTF-8"?&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">project</span> <span class="hljs-attr">...</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">properties</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">maven.compiler.source</span>&gt;</span>21<span class="hljs-tag">&lt;/<span class="hljs-name">maven.compiler.source</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">maven.compiler.target</span>&gt;</span>21<span class="hljs-tag">&lt;/<span class="hljs-name">maven.compiler.target</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">native-maven-plugin.version</span>&gt;</span>0.10.4<span class="hljs-tag">&lt;/<span class="hljs-name">native-maven-plugin.version</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">main.class</span>&gt;</span>com.arpitrathore.byo.App<span class="hljs-tag">&lt;/<span class="hljs-name">main.class</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">image.name</span>&gt;</span>ar-helloworld<span class="hljs-tag">&lt;/<span class="hljs-name">image.name</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">properties</span>&gt;</span>

  <span class="hljs-tag">&lt;<span class="hljs-name">profiles</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">profile</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">id</span>&gt;</span>native<span class="hljs-tag">&lt;/<span class="hljs-name">id</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">build</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">plugins</span>&gt;</span>
          <span class="hljs-tag">&lt;<span class="hljs-name">plugin</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">groupId</span>&gt;</span>org.graalvm.buildtools<span class="hljs-tag">&lt;/<span class="hljs-name">groupId</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">artifactId</span>&gt;</span>native-maven-plugin<span class="hljs-tag">&lt;/<span class="hljs-name">artifactId</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">version</span>&gt;</span>${native-maven-plugin.version}<span class="hljs-tag">&lt;/<span class="hljs-name">version</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">extensions</span>&gt;</span>true<span class="hljs-tag">&lt;/<span class="hljs-name">extensions</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">executions</span>&gt;</span>
              <span class="hljs-tag">&lt;<span class="hljs-name">execution</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-name">id</span>&gt;</span>build-native<span class="hljs-tag">&lt;/<span class="hljs-name">id</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-name">phase</span>&gt;</span>package<span class="hljs-tag">&lt;/<span class="hljs-name">phase</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-name">goals</span>&gt;</span>
                  <span class="hljs-tag">&lt;<span class="hljs-name">goal</span>&gt;</span>compile-no-fork<span class="hljs-tag">&lt;/<span class="hljs-name">goal</span>&gt;</span>
                <span class="hljs-tag">&lt;/<span class="hljs-name">goals</span>&gt;</span>
              <span class="hljs-tag">&lt;/<span class="hljs-name">execution</span>&gt;</span>
            <span class="hljs-tag">&lt;/<span class="hljs-name">executions</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">configuration</span>&gt;</span>
              <span class="hljs-tag">&lt;<span class="hljs-name">mainClass</span>&gt;</span>${main.class}<span class="hljs-tag">&lt;/<span class="hljs-name">mainClass</span>&gt;</span>
              <span class="hljs-tag">&lt;<span class="hljs-name">imageName</span>&gt;</span>${image.name}<span class="hljs-tag">&lt;/<span class="hljs-name">imageName</span>&gt;</span>
              <span class="hljs-tag">&lt;<span class="hljs-name">agent</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-name">enabled</span>&gt;</span>true<span class="hljs-tag">&lt;/<span class="hljs-name">enabled</span>&gt;</span>
              <span class="hljs-tag">&lt;/<span class="hljs-name">agent</span>&gt;</span>
            <span class="hljs-tag">&lt;/<span class="hljs-name">configuration</span>&gt;</span>
          <span class="hljs-tag">&lt;/<span class="hljs-name">plugin</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">plugins</span>&gt;</span>
      <span class="hljs-tag">&lt;/<span class="hljs-name">build</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">profile</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">profiles</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">project</span>&gt;</span>
</code></pre>
<p>The <code>native-maven-plugin</code> plugin integrates the native build process into the Maven lifecycle. It is configured under <code>native</code> maven profile and requires few configurations, such as the main class and the name of native binary output. Once configured, we can use maven commands to build the native binary:</p>
<pre><code class="lang-bash">$ mvn clean package -Pnative

<span class="hljs-comment"># Output</span>
Build resources:
 - 15.89GB of memory (67.9% of 23.42GB system memory, determined at start)
 - 4 thread(s) (100.0% of 4 available processor(s), determined at start)
[2/8] Performing analysis...  [****]                                                                    (19.5s @ 0.25GB)
    3,245 reachable types   (72.7% of    4,462 total)
    3,840 reachable fields  (50.2% of    7,657 total)
   15,730 reachable methods (45.5% of   34,552 total)
    1,025 types,    90 fields, and   676 methods registered <span class="hljs-keyword">for</span> reflection
       57 types,    57 fields, and    52 methods registered <span class="hljs-keyword">for</span> JNI access
        4 native libraries: dl, pthread, rt, z
[3/8] Building universe...                                                                               (2.9s @ 0.32GB)
[4/8] Parsing methods...      [**]                                                                       (2.4s @ 0.23GB)
[5/8] Inlining methods...     [***]                                                                      (1.6s @ 0.23GB)
[6/8] Compiling methods...    [[6/8] Compiling methods...    [****]                                                                    (18.2s @ 0.28GB)
[7/8] Layouting methods...    [**]                                                                       (2.4s @ 0.30GB)
[8/8] Creating image...       [**]                                                                       (2.8s @ 0.35GB)
   5.11MB (38.53%) <span class="hljs-keyword">for</span> code area:     8,933 compilation units
   7.48MB (56.43%) <span class="hljs-keyword">for</span> image heap:   97,328 objects and 47 resources
 684.84kB ( 5.04%) <span class="hljs-keyword">for</span> other data
  13.26MB <span class="hljs-keyword">in</span> total
------------------------------------------------------------------------------------------------------------------------
Top 10 origins of code area:                                Top 10 object types <span class="hljs-keyword">in</span> image heap:
   3.84MB java.base                                            1.59MB byte[] <span class="hljs-keyword">for</span> code metadata
 938.93kB svm.jar (Native Image)                               1.29MB byte[] <span class="hljs-keyword">for</span> java.lang.String
 108.35kB java.logging                                       977.47kB java.lang.String
  56.84kB org.graalvm.nativeimage.base                       753.66kB java.lang.Class
  43.64kB jdk.proxy1                                         278.87kB com.oracle.svm.core.hub.DynamicHubCompanion
  42.03kB jdk.proxy3                                         278.63kB byte[] <span class="hljs-keyword">for</span> general heap data
  21.98kB org.graalvm.collections                            242.67kB java.util.HashMap<span class="hljs-variable">$Node</span>
  19.52kB jdk.internal.vm.ci                                 217.99kB java.lang.Object[]
  10.46kB jdk.proxy2                                         185.82kB java.lang.String[]
   8.04kB jdk.internal.vm.compiler                           156.21kB byte[] <span class="hljs-keyword">for</span> reflection metadata
   3.94kB <span class="hljs-keyword">for</span> 3 more packages                                  1.58MB <span class="hljs-keyword">for</span> 906 more object types
------------------------------------------------------------------------------------------------------------------------
Recommendations:
 INIT: Adopt <span class="hljs-string">'--strict-image-heap'</span> to prepare <span class="hljs-keyword">for</span> the next GraalVM release.
 HEAP: Set max heap <span class="hljs-keyword">for</span> improved and more predictable memory usage.
 CPU:  Enable more CPU features with <span class="hljs-string">'-march=native'</span> <span class="hljs-keyword">for</span> improved performance.
------------------------------------------------------------------------------------------------------------------------
                        3.7s (6.7% of total time) <span class="hljs-keyword">in</span> 350 GCs | Peak RSS: 0.76GB | CPU load: 3.50
------------------------------------------------------------------------------------------------------------------------
Produced artifacts:
 /home/arpit/build-your-own/01-hello-world/target/ar-helloworld (executable)
========================================================================================================================
Finished generating <span class="hljs-string">'ar-helloworld'</span> <span class="hljs-keyword">in</span> 55.3s.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  59.522 s
[INFO] Finished at: 2025-01-07T00:48:43+05:30
[INFO] ------------------------------------------------------------------------

<span class="hljs-comment"># Execute the native binary</span>
$ ./target/ar-helloworld                                                                                          main main
Hello World! Current time is: 2025-01-07T00:48:45.178358
</code></pre>
<h4 id="heading-use-cases-for-graalvm-native-images">Use Cases for GraalVM Native Images</h4>
<ul>
<li><p><strong>Microservices:</strong> Fast startup times and low memory consumption make GraalVM native images perfect for microservices in Kubernetes.</p>
</li>
<li><p><strong>Serverless Computing:</strong> Instantaneous cold starts reduce latency in serverless environments.</p>
</li>
<li><p><strong>CLI Applications:</strong> Lightweight, standalone binaries are ideal for command-line tools.</p>
</li>
<li><p><strong>Edge Computing:</strong> The small footprint of native binaries makes them suitable for edge devices with limited resources.</p>
</li>
</ul>
<h4 id="heading-challenges-and-considerations">Challenges and Considerations</h4>
<p>While GraalVM and the native-maven-plugin offer exciting possibilities, there are some caveats:</p>
<ol>
<li><p><strong>Compatibility Issues:</strong> Not all Java libraries are compatible with GraalVM’s native-image compilation due to reflection or dynamic class loading.</p>
</li>
<li><p><strong>Longer Build Times:</strong> Generating native images can take significantly longer than building traditional JARs.</p>
</li>
<li><p><strong>Configuration Overhead:</strong> Some applications require additional configurations (e.g., <code>reflect-config.json</code>) for successful native compilation.</p>
</li>
</ol>
<h4 id="heading-conclusion">Conclusion</h4>
<p>GraalVM 21 and the native-maven-plugin are game-changers for Java developers aiming to build high-performance, resource-efficient applications. By leveraging these tools, you can modernize your Java projects and meet the demands of today’s cloud-native ecosystems.</p>
<p>Whether you’re building microservices, serverless functions, or lightweight tools, GraalVM and the native-maven-plugin open up a new world of possibilities. Start experimenting today and experience the future of Java development!</p>
]]></content:encoded></item><item><title><![CDATA[BYO: GraalVM Setup - Hello World]]></title><description><![CDATA[In this blog, we will setup local development environment for native Java using Graal VM. For this we will use following tools

Ubuntu 24.04

Sdkman

GraalVM 21

Maven


Code used in this blog: link
Install sdkman
$ lsb_release -a
No LSB modules are ...]]></description><link>https://arpitrathore.com/byo-graalvm-setup-hello-world</link><guid isPermaLink="true">https://arpitrathore.com/byo-graalvm-setup-hello-world</guid><category><![CDATA[GraalVM]]></category><dc:creator><![CDATA[Arpit Rathore]]></dc:creator><pubDate>Sun, 05 Jan 2025 18:30:00 GMT</pubDate><content:encoded><![CDATA[<p>In this blog, we will setup local development environment for native Java using Graal VM. For this we will use following tools</p>
<ol>
<li><p>Ubuntu 24.04</p>
</li>
<li><p>Sdkman</p>
</li>
<li><p>GraalVM 21</p>
</li>
<li><p>Maven</p>
</li>
</ol>
<p>Code used in this blog: <a target="_blank" href="https://github.com/arpitrathore/build-your-own/tree/main/01-hello-world">link</a></p>
<h2 id="heading-install-sdkmanhttpssdkmanio">Install <a target="_blank" href="https://sdkman.io/">sdkman</a></h2>
<pre><code class="lang-bash">$ lsb_release -a
No LSB modules are available.
Distributor ID:    Ubuntu
Description:    Ubuntu 24.04.1 LTS
Release:    24.04
Codename:    noble

$ curl -s <span class="hljs-string">"https://get.sdkman.io"</span> | bash
</code></pre>
<p>Output:</p>
<pre><code class="lang-plaintext">All done!


You are subscribed to the STABLE channel.

Please open a new terminal, or run the following in the existing one:

    source "/home/arpit/.sdkman/bin/sdkman-init.sh"

Then issue the following command:

    sdk help

Enjoy!!!
</code></pre>
<h2 id="heading-install-graalvm-prerequisiteshttpswwwgraalvmorglatestgetting-startedlinux">Install GraalVM <a target="_blank" href="https://www.graalvm.org/latest/getting-started/linux/">Prerequisites</a></h2>
<pre><code class="lang-bash"><span class="hljs-comment"># Open a new terminal (Otherwise the command `sdk` will not be available)</span>
<span class="hljs-comment"># Install prerequisites for GraalVM</span>
$ sudo apt-get install -y build-essential zlib1g-dev
</code></pre>
<h2 id="heading-install-graalvm-21">Install GraalVM 21</h2>
<pre><code class="lang-bash"><span class="hljs-comment"># List available java versions</span>
$ sdk list java
================================================================================
Available Java Versions <span class="hljs-keyword">for</span> Linux ARM 64bit
================================================================================
 Vendor        | Use | Version      | Dist    | Status     | Identifier
--------------------------------------------------------------------------------
 Corretto      |     | 23.0.1       | amzn    |            | 23.0.1-amzn
               |     | 21.0.5       | amzn    |            | 21.0.5-amzn
               |     | 17.0.13      | amzn    |            | 17.0.13-amzn
               |     | 11.0.25      | amzn    |            | 11.0.25-amzn
               |     | 8.0.432      | amzn    |            | 8.0.432-amzn
 GraalVM CE    |     | 23.0.1       | graalce |            | 23.0.1-graalce
               |     | 21.0.2       | graalce |            | 21.0.2-graalce
               |     | 17.0.9       | graalce |            | 17.0.9-graalce

<span class="hljs-comment"># Install GraalVM 21</span>
$ sdk install java 21.0.2-graalce
</code></pre>
<p>Output</p>
<pre><code class="lang-plaintext">.
.
Installing: java 21.0.2-graalce
Done installing!


Setting java 21.0.2-graalce as default.
</code></pre>
<h2 id="heading-install-maven">Install Maven</h2>
<pre><code class="lang-bash">$ sdk install maven
</code></pre>
<h2 id="heading-clone-the-projecthttpsgithubcomarpitrathorebuild-your-own-and-build">Clone the <a target="_blank" href="https://github.com/arpitrathore/build-your-own">project</a> and build</h2>
<pre><code class="lang-bash"><span class="hljs-comment"># Clone the base project</span>
$ git <span class="hljs-built_in">clone</span> https://github.com/arpitrathore/build-your-own
$ <span class="hljs-built_in">cd</span> build-your-own/01-hello-world/

<span class="hljs-comment"># Build the `ar-helloworld` native binary using maven and GraalVM Plugin</span>
$ mvn clean package -Pnative
</code></pre>
<p>Output</p>
<pre><code class="lang-plaintext">Produced artifacts:
 /home/arpit/build-your-own/01-hello-world/target/ar-helloworld (executable)
========================================================================================================================
Finished generating 'ar-helloworld' in 56.2s.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:00 min
[INFO] Finished at: 2025-01-05T00:11:36+05:30
[INFO] ------------------------------------------------------------------------
</code></pre>
<h2 id="heading-test-the-binary">Test the binary</h2>
<pre><code class="lang-bash">$ ./target/ar-helloworld                                                                                   130 main130 main
Hello World! Current time is: 2025-01-05T00:12:52.436238
</code></pre>
]]></content:encoded></item><item><title><![CDATA[BYO: JVM vs GraalVM: Understanding the Differences]]></title><description><![CDATA[JVM vs GraalVM: Understanding the Differences and Performance Comparison
The Java Virtual Machine (JVM) has been the cornerstone of Java's “write once, run anywhere” philosophy for decades. With the advent of GraalVM, a high-performance runtime from ...]]></description><link>https://arpitrathore.com/byo-jvm-vs-graalvm-understanding-the-differences</link><guid isPermaLink="true">https://arpitrathore.com/byo-jvm-vs-graalvm-understanding-the-differences</guid><category><![CDATA[GraalVM]]></category><dc:creator><![CDATA[Arpit Rathore]]></dc:creator><pubDate>Thu, 02 Jan 2025 18:30:00 GMT</pubDate><content:encoded><![CDATA[<p><strong>JVM vs GraalVM: Understanding the Differences and Performance Comparison</strong></p>
<p>The Java Virtual Machine (JVM) has been the cornerstone of Java's “write once, run anywhere” philosophy for decades. With the advent of GraalVM, a high-performance runtime from Oracle, developers now have a powerful alternative that extends beyond the traditional JVM. This blog explores the differences between JVM and GraalVM, comparing their features and performance to help you choose the best fit for your applications.</p>
<h3 id="heading-what-is-the-jvm">What is the JVM?</h3>
<p>The Java Virtual Machine is a runtime environment that executes Java bytecode. It abstracts the underlying hardware, enabling Java applications to run on any platform that supports the JVM.</p>
<p><strong>Key Features of the JVM:</strong></p>
<ul>
<li><p><strong>Platform Independence:</strong> Enables cross-platform compatibility.</p>
</li>
<li><p><strong>JIT Compilation:</strong> Uses Just-In-Time (JIT) compilation to improve runtime performance.</p>
</li>
<li><p><strong>Robust Ecosystem:</strong> Supported by a mature ecosystem of libraries, tools, and frameworks.</p>
</li>
<li><p><strong>Multilingual Support:</strong> Compatible with other JVM-based languages like Kotlin, Scala, and Groovy.</p>
</li>
</ul>
<h3 id="heading-what-is-graalvm">What is GraalVM?</h3>
<p>GraalVM is a high-performance runtime designed to enhance the execution of applications written in Java and other languages. It offers advanced features like Ahead-of-Time (AOT) compilation and polyglot programming capabilities.</p>
<p><strong>Key Features of GraalVM:</strong></p>
<ul>
<li><p><strong>AOT Compilation:</strong> Converts Java applications into native binaries, reducing startup times and memory usage.</p>
</li>
<li><p><strong>Polyglot Support:</strong> Runs multiple languages such as JavaScript, Python, Ruby, and LLVM-based languages.</p>
</li>
<li><p><strong>Enhanced Performance:</strong> Offers an optimized JIT compiler for faster execution of JVM-based applications.</p>
</li>
<li><p><strong>Interoperability:</strong> Facilitates seamless interaction between different programming languages.</p>
</li>
</ul>
<h3 id="heading-jvm-vs-graalvm-feature-comparison">JVM vs GraalVM: Feature Comparison</h3>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Feature</td><td>JVM</td><td>GraalVM</td></tr>
</thead>
<tbody>
<tr>
<td><strong>Compilation</strong></td><td>JIT Compilation</td><td>JIT and AOT Compilation</td></tr>
<tr>
<td><strong>Startup Time</strong></td><td>Relatively slow</td><td>Faster with native image</td></tr>
<tr>
<td><strong>Memory Usage</strong></td><td>Higher due to JIT runtime</td><td>Lower with native image</td></tr>
<tr>
<td><strong>Polyglot Support</strong></td><td>JVM-based languages only</td><td>Multiple languages</td></tr>
<tr>
<td><strong>Performance</strong></td><td>Optimized for long-running applications</td><td>Optimized for both short and long-running applications</td></tr>
<tr>
<td><strong>Ecosystem</strong></td><td>Mature and vast</td><td>Growing rapidly</td></tr>
</tbody>
</table>
</div><h3 id="heading-performance-comparison">Performance Comparison</h3>
<ol>
<li><p><strong>Startup Time:</strong></p>
<ul>
<li><p><strong>JVM:</strong> Traditional JVM applications have longer startup times because of the initialization of the runtime environment and the JIT compilation process.</p>
</li>
<li><p><strong>GraalVM:</strong> Applications compiled into native binaries with GraalVM’s AOT compilation start significantly faster, making it ideal for microservices and serverless environments.</p>
</li>
</ul>
</li>
<li><p><strong>Memory Usage:</strong></p>
<ul>
<li><p><strong>JVM:</strong> Consumes more memory as it includes the JIT compiler and associated metadata.</p>
</li>
<li><p><strong>GraalVM:</strong> Native binaries generated by GraalVM use less memory since they exclude the JIT compiler.</p>
</li>
</ul>
</li>
<li><p><strong>Runtime Performance:</strong></p>
<ul>
<li><p><strong>JVM:</strong> Excels in long-running applications due to dynamic optimizations performed by the JIT compiler.</p>
</li>
<li><p><strong>GraalVM:</strong> The Graal JIT compiler outperforms the standard JVM JIT compiler (C2) in many scenarios, offering better runtime performance.</p>
</li>
</ul>
</li>
<li><p><strong>Polyglot Applications:</strong></p>
<ul>
<li><p><strong>JVM:</strong> Primarily focused on Java and JVM-compatible languages.</p>
</li>
<li><p><strong>GraalVM:</strong> Provides superior polyglot capabilities, enabling seamless integration of languages like JavaScript, Python, and Ruby.</p>
</li>
</ul>
</li>
</ol>
<h3 id="heading-use-cases">Use Cases</h3>
<p><strong>When to Choose JVM:</strong></p>
<ul>
<li><p>Applications that are long-running and benefit from dynamic optimizations.</p>
</li>
<li><p>Projects that rely heavily on the mature Java ecosystem.</p>
</li>
<li><p>Development environments where startup time is less critical.</p>
</li>
</ul>
<p><strong>When to Choose GraalVM:</strong></p>
<ul>
<li><p>Microservices and serverless applications that require fast startup times.</p>
</li>
<li><p>Polyglot applications involving multiple programming languages.</p>
</li>
<li><p>Resource-constrained environments where lower memory usage is essential.</p>
</li>
</ul>
<h3 id="heading-final-thoughts">Final Thoughts</h3>
<p>The choice between JVM and GraalVM depends on your application’s requirements. While the JVM remains a reliable and robust option for many use cases, GraalVM brings innovative capabilities, particularly for modern cloud-native and polyglot environments. Its performance enhancements, especially in terms of startup time and memory usage, make it a strong contender for a variety of scenarios.</p>
<p>Understanding the strengths and trade-offs of both runtimes will empower you to make the best decision for your development needs.</p>
]]></content:encoded></item><item><title><![CDATA[New Year, New Series: Build your own [BYO]]]></title><description><![CDATA[As the calendar flips to a new year, it’s the perfect time to embrace fresh challenges and embark on exciting journeys. This year, I’m thrilled to announce a brand-new series: Build Your Own. The goal of this series is to dive deep into how common Li...]]></description><link>https://arpitrathore.com/new-year-new-series-build-your-own-byo</link><guid isPermaLink="true">https://arpitrathore.com/new-year-new-series-build-your-own-byo</guid><category><![CDATA[BYO]]></category><category><![CDATA[Java]]></category><category><![CDATA[GraalVM]]></category><category><![CDATA[Spring Native]]></category><dc:creator><![CDATA[Arpit Rathore]]></dc:creator><pubDate>Tue, 31 Dec 2024 18:30:00 GMT</pubDate><content:encoded><![CDATA[<p>As the calendar flips to a new year, it’s the perfect time to embrace fresh challenges and embark on exciting journeys. This year, I’m thrilled to announce a brand-new series: <strong>Build Your Own</strong>. The goal of this series is to dive deep into how common Linux command-line utilities work and recreate them using modern technologies like <strong>Java</strong>, <strong>GraalVM</strong>, and <strong>Spring Native</strong>.</p>
<h2 id="heading-why-this-series">Why This Series?</h2>
<p>Linux command-line tools are the unsung heroes of software development and system administration. Utilities like <code>grep</code>, <code>cat</code>, <code>ls</code>, and <code>curl</code> have been around for decades, and they’ve proven to be indispensable in countless workflows. By building these utilities from scratch, we get to:</p>
<ol>
<li><p><strong>Understand Their Inner Workings</strong>: There’s no better way to learn than by doing. Rebuilding these tools gives us a peek under the hood.</p>
</li>
<li><p><strong>Enhance Problem-Solving Skills</strong>: Each utility comes with unique challenges that push us to think critically and creatively.</p>
</li>
<li><p><strong>Leverage Modern Tech</strong>: By using Java, GraalVM, and Spring Native, we can reimagine these utilities with better performance and cross-platform capabilities.</p>
</li>
<li><p><strong>Foster Community Learning</strong>: Sharing this journey helps others learn, contribute, and grow alongside me.</p>
</li>
</ol>
<h2 id="heading-the-tech-stack">The Tech Stack</h2>
<h3 id="heading-1-java">1. <strong>Java</strong></h3>
<p>Java is a robust and versatile programming language with a rich ecosystem. It’s a perfect choice for this project because it combines simplicity with power, making it ideal for building both small utilities and large-scale applications.</p>
<h3 id="heading-2-graalvm">2. <strong>GraalVM</strong></h3>
<p>GraalVM is a high-performance runtime that extends Java capabilities with native image generation. By using GraalVM, we can compile our utilities into lightweight native binaries, ensuring lightning-fast startup times and reduced resource usage.</p>
<h3 id="heading-3-spring-native">3. <strong>Spring Native</strong></h3>
<p>Spring Native enables the creation of Spring Boot applications as native executables. This allows us to leverage the Spring ecosystem’s productivity while reaping the benefits of native compilation.</p>
<h2 id="heading-what-to-expect">What to Expect</h2>
<p>In this series, we’ll tackle a variety of CLI utilities, starting simple and progressively increasing in complexity. Here’s a sneak peek at some of the tools we’ll build:</p>
<ul>
<li><p><code>cat</code>: Displaying file contents.</p>
</li>
<li><p><code>grep</code>: Searching for patterns in files.</p>
</li>
<li><p><code>wc</code>: Counting words, lines, and characters.</p>
</li>
<li><p><code>ls</code>: Listing directory contents.</p>
</li>
<li><p><code>curl</code>: Fetching data from URLs.</p>
</li>
</ul>
<p>For each utility, we’ll cover:</p>
<ol>
<li><p><strong>An Overview</strong>: What the tool does and its real-world applications.</p>
</li>
<li><p><strong>Implementation</strong>: Step-by-step coding walkthroughs using Java, GraalVM, and Spring Native.</p>
</li>
<li><p><strong>Optimization</strong>: Techniques to improve performance and usability.</p>
</li>
<li><p><strong>Comparison</strong>: How our version stacks up against the original.</p>
</li>
</ol>
<h2 id="heading-code-repository">Code repository</h2>
<p>All the code used in this series can be found here: <a target="_blank" href="https://github.com/arpitrathore/build-your-own">link</a></p>
<h2 id="heading-join-the-journey">Join the Journey</h2>
<p>This series is more than just coding; it’s about exploring, learning, and sharing knowledge. Whether you’re a seasoned developer or a curious beginner, I invite you to follow along, experiment with the code, and share your thoughts and improvements.</p>
<p>The first post in this series drops soon, where we’ll recreate the humble yet powerful <code>cat</code> command. Until then, let’s toast to a year of innovation, learning, and growth.</p>
<p>Stay tuned, and happy New Year!</p>
]]></content:encoded></item><item><title><![CDATA[Milestone: Passing the AWS Certified Security – Specialty (SCS-C02) Exam]]></title><description><![CDATA[As a senior AWS engineer, cloud security has always been at the forefront of my architectural decisions. Earning the AWS Certified Security – Specialty (SCS-C02) certification is a testament to my commitment to building secure, scalable, and resilien...]]></description><link>https://arpitrathore.com/milestone-passing-the-aws-certified-security-specialty-scs-c02-exam</link><guid isPermaLink="true">https://arpitrathore.com/milestone-passing-the-aws-certified-security-specialty-scs-c02-exam</guid><category><![CDATA[SCS-C02]]></category><category><![CDATA[AWS]]></category><dc:creator><![CDATA[Arpit Rathore]]></dc:creator><pubDate>Wed, 13 Nov 2024 18:30:00 GMT</pubDate><content:encoded><![CDATA[<p>As a senior AWS engineer, cloud security has always been at the forefront of my architectural decisions. Earning the AWS Certified Security – Specialty (SCS-C02) certification is a testament to my commitment to building secure, scalable, and resilient cloud environments. This milestone reinforces my ability to tackle complex security challenges and stay ahead in the ever-evolving landscape of cloud security. Here is the certification <a target="_blank" href="https://www.credly.com/badges/ecee4cdb-4576-4617-96f1-4db12092ebd4"><strong>link</strong></a></p>
<h2 id="heading-why-security-specialization">Why Security Specialization?</h2>
<p>In today’s digital-first world, security is not optional—it’s a necessity. Cloud security involves protecting sensitive data, ensuring compliance, and mitigating risks in dynamic environments. The SCS-C02 certification delves into critical domains such as:</p>
<ul>
<li><p>Data protection and encryption</p>
</li>
<li><p>Identity and access management (IAM)</p>
</li>
<li><p>Incident response and monitoring</p>
</li>
<li><p>Security in hybrid and multi-cloud architectures</p>
</li>
</ul>
<p>For me, this was an opportunity to deepen my expertise and solidify my role as a trusted advisor in cloud security.</p>
<h2 id="heading-preparation-strategy">Preparation Strategy</h2>
<p>While my AWS experience provided a solid foundation, preparing for the SCS-C02 required a focused approach. Here’s how I tackled it:</p>
<ol>
<li><p><strong>Understanding the Exam Blueprint:</strong> I analyzed AWS’s exam guide to identify key areas like logging, monitoring, and secure network configurations.</p>
</li>
<li><p><strong>Hands-On Labs:</strong> I built and tested secure solutions using AWS services like KMS, AWS WAF, and GuardDuty to reinforce theoretical knowledge.</p>
</li>
<li><p><strong>Reviewing Best Practices:</strong> AWS whitepapers on security, such as the <em>Security Pillar of the Well-Architected Framework</em>, were invaluable.</p>
</li>
<li><p><strong>Incident Response Practice:</strong> Simulating scenarios helped sharpen my skills in detecting, analyzing, and mitigating security events.</p>
</li>
<li><p><strong>Mock Exams and Case Studies:</strong> Practice tests and real-world examples enhanced my understanding of practical applications.</p>
</li>
</ol>
<h2 id="heading-key-takeaways">Key Takeaways</h2>
<p>Preparing for the SCS-C02 offered several important insights:</p>
<ul>
<li><p><strong>Proactive Security:</strong> Anticipating vulnerabilities and implementing preventative measures is as critical as incident response.</p>
</li>
<li><p><strong>Layered Defense:</strong> Combining multiple security measures, from encryption to network isolation, creates a robust security posture.</p>
</li>
<li><p><strong>Continuous Monitoring:</strong> Leveraging tools like CloudWatch, CloudTrail, and GuardDuty ensures real-time visibility into potential threats.</p>
</li>
</ul>
<h2 id="heading-certification-impact">Certification Impact</h2>
<p>Earning the SCS-C02 certification enhances my role in significant ways:</p>
<ul>
<li><p><strong>Architecting Secure Solutions:</strong> I’m better equipped to design architectures that prioritize security without compromising functionality.</p>
</li>
<li><p><strong>Ensuring Compliance:</strong> My knowledge of regulatory standards like GDPR and HIPAA ensures that solutions meet stringent compliance requirements.</p>
</li>
<li><p><strong>Collaborative Leadership:</strong> The certification strengthens my ability to guide teams in implementing security best practices.</p>
</li>
</ul>
<h2 id="heading-whats-next">What’s Next?</h2>
<p>This certification is a stepping stone toward further growth. My next steps include:</p>
<ul>
<li><p><strong>Specializing Further:</strong> Exploring advanced topics like zero-trust architectures and AI-driven threat detection.</p>
</li>
<li><p><strong>Contributing to Security Communities:</strong> Sharing insights and learning from peers to foster a culture of security awareness.</p>
</li>
<li><p><strong>Driving Innovation:</strong> Applying my expertise to create cutting-edge solutions that balance security with agility.</p>
</li>
</ul>
<h2 id="heading-advice-for-aspirants">Advice for Aspirants</h2>
<p>If you’re considering the SCS-C02 certification, embrace a hands-on approach. Build, test, and refine secure architectures. Study AWS’s extensive documentation and engage with the security community. The effort pays off, equipping you with skills that are critical in today’s cloud-driven world.</p>
<p>In conclusion, passing the SCS-C02 certification is more than an accomplishment—it’s a commitment to excellence in cloud security. As threats evolve, so must our defences, and this journey has been an essential step in staying ahead of the curve.</p>
]]></content:encoded></item><item><title><![CDATA[Milestone: 100 days of leetcode]]></title><description><![CDATA[I just finished leetcode daily questions for 100 consecutive days (Almost. Used time travel tickets few times). Received my badge today.
Completing 100 LeetCode problems is a significant achievement for anyone looking to strengthen their coding skill...]]></description><link>https://arpitrathore.com/100-days-of-leetcode</link><guid isPermaLink="true">https://arpitrathore.com/100-days-of-leetcode</guid><category><![CDATA[leetcode]]></category><category><![CDATA[DSA]]></category><dc:creator><![CDATA[Arpit Rathore]]></dc:creator><pubDate>Tue, 08 Oct 2024 08:01:13 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1728375820079/583cd461-1c1e-4346-a3b0-08d5ca6c0e5c.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I just finished leetcode daily questions for 100 consecutive days (Almost. Used time travel tickets few times). Received my badge today.</p>
<p>Completing 100 LeetCode problems is a significant achievement for anyone looking to strengthen their coding skills. Whether you're preparing for a technical interview, enhancing your understanding of algorithms, or simply pushing yourself to grow as a programmer, reaching this milestone is no small feat. The process can be challenging, but the rewards—both in knowledge and confidence—are immense.</p>
<h3 id="heading-failures-in-the-past">Failures in the past</h3>
<p>I have started and failed at least 5 time in last 2-3 years. I have purchased many paid courses, followed Youtube channels, took leetcode premium 2 times yet I was not able to do for more than a month. I used to get frustrated with every unsolved question and then eventually stop.</p>
<p>This time I took a different approach. I said to myself, only one question in a day. Use the question to learn, instead of solving. For the first month, I solved only few easy questions without looking at the solutions. But I didn’t just look at the solution, I tried to learn from it. Tried to do similar problems, sometimes I succeeded, sometimes I failed. But whenever I was successful, it gave me immense confidence and at the same time I did not get discouraged with the failures.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1728375892669/9847b8f9-f273-4a5a-a8a7-eee7427dc70d.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-the-beginning-overcoming-initial-challenges">The Beginning: Overcoming Initial Challenges</h3>
<p>When you first start solving LeetCode problems, it can feel overwhelming. There are hundreds of problems ranging from "easy" to "hard," and the sheer volume of topics—arrays, linked lists, dynamic programming, graph algorithms, etc.—can make you feel like you’ll never master it all. But the key is not to focus on the number of problems left to solve, but on consistency and progress.</p>
<p>Many beginners start by tackling the "easy" problems. This is a great way to build confidence and understand how the platform works. LeetCode’s environment allows you to code in multiple programming languages, which is helpful for testing different approaches. As you move on to more complex problems, you’ll find that your understanding of core data structures like stacks, queues, and trees deepens.</p>
<h3 id="heading-consistency-is-key">Consistency is Key</h3>
<p>One of the biggest lessons I’ve learned from completing 100 LeetCode problems is the importance of consistency. While it’s tempting to try to rush through problems to hit a certain number, the real value comes from solving problems thoughtfully. This often means solving one or two problems a day but doing so with full focus. Instead of moving on once I’ve gotten the solution, I take time to review my approach, analyze its efficiency, and look at alternative solutions.</p>
<p>LeetCode has a strong community of users, and after solving a problem, it’s worth reading through discussions and exploring other people’s solutions. You’ll often find new insights, whether it’s a more efficient algorithm, a clever use of a data structure, or a simpler approach than you had considered.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1728375912156/e8fa1c4e-17f3-4801-952f-b932a7c793a3.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-the-learning-curve-from-frustration-to-mastery">The Learning Curve: From Frustration to Mastery</h3>
<p>At first, some problems will seem impossible, especially when you start encountering medium and hard problems. It’s easy to feel discouraged when you can’t figure out a solution or when your code fails multiple test cases. But every challenge is an opportunity to learn. One of the most important things I’ve realized is that failure is part of the process.</p>
<p>In fact, struggling with a problem is what makes the eventual solution more rewarding. Every time you debug a problem, optimize a solution, or refactor your code, you’re reinforcing your understanding. I found that after the first 20 or so problems, the once unfamiliar concepts started to become clearer. Topics like dynamic programming, which initially seemed like a foreign language, became more intuitive.</p>
<h3 id="heading-growth-through-practice">Growth Through Practice</h3>
<p>Another significant takeaway from solving 100 problems is that my speed and problem-solving ability improved gradually but steadily. In the beginning, even easy problems could take an hour or more. But with practice, I learned to recognize patterns and common strategies. For instance, I could quickly identify when to use a sliding window, backtracking, or a depth-first search (DFS) approach based on the problem description.</p>
<p>Moreover, I became more adept at thinking about edge cases and optimizing solutions. Time and space complexity became second nature, and I started evaluating my solutions based on Big-O analysis without having to consciously think about it.</p>
<h3 id="heading-solutions-amp-notes">Solutions &amp; Notes</h3>
<p>I created a <a target="_blank" href="https://github.com/arpitrathore/dsa">github-repo</a> to put the solutions and my notes. Initially I used a notebook and pen, but I think it’s better to preserve it digitally as it contains some decent insights. I plan to put all my future solutions and notes here and backfill the initial 100 solutions.</p>
<h3 id="heading-advice-for-others">Advice for Others</h3>
<p>If you're starting out on LeetCode or are partway through your journey, my advice is simple: stay consistent and don’t be afraid to fail. The first 100 problems will test your patience, but they will also expand your problem-solving toolbox. Even if you can only dedicate 30 minutes a day to solving problems, that time will add up over weeks and months. Each problem you solve brings you one step closer to mastering the art of algorithms.</p>
<p>In the end, completing 100 LeetCode problems is not just about hitting a number. It’s a reflection of the progress you've made, the knowledge you've gained, and the resilience you’ve built along the way. The journey doesn’t stop here—there are always more problems to solve and more to learn—but reaching this milestone is a reminder of how far you’ve come. Keep pushing, keep learning, and enjoy the process!</p>
]]></content:encoded></item><item><title><![CDATA[Moving My Blog from Hugo to Hashnode: A Journey]]></title><description><![CDATA[For the past couple of years, my blog was built with Hugo, a static site generator and hosted on firebase. It had only few pages about me reaching few milestones. However, as my blogging needs evolved, I realized that Hugo—though powerful—wasn't meet...]]></description><link>https://arpitrathore.com/moving-my-blog-from-hugo-to-hashnode-a-journey</link><guid isPermaLink="true">https://arpitrathore.com/moving-my-blog-from-hugo-to-hashnode-a-journey</guid><category><![CDATA[Hugo]]></category><category><![CDATA[Hashnode]]></category><dc:creator><![CDATA[Arpit Rathore]]></dc:creator><pubDate>Fri, 04 Oct 2024 18:30:00 GMT</pubDate><content:encoded><![CDATA[<p>For the past couple of years, my blog was built with Hugo, a static site generator and hosted on firebase. It had only few pages about me reaching few milestones. However, as my blogging needs evolved, I realized that Hugo—though powerful—wasn't meeting all my requirements. After some deliberation, I decided to move my blog to Hashnode, and here's how the transition went and why I made this choice.</p>
<hr />
<h4 id="heading-why-i-chose-to-switch">Why I Chose to Switch</h4>
<p>Hugo served me well in the beginning. Its static nature meant I could host my site anywhere for free and benefit from lightning-fast performance. However, over time, I began craving a platform that could:</p>
<ul>
<li><p>Simplify content creation and management.</p>
</li>
<li><p>Provide built-in analytics and engagement tools.</p>
</li>
<li><p>Offer seamless integration with a developer-friendly ecosystem.</p>
</li>
<li><p>In built support for comments.</p>
</li>
<li><p>Backdate support. I was able to publish my previous blogs on their original publish date.</p>
</li>
</ul>
<p>Hashnode ticked all these boxes. As a platform specifically tailored for developers, it combines a community-driven approach with a polished blogging experience, making it the perfect choice for my needs.</p>
<hr />
<h4 id="heading-the-migration-process">The Migration Process</h4>
<p>Moving a blog from Hugo to Hashnode was surprisingly straightforward. Here’s a step-by-step breakdown of how I managed the transition:</p>
<ol>
<li><p><strong>Exporting Posts from Hugo</strong>: I exported all my Markdown posts from the Hugo directory. Since Hashnode supports Markdown, this was a smooth process.</p>
</li>
<li><p><strong>Setting Up a Hashnode Account</strong>: Creating a Hashnode account took just minutes. Once I logged in, I explored the dashboard to understand its features and settings.</p>
</li>
<li><p><strong>Creating a Custom Domain</strong>: Hashnode allows you to link a custom domain to your blog, so I ensured that my previous domain pointed to my new Hashnode blog using their DNS setup guide.</p>
</li>
<li><p><strong>Importing Content</strong>: Hashnode’s content importer made it easy to copy my Markdown files and images. I double-checked the formatting and made minor adjustments to ensure everything looked perfect.</p>
</li>
<li><p><strong>Customizing the Blog</strong>: With Hashnode, I could tweak the appearance of my blog using their themes and customization options. The process was far more intuitive compared to configuring Hugo templates.</p>
</li>
<li><p><strong>Testing and Final Touches</strong>: Before officially redirecting traffic, I tested the site for broken links and ensured all posts displayed correctly. Hashnode’s live preview feature was a lifesaver here.</p>
</li>
</ol>
<hr />
<h4 id="heading-benefits-of-hashnode">Benefits of Hashnode</h4>
<p>After completing the migration, here are the key benefits I’ve experienced:</p>
<ol>
<li><p><strong>Ease of Use</strong>: Writing and publishing on Hashnode is as simple as it gets. The editor is intuitive, and there’s no need to rebuild the site after every update.</p>
</li>
<li><p><strong>Community Engagement</strong>: Hashnode’s community-driven approach has increased the visibility of my posts, allowing me to connect with like-minded developers.</p>
</li>
<li><p><strong>SEO Optimization</strong>: Hashnode provides built-in SEO tools that make optimizing my blog for search engines a breeze.</p>
</li>
<li><p><strong>Analytics</strong>: With detailed insights into my readership, I can make data-driven decisions to improve my content strategy.</p>
</li>
<li><p><strong>Reduced Maintenance</strong>: No more worrying about Hugo themes, plugins, or updates. Hashnode handles all the technical aspects for me.</p>
</li>
</ol>
<hr />
<h4 id="heading-lessons-learned">Lessons Learned</h4>
<p>Switching platforms can feel daunting, but it’s also an opportunity to streamline and enhance your blogging workflow. Here are a few lessons I picked up along the way:</p>
<ul>
<li><p><strong>Plan Ahead</strong>: Map out the migration process to avoid surprises.</p>
</li>
<li><p><strong>Back Everything Up</strong>: Always keep backups of your existing content before making any changes.</p>
</li>
<li><p><strong>Test Thoroughly</strong>: Ensure the new platform meets your expectations before going live.</p>
</li>
<li><p><strong>Leverage the Community</strong>: Hashnode’s support team and user base are incredibly helpful—don’t hesitate to ask questions.</p>
</li>
</ul>
<hr />
<h4 id="heading-final-thoughts">Final Thoughts</h4>
<p>Moving my blog from Hugo to Hashnode has been a game-changer. The process not only simplified my blogging experience but also opened up new opportunities for engagement and growth. If you’re considering a similar move, I highly recommend giving Hashnode a try. The platform’s developer-first approach might just be what you need to take your blog to the next level.</p>
]]></content:encoded></item><item><title><![CDATA[Milestone: Passing the AWS Certified Advanced Networking – Specialty (ANS-C01) Exam]]></title><description><![CDATA[Embracing Complexity: Achieving the AWS Certified Advanced Networking – Specialty (ANS-C01)
As someone deeply immersed in AWS architecture, the AWS Certified Advanced Networking – Specialty (ANS-C01) certification presented an exciting challenge. It ...]]></description><link>https://arpitrathore.com/milestone-passing-the-aws-certified-advanced-networking-specialty-ans-c01-exam</link><guid isPermaLink="true">https://arpitrathore.com/milestone-passing-the-aws-certified-advanced-networking-specialty-ans-c01-exam</guid><category><![CDATA[AWS]]></category><category><![CDATA[ANS-C01]]></category><dc:creator><![CDATA[Arpit Rathore]]></dc:creator><pubDate>Sun, 29 Sep 2024 18:30:00 GMT</pubDate><content:encoded><![CDATA[<h1 id="heading-embracing-complexity-achieving-the-aws-certified-advanced-networking-specialty-ans-c01">Embracing Complexity: Achieving the AWS Certified Advanced Networking – Specialty (ANS-C01)</h1>
<p>As someone deeply immersed in AWS architecture, the AWS Certified Advanced Networking – Specialty (ANS-C01) certification presented an exciting challenge. It required me to step beyond foundational cloud knowledge and tackle the nuanced demands of advanced networking. Earning this certification validates my ability to design and manage scalable, secure, and efficient networking infrastructures in complex environments. Here is the certification <a target="_blank" href="https://www.credly.com/badges/e76707eb-3467-43b6-b1d0-457c2dcc9b9a"><strong>link</strong></a></p>
<h2 id="heading-why-advanced-networking-matters">Why Advanced Networking Matters</h2>
<p>Networking is the unsung hero of cloud architectures. From enabling global connectivity to ensuring seamless hybrid integrations, advanced networking skills are essential for delivering business-critical solutions. For me, this certification was about:</p>
<ul>
<li><p>Deepening my expertise in hybrid and multi-cloud connectivity</p>
</li>
<li><p>Strengthening security and resilience in network designs</p>
</li>
<li><p>Fine-tuning performance for latency-sensitive applications</p>
</li>
</ul>
<h2 id="heading-my-preparation-journey">My Preparation Journey</h2>
<p>Despite my AWS experience, preparing for the ANS-C01 required deliberate effort and focus. Here’s what shaped my approach:</p>
<ol>
<li><p><strong>Building from Fundamentals:</strong> Revisiting core networking principles ensured a solid foundation for tackling advanced topics like Direct Connect and Transit Gateway.</p>
</li>
<li><p><strong>Practical Experimentation:</strong> Deploying hands-on solutions like secure VPN configurations and multi-region architectures provided invaluable insights.</p>
</li>
<li><p><strong>Learning Through Documentation:</strong> AWS whitepapers and guides, such as <em>Hybrid Connectivity</em> and <em>Networking Best Practices</em>, became my roadmap.</p>
</li>
<li><p><strong>Simulating Exam Scenarios:</strong> Practice exams and real-world case studies sharpened my problem-solving abilities.</p>
</li>
<li><p><strong>Collaborating with Peers:</strong> Discussing strategies and solutions with colleagues and the AWS community added fresh perspectives to my understanding.</p>
</li>
</ol>
<h2 id="heading-what-i-discovered">What I Discovered</h2>
<p>This journey reinforced some critical insights:</p>
<ul>
<li><p><strong>Precision in Design:</strong> Advanced networking demands meticulous attention to detail, particularly in areas like route prioritization and protocol configurations.</p>
</li>
<li><p><strong>Security is Non-Negotiable:</strong> Every design decision—from Network ACLs to encryption—must prioritize safeguarding data.</p>
</li>
<li><p><strong>Scalability is Key:</strong> Architectures need to anticipate future growth and evolving business requirements.</p>
</li>
</ul>
<h2 id="heading-certification-value">Certification Value</h2>
<p>Achieving the ANS-C01 isn’t just a personal milestone; it’s a professional asset that:</p>
<ul>
<li><p><strong>Elevates Problem-Solving:</strong> Enables tackling intricate challenges like cross-region failover and hybrid cloud integrations.</p>
</li>
<li><p><strong>Enhances Team Collaboration:</strong> Fosters better alignment with DevOps and infrastructure teams to create cohesive solutions.</p>
</li>
<li><p><strong>Broadens Horizons:</strong> Opens pathways to explore cutting-edge technologies in edge computing and global networks.</p>
</li>
</ul>
<h2 id="heading-what-comes-next">What Comes Next</h2>
<p>With the ANS-C01 certification, I’m motivated to:</p>
<ul>
<li><p><strong>Take on Complex Projects:</strong> Applying these advanced skills to drive impactful solutions in enterprise environments.</p>
</li>
<li><p><strong>Explore Adjacent Domains:</strong> Diving deeper into fields like security and automation to build holistic expertise.</p>
</li>
<li><p><strong>Guide Others:</strong> Sharing knowledge to empower peers and promote best practices across the cloud community.</p>
</li>
</ul>
<h2 id="heading-advice-for-aspiring-candidates">Advice for Aspiring Candidates</h2>
<p>For anyone considering this certification, I’d emphasize the value of real-world practice. Dive into challenging scenarios, engage with AWS’s extensive documentation, and don’t shy away from collaboration. The journey might be rigorous, but the rewards are profound—both in personal growth and professional impact.</p>
<p>In conclusion, the ANS-C01 journey has been a transformative experience. It’s not just about earning a credential but about evolving as a cloud professional. This certification represents the commitment to continuous learning and excellence in navigating the intricate world of cloud networking.</p>
]]></content:encoded></item><item><title><![CDATA[Milestone: Passing the HashiCorp Certified Terraform Associate Exam]]></title><description><![CDATA[As a senior cloud engineer with extensive AWS experience, earning the HashiCorp Certified: Terraform Associate (003) certification was a key step in enhancing my expertise in infrastructure as code (IaC) and multi-cloud automation. Here is the certif...]]></description><link>https://arpitrathore.com/milestone-passing-the-hashicorp-certified-terraform-associate-exam</link><guid isPermaLink="true">https://arpitrathore.com/milestone-passing-the-hashicorp-certified-terraform-associate-exam</guid><category><![CDATA[#IaC]]></category><category><![CDATA[Terraform]]></category><dc:creator><![CDATA[Arpit Rathore]]></dc:creator><pubDate>Tue, 30 Jul 2024 18:30:00 GMT</pubDate><content:encoded><![CDATA[<p>As a senior cloud engineer with extensive AWS experience, earning the HashiCorp Certified: Terraform Associate (003) certification was a key step in enhancing my expertise in infrastructure as code (IaC) and multi-cloud automation. Here is the certification <a target="_blank" href="https://www.credly.com/badges/28e50664-766e-4696-ad6c-cc0e287e0793"><strong>link</strong></a><strong>.</strong></p>
<h2 id="heading-why-terraform">Why Terraform?</h2>
<p>Terraform is essential for provisioning and managing infrastructure across cloud platforms. This certification validated my skills in:</p>
<ul>
<li><p>Writing Terraform configurations</p>
</li>
<li><p>Managing state effectively</p>
</li>
<li><p>Utilizing advanced features like modules and workspaces</p>
</li>
<li><p>Following best practices for security and scalability</p>
</li>
</ul>
<h2 id="heading-preparation-highlights">Preparation Highlights</h2>
<p>Despite my AWS expertise, this exam required focus. My preparation included:</p>
<ol>
<li><p><strong>Studying Exam Objectives:</strong> I reviewed HashiCorp’s guide to understand key topics like providers, resources, and state management.</p>
</li>
<li><p><strong>Hands-On Practice:</strong> I built multi-cloud infrastructures, explored modules, and worked with remote state.</p>
</li>
<li><p><strong>Learning Resources:</strong> HashiCorp documentation and online courses deepened my knowledge.</p>
</li>
<li><p><strong>Community Insights:</strong> Forums provided practical tips and clarified real-world challenges.</p>
</li>
<li><p><strong>Mock Exams:</strong> Practice tests sharpened my readiness and time management.</p>
</li>
</ol>
<h2 id="heading-lessons-learned">Lessons Learned</h2>
<ul>
<li><p><strong>Multi-Cloud Mindset:</strong> Terraform’s agnostic approach broadened my perspective beyond AWS.</p>
</li>
<li><p><strong>State Management:</strong> Mastering state handling was crucial.</p>
</li>
<li><p><strong>Code Reusability:</strong> Emphasis on clean, maintainable configurations reinforced best practices.</p>
</li>
</ul>
<h2 id="heading-certification-impact">Certification Impact</h2>
<p>Achieving this certification enhances my role as a senior engineer by:</p>
<ul>
<li><p><strong>Improving Automation:</strong> Terraform’s declarative model boosts deployment efficiency.</p>
</li>
<li><p><strong>Expanding Multi-Cloud Proficiency:</strong> It enables seamless operation across platforms.</p>
</li>
<li><p><strong>Strengthening DevOps Collaboration:</strong> I’m better equipped to integrate IaC into CI/CD pipelines.</p>
</li>
</ul>
<h2 id="heading-looking-ahead">Looking Ahead</h2>
<p>With Terraform certification in hand, my goals include:</p>
<ul>
<li><p><strong>Scaling Automation:</strong> Applying skills to complex infrastructures.</p>
</li>
<li><p><strong>Exploring Advanced Tools:</strong> Delving into HashiCorp’s Vault.</p>
</li>
<li><p><strong>Mentoring:</strong> Sharing insights to guide peers in adopting IaC practices.</p>
</li>
</ul>
<h2 id="heading-encouragement-for-aspirants">Encouragement for Aspirants</h2>
<p>For those considering this certification, my advice is to embrace the challenge. Terraform’s capabilities can transform how you manage infrastructure, making this journey a valuable investment in your career.</p>
<p>In summary, passing the Terraform Associate exam has been an enriching experience, blending existing expertise with new skills. Continuous learning remains essential in staying ahead in the dynamic cloud and DevOps landscape.</p>
]]></content:encoded></item><item><title><![CDATA[Milestone: Passing the AWS Certified Solutions Architect – Professional (SAP-C02) Exam]]></title><description><![CDATA[As a senior cloud engineer with extensive experience in AWS, professional certifications have always been a way to benchmark expertise and stay current in this fast-evolving field. Recently, I achieved another significant milestone by passing the AWS...]]></description><link>https://arpitrathore.com/milestone-passing-the-aws-certified-solutions-architect-professional-sap-c02-exam</link><guid isPermaLink="true">https://arpitrathore.com/milestone-passing-the-aws-certified-solutions-architect-professional-sap-c02-exam</guid><category><![CDATA[AWS]]></category><category><![CDATA[SAP-C02]]></category><dc:creator><![CDATA[Arpit Rathore]]></dc:creator><pubDate>Wed, 12 Jun 2024 18:30:00 GMT</pubDate><content:encoded><![CDATA[<p>As a senior cloud engineer with extensive experience in AWS, professional certifications have always been a way to benchmark expertise and stay current in this fast-evolving field. Recently, I achieved another significant milestone by passing the AWS Certified Solutions Architect – Professional (SAP-C02) exam. Here is the certification <a target="_blank" href="https://www.credly.com/badges/05dfbd0a-2d6c-42ba-9f6c-7ebf0b33998b"><strong>link</strong></a><strong>.</strong></p>
<h2 id="heading-why-pursue-the-sap-c02">Why Pursue the SAP-C02?</h2>
<p>The SAP-C02 exam is considered one of the most challenging certifications in the AWS ecosystem. It’s designed for seasoned professionals who architect and implement solutions that meet complex, enterprise-scale requirements. The exam covers:</p>
<ul>
<li><p><strong>Designing solutions for organizational complexity</strong></p>
</li>
<li><p><strong>Designing for new solutions</strong></p>
</li>
<li><p><strong>Continuous improvement for existing solutions</strong></p>
</li>
<li><p><strong>Accelerating workload migration and modernization</strong></p>
</li>
</ul>
<p>For a senior engineer, this certification validates the ability to design and deliver robust solutions for large-scale, mission-critical applications.</p>
<h2 id="heading-preparation-strategy-for-experienced-professionals">Preparation Strategy for Experienced Professionals</h2>
<p>Even as someone deeply familiar with AWS, the SAP-C02 exam demanded a focused preparation strategy. Here’s how I approached it:</p>
<ol>
<li><p><strong>Focusing on Advanced Topics:</strong> Unlike associate-level exams, the professional certification emphasizes intricate scenarios. I dedicated time to areas like hybrid architectures, multi-account strategies, and disaster recovery planning.</p>
</li>
<li><p><strong>Hands-On Practice:</strong> Designing and troubleshooting complex AWS architectures in real-world environments was instrumental. I replicated enterprise-level challenges to test my knowledge.</p>
</li>
<li><p><strong>Leveraging AWS Whitepapers and Case Studies:</strong> AWS’s official documentation provided invaluable insights into best practices and innovative solutions.</p>
</li>
<li><p><strong>Mock Exams and Simulations:</strong> I used professional-level practice exams to refine my approach to problem-solving and manage time effectively during the actual test.</p>
</li>
<li><p><strong>Peer Collaboration:</strong> Discussing complex scenarios with peers helped broaden my perspective and solidify my understanding of advanced architectural principles.</p>
</li>
</ol>
<h2 id="heading-challenges-and-insights">Challenges and Insights</h2>
<p>The SAP-C02 exam was a humbling experience that reinforced some key lessons:</p>
<ul>
<li><p><strong>Breadth and Depth Are Equally Important:</strong> It’s not enough to know individual services; understanding how they integrate into comprehensive solutions is crucial.</p>
</li>
<li><p><strong>Cost Optimization is Key:</strong> AWS emphasizes delivering value through cost-effective solutions, making this a critical aspect of professional-level certification.</p>
</li>
<li><p><strong>Keep Learning:</strong> The AWS landscape evolves rapidly, and staying updated is essential for both the exam and real-world application.</p>
</li>
</ul>
<h2 id="heading-why-this-certification-matters">Why This Certification Matters</h2>
<p>Achieving the SAP-C02 certification brings a wealth of benefits to my professional journey:</p>
<ul>
<li><p><strong>Enhanced Credibility:</strong> It reinforces my role as a trusted advisor for enterprise-scale AWS solutions.</p>
</li>
<li><p><strong>Mentorship Opportunities:</strong> With this certification, I’m better equipped to mentor junior engineers and help them navigate complex cloud challenges.</p>
</li>
<li><p><strong>Driving Innovation:</strong> The knowledge gained empowers me to design cutting-edge solutions that drive business transformation.</p>
</li>
</ul>
<h2 id="heading-whats-next">What’s Next?</h2>
<p>While passing the SAP-C02 is a significant accomplishment, the journey doesn’t end here. My focus now shifts to:</p>
<ul>
<li><p><strong>Contributing to Large-Scale Projects:</strong> Applying this expertise to real-world scenarios that push the boundaries of innovation.</p>
</li>
<li><p><strong>Continuous Learning:</strong> AWS never stops evolving, and staying on top of new developments is a priority.</p>
</li>
<li><p><strong>Specialized Certifications:</strong> Exploring specialty certifications like AWS Advanced Networking or AWS Security to further diversify my skill set.</p>
</li>
</ul>
<h2 id="heading-a-word-of-encouragement">A Word of Encouragement</h2>
<p>For anyone contemplating the SAP-C02 certification, my advice is to embrace the challenge. Whether you’re an experienced professional or looking to elevate your career, this certification is a rewarding journey that sharpens your skills and broadens your horizons.</p>
<p>In conclusion, passing the AWS Certified Solutions Architect – Professional (SAP-C02) exam is not just a personal triumph but a testament to the value of perseverance and continuous growth. As the cloud landscape expands, so do the opportunities to make a meaningful impact—and I’m excited to be part of this journey.</p>
]]></content:encoded></item><item><title><![CDATA[Milestone: Passing the AWS Certified Solutions Architect – Associate (SAA-C03) Exam]]></title><description><![CDATA[Achieving professional certifications is a milestone worth celebrating, and I’m thrilled to share my journey in passing the AWS Certified Solutions Architect – Associate (SAA-C03) exam. This certification not only validates my skills but also represe...]]></description><link>https://arpitrathore.com/milestone-passing-the-aws-certified-solutions-architect-associate-saa-c03-exam</link><guid isPermaLink="true">https://arpitrathore.com/milestone-passing-the-aws-certified-solutions-architect-associate-saa-c03-exam</guid><category><![CDATA[AWS]]></category><category><![CDATA[SAA-C03]]></category><dc:creator><![CDATA[Arpit Rathore]]></dc:creator><pubDate>Wed, 24 Apr 2024 18:30:00 GMT</pubDate><content:encoded><![CDATA[<p>Achieving professional certifications is a milestone worth celebrating, and I’m thrilled to share my journey in passing the AWS Certified Solutions Architect – Associate (SAA-C03) exam. This certification not only validates my skills but also represents a significant step forward in my career in cloud computing. Here is the certification <a target="_blank" href="https://www.credly.com/badges/5b9edb46-eb40-44f4-b953-7caa4c53ae29">link</a></p>
<h2 id="heading-the-journey-to-certification">The Journey to Certification</h2>
<p>When I first decided to pursue the SAA-C03 certification, I knew it would be a challenging yet rewarding experience. Amazon Web Services (AWS) is a leader in cloud computing, and its certifications are globally recognized as benchmarks of expertise. This motivated me to dive deep into AWS’s vast ecosystem and enhance my knowledge.</p>
<h3 id="heading-why-saa-c03">Why SAA-C03?</h3>
<p>The SAA-C03 exam is designed for individuals who architect and deploy robust and secure applications on AWS technologies. It covers a wide range of topics, including:</p>
<ul>
<li><p><strong>Secure applications and architectures</strong></p>
</li>
<li><p><strong>Designing resilient architectures</strong></p>
</li>
<li><p><strong>High-performing architectures</strong></p>
</li>
<li><p><strong>Cost-optimized architectures</strong></p>
</li>
</ul>
<p>Earning this certification means having the ability to design scalable, fault-tolerant systems while optimizing performance and cost—skills that are in high demand.</p>
<h3 id="heading-preparation-strategy">Preparation Strategy</h3>
<p>Preparation was key to my success, and I followed a structured approach:</p>
<ol>
<li><p><strong>Understanding the Exam Blueprint:</strong> I began by thoroughly reviewing the official AWS exam guide to understand the domains and weightage.</p>
</li>
<li><p><strong>Hands-On Practice:</strong> AWS is best learned by doing, so I spent time building, deploying, and troubleshooting applications on the platform.</p>
</li>
<li><p><strong>Study Resources:</strong> I leveraged resources like Udemy courses, tech talks and whitepapers. Tutorials by industry experts also provided valuable insights.</p>
</li>
<li><p><strong>Mock Exams:</strong> Practice tests were instrumental in identifying weak areas and building confidence.</p>
</li>
</ol>
<h3 id="heading-challenges-and-lessons-learned">Challenges and Lessons Learned</h3>
<p>Every journey has its challenges, and mine was no different. Balancing preparation with other responsibilities required discipline and effective time management. Tackling complex scenarios during practice sessions taught me the importance of thinking critically and staying updated with the latest AWS developments.</p>
<h2 id="heading-the-exam-day">The Exam Day</h2>
<p>On exam day, I walked in feeling a mix of excitement and nervousness. The exam was comprehensive, testing not just theoretical knowledge but also practical application. With a clear strategy for time management and a focus on understanding rather than memorization, I navigated through the questions confidently.</p>
<h2 id="heading-why-this-certification-matters">Why This Certification Matters</h2>
<p>Passing the SAA-C03 exam is more than just a personal achievement. It’s a testament to my commitment to professional growth and delivering value in cloud solutions. This certification equips me to:</p>
<ul>
<li><p><strong>Collaborate effectively</strong> with teams on cloud projects</p>
</li>
<li><p><strong>Drive innovation</strong> by leveraging AWS’s extensive services</p>
</li>
<li><p><strong>Ensure cost-efficiency</strong> in cloud implementations</p>
</li>
</ul>
<h2 id="heading-whats-next">What’s Next?</h2>
<p>While I’m proud of this accomplishment, I view it as a stepping stone. My next goal is to pursue the AWS Certified Solutions Architect – Professional certification to deepen my expertise further. I’m also eager to apply what I’ve learned to real-world projects, solving complex challenges and contributing to impactful outcomes.</p>
<h2 id="heading-a-word-of-encouragement">A Word of Encouragement</h2>
<p>To anyone considering the SAA-C03 certification or embarking on a similar journey, I encourage you to take the plunge. With dedication, persistence, and the right resources, success is within reach. Remember, every challenge is an opportunity to grow.</p>
<p>In conclusion, passing the AWS Certified Solutions Architect – Associate (SAA-C03) exam is a proud milestone in my career. It’s a testament to hard work, resilience, and the power of continuous learning. Here’s to embracing the journey ahead and unlocking new possibilities in the ever-evolving world of cloud computing!</p>
]]></content:encoded></item><item><title><![CDATA[Exploring Netflix/Orkes Conductor: A Workflow Orchestration Powerhouse]]></title><description><![CDATA[Modern distributed systems often involve complex workflows that require seamless coordination among multiple services. Netflix/Orkes Conductor, an open-source microservices orchestration platform, is designed to tackle these challenges. Initially dev...]]></description><link>https://arpitrathore.com/exploring-netflixorkes-conductor-a-workflow-orchestration-powerhouse</link><guid isPermaLink="true">https://arpitrathore.com/exploring-netflixorkes-conductor-a-workflow-orchestration-powerhouse</guid><category><![CDATA[orkes]]></category><category><![CDATA[conductor]]></category><category><![CDATA[netflix]]></category><dc:creator><![CDATA[Arpit Rathore]]></dc:creator><pubDate>Wed, 03 Apr 2024 18:30:00 GMT</pubDate><content:encoded><![CDATA[<p>Modern distributed systems often involve complex workflows that require seamless coordination among multiple services. Netflix/Orkes Conductor, an open-source microservices orchestration platform, is designed to tackle these challenges. Initially developed by Netflix to manage its own workflows, Conductor has since evolved into a robust tool that simplifies building, managing, and scaling workflows across diverse industries.</p>
<hr />
<h4 id="heading-what-is-netflixorkes-conductor">What is Netflix/Orkes Conductor?</h4>
<p>Netflix Conductor is a microservices orchestration engine that helps developers define and execute workflows as code. It provides a scalable and flexible architecture for managing workflows with:</p>
<ul>
<li><p><strong>Dynamic Workflow Definition</strong>: Define workflows declaratively in JSON or programmatically using APIs.</p>
</li>
<li><p><strong>Pluggable Architecture</strong>: Integrate with custom or existing services through task implementations.</p>
</li>
<li><p><strong>Scalability</strong>: Handle millions of tasks with ease.</p>
</li>
<li><p><strong>Monitoring and Debugging</strong>: Offers built-in tools for monitoring workflows and diagnosing failures.</p>
</li>
</ul>
<p>Conductor’s flexibility makes it ideal for orchestrating workflows in a variety of domains, including media streaming, e-commerce, and DevOps automation.</p>
<hr />
<h4 id="heading-key-features">Key Features</h4>
<ol>
<li><p><strong>Task Management</strong>:</p>
<ul>
<li><p><strong>System Tasks</strong>: Predefined tasks like HTTP calls, event waits, and sub-workflows.</p>
</li>
<li><p><strong>Worker Tasks</strong>: Custom tasks implemented as microservices.</p>
</li>
</ul>
</li>
<li><p><strong>Workflow Versioning</strong>: Maintain and manage multiple versions of workflows seamlessly.</p>
</li>
<li><p><strong>Failure Handling</strong>: Built-in support for retries, timeouts, and compensation logic.</p>
</li>
<li><p><strong>Extensibility</strong>: Add custom task types, queue providers, and persistence layers.</p>
</li>
<li><p><strong>UI and API</strong>: Manage workflows through an intuitive web UI or REST APIs.</p>
</li>
</ol>
<hr />
<h4 id="heading-use-cases-for-netflixorkes-conductor">Use Cases for Netflix/Orkes Conductor</h4>
<ol>
<li><p><strong>Media Processing Pipelines</strong>:</p>
<ul>
<li><p>Orchestrate encoding, thumbnail generation, and metadata extraction for uploaded videos.</p>
</li>
<li><p>Manage long-running tasks like content delivery validation.</p>
</li>
</ul>
</li>
<li><p><strong>E-commerce Order Management</strong>:</p>
<ul>
<li><p>Coordinate order placement, payment processing, inventory updates, and shipment tracking.</p>
</li>
<li><p>Handle order failures with rollback workflows.</p>
</li>
</ul>
</li>
<li><p><strong>DevOps Automation</strong>:</p>
<ul>
<li><p>Automate CI/CD pipelines by integrating build, test, and deployment stages.</p>
</li>
<li><p>Manage infrastructure provisioning and scaling workflows.</p>
</li>
</ul>
</li>
<li><p><strong>Data Processing Pipelines</strong>:</p>
<ul>
<li><p>Execute ETL jobs by coordinating data extraction, transformation, and loading tasks.</p>
</li>
<li><p>Handle failures in a distributed data pipeline with retry logic.</p>
</li>
</ul>
</li>
<li><p><strong>Customer Onboarding</strong>:</p>
<ul>
<li>Streamline multi-step onboarding processes such as identity verification, account setup, and user notifications.</li>
</ul>
</li>
<li><p><strong>Data Migration:</strong></p>
<ul>
<li>If you have a use case of migrating data from one database to other or one environment to another, one customer at a time.</li>
</ul>
</li>
</ol>
<hr />
<h4 id="heading-important-configurations">Important Configurations</h4>
<p>To effectively use Netflix/Orkes Conductor, some essential configurations include:</p>
<ol>
<li><p><strong>Persistence Layer</strong>:</p>
<ul>
<li><p>Conductor supports multiple storage backends like MySQL, Postgres, Cassandra, and DynamoDB.</p>
</li>
<li><p>Choose a database based on your scalability and availability requirements.</p>
</li>
</ul>
</li>
<li><p><strong>Task Queues</strong>:</p>
<ul>
<li><p>Use built-in queues like Redis or RabbitMQ, or integrate with custom queue implementations.</p>
</li>
<li><p>Configure queue priorities and polling intervals for optimal task execution.</p>
</li>
</ul>
</li>
<li><p><strong>Worker Configuration</strong>:</p>
<ul>
<li><p>Define task workers with clear interfaces and ensure they are stateless.</p>
</li>
<li><p>Use gRPC or REST for communication between Conductor and workers.</p>
</li>
</ul>
</li>
<li><p><strong>Workflow Definitions</strong>:</p>
<ul>
<li><p>Create reusable workflow templates in JSON.</p>
</li>
<li><p>Define retry logic, timeouts, and input parameters for tasks.</p>
</li>
</ul>
</li>
<li><p><strong>Authentication and Authorization</strong>:</p>
<ul>
<li><p>Secure access to the Conductor server with authentication mechanisms like OAuth2.</p>
</li>
<li><p>Use role-based access control (RBAC) for user and API permissions.</p>
</li>
</ul>
</li>
<li><p><strong>Monitoring and Alerts</strong>:</p>
<ul>
<li><p>Enable metrics collection with tools like Prometheus or Grafana.</p>
</li>
<li><p>Configure alerts for task failures or workflow bottlenecks.</p>
</li>
</ul>
</li>
</ol>
<hr />
<h4 id="heading-best-practices">Best Practices</h4>
<ol>
<li><p><strong>Design Idempotent Tasks</strong>: Ensure that tasks can be retried without adverse effects to handle failures gracefully.</p>
</li>
<li><p><strong>Use Sub-Workflows</strong>: Break complex workflows into smaller, reusable sub-workflows for better maintainability.</p>
</li>
<li><p><strong>Optimize Task Polling</strong>: Configure task polling intervals to balance latency and resource utilization.</p>
</li>
<li><p><strong>Test Workflows Thoroughly</strong>: Simulate edge cases and failure scenarios to validate workflow behavior.</p>
</li>
<li><p><strong>Leverage Versioning</strong>: Maintain multiple workflow versions to support backward compatibility during updates.</p>
</li>
</ol>
<hr />
<h4 id="heading-conclusion">Conclusion</h4>
<p>Netflix/Orkes Conductor is a powerful tool for orchestrating microservices workflows, offering unmatched flexibility and scalability. Whether you’re automating DevOps processes, managing media pipelines, or streamlining e-commerce operations, Conductor provides the tools you need to succeed. With its vibrant community and extensible design, it’s no wonder that Conductor has become a go-to solution for developers worldwide.</p>
]]></content:encoded></item></channel></rss>