<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Prasun Chakraborty</title>
    <description>The latest articles on Forem by Prasun Chakraborty (@prasunchakra).</description>
    <link>https://forem.com/prasunchakra</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3214679%2F0f81ceb2-e229-48a9-8335-44eb244a0172.jpeg</url>
      <title>Forem: Prasun Chakraborty</title>
      <link>https://forem.com/prasunchakra</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/prasunchakra"/>
    <language>en</language>
    <item>
      <title>Full Stack System Design 4 : GraphQL and gRPC</title>
      <dc:creator>Prasun Chakraborty</dc:creator>
      <pubDate>Mon, 09 Feb 2026 17:19:35 +0000</pubDate>
      <link>https://forem.com/prasunchakra/full-stack-system-design-4-graphql-and-grpc-5g1p</link>
      <guid>https://forem.com/prasunchakra/full-stack-system-design-4-graphql-and-grpc-5g1p</guid>
      <description>&lt;p&gt;In our previous episode on REST APIs, we broke down how traditional APIs work from architectures and URLs to headers and status codes. We saw how REST keeps things simple and predictable using HTTP methods and resources. But as apps get more complex, REST can sometimes feel limiting. That's where alternatives shine. In this Episode 4, we'll explore GraphQL and gRPC.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Quick History of GraphQL and gRPC
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;GraphQL started at Facebook in 2012 when they were dealing with mobile apps that needed flexible data without wasting bandwidth. The old REST way meant over fetching of extra info, which was bad for slow networks. They built GraphQL internally and then open sourced it in 2015. It quickly caught on because it let clients ask for exactly what they needed. Today, it's used by big names like GitHub, Shopify, and Netflix for complex UIs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;gRPC, on the other hand, came from Google around the same time, it evolved from their internal Stubby system and open sourced in 2015. It's built on HTTP/2 and uses Protocol Buffers for efficient data packing. Google needed something fast for microservices talking to each other, especially in data centers. Now, it's popular in cloud setups like Kubernetes, with companies like Uber and Square using it for backend to backend speed.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both came out around the mobile boom and microservices trend, solving pain points REST couldn't handle well. But they're tools, not replacements, based on your system's needs.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is GraphQL?
&lt;/h3&gt;

&lt;p&gt;GraphQL is a query language for your API and a server side runtime that runs those queries against a type system you define for your data. Unlike REST with its many endpoints (like /users, /posts, /comments), GraphQL usually has just one endpoint, say /graphql and the client decides the data shape, not the server. You send a query like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight graphql"&gt;&lt;code&gt;&lt;span class="k"&gt;query&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"1"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="n"&gt;posts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The server returns exactly that no more, no less:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"data"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"user"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Prasun"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"posts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Web Basics"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Protocols"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"REST Deep Dive"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is powered by a schema in Schema Definition Language (SDL) that defines types, like User and Post, with fields and relationships. Tools like Apollo or Relay handle the client side, making it easy to integrate with React or other frontends.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why GraphQL? (Problem → Solution → Benefits)
&lt;/h3&gt;

&lt;p&gt;In the 3-tier architecture we discussed in Episode 3, REST works well for simple use cases, but real world applications expose its limits especially as frontends grow more dynamic.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Over fetching&lt;/strong&gt; is a common issue. Suppose your mobile app only needs a user’s name for a profile badge. A REST call like GET /users/1 often returns everything like email, bio, address, login history. That’s unnecessary data moving over the network, slowing performance on 3G connections and draining battery. With GraphQL, the client asks for exactly what it needs:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight graphql"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Under fetching&lt;/strong&gt; is the flip side. A dashboard that shows user details along with recent posts might require multiple REST calls like &lt;code&gt;GET /users/1&lt;/code&gt;, then &lt;code&gt;GET /users/1/posts?limit=3&lt;/code&gt;. Each call adds latency and coordination overhead. GraphQL solves this by allowing nested queries, fetching all required data in a single round trip. This is especially valuable in full stack systems where frontend requirements evolve faster than backend APIs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At its core, GraphQL acts like a surgical instrument for data access it's precise, flexible, and efficient. It doesn’t replace REST but it complements it where flexibility and performance matter most.&lt;/p&gt;

&lt;h3&gt;
  
  
  This design unlocks several key benefits:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Declarative Data Fetching&lt;/strong&gt;&lt;br&gt;
Clients explicitly describe the shape of the data they need. For example, the same API can return full post details for desktop views and lightweight summaries for mobile, without new endpoints or server changes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Strongly Typed Schema&lt;/strong&gt;&lt;br&gt;
All data is defined in a shared schema &lt;code&gt;schema.graphql&lt;/code&gt;. This enables IDE auto completion, early error detection, and tooling like GraphiQL. Think of it as TypeScript for your API that makes full stack development safer and more predictable.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Introspection by Design&lt;/strong&gt;&lt;br&gt;
GraphQL APIs are self describing. Clients can query the schema itself e.g.,&lt;code&gt;__schema { types { name } }&lt;/code&gt;, making it easier to explore capabilities and evolve systems without breaking consumers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Faster Frontend Iteration&lt;/strong&gt;&lt;br&gt;
UI teams can move independently. If the schema already exposes postViews, frontend developers can query it immediately no new endpoint, no backend redeploy. This dramatically shortens iteration cycles.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>fullstack</category>
      <category>systemdesign</category>
      <category>graphql</category>
      <category>rpc</category>
    </item>
    <item>
      <title>Full Stack System Design 3 : REST APIs from Architectures to Status Codes</title>
      <dc:creator>Prasun Chakraborty</dc:creator>
      <pubDate>Sun, 08 Feb 2026 14:10:39 +0000</pubDate>
      <link>https://forem.com/prasunchakra/demystifying-the-web-3-rest-api-1nn</link>
      <guid>https://forem.com/prasunchakra/demystifying-the-web-3-rest-api-1nn</guid>
      <description>&lt;p&gt;In our last episode, we explored the networking protocols that make data flow across the web, like TCP for reliability, HTTP/HTTPS for requests, and WebSockets for real time chats. Building on our web foundations, we're expanding to full-stack system design with the Episode 3, which dives into how applications communicate in more structured ways, starting with APIs. We'll focus on REST APIs first, using everyday analogies to keep it simple. This sets the stage for later topics in the series, like gRPC, GraphQL, and communication patterns. Let's get into it with the basics of app architectures and how REST fits in.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Evolution of Tiers (The Restaurant Analogy)
