<?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[Build. Break. Learn.]]></title><description><![CDATA[This publication is for developers who grow by building projects, breaking things, and learning from real-world experience.]]></description><link>https://blogs.kartikeynarayan.in</link><generator>RSS for Node</generator><lastBuildDate>Thu, 21 May 2026 09:35:05 GMT</lastBuildDate><atom:link href="https://blogs.kartikeynarayan.in/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[TCP vs UDP Explained: When to Use What and How HTTP Fits In]]></title><description><![CDATA[Think of a situation where two people are talking on the phone line. One person speaks, but the other does not reply. Some words get cut off, some sentences repeat, noise in between, and some never arrive at all. After sometime, the connection breaks...]]></description><link>https://blogs.kartikeynarayan.in/tcp-udp-explained-and-http-integration</link><guid isPermaLink="true">https://blogs.kartikeynarayan.in/tcp-udp-explained-and-http-integration</guid><category><![CDATA[TCP]]></category><category><![CDATA[UDP]]></category><category><![CDATA[http]]></category><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[Kartikey Narayan]]></dc:creator><pubDate>Sat, 24 Jan 2026 13:51:36 GMT</pubDate><content:encoded><![CDATA[<p>Think of a situation where two people are talking on the phone line. One person speaks, but the other does not reply. Some words get cut off, some sentences repeat, noise in between, and some never arrive at all. After sometime, the connection breaks down completely.</p>
<p>This is exactly what happens on the internet if the data is sent without rules or protocols.</p>
<p>Networks are not always reliable.<br />Sometimes networks are noisy.<br />Data packets can be lost, duplicated, or arrive out of order.</p>
<p>So now the big question is:</p>
<blockquote>
<p><strong><em>“</em></strong>How do computers communicate reliably over the network?<strong><em>”</em></strong></p>
</blockquote>
<p>This is where TCP and UDP come into the picture. They are designed to handle data transmission in different ways, depending on the situation and the level of reliability required.</p>
<h2 id="heading-two-protocols-two-different-goals"><strong>Two Protocols, Two Different Goals</strong></h2>
<p>Let’s look at two simple scenarios:</p>
<ol>
<li><p>A user wants to deliver a package to a friend, so he chooses a courier service. He hands over the parcel and receives a tracking number. The courier confirms when the package is picked up and when it is delivered. Everything is delivered in the correct order. If something is lost along the way, it is resent. The delivery might take a little longer, but it is guaranteed.</p>
<p> This is exactly how TCP works.</p>
</li>
<li><p>Imagine a live radio broadcast. The broadcaster sends the message only once. There is no confirmation that every listener received it. If something is missed or lost due to noise or interference, it is gone forever. Nothing is resent, and the broadcast keeps moving forward.</p>
<p> This is how UDP works.</p>
</li>
</ol>
<p>Both approaches solve communication problems but with different goals.<br />TCP focuses on reliability, ordering, loss detection, retransmission, and correctness, while UDP focuses on speed and real-time delivery.</p>
<p>So, a natural question arises:</p>
<blockquote>
<p><strong>“How do TCP and UDP actually send data differently under the hood?”</strong></p>
</blockquote>
<h2 id="heading-how-do-tcp-and-udp-actually-send-data-differently-under-the-hood">How do TCP and UDP actually send data differently under the hood?</h2>
<p>TCP: “Connection First, Data Later”</p>
<p>Before sending any data, TCP first establishes a connection using the 3-way handshake:</p>
<ol>
<li><p>SYN – “Am I audible?”</p>
</li>
<li><p>SYN-ACK – “Yes, I can hear you.”</p>
</li>
<li><p>ACK – “Let’s start.”</p>
</li>
</ol>
<p>Only after this handshake does, TCP begins, sending data and reliability by:</p>
<ul>
<li><p>Numbering each packets.</p>
</li>
<li><p>Sending data in ordered format.</p>
</li>
<li><p>Waits for acknowledgements.</p>
</li>
<li><p>Retransmits lost packets.</p>
</li>
<li><p>Controlling speed to avoid congestion.</p>
</li>
</ul>
<p>This makes TCP slow but more reliable.</p>
<p>UDP: “Send and Move on”</p>
<p>UDP is connectionless, there is no handshake, no setup, and no confirmation.</p>
<p>When application sends data using UDP:</p>
<ul>
<li><p>The data is sent immediately.</p>
</li>
<li><p>There is no check for the receiver status, is ready than send the data.</p>
</li>
<li><p>There are no acknowledgements.</p>
</li>
<li><p>Lost packets are not retransmitted.</p>
</li>
<li><p>Packets may arrive out of order.</p>
</li>
</ul>
<p>This makes UDP fast but less reliable.</p>
<p>But as developers, we should ask:</p>
<blockquote>
<p>“When should we use TCP, and when should we use UDP <strong>i</strong>n real applications?”</p>
</blockquote>
<p>Let’s find out.</p>
<h2 id="heading-when-should-we-use-tcp-and-when-should-we-use-udp-in-real-applications">When should we use TCP, and when should we use UDP <strong>i</strong>n real applications?</h2>
<p>Now that we understand how TCP and UDP work, the next question is when should we use each of them in real applications?</p>
<h3 id="heading-when-to-use-tcp">When to Use TCP?</h3>
<p>Use TCP when:</p>
<ul>
<li><p>Data must be delivered in the correct order.</p>
</li>
<li><p>Data <strong>must</strong> not be lost.</p>
</li>
<li><p>Acknowledgements are required after successful transmission.</p>
</li>
<li><p>Accuracy and reliability are critical.</p>
</li>
</ul>
<p>In these cases, TCP ensures reliable communication.</p>
<p>Real-world examples:</p>
<ul>
<li><p>Web browsing</p>
</li>
<li><p>Email</p>
</li>
<li><p>File downloads</p>
</li>
<li><p>APIs</p>
</li>
</ul>
<h3 id="heading-when-to-use-udp">When to Use UDP?</h3>
<p>Use UDP when:</p>
<ul>
<li><p>Speed matters more than accuracy.</p>
</li>
<li><p>Small data loss is acceptable.</p>
</li>
<li><p>Real-time delivery is more important than perfect reliability.</p>
</li>
</ul>
<p>In these cases, UDP sacrifices reliability for speed.</p>
<p>Real-world examples<strong>:</strong></p>
<ul>
<li><p>Video streaming</p>
</li>
<li><p>Online gaming</p>
</li>
<li><p>Live broadcasts</p>
</li>
<li><p>Voice and video calls</p>
</li>
</ul>
<p>Now, we are understood both the TCP and UDP, but another question comes to mind:</p>
<blockquote>
<p>“What is HTTP, why do we use it, and how is it related to TCP?”</p>
</blockquote>
<p>This is where the concept of <strong>HTTP</strong> comes into the picture.</p>
<h2 id="heading-tcp-and-http"><strong>TCP and HTTP?</strong></h2>
<p>We can think like:</p>
<p>TCP ensures data arrives correctly.<br />HTTP defines what that data represents.</p>
<p>Specifically, HTTP defines:</p>
<ul>
<li><p>How requests and responses are structured?</p>
</li>
<li><p>Methods like GET, POST, PUT, DELETE?</p>
</li>
<li><p>Status codes such as 200, 404, 500 and many more.</p>
</li>
</ul>
<p>HTTP does not send data by itself. It relies on lower-level transport protocols to move data across the network, this is where TCP comes in picture.</p>
<h3 id="heading-the-relationship-between-tcp-and-http">The Relationship Between TCP and HTTP</h3>
<p>HTTP runs on top of TCP.</p>
<p>A simple way to think about this:</p>
<ul>
<li><p>TCP = the delivery truck.</p>
</li>
<li><p>HTTP = the instructions inside the package.</p>
</li>
</ul>
<p>TCP makes sure the data arrives safely and in the correct order.</p>
<p>HTTP explains what that data represents and how it should be interpreted.</p>
<h3 id="heading-why-http-does-not-replace-tcp">Why HTTP Does Not Replace TCP?</h3>
<p>HTTP cannot replace TCP because it does not handle:</p>
<ul>
<li><p>Orderning of packets</p>
</li>
<li><p>Connection management</p>
</li>
<li><p>Reliable delivery</p>
</li>
<li><p>Retransmission</p>
</li>
<li><p>Acknowledgement</p>
</li>
</ul>
<p>Those responsibilities belong entirely to TCP.</p>
<p>HTTP and TCP are not competitors.<br />You can think like HTTP is a wrapper around TCP.<br />They are partners, each solving a different part of the communication.</p>
<h2 id="heading-big-picture">Big Picture</h2>
<p><strong>Each protocol has a clear responsibility, and none of them exist by accident.</strong></p>
<h3 id="heading-it-start-feeling-like-tools-for-communication-at-different-layers-of-the-network">It start feeling like tools for communication at different layers of the network.</h3>
]]></content:encoded></item><item><title><![CDATA[How DNS Resolution Works: From Domain Name to IP Address]]></title><description><![CDATA[Think about this for a moment.
You open a browser and visit a website like kartikeynarayan.in on your mobile phone, laptop, or any other device. The website loads instantly, without you needing to think about what happens behind the scenes.
But have ...]]></description><link>https://blogs.kartikeynarayan.in/how-dns-resolution-works</link><guid isPermaLink="true">https://blogs.kartikeynarayan.in/how-dns-resolution-works</guid><category><![CDATA[dns]]></category><category><![CDATA[dns resolver]]></category><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[Kartikey Narayan]]></dc:creator><pubDate>Sat, 24 Jan 2026 09:49:15 GMT</pubDate><content:encoded><![CDATA[<p>Think about this for a moment.</p>
<p>You open a browser and visit a website like kartikeynarayan.in on your mobile phone, laptop, or any other device. The website loads instantly, without you needing to think about what happens behind the scenes.</p>
<p>But have you ever wondered how your browser actually reaches the website you requested?</p>
<p>Computers or browsers do not understand the domain name. They communicate using <strong>IP addresses</strong>, which tell them exactly where to go.</p>
<p>So before the website loads, something very important happens in the background:</p>
<pre><code class="lang-plaintext">kartkeynarayan.in → convert it into → 192.1.2.1
</code></pre>
<p>So that process, which is running in background which convert the domain name to an IP address is called DNS resolution.</p>
<p>Now, let’s dive deeper into DNS resolution and understand how this process works under the hood.</p>
<h2 id="heading-internet-phone-book">Internet Phone Book</h2>
<p>To understand DNS resolution, we first need to clearly understand what DNS means?</p>
<p>As discussed earlier, DNS converts a domain name into an IP address so that the browser knows where to go and can load the website. Browsers and computers communicate using IP addresses, not domain names.</p>
<p>You can think of DNS as the internet’s phonebook.</p>
<p>Just like a phonebook contains names and their corresponding phone numbers, DNS contains domain names and their corresponding IP addresses in form of different DNS record types. These entries guide the browser by providing instructions on how to reach the final destination.</p>
<p>DNS exists because remembering IP addresses is not practical for humans. Instead of memorizing numbers like 192.1.2.1, we use easy-to-remember names like kartikeynarayan.in, and DNS handles the translation in the background.</p>
<p>But here the catch, even we are thinking that it is a simple task, converting a domain name to IP address, multiple systems and servers work together behind the scene.</p>
<p>So, a natural question arises:</p>
<blockquote>
<p><strong>“Who is Involved in DNS Resolution?”</strong></p>
</blockquote>
<h2 id="heading-who-is-involved-in-dns-resolution">Who is Involved in DNS Resolution?</h2>
<p>Before understanding DNS resolution, how the process works and how the conversion happens between the client and the server. We first need to identify the key players involved.</p>
<p>Think of it like a match. Every match has players, and each player has a specific role. If we know the players and their roles in advance, it becomes much easier to understand what happens during the game.</p>
<p>When you type a domain name into a browser, several components (players) work together to convert that domain name into an IP address. The browser then uses this IP address to reach its final destination.</p>
<p>The key players involved are:</p>
<ul>
<li><p><strong>Browser</strong> – Starts the request.</p>
</li>
<li><p><strong>Operating System (OS) Cache</strong> – Checks if the answer is already known.</p>
</li>
<li><p><strong>Recursive DNS Resolver</strong> – Finds the answer on behalf of the browser.</p>
</li>
<li><p><strong>Root DNS Server</strong> – Knows where top-level domains live.</p>
</li>
<li><p><strong>TLD DNS Server</strong> – Handles domains like .com, .in, .org, and many more.</p>
</li>
<li><p><strong>Authoritative DNS Server</strong> – Stores the final DNS records.</p>
</li>
</ul>
<p>This whole thing ensures that DNS queries are resolved efficiently and reliably.</p>
<p>Now, another natural question arises:</p>
<blockquote>
<p><strong>“How does this process actually work under the hood?”</strong></p>
</blockquote>
<h2 id="heading-how-does-this-process-actually-work-under-the-hood">How does this process actually work under the hood?</h2>
<p>Now we have reached where everything becomes interesting.</p>
<p>This is the moment when we finally see what actually happens behind the scenes when you visit a website like kartikeynarayan.in on our browsers.</p>
<p>Although the page loads in a second, several systems and components work together very quickly and very quietly.</p>
<p>Let’s walk through this journey step by step.</p>
<ul>
<li><p><strong>Browser Check:</strong></p>
<p>  When we type kartikeynarayan.in into the browser and press Enter, the browser doesn’t immediately ask the internet.</p>
<p>  First, it asks itself:</p>
<blockquote>
<p>“Do I already know the IP address for this domain?”</p>
</blockquote>
<p>  Browsers store recently resolved domain names in a DNS cache. If the browser finds the IP address here, the process stops immediately and the website loads faster. If not, the browser moves to the next level.</p>
</li>
<li><p><strong>OS Cache Check</strong></p>
<p>  When we are here, the browser asks the operating system:</p>
<blockquote>
<p>“Have you resolved this domain recently?”</p>
</blockquote>
<p>  The operating system also maintains its own DNS cache, shared by all applications on the system.</p>
<ul>
<li><p>If the OS finds the IP address, it returns it to the browser.</p>
</li>
<li><p>If not, the request moves forward to the next component or server or system.</p>
</li>
</ul>
</li>
</ul>
<p>    If there is still no answer?<br />    Then the real DNS journey begins from this point.</p>
<ul>
<li><p><strong>Recursive Resolver</strong></p>
<p>  Now the request is sent to a recursive DNS resolver.</p>
<p>  The browser’s message to the resolver is simple:</p>
<blockquote>
<p>“Please find the IP address for kartikeynarayan.in.”</p>
</blockquote>
<p>  From this point onward, the resolver takes full responsibility. The browser waits, and the resolver does all the hard work.</p>
</li>
<li><p><strong>Root DNS Server</strong></p>
<p>  The recursive resolver doesn’t know the answer yet, so it starts at the top of the DNS hierarchy which is the starting point of the internet.</p>
<p>  It asks a root DNS server:</p>
<blockquote>
<p>“Do you the IP address of kartikeynarayan.in?”</p>
</blockquote>
<p>  The root server doesn’t know the IP address of the website. Instead, it responds with a direction:</p>
<blockquote>
<p>“I don’t know the IP address, but I know who manages .in domains.”</p>
</blockquote>
<p>  It then points the resolver to the TLD DNS server.</p>
</li>
<li><p><strong>TLD DNS Server</strong></p>
<p>  Now, The resolver contacts the Top-Level Domain (TLD) DNS server for .in domain.</p>
<p>  The resolver asks:</p>
<blockquote>
<p>“Do you the IP address of kartikeynarayan.in?”</p>
</blockquote>
<p>  The TLD server replies:</p>
<blockquote>
<p>“I don’t know the IP address, but this is the authoritative DNS server for that domain.”</p>
</blockquote>
<p>  Now the resolver knows exactly where to go next.</p>
</li>
<li><p><strong>Authoritative DNS Server</strong></p>
<p>  The resolver now contacts the authoritative DNS <strong>server</strong> for kartikeynarayan.in. This server holds the actual DNS records.</p>
<p>  The resolver asks:</p>
<blockquote>
<p>“Do you the IP address of kartikeynarayan.in?”</p>
</blockquote>
<p>  The authoritative server responds with the final answer:</p>
<p>  Yes, I know the IP address of kartikeynarayan.in, here the details</p>
<ul>
<li><p>A <strong>record</strong> → IPv4 address</p>
</li>
<li><p>AAAA <strong>record</strong> → IPv6 address ( in case of IPv6 IP address )</p>
</li>
</ul>
</li>
</ul>
<p>    This is the source of truth.<br />    No more guessing.</p>
<ul>
<li><p><strong>Response to Browser</strong></p>
<p>  Now something important happens. The answer travels back the same path it came from:</p>
<ul>
<li><p>Authoritative server → Recursive resolver</p>
</li>
<li><p>Recursive resolver → OS</p>
</li>
<li><p>OS → Browser</p>
</li>
</ul>
</li>
</ul>
<p>    At each level, the IP address is cached for future use (based on TTL). This means the next request will be faster.</p>
<ul>
<li><p><strong>Browser Loads the Website</strong></p>
<p>  Finally, the browser has what it needs.</p>
<p>  It uses the IP address to:</p>
<ul>
<li><p>Connect to the web server.</p>
</li>
<li><p>Send an HTTP/HTTPS request.</p>
</li>
<li><p>Download HTML, CSS, JavaScript, images.</p>
</li>
</ul>
</li>
</ul>
<p>    And the website appears on your screen. All of this happens in milliseconds.</p>
<h2 id="heading-big-picture">Big Picture</h2>
<p>After understanding the data flow from the starting point to the final destination and back again, the bigger picture becomes clear.</p>
<p>DNS works smoothly because:</p>
<ul>
<li><p>Caching reduces repeated work.</p>
</li>
<li><p>Responsibility is clearly divided between servers.</p>
</li>
<li><p>The system is hierarchical and scalable, allowing it to grow as needed.</p>
</li>
<li><p>Recursive resolvers do the heavy lifting on behalf of the browser.</p>
</li>
</ul>
<p>It looks like magic is actually a well-designed, recursive lookup system working quietly in the background.</p>
<p>Now it becomes clear and understandable that when you type a domain name into your browser, DNS doesn’t guess. It asks the right questions, in the right order, until it reaches the source of truth then delivers the answer back to you.</p>
<h3 id="heading-and-thats-how-a-simple-name-like-kartikeynarayanin-turns-into-a-real-website-on-our-screen">And that’s how a simple name like kartikeynarayan.in turns into a real website on our screen.</h3>
]]></content:encoded></item><item><title><![CDATA[DNS Record Types Explained: A Simple Guide for Beginners]]></title><description><![CDATA[You type a website address into your browser and press Enter. Within seconds, the page loads, no questions asked.
At that moment, a natural question arises in the mind of the end user:

“How does a browser know where a website lives?”

More questions...]]></description><link>https://blogs.kartikeynarayan.in/dns-record-types-explained</link><guid isPermaLink="true">https://blogs.kartikeynarayan.in/dns-record-types-explained</guid><category><![CDATA[dns]]></category><category><![CDATA[dns-records]]></category><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[Kartikey Narayan]]></dc:creator><pubDate>Sat, 24 Jan 2026 04:06:48 GMT</pubDate><content:encoded><![CDATA[<p>You type a website address into your browser and press Enter. Within seconds, the page loads, no questions asked.</p>
<p>At that moment, a natural question arises in the mind of the end user:</p>
<blockquote>
<p>“How does a browser know where a website lives?”</p>
</blockquote>
<p>More questions quickly follow.</p>
<blockquote>
<p>“How does kartikeynarayan.in turn into a real website on a real server?”<br />“How does an email sent to contact@kartikeynarayan.in reach the correct inbox?”<br />“Why does blog.kartikeynarayan.in behave differently from the main website?”</p>
</blockquote>
<p>All these questions point to concepts that work quietly in the background. Although everything looks simple on the surface, a lot is happening under the hood. The browser needs a clear set of instructions to find the correct destination.</p>
<p>That entire system of instructions is called DNS (Domain Name System). But in this blog our main focus on DNS record types, a critical concept that helps requests reach the right place, whether it’s opening a website, sending an email, or performing any other action on the internet.</p>
<h2 id="heading-instructions-for-the-internet">Instructions for the Internet</h2>
<p>We can think of DNS as the internet’s phonebook, much like the phonebook we have at home. But there’s a catch. If a phone book has no entries, what’s the point of having it at all? That question makes sense and the same logic applies to DNS.</p>
<p>DNS is useful only because it contains entries, and those entries tell the internet what to do. These entries are known as DNS record types. They act as instructions that guide the internet based on the kind of request being made.</p>
<p>Each record type answers a specific question, such as:</p>
<blockquote>
<p><strong>“Who manages this domain?”</strong><br />“<strong>What is the IP address of kartikeynarayan.in?”</strong><br />“<strong>Where should emails for this domain be delivered?”</strong></p>
</blockquote>
<p>This is one of the most fundamental and important concepts of DNS. You can think of it as the starting point of the race without it, nothing on the internet knows where to go.</p>
<p>Now, a natural question arises:</p>
<blockquote>
<p>“<strong>How do we set up DNS records?”</strong></p>
</blockquote>
<h2 id="heading-adding-entries-to-the-internets-phonebook"><strong>Adding Entries to the Internet’s Phonebook</strong></h2>
<p>When you buy a domain name like kartikeynarayan.in from GoDaddy, Hostinger, or any other platform, it doesn’t automatically know where your website or emails should go. At first, it’s like an empty phonebook with a name, but no entries. (In some cases, basic default records are set that point back to the provider’s own DNS.)</p>
<p>To make the domain useful, we need to add entries to it. This process is called setting up DNS records. DNS records live on DNS servers and act as instructions for the internet, telling it where to send website requests, emails, and other services.</p>
<p>By configuring the right DNS records, we teach the internet how to handle different types of requests for our domain whether someone is visiting a website, sending an email, or accessing another service.</p>
<p>At this point, a natural question comes to mind:</p>
<blockquote>
<p><strong>“How does this flow work when entries are added to the internet’s phonebook?”</strong></p>
</blockquote>
<h2 id="heading-how-dns-finds-the-right-place"><strong>How DNS Finds the Right Place?</strong></h2>
<p>Now the story reaches a very interesting point, this is where the real work happens behind the scenes.</p>
<p>To understand how DNS finds the right place, we first need to know about the key entries in the internet’s phonebook. These entries are called DNS record types, and they act as instructions that guide requests across the internet.</p>
<p>The most important DNS records are:</p>
<ul>
<li><p>NS</p>
</li>
<li><p>A</p>
</li>
<li><p>AAAA</p>
</li>
<li><p>CNAME</p>
</li>
<li><p>MX</p>
</li>
<li><p>TXT</p>
</li>
</ul>
<p>Each of these records plays a specific role.</p>
<p>A natural question follows:</p>
<blockquote>
<p><strong>“How do these records work together to help DNS resolve requests accurately?”</strong></p>
</blockquote>
<h2 id="heading-how-dns-records-work-together"><strong>How DNS Records Work Together?</strong></h2>
<p>DNS does not rely on a single record to solve everything. Instead, it works like a team, where each DNS record has a specific responsibility. When these records work together, the internet is able to route requests accurately and efficiently.</p>
<p>Let’s understand this with a simple flow.</p>
<ul>
<li><p>When you type a domain name like kartikeynarayan.in into your browser, the internet doesn’t immediately look for the website’s IP address. First, it needs to know who is responsible for managing that domain.</p>
</li>
<li><p>That responsibility is defined by the NS (Name Server) records. NS records tell the internet which DNS servers are authoritative for the domain and where the correct information can be found.</p>
</li>
<li><p>Once the correct DNS server is reached, the browser looks for the A or AAAA records. These records provide the actual IP address of the server where the website is hosted, IPv4 for A records and IPv6 for AAAA records.</p>
</li>
<li><p>Sometimes, a domain doesn’t point directly to an IP address. Instead, it points to another domain name. This is handled by CNAME records, which act like aliases or nicknames. They redirect the request to another domain, which eventually resolves to an A or AAAA record.</p>
</li>
<li><p>Email delivery works in a similar coordinated way. When an email is sent to an address like contact@kartikeynarayan.in, the sending mail server looks for MX (Mail Exchange) records. These records specify which mail servers should receive emails for the domain.</p>
</li>
<li><p>Finally, TXT records support the entire system by providing additional information. Most commonly for verification, security, and domain ownership. Technologies like SPF, DKIM, and domain verification rely heavily on TXT records.</p>
</li>
</ul>
<p>Together, these records form a complete instruction set. Each one answers a different question, and only when all of them work together does DNS function smoothly.</p>
<p>It is a well-organized system of responsibilities, decisions, and clear instructions working behind the scenes.</p>
<h2 id="heading-big-picture">Big Picture</h2>
<p>After understanding all the individual DNS records, the bigger picture becomes clear.</p>
<p>DNS records are simply instructions for the internet. They tell it how to find the right place for a request whether that request is coming from a browser, an email server, or another service.</p>
<p>Each record solves a specific problem so there is no confusion:</p>
<ul>
<li><p>NS records define who is responsible for a domain?</p>
</li>
<li><p>A and AAAA records tell browsers where a website lives.</p>
</li>
<li><p>CNAME records act like nicknames.</p>
</li>
<li><p>MX records decide where emails should be delivered.</p>
</li>
<li><p>TXT records are commonly used for verification and domain ownership checks.</p>
</li>
</ul>
<p>Because every record has a clear responsibility, DNS can resolve requests accurately and efficiently.</p>
<p>Once DNS records start making sense:</p>
<blockquote>
<p>“Domains stop feeling magical, they become understandable systems.”</p>
</blockquote>
<h3 id="heading-and-thats-the-moment-when-dns-truly-clicks">And that’s the moment when DNS truly clicks.</h3>
]]></content:encoded></item><item><title><![CDATA[From "Am I Audible?" to "Bye": How TCP Communicates Reliably]]></title><description><![CDATA[Think of a situation where two people are talking on the phone line. One person speaks, but the other does not reply. Some words get cut off, some sentences repeat, noise in between, and some never arrive at all. After sometime, the connection breaks...]]></description><link>https://blogs.kartikeynarayan.in/from-am-i-audible-to-bye</link><guid isPermaLink="true">https://blogs.kartikeynarayan.in/from-am-i-audible-to-bye</guid><category><![CDATA[internet]]></category><category><![CDATA[TCP]]></category><category><![CDATA[3-way handshake]]></category><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[Kartikey Narayan]]></dc:creator><pubDate>Wed, 21 Jan 2026 09:48:53 GMT</pubDate><content:encoded><![CDATA[<p>Think of a situation where two people are talking on the phone line. One person speaks, but the other does not reply. Some words get cut off, some sentences repeat, noise in between, and some never arrive at all. After sometime, the connection breaks down completely.</p>
<p>This is exactly what happens on the internet if the data is sent without rules or protocols.</p>
<p>Networks are not always reliable.<br />Sometimes networks are noisy.<br />Data packets can be lost, duplicated, or arrive out of order.</p>
<p>So now the big question is:</p>
<blockquote>
<p>“How do computers communicate reliably over the network?”</p>
</blockquote>
<p>This is where the concept of TCP comes in.</p>
<h2 id="heading-tcp-reliable-communication-with-discipline"><strong>TCP : Reliable Communication with Discipline</strong></h2>
<p>Now the real hero comes into the picture:</p>
<p>TCP (Transmission Control Protocol) brings order, reliability, loss detection, retransmission, flow control, and congestion control, making reliable communication possible over an unreliable network.</p>
<p>We can think of TCP as a well-structured conversation, instead of random shouting.</p>
<p>But as developers, we should ask:</p>
<blockquote>
<p><strong>“Why is TCP needed at all?”</strong></p>
</blockquote>
<p>Let’s find out.</p>
<h2 id="heading-why-is-tcp-needed-at-all">Why is TCP needed at all ?</h2>
<p>First, we need to understand how the Internet moves data.</p>
<p>It sends data as small chunks called packets. These packets may take different paths, travel at different speeds, and there is a high <strong>chance</strong> they can be dropped along the way.</p>
<p>Now here’s the key idea to understand:</p>
<p>TCP does not control the network itself**,** controls the conversation between two computers**.**</p>
<p>Before sending real data, TCP first asks:</p>
<blockquote>
<p>“Are you ready?”<br />“Can you hear me?”<br />“Am I audible?”</p>
</blockquote>
<p>This brings us to the TCP 3-Way Handshake, an important concept in TCP communication.</p>
<h2 id="heading-how-does-the-3-way-handshake-work"><em>How Does the 3-Way Handshake Work?</em></h2>
<p>The term “3-Way Handshake” itself is fundamental to TCP.</p>
<p>It may sound simple, but it plays a critical role in TCP communication. Before a client and a server send any data to each other, TCP first makes sure that both computers are ready to communicate. TCP does not control the network, instead, it controls the conversation between the client and the server. Because the Internet is unreliable, both sides need to confirm that they can reach each other, understand each other, and stay in sync.</p>
<p>This preparation step is called the TCP 3-Way Handshake. It ensures that both computers agree to communicate before the actual data transfer begins.</p>
<h3 id="heading-understanding-the-3-way-handshake-with-a-simple-analogy"><strong>Understanding the 3-Way Handshake with a Simple Analogy</strong></h3>
<p>Think of it like this:</p>
<blockquote>
<p><strong>Client:</strong> “Am I audible?”<br /><strong>Server:</strong> “Yes, I can hear you.”<br /><strong>Client:</strong> “Great, let’s start.”</p>
</blockquote>
<p>Only after this confirmation does real data begin to flow.<br />Now, let’s deep dive into this flow and understand how it works under the hood.</p>
<h3 id="heading-step-1-syn-am-i-audible"><strong>Step 1: SYN - “Am I Audible?”</strong></h3>
<p>The client sends a SYN message.</p>
<p><strong>Meaning:</strong></p>
<ul>
<li><p>“I want to connect with you.”</p>
</li>
<li><p>“Here is my starting point, Let’s connect.”</p>
</li>
</ul>
<p>At this stage, no actual data is sent, only the intent to communicate.</p>
<h3 id="heading-step-2-syn-ack-yes-i-hear-you"><strong>Step 2: SYN-ACK - “Yes, I Hear You.”</strong></h3>
<p>The server replies with a SYN + ACK message.</p>
<p><strong>Meaning:</strong></p>
<ul>
<li><p>“I received your message.”</p>
</li>
<li><p>“Here is my starting point.”</p>
</li>
<li><p>“I acknowledge yours.”</p>
</li>
</ul>
<p>At this point, both sides are aware of each other.</p>
<h3 id="heading-step-3-ack-lets-begin"><strong>Step 3: ACK - “Let’s Begin”</strong></h3>
<p>The client sends an ACK message.</p>
<p><strong>Meaning:</strong></p>
<ul>
<li><p>“I acknowledge your response.”</p>
</li>
<li><p>“We are now synchronized.”</p>
</li>
</ul>
<p>Now, the connection is established between the client and the server, and both sides are ready. Actual data can now flow reliably between them.</p>
<p>Now data is broken into small chunks called segments. Each segment is assigned a sequence number, and the receiver sends acknowledgements (ACKs) for the data it receives. The sender keeps track of what has been sent and what has been acknowledged.</p>
<p>Because of this, TCP always knows:</p>
<ul>
<li><p>What data it has sent?</p>
</li>
<li><p>What data has been acknowledged?</p>
</li>
<li><p>What data needs to be retransmitted?</p>
</li>
</ul>
<p>This tracking mechanism is one of the core properties of TCP, and it is what makes reliable data transfer possible.</p>
<h2 id="heading-does-tcp-mean-reliability">Does TCP mean “Reliability”?</h2>
<p>TCP is associated with reliability, but TCP does not mean reliability by itself. Instead, TCP provides reliability on top of an unreliable Internet. The Internet can lose packets, deliver them out of order, or deliver them multiple times.</p>
<p>TCP handles these problems by using:</p>
<ul>
<li><p>Sequence numbers → to keep data in order.</p>
</li>
<li><p>Acknowledgements (ACKs) → to confirm delivery.</p>
</li>
<li><p>Retransmission → to resend lost data.</p>
</li>
<li><p>Flow control → to avoid overwhelming the receiver.</p>
</li>
<li><p>Congestion <strong>control</strong> → to protect the network.</p>
</li>
</ul>
<p>Because of these mechanisms, TCP can guarantee that data is delivered:</p>
<ul>
<li><p>Reliably</p>
</li>
<li><p>In order</p>
</li>
<li><p>Without duplication</p>
</li>
</ul>
<p>So, TCP doesn’t just start and end communication politely. it manages the entire lifecycle, from “Am I audible?” to “Bye.”</p>
<p>That is why TCP is considered the reliability layer of the Internet.</p>
<h2 id="heading-what-is-bye-in-terms-of-tcp"><strong>What Is “Bye” in Terms of TCP?</strong></h2>
<p>People often think that only the start of communication needs rules, but that is only half correct.</p>
<p>For effective communication, both the beginning and the ending need rules. After the data has been transferred and received successfully, the connection should close properly.</p>
<p>TCP closes connections politely and safely using:</p>
<ul>
<li><p>FIN → “I’m done sending data.”</p>
</li>
<li><p>ACK → “I acknowledge that.”</p>
</li>
</ul>
<p>Both sides agree before disconnecting, which ensures:</p>
<ul>
<li><p>No sudden cuts.</p>
</li>
<li><p>No half-sent data.</p>
</li>
</ul>
<h2 id="heading-the-full-tcp-lifecycle"><strong>The Full TCP Lifecycle</strong></h2>
<ol>
<li><p>Establish → 3-Way Handshake.</p>
</li>
<li><p>Transfer → Reliable, ordered, and error-free data flow.</p>
</li>
<li><p>Close → FIN and ACK exchange.</p>
</li>
</ol>
<p>From:</p>
<blockquote>
<p><strong>“Am I audible ?”</strong></p>
</blockquote>
<p>to</p>
<blockquote>
<p><strong>“Bye.”</strong></p>
</blockquote>
<h3 id="heading-from-the-first-am-i-audible-to-the-final-bye-tcp-manages-the-entire-journey-of-communication"><strong>From the first “Am I Audible?” to the final “Bye”,</strong> TCP manages the entire journey of communication.</h3>
]]></content:encoded></item><item><title><![CDATA[The Pendrive Problem]]></title><description><![CDATA[Before Kartikey understood Git, repositories and commits, there was a time when developers shared code in much simpler ways.
This chapter goes back to that time to understand why version control wasn’t a luxury, but a necessity.

“This is the story o...]]></description><link>https://blogs.kartikeynarayan.in/the-pendrive-problem</link><guid isPermaLink="true">https://blogs.kartikeynarayan.in/the-pendrive-problem</guid><category><![CDATA[Git]]></category><category><![CDATA[version control]]></category><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[Kartikey Narayan]]></dc:creator><pubDate>Mon, 12 Jan 2026 10:08:08 GMT</pubDate><content:encoded><![CDATA[<p>Before Kartikey understood Git, repositories and commits, there was a time when developers shared code in much simpler ways.</p>
<p>This chapter goes back to that time to understand why version control wasn’t a luxury, but a necessity.</p>
<blockquote>
<p>“This is the story of the Pendrive Problem.”</p>
</blockquote>
<h2 id="heading-before-git-before-safety"><strong>Before Git, Before Safety</strong></h2>
<p>Kartikey still remembers his college days.</p>
<p>No Git.<br />No GitHub.<br />No version control.</p>
<p>Just folders and a pendrive.  </p>
<p>He had a project directory that looked like this:</p>
<pre><code class="lang-bash">to-do-app/
├── final/
├── final_v2/
├── final_v3/
├── final_latest_v1/
├── final_latest_v2/
</code></pre>
<p>Each folder meant only one thing:</p>
<blockquote>
<p>“Please don’t touch or open the wrong one.”</p>
</blockquote>
<h2 id="heading-the-pendrive-workflow"><strong>The Pendrive Workflow</strong></h2>
<p>When Kartikey worked with friends, the workflow was simple.</p>
<p>Painfully simple.</p>
<ul>
<li><p>One pendrive.</p>
</li>
<li><p>One person edits the code.</p>
</li>
<li><p>The pendrive passes to the next person.</p>
</li>
</ul>
<p>Sometimes, email replaced the pendrive:</p>
<blockquote>
<p>“Here’s the updated zip file.”<br />“No wait, use the newer one.”<br />“Ignore the last email.”</p>
</blockquote>
<p>At that time, Kartikey didn’t think much of it, until things started breaking.</p>
<h2 id="heading-when-code-starts-disappearing"><strong>When Code Starts Disappearing?</strong></h2>
<p>One day, Kartikey updates a file.<br />Later, his friend copies an older version from the pendrive.<br />Kartikey opens the project again.</p>
<p>His changes are gone.</p>
<blockquote>
<p>“No warning.”<br />“No history.”<br />“No explanation.”</p>
</blockquote>
<p>Just… gone.</p>
<p>He asks:</p>
<blockquote>
<p>“Who changed this file?”</p>
</blockquote>
<p>No one knows.</p>
<h2 id="heading-the-real-problems-appear"><strong>The Real Problems Appear</strong></h2>
<p>Slowly, the real issues become impossible to ignore.</p>
<h3 id="heading-overwriting-code"><strong>❌ Overwriting Code</strong></h3>
<p>Someone saves their version.<br />someone else’s work disappears.</p>
<h3 id="heading-no-history"><strong>❌ No History</strong></h3>
<p>There’s no way to know:</p>
<ul>
<li><p>What changed?</p>
</li>
<li><p>Who changed it?</p>
</li>
<li><p>Why it changed?</p>
</li>
</ul>
<h3 id="heading-no-collaboration"><strong>❌ No Collaboration</strong></h3>
<ul>
<li><p>Only one person can safely work at a time.</p>
</li>
<li><p>Everyone else waits.</p>
</li>
</ul>
<h3 id="heading-no-going-back"><strong>❌ No Going Back</strong></h3>
<p>If something breaks:</p>
<blockquote>
<p>“Hope someone still has the old file.”</p>
</blockquote>
<p>Kartikey realizes something important:</p>
<ul>
<li><p>The problem isn’t bad developers.</p>
</li>
<li><p>The problem is bad process.</p>
</li>
</ul>
<h2 id="heading-the-folder-timeline-disaster"><strong>The Folder Timeline Disaster</strong></h2>
<p>Kartikey looks at the folder names again.<br />Each folder is supposed to represent time.</p>
<p>But time is broken.<br />There’s no clear timeline.  </p>
<p>No reliable past.<br />No safe present.</p>
<p>Just guesses disguised as backups.</p>
<h2 id="heading-teams-make-it-worse"><strong>Teams Make It Worse</strong></h2>
<p>As the team grows, the problem multiplies.</p>
<p>Two people edit the same file.<br />Three people send updates.<br />One person forgets to copy the latest version.</p>
<p>Now the project has multiple realities.</p>
<p>Kartikey notices something clearly:<br />the pendrive workflow doesn’t scale at all.</p>
<h2 id="heading-the-question-that-changed-everything"><strong>The Question That Changed Everything</strong></h2>
<p>Kartikey asks a simple question:</p>
<blockquote>
<p>“Why doesn’t code remember its own history by default?”</p>
</blockquote>
<p>Why can’t code:</p>
<ul>
<li><p>Track changes?</p>
</li>
<li><p>Know who changed what?</p>
</li>
<li><p>Allow multiple people to work safely?</p>
</li>
</ul>
<p>Why does collaboration feel so fragile?<br />That’s when Git quietly enters the conversation.</p>
<h2 id="heading-why-version-control-was-born"><strong>Why Version Control Was Born?</strong></h2>
<p>Git explains calmly:</p>
<blockquote>
<p>“Pendrives move files.”<br />“Emails move files.”<br />“Folders copy files.”<br />“But none of them understand <strong>history</strong>.”</p>
</blockquote>
<p>Version control was created to solve exactly this:</p>
<ul>
<li><p>Preserve every version.</p>
</li>
<li><p>Track every change.</p>
</li>
<li><p>Allow safe collaboration.</p>
</li>
<li><p>Make mistakes reversible.</p>
</li>
</ul>
<p>Git isn’t about commands.<br />It is about memory and trust.</p>
<h2 id="heading-pendrive-vs-version-control"><strong>Pendrive vs Version Control</strong></h2>
<p>Git shows Kartikey the difference.</p>
<h3 id="heading-pendrive-world"><strong>Pendrive World</strong></h3>
<ul>
<li><p>One person at a time.</p>
</li>
<li><p>No history.</p>
</li>
<li><p>Easy to lose work.</p>
</li>
<li><p>Hard to collaborate.</p>
</li>
</ul>
<h3 id="heading-version-control-world"><strong>Version Control World</strong></h3>
<ul>
<li><p>Everyone works together.</p>
</li>
<li><p>Full history.</p>
</li>
<li><p>No lost changes.</p>
</li>
<li><p>Clear ownership.</p>
</li>
</ul>
<h2 id="heading-why-git-became-mandatory"><strong>Why Git Became Mandatory?</strong></h2>
<p>Modern software is:</p>
<ul>
<li><p>Large</p>
</li>
<li><p>Collaborative</p>
</li>
<li><p>Long-running</p>
</li>
</ul>
<p>Pendrives and emails were never built for this.</p>
<p>Version control didn’t become popular because it was trendy.<br />It became mandatory because everything else failed.</p>
<p>Kartikey smiles because now he understands:</p>
<blockquote>
<p>“Git didn’t replace pendrives.”<br />“I<strong>t replaced uncertainty.”</strong></p>
</blockquote>
<p>If you’ve ever lost code, overwritten someone else’s work, or wondered:</p>
<blockquote>
<p><em>“Where did my changes go?”</em></p>
</blockquote>
<p>Version control exists so you never have to feel that again.</p>
<h3 id="heading-kartikeys-journey-continues-and-this-time-the-past-is-finally-safe">Kartikey’s journey continues and this time, the past is finally safe.</h3>
]]></content:encoded></item><item><title><![CDATA[Inside Git: The Hidden Engine]]></title><description><![CDATA[This chapter is not about learning new Git commands.It’s about answering the question every curious developer eventually asks:

“What is Git actually doing behind the scenes?”

This is the story of Kartikey going one level deeper inside Git itself.

...]]></description><link>https://blogs.kartikeynarayan.in/the-hidden-engine</link><guid isPermaLink="true">https://blogs.kartikeynarayan.in/the-hidden-engine</guid><category><![CDATA[Git]]></category><category><![CDATA[version control]]></category><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[Kartikey Narayan]]></dc:creator><pubDate>Thu, 08 Jan 2026 08:11:49 GMT</pubDate><content:encoded><![CDATA[<p>This chapter is not about learning new Git commands.<br />It’s about answering the question every curious developer eventually asks:</p>
<blockquote>
<p><strong>“What is Git actually doing behind the scenes?”</strong></p>
</blockquote>
<p>This is the story of Kartikey going one level deeper inside Git itself.</p>
<blockquote>
<p><strong><em>“This is where Kartikey’s journey begins.”</em></strong></p>
</blockquote>
<h2 id="heading-the-hidden-door"><strong>The Hidden Door</strong></h2>
<p>Kartikey has been using Git for a while now.</p>
<p>He can commit.<br />He can create branches.<br />He feels comfortable.</p>
<p>Then one day, while exploring his project folder, he notices something unusual.</p>
<p>A hidden directory.</p>
<pre><code class="lang-bash">.git
</code></pre>
<p>Kartikey pauses.</p>
<blockquote>
<p>“What is this folder… and why does it exist?”</p>
</blockquote>
<p>Git doesn’t answer immediately.</p>
<h2 id="heading-the-git-folder-revealed"><strong>The  .git Folder Revealed</strong></h2>
<p>Finally, Git speaks.</p>
<blockquote>
<p>“Everything you trust me for lives here.”</p>
</blockquote>
<p>Kartikey opens the .git folder.</p>
<p>It’s not code.<br />It’s not configuration alone.  </p>
<p>It’s Git’s entire memory.</p>
<p>Git explains:</p>
<ul>
<li><p>This folder stores history.</p>
</li>
<li><p>This folder stores snapshots.</p>
</li>
<li><p>This folder stores relationships.</p>
</li>
<li><p>This folder stores integrity.</p>
</li>
</ul>
<p>Then Git adds quietly:</p>
<blockquote>
<p>“Delete this folder and I forget everything.”</p>
</blockquote>
<p>Kartikey understands.  </p>
<p>The .git folder isn’t optional.<br />It is Git.</p>
<h2 id="heading-git-doesnt-track-files"><strong>Git Doesn’t Track Files</strong></h2>
<p>Kartikey assumes Git tracks files line by line.</p>
<p>Git corrects him.</p>
<blockquote>
<p>“I don’t track files.”<br />“I track <strong>content</strong>.”</p>
</blockquote>
<p>Whenever Kartikey writes code, Git doesn’t care about:</p>
<ul>
<li><p>File names</p>
</li>
<li><p>Folder names</p>
</li>
</ul>
<p>Git only cares about:</p>
<ul>
<li><p>What the content is?</p>
</li>
<li><p>Whether it has changed?</p>
</li>
</ul>
<p>That’s when Git introduces its core building blocks.</p>
<h2 id="heading-the-three-objects-of-git"><strong>The Three Objects of Git</strong></h2>
<p>Git draws three symbols in the air:</p>
<ul>
<li><p>Blob</p>
</li>
<li><p>Tree</p>
</li>
<li><p>Commit</p>
</li>
</ul>
<blockquote>
<p>“Everything I store is one of these.”</p>
</blockquote>
<h3 id="heading-blob-the-content"><strong>Blob - The Content</strong></h3>
<p>A blob is just raw content.</p>
<ul>
<li><p>No filename</p>
</li>
<li><p>No folder</p>
</li>
<li><p>Just data</p>
</li>
</ul>
<p>If two files have the same content, Git stores only one blob.</p>
<p>Git says calmly:</p>
<blockquote>
<p>“I don’t duplicate memory” .</p>
</blockquote>
<h3 id="heading-tree-the-structure"><strong>Tree - The Structure</strong></h3>
<p>A tree represents:</p>
<ul>
<li><p>Folder structure</p>
</li>
<li><p>File names</p>
</li>
<li><p>How blobs are arranged.</p>
</li>
</ul>
<p>Think of a tree as a map, not the content itself.</p>
<h3 id="heading-commit-the-snapshot"><strong>Commit - The Snapshot</strong></h3>
<p>A commit ties everything together.</p>
<p>It points to:</p>
<ul>
<li><p>One tree (structure)</p>
</li>
<li><p>Previous commit(s)</p>
</li>
<li><p>Metadata (author, message, time)</p>
</li>
</ul>
<p>Git explains:</p>
<blockquote>
<p>“A commit is not a change.”<br />“It’s a snapshot.”</p>
</blockquote>
<p>Kartikey starts seeing Git differently.</p>
<h2 id="heading-what-really-happens-during-git-add"><strong>What Really Happens During “git add”?</strong></h2>
<p>Kartikey types:</p>
<pre><code class="lang-bash">git add index.js
</code></pre>
<p>Nothing seems to change.  </p>
<p>But inside Git, everything changes.</p>
<p>Git explains:</p>
<ol>
<li><p>Git reads the file content.</p>
</li>
<li><p>Git creates a blob.</p>
</li>
<li><p>Git calculates a hash.</p>
</li>
<li><p>Git stores it inside .git/objects.</p>
</li>
<li><p>Git updates the index (staging area).</p>
</li>
</ol>
<p>Git adds:</p>
<blockquote>
<p>“The staging area is a list of hashes, I’m preparing to remember.”</p>
</blockquote>
<p>Kartikey realizes something important:<br />git add doesn’t save history, It prepares reality.</p>
<h2 id="heading-what-really-happens-during-git-commit"><strong>What Really Happens During “git commit”?</strong></h2>
<p>Now Kartikey commits:</p>
<pre><code class="lang-bash">git commit -m <span class="hljs-string">"Save progress of index.js file."</span>
</code></pre>
<p>Git goes to work.</p>
<p>Internally:</p>
<ol>
<li><p>Git creates a tree from staged blobs.</p>
</li>
<li><p>Git creates a commit object.</p>
</li>
<li><p>Git links it to the previous commit.</p>
</li>
<li><p>Git moves HEAD forward.</p>
</li>
</ol>
<p>Git says:</p>
<blockquote>
<p>“This is when time moves forward.”</p>
</blockquote>
<p>Kartikey understands:  </p>
<p>Commits don’t store differences.<br />They store complete snapshots, efficiently.</p>
<h2 id="heading-the-power-of-hashes"><strong>The Power of Hashes</strong></h2>
<p>Kartikey notices strange strings everywhere.</p>
<p>Long.<br />Random.<br />Unreadable.</p>
<p>Git explains:</p>
<blockquote>
<p>“Those are hashes.”</p>
</blockquote>
<p>Every blob, tree, and commit is identified by a cryptographic hash (SHA-1 or SHA-256).</p>
<p>This means:</p>
<ul>
<li><p>Change the content → the hash changes.</p>
</li>
<li><p>Corrupt the data → the hash does not match.</p>
</li>
<li><p>History cannot be secretly altered.</p>
</li>
</ul>
<p>Git says calmly:</p>
<blockquote>
<p>“My memory is tamper-proof.”</p>
</blockquote>
<p>Kartikey finally understands why Git feels so reliable.</p>
<h2 id="heading-the-mental-model-clicks"><strong>The Mental Model Clicks</strong></h2>
<p>Git summarizes:</p>
<ul>
<li><p>Files → Blobs</p>
</li>
<li><p>Folders → Trees</p>
</li>
<li><p>Snapshots → Commits</p>
</li>
<li><p>Hashes → Identity</p>
</li>
<li><p>.git folder → Memory</p>
</li>
</ul>
<p>Git tells Kartikey:</p>
<blockquote>
<p>“Don’t memorize commands.”<br />“Understand how I think.”</p>
</blockquote>
<p>That’s when it clicks.</p>
<h2 id="heading-seeing-git-clearly"><strong>Seeing Git Clearly</strong></h2>
<p>Kartikey looks at Git differently now.</p>
<p>Not as magic.<br />Not as commands.<br />But as a content-addressed memory system.</p>
<p>He smiles.</p>
<p>Because now:</p>
<ul>
<li><p>Git feels predictable.</p>
</li>
<li><p>Git feels safe.</p>
</li>
<li><p>Git feels logical.</p>
</li>
</ul>
<p>And once again, Kartikey realizes:</p>
<blockquote>
<p>“Git doesn’t just help him write code.”<br />“It helps him trust his progress.”</p>
</blockquote>
<p>If Git has ever felt mysterious, you’re not alone.<br />Understanding Git internally doesn’t make you a power user, it makes you a calm developer.</p>
<h3 id="heading-and-this-is-only-the-beginning-of-kartikeys-journey">And this is only the beginning of Kartikey’s journey.</h3>
]]></content:encoded></item><item><title><![CDATA[Git: A Time Travel Story]]></title><description><![CDATA[This is not a traditional Git tutorial.
This story follows a developer named Kartikey, at the exact moment every beginner reaches when code breaks, panic sets in, and progress feels fragile.
Instead of explaining Git as a list of commands, the story ...]]></description><link>https://blogs.kartikeynarayan.in/a-time-travel-story</link><guid isPermaLink="true">https://blogs.kartikeynarayan.in/a-time-travel-story</guid><category><![CDATA[Git]]></category><category><![CDATA[version control]]></category><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[Kartikey Narayan]]></dc:creator><pubDate>Tue, 06 Jan 2026 10:47:31 GMT</pubDate><content:encoded><![CDATA[<p>This is not a traditional Git tutorial.</p>
<p>This story follows a developer named Kartikey, at the exact moment every beginner reaches when code breaks, panic sets in, and progress feels fragile.</p>
<p>Instead of explaining Git as a list of commands, the story presents it as something else entirely:<br />A quiet power that protects your work, remembers your journey, and makes mistakes safe.</p>
<p>It’s about realizing that you don’t need to avoid errors to grow.<br />You just need a way to protect your progress while you make them.</p>
<p>By the end, Git stops feeling confusing and starts feeling like something you can trust.</p>
<blockquote>
<p><strong>“This is where Kartikey’s journey begins.”</strong></p>
</blockquote>
<h2 id="heading-the-confident-beginning"><strong>The Confident Beginning</strong></h2>
<p>It’s late evening.</p>
<p>Kartikey’s laptop is open.<br />VS Code (code editor) glows softly on the screen.  </p>
<p>The project finally works.<br />He leans back and smiles.</p>
<blockquote>
<p>“This wasn’t so hard.”</p>
</blockquote>
<p>He decides to add one small feature.</p>
<p>Just one more.</p>
<p>No backup.<br />No copy.</p>
<p>Because why would he need one?</p>
<h2 id="heading-the-moment-everything-breaks"><strong>The Moment Everything Breaks</strong></h2>
<p>Kartikey saves the file.</p>
<p>He refreshes the browser.<br />Nothing loads in the browser.</p>
<p>He opens another file.<br />Change a line in the opened file.  </p>
<p>Refresh the browser again.</p>
<p>Now more things are broken.  </p>
<p>His heartbeat increases.<br />He starts undoing randomly:</p>
<ul>
<li><p>Ctrl + Z.</p>
</li>
<li><p>Reverting files.</p>
</li>
<li><p>Commenting code like a maniac.</p>
</li>
</ul>
<p>Then the thought hits him:</p>
<blockquote>
<p>“I don’t even remember what I changed.”</p>
</blockquote>
<p>This is the moment every developer reaches when progress feels fragile and fear takes over.</p>
<h2 id="heading-someone-was-watching"><strong>Someone Was Watching</strong></h2>
<p>Kartikey thinks:<br />He is alone.<br />He is not.</p>
<p>A calm voice speaks:</p>
<blockquote>
<p>“You didn’t lose anything.”</p>
</blockquote>
<p>Kartikey looks around.  </p>
<p>There’s no one there.<br />The voice continues:</p>
<blockquote>
<p>“I’ve been watching every change you made.”</p>
</blockquote>
<p>Kartikey swallows.</p>
<blockquote>
<p>“Who are you?”</p>
</blockquote>
<p>The answer is simple.</p>
<blockquote>
<p><strong>“I am Git.”</strong></p>
</blockquote>
<h2 id="heading-git-explains-itself"><strong>Git Explains Itself</strong></h2>
<p>Git doesn’t look flashy.</p>
<p>No cape.<br />No explosions.</p>
<p>Git speaks slowly:</p>
<blockquote>
<p>“I don’t stop you from making mistakes.”<br />“I just make sure mistakes are reversible.”</p>
</blockquote>
<p>Git explains:</p>
<ul>
<li><p>It lives on Kartikey’s computer.</p>
</li>
<li><p>It remembers every meaningful version.</p>
</li>
<li><p>It creates timelines instead of chaos.</p>
</li>
</ul>
<p>Git isn’t here to control Kartikey.<br />Git is here to protect his progress.</p>
<h2 id="heading-the-project-transformation"><strong>The Project Transformation</strong></h2>
<p>Git points at Kartikey’s project folder.</p>
<blockquote>
<p>“Right now, this is just files.”</p>
</blockquote>
<p>Git asks Kartikey to type one command:</p>
<pre><code class="lang-bash">git init
</code></pre>
<p>The air feels different.  </p>
<p>Git smiles.</p>
<blockquote>
<p>“Now this is a repository.”</p>
</blockquote>
<p>Inside your folder:</p>
<ul>
<li><p>A hidden .git directory appears.</p>
</li>
<li><p>A memory vault is created.</p>
</li>
<li><p>A timeline engine wakes up.</p>
</li>
</ul>
<p>Kartikey’s project now has a past and a future.</p>
<h2 id="heading-the-three-worlds-revealed"><strong>The Three Worlds Revealed</strong></h2>
<p>Git draws three circles in the air.</p>
<blockquote>
<p>“You think you write code in one place, You don’t.”</p>
</blockquote>
<h3 id="heading-the-working-directory"><strong>The Working Directory</strong></h3>
<p>This is where Kartikey writes code.</p>
<p>He experiments.<br />He breaks things.</p>
<p>Nothing here is permanent.</p>
<p>Git says:</p>
<blockquote>
<p>“This world is chaos, and that’s okay.”</p>
</blockquote>
<h3 id="heading-the-staging-area"><strong>The Staging Area</strong></h3>
<p>This world is about choice.</p>
<blockquote>
<p>“Here, Git explains, you decide what matters.”</p>
</blockquote>
<p>Not everything deserves to be remembered.</p>
<h3 id="heading-the-repository"><strong>The Repository</strong></h3>
<p>Git lowers its voice.</p>
<blockquote>
<p>“Once something reaches here, it becomes history.”</p>
</blockquote>
<p>This world never forgets.</p>
<h2 id="heading-git-notices-a-change"><strong>Git Notices a Change</strong></h2>
<p>Kartikey creates a new file.</p>
<p>He feels proud.<br />But Git interrupts.</p>
<p>Kartikey asks:</p>
<pre><code class="lang-bash">git status
</code></pre>
<p>Git replies calmly:</p>
<blockquote>
<p>“I see your file.”<br />“But I’m not tracking it yet.”</p>
</blockquote>
<p>Kartikey looks confused.</p>
<p>Git explains:</p>
<blockquote>
<p>“I never assume.”<br />“You must choose.”</p>
</blockquote>
<h2 id="heading-the-moment-of-decision"><strong>The Moment of Decision</strong></h2>
<p>Git waits.  </p>
<p>Kartikey decides what deserves to be remembered.</p>
<pre><code class="lang-bash">git add index.txt
</code></pre>
<p>The file moves worlds.<br />From chaos → preparation.</p>
<p>Git nods.</p>
<blockquote>
<p>“Good choice.”</p>
</blockquote>
<h2 id="heading-time-is-frozen"><strong>Time is Frozen</strong></h2>
<p>Git gives Kartikey one final step.</p>
<pre><code class="lang-bash">git commit -m <span class="hljs-string">"Initial commit."</span>
</code></pre>
<p>Everything stops.</p>
<p>Git speaks softly:</p>
<blockquote>
<p>“This moment is safe now.”</p>
</blockquote>
<p>A commit is born.</p>
<p>Not a save.<br />Not a backup.  </p>
<p>A checkpoint in time.</p>
<h2 id="heading-the-memory-you-didnt-know-you-had"><strong>The Memory You Didn’t Know You Had</strong></h2>
<p>Days pass.</p>
<p>Kartikey commits again and again.</p>
<p>One day, he wonders:</p>
<blockquote>
<p>“What have I done so far?”</p>
</blockquote>
<p>Git opens a book.</p>
<pre><code class="lang-bash">git <span class="hljs-built_in">log</span>
</code></pre>
<p>Each page shows:</p>
<ul>
<li><p>What changed?</p>
</li>
<li><p>Why it changed?</p>
</li>
<li><p>In what order.</p>
</li>
</ul>
<p>Git remembers Kartikey’s journey better than he ever could.</p>
<h2 id="heading-the-multiverse-decision"><strong>The Multiverse Decision</strong></h2>
<p>Kartikey wants to try something risky.  </p>
<p>In the past, this meant fear.</p>
<p>Git shakes its head.</p>
<blockquote>
<p>“Create another timeline.”</p>
</blockquote>
<pre><code class="lang-bash">git checkout -b feature-branch
</code></pre>
<p>Reality splits:</p>
<p>Two worlds exist at once.<br />If one collapses…The other survives.</p>
<h2 id="heading-you-are-never-lost"><strong>You Are Never Lost</strong></h2>
<p>Git points to a glowing marker.</p>
<blockquote>
<p>“This is HEAD - It always shows where you are.”</p>
</blockquote>
<p>No matter how complex things get.<br />Git always knows Kartikey’s position in time.</p>
<h2 id="heading-the-real-power"><strong>The Real Power</strong></h2>
<p>Kartikey looks at his code again.</p>
<p>It’s not perfect.<br />But he’s calm.</p>
<p>Because now he knows:</p>
<ul>
<li><p>Mistakes aren’t disasters.</p>
</li>
<li><p>Experiments aren’t dangerous.</p>
</li>
<li><p>Progress is never lost.</p>
</li>
</ul>
<p>Git doesn’t make Kartikey smarter.<br />Git makes him braver.</p>
<p>And that’s when he realizes:</p>
<blockquote>
<p>“He is not just writing code anymore.”<br />“<strong>He is controlling time.”</strong></p>
</blockquote>
<p>If this story felt familiar, you’re not alone.<br />Every developer reaches this moment.  </p>
<p>The difference is whether you have a way to protect your progress when you do.</p>
<h3 id="heading-and-this-is-only-the-beginning-for-kartikey">And this is only the beginning for Kartikey.</h3>
]]></content:encoded></item></channel></rss>