&lt;/h2&gt;

&lt;p&gt;To explain how apps are built, think of it like running a restaurant. We'll use this "digital kitchen" idea to break down the three main architectures.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;1-Tier Architecture: The Food Truck&lt;/strong&gt;
Everything happens in one spot. The guy taking your order is also cooking and pulling stuff from the fridge. In software, this means the user interface, business logic and data storage are all on the same machine, just like an old desktop app.
The issue with this is if a crowd suddenly shows up, the whole thing slows down or crashes. You can't easily add help without starting over.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmgdwu388zqpmkd62vm0w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmgdwu388zqpmkd62vm0w.png" alt="1-Tier Architecture" width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;2-Tier Architecture: The Small Diner&lt;/strong&gt;
Now the operation is split into two distinct spaces. There’s a front counter where customers place orders and interact with staff, and there’s a back kitchen where the actual work happens. The cashier focuses on talking to customers, taking orders, maybe doing light checks like “is this a valid order,” while the kitchen handles cooking, pricing rules, checking ingredients, and pulling items from the fridge. In software terms, the client handles the user interface and basic validation, while the server contains both the business logic and the database. This setup can handle far more customers than a food truck because multiple clients can talk to the same kitchen at once, and changes to the kitchen don’t necessarily require rebuilding the counter. The problem is that the kitchen becomes responsible for everything beyond taking the order. As the menu grows and customers want more custom options, all those special rules pile up in the kitchen, making it harder to manage and slower to respond. If demand increases or storage needs grow, you can’t just add another fridge or cook independently without redesigning the whole kitchen, because the logic and the data live together in one place.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4a03qjd5pp9rwbuu1yqn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4a03qjd5pp9rwbuu1yqn.png" alt="2-Tier Architecture" width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;3-Tier Architecture: The Fine-Dining Restaurant&lt;/strong&gt;
Now the restaurant is fully professional and built to scale. The front-of-house staff focuses only on the guest experience, guiding customers through the menu and taking orders without knowing how the food is prepared or where ingredients are stored. Orders are passed to the kitchen, where chefs concentrate purely on cooking and applying business rules, completely independent of how the order was taken or who took it. Behind all of this is a separate storage area where ingredients, recipes, and inventory are managed on their own, isolated from the chaos of the dining room and the heat of the kitchen. In software, this means the presentation layer handles user interaction, the application layer processes logic and decisions, and the data layer stores and manages information independently. Because each tier has a single responsibility, you can add more waiters, more chefs, or a bigger warehouse without redesigning the entire restaurant, making it far easier to handle growth, change menus, or support huge spikes in customers without the system slowing down or breaking.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fumcme7i5gl9bo8edxf9r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fumcme7i5gl9bo8edxf9r.png" alt="3-Tier Architecture" width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is an API? What is REST?
&lt;/h2&gt;

&lt;p&gt;Before we talk REST, let's define API i.e. Application Programming Interface. In the restaurant, it's like the order slip the waiter hands to the chef. The frontend (waiter) writes what’s needed and passes it to the backend (chef). The waiter doesn't need to know how the oven works; they just follow the format. It's a simple contract between systems, letting them talk without knowing each other's insides.&lt;br&gt;
REST, or Representational State Transfer, is a style for building APIs. If API is the order slip, REST is the standard way to fill it out, so everyone uses the same language.&lt;br&gt;
Instead of random notes, REST uses consistent "nouns" and "verbs" over HTTP (from Episode 2).&lt;br&gt;
Nouns (Resources): Things like /orders, /menu-items, /customers—the stuff you're dealing with.&lt;br&gt;
Verbs (Methods): GET (fetch something), POST (create new), PUT (update), DELETE (remove).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fll5kos6fs8mnnb1mtsnz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fll5kos6fs8mnnb1mtsnz.png" alt="API and REST API" width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Grammar and Vocabulary
&lt;/h2&gt;

&lt;p&gt;If the 3-Tier architecture is the building, these topics explain how we navigate the hallways and what actions we can perform once we get there.&lt;br&gt;
Let's start with the parts of a URL, since that's the starting point for any API call. Think of it as the map your browser (or app) to find and interact with resources on the server.&lt;/p&gt;

&lt;h3&gt;
  
  
  Anatomy of a URL: The Map
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;A URL (Uniform Resource Locator)&lt;/strong&gt; Is like an address, a full set of directions for the browser on where to go and what to do. It guides the request from your client to the exact spot on the server, following the HTTP rules we talked about in Episode 2. Let's split it into parts with examples.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Scheme (Protocol)&lt;/strong&gt;: Like &lt;code&gt;https://&lt;/code&gt; or &lt;code&gt;http://&lt;/code&gt;. It tells the browser (or your app) what protocol to use for communication.Like &lt;code&gt;https://&lt;/code&gt; this tells how to talk securely, as we covered in Episode 2 with &lt;code&gt;HTTP/HTTPS&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Host (Domain)&lt;/strong&gt;: This is the main address, like &lt;code&gt;api.prasunchakra.com&lt;/code&gt;. It points to the specific server or subdomain where the API is hosted. For This could be separate from your main site &lt;code&gt;prasunchakra.com&lt;/code&gt; to keep API traffic separate and organized. For example, if prasunchakra.com has a blog, the host api.prasunchakra.com might handle requests for posts and users. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Path&lt;/strong&gt;: This comes after the host, like &lt;code&gt;/v1/users/123&lt;/code&gt;. It's the route to the exact resource. In REST design, paths are always nouns representing things and never an actions. So &lt;code&gt;/users&lt;/code&gt; for a list of users, or &lt;code&gt;/users/123&lt;/code&gt; for a specific one. The &lt;code&gt;/v1&lt;/code&gt; is a version number, common in APIs to let you update without breaking old clients. For &lt;code&gt;prasunchakra.com&lt;/code&gt;, a path like &lt;code&gt;/v1/posts/abc&lt;/code&gt; might fetch a blog post by ID &lt;code&gt;abc&lt;/code&gt;. This makes APIs intuitive, as if you  are navigating like folders on a computer.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Query Strings&lt;/strong&gt;: These start with &lt;code&gt;?&lt;/code&gt; and use &lt;code&gt;&amp;amp;&lt;/code&gt; to separate params, like &lt;code&gt;?format=json&amp;amp;sort=desc&lt;/code&gt;. They're optional extras that tweak the request without changing the path. Think of them as filters, format=json says "send data as JSON, not XML," and sort=desc means "oldest first." For example say prasunchakra.com's API, you might do /posts?author=jagd&amp;amp;limit=10 to get the last 10 posts by Jagdish. They're great for searches.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Fragment&lt;/strong&gt;: This is the # part at the end, like #profile. It's for client side only. The browser uses it to scroll or jump to a section after the page loads. Servers never see it, so it's not for APIs. In prasunchakra.com, if a post has #comments, your browser scrolls to the comments without a new request. Handy for single page apps.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs0dkrscajgpjy9vnk2t6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs0dkrscajgpjy9vnk2t6.png" alt="Anatomy of URL" width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  CRUD and the HTTP Methods: The Actions
&lt;/h3&gt;

&lt;p&gt;REST is all about doing basic operations on resources, called CRUD (Create, Read, Update, Delete). We tie these to HTTP methods to keep things standard and easy to predict. This predictability is why REST is so popular, it lets developers guess how an API works without docs. Let's expand on each with examples and why they matter.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Create &lt;/strong&gt;: This sends data to make something new. It's like submitting a form where the body of the request holds the details (e.g., in JSON). For example POST to /users with {"name": "New User", "email": "&lt;a href="mailto:user@example.com"&gt;user@example.com&lt;/a&gt;"} creates a account. Servers respond with 201 Created and maybe with the new ID. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Read &lt;/strong&gt;: This grabs data without changing anything. It's safe and repeatable. For example GET /posts fetches all blog posts, or GET /posts/123 gets one. Servers send 200 OK with the data. This method is cacheable, speeding up apps.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Update  / &lt;/strong&gt;: These change existing resources. PUT replaces the whole thing like send the full data to /users/123, and it overwrites everything. PATCH is partial it just send changes, like {"email": "&lt;a href="mailto:new@email.com"&gt;new@email.com&lt;/a&gt;"} to update a single field. PUT is idempotent (repeatable safely), PATCH might not be. Choose based on if you want full control or efficiency.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Delete &lt;/strong&gt;: This removes a resource. A simple DELETE /users/123 and it's gone. Server replies 204 No Content if successful. For example DELETE /comments/xyz clears a comment. It's idempotent because deleting twice is fine (second time just says not found).&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fft20ynl5fqyapex8egrd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fft20ynl5fqyapex8egrd.png" alt="Rest &amp;amp; Crud" width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;CRUD also maps well to databases like Create=INSERT, Read=SELECT, etc. making REST a natural fit for web apps.&lt;/p&gt;

&lt;h3&gt;
  
  
  The "Specialist" Methods
&lt;/h3&gt;

&lt;p&gt;CRUD covers most stuff, but there are a few extra HTTP methods for special cases, like tools you pull out only when needed. They're less common but useful for optimization, security, or debugging. Let's dive deeper with use cases and caveats.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;HEAD&lt;/strong&gt;: Same as GET, but skips the body and just gets headers. It's like peeking at mail without opening it. For example, HEAD /images/bigfile.jpg checks Content-Length (size) or Last-Modified (date) to see if it's worth downloading there by saving bandwidth on mobiles or low network scenarios. Response is 200 OK with headers only and no data transfer.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;OPTIONS&lt;/strong&gt;: Asks what methods a URL supports. Server replies with Allow: GET, POST, etc. Crucial for CORS, when your frontend on prasunchakra.com calls an API on another domain, the browser sends OPTIONS first as a "preflight" to check if it's allowed (via headers like Access-Control-Allow-Origin). If not, the real request is blocked for security. Use it to test API capabilities without full calls.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;CONNECT&lt;/strong&gt;: Sets up a tunnel through proxies, turning the connection into a pipe for other protocols. Rare in APIs, but used for things like HTTPS over proxies or VPNs. For example behind a corporate firewall, CONNECT might establish a secure link. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;TRACE&lt;/strong&gt;: Loops back the request for testing, server echoes what it got, including headers. Good for debugging proxies or seeing if requests are tampered with. But security risks are often disabled because attacks like Cross Site Tracing (XST) can use it to steal cookies or headers.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Headers : Metadata that Drives the Web.
&lt;/h2&gt;

&lt;p&gt;Headers are like the metadata or notes attached to your HTTP requests and responses. They're key for telling the server what you want and how the client should handle what's sent back. Think of headers as the envelope around your letter: the address is the URL, but headers add the stamps, return address, and special instructions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Request Headers: The Client’s Instructions
&lt;/h3&gt;

&lt;p&gt;When your frontend or a tool like Postman sends a request to the API, it includes these headers to give context, preferences, and security details. They're sent in the HTTP request and servers read them to decide how to process and respond. Let's break them down with more detail and why they matter in real world REST setups.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Identity &amp;amp; Context&lt;/strong&gt;:
These help the server know who's asking and from where.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Host: This is mandatory in HTTP/1.1 and tells the server which domain the request is for, like servers often host multiple sites on one IP (virtual hosting), so this routes it right. If you forget this, the server might reject the request with a 400 Bad Request.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;User-Agent: This strings together your browser or app info, e.g., &lt;code&gt;User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36&lt;/code&gt;. Servers use it to optimize, like sending mobile friendly JSON if it's from an android app, while the backend might log this for analytics or serve lighter data to slow devices. But users can fake it, so we don't rely on it for security it's only for better user experience.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Origin and Referer: Origin is for security, showing just the domain and port (e.g., &lt;code&gt;Origin: https://prasunchakra.com&lt;/code&gt;) during CORS checks . Referer gives the full previous URL, like &lt;code&gt;Referer: https://prasunchakra.com/blog/post1&lt;/code&gt;. Use Origin for strict checks and Referer for tracking how users arrived. In APIs, if Origin doesn't match allowed domains, the server blocks cross site requests to prevent attacks.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Content Negotiation:&lt;/strong&gt;
This is like negotiating the menu, client says what it can handle, server picks.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Accept: Specifies response formats, e.g., &lt;code&gt;Accept: application/json, text/xml&lt;/code&gt;. For example in API, if you GET &lt;code&gt;/posts&lt;/code&gt; and set &lt;code&gt;Accept: application/json&lt;/code&gt;, the server sends JSON; otherwise, maybe HTML. If unsupported, it might return 406 Not Acceptable. This makes APIs flexible for different clients (web vs. mobile).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Accept-Language: User's language prefs, e.g., &lt;code&gt;Accept-Language: en-US, hi;q=0.5&lt;/code&gt; (English first, Hindi second with lower priority). Servers can localize responses, like sending Hindi error messages for prasunchakra.com users in India. q values (0-1) weight preferences.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Accept-Encoding: Compression support, e.g., &lt;code&gt;Accept-Encoding: gzip, deflate, br (Brotli)&lt;/code&gt;. Servers compress data to speed up transfers. For large JSON from prasunchakra.com's /posts endpoint, gzip shrinks it 70%, saving bandwidth on slow connections.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Security &amp;amp; State&lt;/strong&gt;:
Crucial for protected APIs.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Authorization: Like showing ID, e.g., &lt;code&gt;Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...&lt;/code&gt; (a JWT token). For example to create a new post, you need this after login. Types include Basic (username:password base64'd—unsafe), Bearer (tokens), or API keys. Without it you get 401 Unauthorized.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cookie: Client stored data from previous responses, e.g., &lt;code&gt;Cookie: sessionId=abc123; theme=dark&lt;/code&gt;. For example it might track logged in state.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Conditional/Caching: For efficiency, avoiding unnecessary data.&lt;br&gt;
&lt;code&gt;If-Modified-Since: A date&lt;/code&gt;, e.g., &lt;code&gt;If-Modified-Since: Wed, 21 Oct 2015 07:28:00 GMT&lt;/code&gt;. Server checks if resource changed if not, sends 304 Not Modified (no body). Great for static images it saves redownloading.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cache-Control: Client side rules, e.g., &lt;code&gt;Cache-Control: no-cache&lt;/code&gt; (always check server). Or &lt;code&gt;max-age=0&lt;/code&gt; for fresh data. In APIs, this tells proxies or browsers how to cache requests.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Response Headers: The Server’s Reply
&lt;/h3&gt;

&lt;p&gt;After processing, the server sends these back with the status code (like 200 Which we have discussed in the next section) and body. They guide the client on what to do with the data to render it, to cache it, or secure it. In REST, good headers make apps faster and safer.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Content Details:&lt;/strong&gt;
Basics on what's in the body.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Content-Type: Describes the body, e.g., &lt;code&gt;Content-Type: application/json; charset=utf-8&lt;/code&gt; this tells the client to parse as JSON. If mismatched (say, sending HTML as JSON), the app crashes. Multipart types handle files too.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Content-Length: Body size in bytes, e.g., &lt;code&gt;Content-Length: 1024&lt;/code&gt;. Helps clients know when transfer ends, especially for streaming. If without it we use chunked encoding.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Content-Encoding: If compressed, e.g., &lt;code&gt;Content-Encoding: gzip&lt;/code&gt;. Client decompresses before using. For big responses this pairs with Accept-Encoding to cut load times.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Caching &amp;amp; Freshness&lt;/strong&gt;:
These prevent refetching unchanged data, huge for speed.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;ETag: A hash or version, e.g., &lt;code&gt;ETag: "33a64df551425fcc55e4d42a148795d9f25f89d4"&lt;/code&gt;. Client sends &lt;code&gt;If-None-Match&lt;/code&gt; next time and if matches, 304 Not Modified. If content hasn't changed, skip download. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Last-Modified: Timestamp, e.g., &lt;code&gt;Last-Modified: Tue, 29 Oct 2024 12:00:00 GMT&lt;/code&gt;. Pairs with If-Modified-Since. Simpler than ETag but less precise for dynamic data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Expires: Absolute staleness date, e.g., &lt;code&gt;Expires: Wed, 21 Oct 2025 07:28:00 GMT&lt;/code&gt;. Browser won't refetch until then. Good for static assets.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cache-Control: Most flexible, e.g., &lt;code&gt;Cache-Control: public, max-age=3600&lt;/code&gt; (cacheable by anyone for 1 hour). Or private (user-specific), no-store (no caching). Overrides Expires. In APIs, use &lt;code&gt;must-revalidate&lt;/code&gt; for fresh checks after stale.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;State &amp;amp; Server Info&lt;/strong&gt;:
Managing ongoing sessions and info.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Set-Cookie: Server sets client cookies, e.g., &lt;code&gt;Set-Cookie: sessionId=abc123; Max-Age=3600; Secure; HttpOnly&lt;/code&gt;. This starts a session. Flags: Secure (HTTPS only), HttpOnly (no JS access), SameSite (anti-CSRF).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Server: Server software, e.g., &lt;code&gt;Server: nginx/1.24.0&lt;/code&gt;. Gives hints but often hidden (e.g., removed or faked) to avoid targeted attacks.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Status Codes: The Server's Quick Feedback
&lt;/h3&gt;

&lt;p&gt;When the server processes your request, it starts the response with a status code. It's the first thing in the HTTP response line, like "HTTP/1.1 200 OK." Codes are grouped into ranges (1xx to 5xx), and good API docs always explain what each means for their endpoints. In tools like Postman or browser consoles, you'll see them as 200 is green, 404 is red. Let's break them down with more context.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;1XX&lt;/strong&gt;: "Hold on..." (Informational)
These are rare, interim codes saying the request is being handled but not done yet. Clients usually don't need to do much,they're automatic.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;100 Continue: Server says, "What you've sent so far is fine, send the rest." Useful for big uploads, like POSTing a large image to say /uploads endpoint. Client sends the first chunk, gets 100 and then continues. Prevents wasting bandwidth on invalid starts.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;101 Switching Protocols: Server agrees to change protocols, like upgrading from HTTP to WebSockets. For example, if you have real-time comments, a GET /comments with Upgrade: websocket header might trigger 101, switching to bidirectional chat.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;2XX&lt;/strong&gt;: "Got it!" (Success)
Everything worked and the request was valid, server did its job. These are what you aim for in happy paths.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;200 OK: The default success for most requests, like GET /posts returning blog data or fetching a user profile sends 200 with JSON in the body. Always include a body if there's data; empty is fine for simple confirms.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;201 Created: For POSTs that make new stuff, like POST /posts creating a blog entry. Server responds with 201 and often a Location header pointing to the new resource (e.g., Location: /posts/456) this confirms the post is live and gives the URL to view it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;204 No Content: Success, but no body needed—like DELETE /comments/123. For example, removing a spam comment sends 204; client knows it's gone without extra data. Efficient for actions without results.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;206 Partial Content: When you request ranges, like video streaming. If website has a media API, GET /videos/bigfile with Range: bytes=500-999 gets 206 and just that chunk. Headers like Content-Range tell the byte range. Great for resuming downloads on flaky connections.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;3XX&lt;/strong&gt;: "Go over there" (Redirection)
The resource moved or can be found elsewhere, client should follow or cache. Servers use these for SEO, load balancing, or versioning.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;301 / 308: Permanent moves: 301 Moved Permanently says "Use this new URL forever" (with Location header). For example if you rename /blog to /posts, 301 redirects old links. 308 is similar but preserves method/body for POSTs. Caches well, but update your links to avoid chains.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;304 Not Modified: Ties to caching headers (from earlier). If client sends If-None-Match with an ETag, and nothing changed, server sends 304—no body, use your cache. For example static CSS, this saves reloads on repeat visits.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;4XX&lt;/strong&gt;: "You messed up" (Client Error)
Client's fault like bad input, no auth, or wrong URL. &lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;400 Bad Request: Generic for malformed requests, like missing params or invalid JSON in POST. For example if you POST /users with broken email format, 400 with details helps debug.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;401 / 403: You aren't logged in or you don't have permission: 401 Unauthorized means "Log in first". 403 Forbidden is "You're logged in but not allowed," like accessing admin without rights. 401 is used for missing creds and 403 for denied access.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;404 Not Found: Classic, the resource doesn't exist. GET /posts/999 on some website if ID's wrong.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;429 Too Many Requests: Rate limiting, you're hitting too fast. Headers like Retry-After: 60 say wait 1 minute. For public API, this prevents abuse.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;5XX&lt;/strong&gt;: "I messed up" (Server Error)
Server's problem like bug, overload, or downstream issue. Clients can retry later. &lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;500 Internal Error: Catch all for crashes, like unhandled exceptions in backend code. Body might say "Something went wrong" for users, but logs have stack traces.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;502 / 504: Gateway/Timeout issues. 502 Bad Gateway means a proxy or upstream server failed e.g. load balancer can't reach the app server. 504 Gateway Timeout is when it takes too long. Common in microservices check connections.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;507 Insufficient Storage: Server's disk is full, can't save your POST. Rare, but for websites with heavy user uploads, this means scale storage ASAP.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Status codes are your API's language for feedback, use them right, and your REST service becomes user friendly.&lt;/p&gt;

&lt;p&gt;That wraps up Episode 3 on APIs and architectures, starting with REST. We've gone from tiers and basics to URLs, methods, headers, and now status codes—building a solid foundation for how frontends talk to backends. But REST isn't the only game in town. In the next episode, we'll pick up alternatives like GraphQL (for flexible queries) and gRPC (for high-performance microservices), comparing them to REST with examples.&lt;/p&gt;

</description>
      <category>systemdesign</category>
      <category>fullstack</category>
      <category>javascript</category>
      <category>python</category>
    </item>
    <item>
      <title>Demystifying the Web 2: The Language of the Internet</title>
      <dc:creator>Prasun Chakraborty</dc:creator>
      <pubDate>Sat, 07 Feb 2026 03:12:59 +0000</pubDate>
      <link>https://forem.com/prasunchakra/demystifying-the-web-2-the-language-of-the-internet-2bpp</link>
      <guid>https://forem.com/prasunchakra/demystifying-the-web-2-the-language-of-the-internet-2bpp</guid>
      <description>&lt;p&gt;In Episode 1, we walked through the basics of how the web works. From typing a web address into your browser, through DNS lookups and secure connections, to rendering the page on your screen. We touched on things like TCP and HTTP, but that's just the surface. Now, in Episode 2, let's dig deeper into the networking protocols that power all this communication. These are the building blocks that make data move reliably and fast across the internet. We'll start with the low-level ones and move up.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Low-Level Workhorses (TCP vs. UDP)
&lt;/h3&gt;

&lt;p&gt;Before the web can talk, it needs a transport layer that decides how data packets are sent between two machines. Think of this as choosing between a careful courier and a fast bike messenger.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;TCP (Transmission Control Protocol):&lt;/strong&gt; TCP is the “reliable guy” of the transport layer. It is connection oriented, which means it first sets up a virtual connection between your browser and the server using a handshake before any real data flows. Once the connection is established, TCP breaks your data into numbered segments so they can be reassembled correctly on the receiving side, waits for acknowledgements (ACKs) from the receiver and retransmits any lost segments to ensure nothing goes missing, guarantees that all data arrives in the correct order even if packets take different paths through the network, and performs flow control and congestion control so a fast sender does not overwhelm a slow receiver or a congested network. All of this reliability comes with extra overhead and slightly more latency, but it is perfect when correctness matters more than speed. Like Web browsing, Emails or File transfers&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;UDP (User Datagram Protocol):&lt;/strong&gt; This one's all about speed it takes the opposite approach. It is connectionless and focuses on minimal delay. There is no handshake to set up a session, no tracking of which packets arrived, and no built-in mechanism to reorder or retransmit lost data. Because UDP does not spend time on acknowledgements, retransmissions, or congestion algorithms, it has much lower overhead and can be significantly faster and more predictable in terms of latency. That makes it ideal for real time scenarios where a small amount of loss is acceptable, but delay is not. Like live streaming and video conferencing, Online gaming or VoIP calls.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvapkvpyj2kvp1t2j476o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvapkvpyj2kvp1t2j476o.png" alt="TCP vs UDP" width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  The Web Giants (HTTP, HTTPS, HTTP/3)
&lt;/h3&gt;

&lt;p&gt;Once TCP or UDP has done the hard work of moving packets around, the web needs a language for clients and servers to talk in. That language is HTTP and its secure cousins.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;HTTP (Hypertext Transfer Protocol):&lt;/strong&gt; Defines how a client (like your browser) sends a request and how a server replies with a response. It is a simple text based, request response protocol.The client asks for a resource (HTML, CSS, JSON, etc.), and the server answers with a status line, headers, and an optional body. By default, classic HTTP (HTTP/1.1) runs over TCP, so it inherits TCP’s reliability and ordering guarantees.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;HTTPS (Hypertext Transfer Protocol Secure):&lt;/strong&gt; Is not a different application protocol. It is simply HTTP running inside a TLS-encrypted tunnel. The “S” in &lt;a href="https://prasunchakra.com" rel="noopener noreferrer"&gt;https://prasunchakra.com&lt;/a&gt; means that before any HTTP request–response messages are exchanged, the client and server perform a TLS handshake to agree on keys and ciphers, and to authenticate the server’s identity using its certificate. So you can think of HTTPS as “take normal HTTP and wrap every byte of it inside TLS, at the transport layer.” Today, browsers treat plain HTTP as “not secure” and strongly prefer HTTPS everywhere.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;HTTP/3 (QUIC):&lt;/strong&gt; HTTP/2 improved performance by multiplexing many HTTP streams over a single TCP connection, but it ran into a TCP level problem called head of line (HOL) blocking. If one TCP packet is lost, TCP must hold back all later packets for that connection until the missing one is retransmitted, which delays every active HTTP stream sharing that connection. HTTP/3 takes a different route by running over QUIC, a transport protocol built on top of UDP. QUIC provides its own reliability, encryption (it uses TLS 1.3 integrated into the transport), and congestion control, but crucially it is stream-aware: it can treat each HTTP stream independently. This significantly reduces head of line blocking and improves perceived performance, especially on flaky mobile or Wi‑Fi networks where packet loss and changing network paths are common. Modern browsers are gradually adopting HTTP/3 for many large sites so that page loads, API calls, and asset fetches feel snappier and more resilient in real-world conditions.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwaq1wxcmxt63rjrcil33.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwaq1wxcmxt63rjrcil33.png" alt="HTTPS vs HTTP3" width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  The Real Time &amp;amp; Legacy Layer (WebSocket, SMTP, FTP)
&lt;/h3&gt;

&lt;p&gt;Not everything on the internet fits cleanly into “classic web pages.” Some protocols exist for real time interactions, others are older but still important in the background.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;WebSockets:&lt;/strong&gt; WebSockets were created to solve a limitation of HTTP that the client always has to initiate the conversation. With WebSockets, the browser and server upgrade an existing HTTP connection, then switch to a protocol that keeps a single TCP connection open and full‑duplex.&lt;br&gt;
Once the WebSocket is established, both the client and the server can send messages at any time without creating new HTTP requests, the connection remains open until it is explicitly closed which reduces overhead and latency, and messages can be sent as either text or binary frames, making WebSocket flexible for a wide range of real-time use cases.Which include chat apps, live dashboards (like stock prices or sports scores), collaborative tools (Figma, Google Docs‑style editors), multiplayer games, and any UI that needs instant updates pushed from the server.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;SMTP (Simple Mail Transfer Protocol):&lt;/strong&gt; It is the protocol responsible for sending emails between mail servers. When you hit “Send” in Gmail or Outlook, your client talks to an SMTP server over TCP, hands over the message, and then a series of SMTP servers relay that message until it reaches the recipient’s mail server. &lt;br&gt;
A simplified flow works as follows: your email client submits the message to your provider’s SMTP server, that server looks up the recipient’s domain using DNS and forwards the email to the destination SMTP server, possibly passing through intermediate relay servers, and finally the recipient’s server accepts the message and stores it in a mailbox where it can later be retrieved using protocols such as IMAP or POP3. &lt;strong&gt;IMAP (Internet Message Access Protocol)&lt;/strong&gt; and &lt;strong&gt;POP3 (Post Office Protocol version 3)&lt;/strong&gt; are email retrieval protocols, with IMAP keeping messages stored and synchronized on the mail server across multiple devices, while POP3 downloads messages to the local device and usually removes them from the server.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;FTP (File Transfer Protocol):&lt;/strong&gt; This is one of the oldest protocols for transferring files between a client and a server. It uses separate control and data channels over TCP, which historically made it flexible but also a bit of a pain for firewalls and NAT devices.&lt;br&gt;
Classic FTP has a big downside that the credentials and file contents are sent in plain text, so anyone sniffing the network can potentially see usernames, passwords, and data. Because of this, modern setups usually prefer secure alternatives such as &lt;strong&gt;SFTP (Secure File Transfer Protocol)&lt;/strong&gt;, which transfers files over SSH using a single encrypted channel for both commands and data, and &lt;strong&gt;FTPS (File Transfer Protocol Secure)&lt;/strong&gt;, which runs FTP over SSL/TLS to add encryption on top of the traditional FTP model.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F055b0tvg2o9kdwpfunvj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F055b0tvg2o9kdwpfunvj.png" alt="WebSocket, SMTP, FTP" width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From TCP and UDP at the transport layer to HTTP, HTTPS, WebSockets, SMTP, and FTP at the application layer, these protocols are the invisible glue that holds the internet together. Each one solves a slightly different problem: reliable delivery, secure browsing, real-time updates, email, or file transfer. The key idea to carry forward is this: when you type prasunchakra.com or open your favorite app, you are really triggering a carefully layered conversation between machines, with each protocol playing its part in the stack. As you build web apps, APIs, or backend systems, understanding these layers helps you reason about performance issues, security choices, and why things sometimes break in “mysterious” ways on real networks. In future episodes, we will zoom into specific pieces of this puzzle.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Demystifying the Web 1: The Journey of a web page</title>
      <dc:creator>Prasun Chakraborty</dc:creator>
      <pubDate>Fri, 06 Feb 2026 17:38:56 +0000</pubDate>
      <link>https://forem.com/prasunchakra/demystifying-the-web-episode-1-the-journey-of-a-web-page-from-browser-to-screen-4dbh</link>
      <guid>https://forem.com/prasunchakra/demystifying-the-web-episode-1-the-journey-of-a-web-page-from-browser-to-screen-4dbh</guid>
      <description>&lt;p&gt;Ever wondered why typing any website say my personal one prasunchakra.com into your browser feels so quick, even though it involves a bunch of stuff happening across the world? From DNS servers connecting over the internet to your screen showing the final page, the web is built on many connected technologies. &lt;br&gt;
Let's break it down step by step.&lt;/p&gt;

&lt;p&gt;Let's start with the basic exchange between your browser and the server. This is the core of how the web works,it's like a simple back and forth conversation.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;First, the request:&lt;/strong&gt; When you type &lt;a href="https://www.prasunchakra.com/" rel="noopener noreferrer"&gt;prasunchakra.com&lt;/a&gt; into your browser and hit Enter, your browser creates an HTTP request message. This is basically your browser saying, "Hey server, send me the main page for prasunchakra.com." It includes details like the URL, what type of data it's expecting (like HTML,CSS,JS), and some headers for things like your browser version or cookies if you've visited before.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Next, the processing:&lt;/strong&gt; The server for prasunchakra.com gets this request. It checks the URL, goes into its directories, and pulls out the files needed. For prasunchakra.com, this might mean finding the index.html file, any linked images, or backend scripts if there's dynamic content. The server processes any logic, like running code to generate the page if it's not static.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Finally, the response:&lt;/strong&gt; The server packs up an HTTP response and sends it back. This includes a status code (like 200 OK if everything's fine), and the actual content. For prasunchakra.com, it's usually the HTML for the page structure, CSS files for styling (like fonts and colors), and JavaScript for any interactive parts, like menus or forms. Your browser then starts putting it all together.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk8seh7h8tx2pzdx71owp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk8seh7h8tx2pzdx71owp.png" alt="Client-Server Model" width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For a deeper understanding, think of it in two main parts: first, finding the server's address (that's DNS), and then actually connecting to it and getting the data (that's the request to the server).&lt;/p&gt;

&lt;h2&gt;
  
  
  Part 1: Finding the Address (DNS Lookup)
&lt;/h2&gt;

&lt;p&gt;When you type prasunchakra.com into your browser, your computer doesn't know the exact location. It needs the IP address, something like 192.0.2.1, to reach the server.&lt;/p&gt;

&lt;p&gt;It checks for the IP address in a few places locally first to save time:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Browser Cache:&lt;/strong&gt; This is split into memory and disk. Memory cache is super fast, but it clears out when you close the tab or browser and disk cache, bit slower than memory but it sticks around between sessions. This is where stuff like images, scripts, or even DNS info from prasunchakra.com gets stored.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Service Workers:&lt;/strong&gt; If prasunchakra.com uses one (it's a background script), it can grab requests and pull files from its own Cache Storage. This works even offline.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Operating System (OS) Cache:&lt;/strong&gt; The browser then asks your OS (like Windows or macOS) if it has a recent DNS entry for prasunchakra.com saved in system memory.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Router Cache:&lt;/strong&gt; Finally, your home router might have its own DNS table cached, speeding things up for all devices on your network.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4h2h6djv5udmnprmtrjv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4h2h6djv5udmnprmtrjv.png" alt="Pre-flight' checklist" width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If none of these have the IP, then it moves to asking the ISP's DNS resolver. Now when the DNS resolver needs to find the IP for "&lt;a href="https://www.prasunchakra.com" rel="noopener noreferrer"&gt;https://www.prasunchakra.com&lt;/a&gt;", it doesn't search everywhere at once. It follows a structure, reading the URL from right to left, like flipping through a phone book.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The Root Level (.):&lt;/strong&gt; This is the top of the tree, hidden in every URL (think prasunchakra.com.) Root servers are like the main directory, they point to where the next level's info is stored. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Top-Level Domain (TLD):&lt;/strong&gt; That's the ending like .com, .org, or .in. For prasunchakra.com, the root server says, "Go ask the .com servers." These TLD nameservers know all the .com domains and direct to the right one.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Second-Level Domain (SLD):&lt;/strong&gt; This is the main name you picked, like "prasunchakra" The .com server points to the authoritative nameserver for prasunchakra, which is usually set up by your hosting provider (maybe Cloudflare or GoDaddy). That's where the actual IP is stored.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Third-Level Domain (Subdomain):&lt;/strong&gt; If it's something like blog.prasunchakra.com, the authoritative server handles the "blog" part. Subdomains let you point to different sections or servers, like blog.prasunchakra.com going to a separate machine.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frnwsl91ktb7ayr4d0htn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frnwsl91ktb7ayr4d0htn.png" alt="DNS hierarchy" width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This whole process usually takes milliseconds because of caching at each level. Once done, your browser gets the IP and moves to the connection phase.&lt;/p&gt;

&lt;h2&gt;
  
  
  Part 2: The Connection Phase (Handshakes)
&lt;/h2&gt;

&lt;p&gt;Now that we've got the IP address from DNS, it's time for the connection phase. This is where your browser sets up a reliable and secure link to the server hosting prasunchakra.com before asking for the page.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The TCP 3-Way Handshake (For Reliability)&lt;/strong&gt;
The internet can drop packets sometimes, so TCP makes sure everything arrives in order and nothing gets lost. Before sending any real data, the browser and server do a quick check to confirm they're both ready.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;SYN (Synchronize): Your browser sends a packet to the server's IP. It's like saying, "Hey, prasunchakra.com server, I want to connect. My starting number is X."&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;SYN-ACK (Synchronize-Acknowledge): The server gets it and replies, "Okay, got your message. I'm ready too. My starting number is Y, and I confirm yours (X+1)." &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;ACK (Acknowledge): Your browser sends back, "Cool, I got that. Let's go (Y+1)."&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now the connection is open, and data can flow reliably.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The TLS/SSL Handshake (For Security)&lt;/strong&gt;
If it's HTTPS (you see the padlock for prasunchakra.com), there's an extra step right after TCP to encrypt everything. This stops your ISP or anyone on the network from snooping on your data.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Client Hello: Your browser sends a list of encryption options it supports (called cipher suites) and some random data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Server Hello + Certificate: The server picks one option, sends its own random data, and shares its digital certificate (signed by someone trusted, like Let's Encrypt).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Authentication: Your browser verifies the certificate: "Is this really prasunchakra.com? Yes."&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Key Exchange: Using math like RSA or Diffie Hellman, they agree on a shared secret key. They start with slow asymmetric encryption just to set up a faster symmetric key for the rest.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Finished: Both confirm, "Alright, from here on, all data is encrypted."&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1tjt59g132e255codiri.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1tjt59g132e255codiri.png" alt="Handshake" width="800" height="436"&gt;&lt;/a&gt;&lt;br&gt;
With the connection secure, the browser can finally send the HTTP request for the page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Part 3: Getting the Data (HTTP Request)
&lt;/h2&gt;

&lt;p&gt;Once the secure connection is set up, the server for prasunchakra.com sends back the response packets. Your browser starts receiving them and begins the rendering process to show the page. This happens in stages, turning raw code into what you see on screen.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The Construction Phase (DOM &amp;amp; CSSOM)&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As the HTML starts coming in chunks, the browser doesn't wait for everything—it begins building right away.&lt;/p&gt;

&lt;p&gt;DOM (Document Object Model): The browser reads the HTML and builds a tree structure from it. For prasunchakra.com, every tag like &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt;, or &lt;code&gt;&amp;lt;img&amp;gt;&lt;/code&gt; becomes a node in this tree, representing the page's skeleton.&lt;br&gt;
CSSOM (CSS Object Model): While parsing the HTML, it spots &lt;code&gt;&amp;lt;link&amp;gt;&lt;/code&gt;tags for CSS files. The browser downloads and parses these to get the styling rules, like colors, fonts, and sizes for prasunchakra.com.&lt;br&gt;
CSS blocks rendering. The browser won't display anything until the CSSOM is done, to avoid showing a plain, unstyled page first (that's called Flash of Unstyled Content or FOUC). It wants prasunchakra.com to look right from the start.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm5pfzjzm2cde58tdekwa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm5pfzjzm2cde58tdekwa.png" alt="DOM &amp;amp; CSSOM" width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Interaction Phase (JavaScript)&lt;/strong&gt;
Next comes JavaScript, which adds the dynamic parts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;JS is Parser Blocking that is when the browser hits a &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tag in the HTML for &lt;code&gt;prasunchakra.com&lt;/code&gt;, it stops parsing the rest of the HTML. It downloads the script, runs it, then continues.&lt;br&gt;
Why? Because JS can change the DOM on the fly, like adding or removing elements. The browser doesn't want to build something that JS might mess up right after.&lt;br&gt;
To fix, we use async or defer on script tags. Async loads JS without blocking but runs it as soon as it's ready. Defer waits until the HTML is fully parsed. That's how modern sites like prasunchakra.com speed things up!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The Visual Phase (Render Tree, Layout, and Paint)&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With DOM and CSSOM ready, the browser combines them to draw the page.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The Render Tree&lt;/em&gt;: It merges DOM and CSSOM, skipping hidden stuff like &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; or elements with &lt;code&gt;display: none&lt;/code&gt;. For prasunchakra.com, this creates a visible structure.&lt;br&gt;
&lt;em&gt;Layout (Reflow)&lt;/em&gt;: The browser calculates positions and sizes— like how wide a div is or where an image sits on prasunchakra.com.&lt;br&gt;
&lt;em&gt;Paint&lt;/em&gt;: It fills in the details: text, colors, borders, images—all the pixels for the page.&lt;br&gt;
&lt;em&gt;Compositing&lt;/em&gt;: For layered elements (like a sticky navbar on prasunchakra.com), it uses the GPU to combine them into the final screen image efficiently.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgzvom9d6ec43le1610p0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgzvom9d6ec43le1610p0.png" alt="Render Tree" width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With this we've covered the journey from typing prasunchakra.com into your browser to seeing the fully rendered page on your screen. It's a mix of DNS lookups, secure connections, and browser magic that makes the web feel effortless. But this is just the start and there's a lot more under the hood, like how the backend handles things or advanced topics in networking and security. Stay tuned!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>architecture</category>
    </item>
  </channel>
</rss>
