<?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>DEV Community: Kush</title>
    <description>The latest articles on DEV Community by Kush (@mavestorm).</description>
    <link>https://dev.to/mavestorm</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4069875%2F8bcf2a8b-8d9e-4e1a-8682-ed56a3256e65.jpg</url>
      <title>DEV Community: Kush</title>
      <link>https://dev.to/mavestorm</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mavestorm"/>
    <language>en</language>
    <item>
      <title>Backend Odyssey - Ep 03: Client vs server</title>
      <dc:creator>Kush</dc:creator>
      <pubDate>Wed, 12 Aug 2026 17:03:12 +0000</pubDate>
      <link>https://dev.to/mavestorm/backend-odyssey-ep-03-client-vs-server-4d56</link>
      <guid>https://dev.to/mavestorm/backend-odyssey-ep-03-client-vs-server-4d56</guid>
      <description>&lt;p&gt;In Episode #2 we learned the golden rule: the frontend runs on the user's machine, the backend runs on yours.&lt;/p&gt;

&lt;p&gt;Today we make the picture sharper. We keep saying "client" and "server", but what do those words really mean?&lt;/p&gt;

&lt;p&gt;Here is a small test. Your phone, your laptop, and your smart TV can all open YouTube. Are they all clients? And can one machine be a client and a server at the same time?&lt;/p&gt;

&lt;p&gt;By the end of this episode, you will answer both without thinking. And I will also settle the 5 questions from last time.&lt;/p&gt;




&lt;h2&gt;
  
  
  🙋 The Only Definition You Need
&lt;/h2&gt;

&lt;p&gt;Forget devices for a moment. Remember this one line:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;The client is the one who asks. The server is the one who answers.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That is the full definition. Nothing about hardware. Nothing about size. Nothing about location.&lt;/p&gt;

&lt;p&gt;Think of a shop. A customer walks in and asks for 2 kg of rice. The shopkeeper hands it over.&lt;/p&gt;

&lt;p&gt;The customer is not a customer because of who they are. They are a customer because of what they are doing right now: asking. The shopkeeper is the shopkeeper because they are answering.&lt;/p&gt;

&lt;p&gt;Same on the internet:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your phone asks Instagram for the feed. Right now, your phone is the &lt;strong&gt;client&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Instagram's machine answers with 30 posts. Right now, that machine is the &lt;strong&gt;server&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Client and server are roles in a conversation, not types of machines.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That single idea answers Question 1 from last episode: what makes something a client is not the device. It is the act of asking.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔁 Question 2: Can a Server Also Be a Client?
&lt;/h2&gt;

&lt;p&gt;Yes. And it happens millions of times every second.&lt;/p&gt;

&lt;p&gt;Remember Episode #1, Step 5? Your request reached the app server, and then the server turned around and asked the &lt;strong&gt;database&lt;/strong&gt; a question:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT * FROM articles ORDER BY created_at LIMIT 30;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look at what just happened:&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fb9swi53j65y4ahc1aj2i.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fb9swi53j65y4ahc1aj2i.png" alt=" " width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To your phone, the app server is the &lt;strong&gt;server&lt;/strong&gt;. It answers.&lt;/li&gt;
&lt;li&gt;To the database, the same app server is the &lt;strong&gt;client&lt;/strong&gt;. It asks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One machine, both roles, at the same moment.&lt;/p&gt;

&lt;p&gt;Real life works the same way. A shopkeeper sells rice to you. But in the morning, that same shopkeeper went to the wholesale market and bought 100 kg of rice from a bigger seller. Seller in one conversation, buyer in another.&lt;/p&gt;

&lt;p&gt;In a big app, this chain can be 4 or 5 levels deep. Your phone asks server A, server A asks server B, server B asks the database. Every arrow has a client side and a server side.&lt;/p&gt;




&lt;h2&gt;
  
  
  🍕 One Real Example, Traced Fully
&lt;/h2&gt;

&lt;p&gt;Let us watch one complete conversation, message by message. You are ordering a pizza in a food app.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fue3fpkb92hzmh2ste6e8.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fue3fpkb92hzmh2ste6e8.png" alt=" " width="799" height="453"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tap 1: you open the menu.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Your app asks: &lt;code&gt;GET /menu&lt;/code&gt; which means "show me the menu."&lt;/p&gt;

&lt;p&gt;The server answers: &lt;code&gt;200 OK&lt;/code&gt; with a list of 25 pizzas, about 18 KB of data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tap 2: you add a pizza.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Your app asks: &lt;code&gt;POST /cart&lt;/code&gt; which means "add 1 farmhouse pizza, size large."&lt;/p&gt;

&lt;p&gt;The server answers: &lt;code&gt;200 OK&lt;/code&gt;, your cart total is now 499 rupees.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tap 3: you place the order.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Your app asks: &lt;code&gt;POST /order&lt;/code&gt; which means "place the order, pay from wallet."&lt;/p&gt;

&lt;p&gt;The server checks your wallet balance in its database, sees 800 rupees, subtracts 499, and answers: &lt;code&gt;201 Created&lt;/code&gt;, order number 88231, arriving in 32 minutes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tap 4: you check the status.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Your app asks: &lt;code&gt;GET /order/88231&lt;/code&gt; which means "where is my pizza?"&lt;/p&gt;

&lt;p&gt;The server answers: &lt;code&gt;200 OK&lt;/code&gt;, status is "baking", 24 minutes left.&lt;/p&gt;

&lt;p&gt;That is the entire app. 4 questions, 4 answers.&lt;/p&gt;

&lt;p&gt;Now notice something in that diagram. Something that should bother you a little:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;The server never speaks first. It only ever answers.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The client always starts every conversation. Which brings us to the trickiest question from last time.&lt;/p&gt;




&lt;h2&gt;
  
  
  ✍️ Question 3: Google Docs Feels Like Magic. Is It Still Request and Response?
&lt;/h2&gt;

&lt;p&gt;You type a letter. Your friend, 1,200 km away, sees it appear in under 1 second. Nobody refreshed anything.&lt;/p&gt;

&lt;p&gt;If the server cannot speak first, how did your friend's screen learn about your letter?&lt;/p&gt;

&lt;p&gt;Here is the trick. Your friend's browser asked first. It just asked a very special question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Keep me updated. I will hold the line open."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Think of it like a phone call versus a text message. A normal request is a text: you ask, they reply, done. But your friend's browser placed a &lt;strong&gt;call&lt;/strong&gt; to the server and never hung up. The line stays open.&lt;/p&gt;

&lt;p&gt;Now when you type the letter "k":&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Your browser sends it to the server (a normal request, you asked first).&lt;/li&gt;
&lt;li&gt;The server looks at its list of open lines and sees your friend holding one.&lt;/li&gt;
&lt;li&gt;The server speaks into that open line: "he typed k."&lt;/li&gt;
&lt;li&gt;Your friend's screen updates. Total time: around 200 milliseconds.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So yes, even the magic is built on the same rule. The client opened the line first. The server never calls a stranger.&lt;/p&gt;

&lt;p&gt;This open line technique is called a &lt;strong&gt;WebSocket&lt;/strong&gt;. It gets its own full episode later in the series.&lt;/p&gt;




&lt;h2&gt;
  
  
  🛵 Question 4: How Does the Rider Move on Your Map?
&lt;/h2&gt;

&lt;p&gt;Your food app shows the delivery rider crawling along the road, updating every few seconds. There are exactly 2 ways to build this:&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhc2vx6w1jdvhz3r30o1o.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhc2vx6w1jdvhz3r30o1o.png" alt=" " width="799" height="413"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Way 1: Pull (also called polling).&lt;/strong&gt; Your phone simply asks again and again:&lt;/p&gt;

&lt;p&gt;"Where is the rider?" ... "Where is the rider?" ... "Where is the rider?"&lt;/p&gt;

&lt;p&gt;Say it asks every 5 seconds. That is 12 questions per minute. For a 30 minute delivery, that is &lt;strong&gt;360 requests&lt;/strong&gt;, and maybe 300 of them get the same answer as before. Wasteful, but very simple to build.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Way 2: Push (the open line).&lt;/strong&gt; Your phone asks once: "keep me updated." The server then pushes only real changes: "moved", "moved", "reached your door." For the same 30 minute delivery, maybe &lt;strong&gt;40 messages total&lt;/strong&gt; and zero waste.&lt;/p&gt;

&lt;p&gt;Most delivery apps actually use pull with a short gap, because it is simpler and a 5 second delay does not hurt anyone. Chat apps and multiplayer games use push, because a 5 second delay there would ruin everything.&lt;/p&gt;

&lt;p&gt;This is your first real taste of a backend engineering decision. Both ways work. The job is picking the right one for the situation. Here, the numbers decide: 360 wasteful requests versus 40 useful messages, against how much harder push is to build.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔌 Question 5: The Server Dies. What Still Works?
&lt;/h2&gt;

&lt;p&gt;Imagine Instagram's servers go down for 10 minutes. Open the app. What happens?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Scrolling posts you already loaded: &lt;strong&gt;works&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;The like animation when you tap a heart: &lt;strong&gt;works&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Loading even 1 new post: &lt;strong&gt;dead&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Sending 1 message: &lt;strong&gt;dead&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Logging in on a new phone: &lt;strong&gt;dead&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;See the pattern? Everything that lives on your device keeps working. Everything that needs the shared truth from Episode #2 stops.&lt;/p&gt;

&lt;p&gt;Your phone is like a water tank on your roof. If the city supply stops, you can still use whatever is in the tank. But the tank cannot refill itself.&lt;/p&gt;

&lt;p&gt;Some apps prepare for this on purpose. Google Docs lets you keep typing with no internet, saves your changes in the phone's own storage, and syncs everything to the server when the line returns. That design has a name: &lt;strong&gt;offline first&lt;/strong&gt;. Your changes wait patiently in the tank until the city supply is back.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎯 What Interviewers Ask About This
&lt;/h2&gt;

&lt;p&gt;This exact topic, as it appears in real interviews:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. "Explain the client server model."&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One line: the client asks, the server answers, and these are roles in a conversation, not types of machines. Then give the app server and database example to show one machine playing both roles.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. "Can a server be a client?"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Yes. Every time your backend calls a database, a payment gateway, or another service, it is acting as a client in that conversation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. "What is polling? What are its drawbacks?"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Asking repeatedly on a timer. Simple, but wasteful: at a 5 second gap, 1 user costs 720 requests per hour even when nothing changes. Mention WebSockets as the push alternative.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. "How would you build live order tracking?"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Show the tradeoff: polling every 5 seconds is fine for a delivery map, push is needed for chat. Interviewers love hearing that both are valid and the situation decides.&lt;/p&gt;




&lt;h2&gt;
  
  
  🌱 The Key Idea Behind It All
&lt;/h2&gt;

&lt;p&gt;The whole internet runs on one tiny pattern, repeated billions of times per second:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Someone asks. Someone answers.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;A phone asks a server: client and server.&lt;/li&gt;
&lt;li&gt;That server asks a database: client and server again.&lt;/li&gt;
&lt;li&gt;A browser holds a line open, and the server speaks into it: still client first.&lt;/li&gt;
&lt;li&gt;The server goes silent, and only the asking side survives on whatever it saved.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once you see conversations instead of machines, every system diagram in the world becomes easy to read. It is just arrows of asking and answering.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;This concludes Episode #3 of Backend Odyssey&lt;/strong&gt;, a series that starts from the very beginning and slowly explores what really happens behind the scenes when you use the internet.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Episode #4 is "HTTP Explained From Scratch"&lt;/strong&gt;. The language every ask and answer is written in. We will read raw requests line by line, and you will never look at a URL the same way again.&lt;/p&gt;

&lt;p&gt;Before you go. here are &lt;strong&gt;5 questions to sit with&lt;/strong&gt;. Try answering them in the comments; Episode #4 answers all five:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You have seen &lt;code&gt;http://&lt;/code&gt; and &lt;code&gt;https://&lt;/code&gt; at the start of URLs. What do those letters actually stand for, and what is the 1 letter difference doing?&lt;/li&gt;
&lt;li&gt;When a form asks for your password, why is it sent with POST and not GET? What would go wrong with GET?&lt;/li&gt;
&lt;li&gt;If you refresh a page 5 times, is that 5 identical requests? Does the server know it is you all 5 times?&lt;/li&gt;
&lt;li&gt;What is inside a URL like &lt;code&gt;dev.to/search?q=backend&amp;amp;page=2&lt;/code&gt; after the question mark? Who reads that part?&lt;/li&gt;
&lt;li&gt;HTTP is called "stateless." The server forgets you after every single request. Then how does any website keep you logged in?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Think you know some of these? Drop your answers below. I'll tell you if you're right in Episode #4, and the best answers get a shoutout.&lt;/p&gt;

&lt;p&gt;If you found it useful, &lt;strong&gt;follow and subscribe&lt;/strong&gt; to receive future episodes as they are published.&lt;/p&gt;

&lt;p&gt;– Your friendly neighbourhood KS 🕸️&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Backend Odyssey - Ep 02: What Is a Backend? And Why Do We Need One? ⚫</title>
      <dc:creator>Kush</dc:creator>
      <pubDate>Mon, 10 Aug 2026 06:57:37 +0000</pubDate>
      <link>https://dev.to/mavestorm/backend-odyssey-ep-02-what-is-a-backend-and-why-do-we-need-one-3549</link>
      <guid>https://dev.to/mavestorm/backend-odyssey-ep-02-what-is-a-backend-and-why-do-we-need-one-3549</guid>
      <description>&lt;p&gt;In Episode #1 we followed one request on its full journey — DNS, TCP, HTTPS, and finally a server that did some work and sent back a page.&lt;/p&gt;

&lt;p&gt;Missed it? Start here:&lt;/p&gt;

&lt;p&gt;Today we zoom into that server. Because there is a question that sounds obvious — until someone asks it in an interview and your mind goes blank:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"What is a backend? And why do we even need one?"&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Browsers today are incredibly powerful. They run 3D games. They edit videos. They have their own storage, their own databases, their own everything.&lt;/p&gt;

&lt;p&gt;So why can't the browser just &lt;em&gt;be&lt;/em&gt; the whole app?&lt;/p&gt;

&lt;p&gt;By the end of this episode, you'll have an answer you can explain to anyone — and I'll also settle the 5 questions I left you with last time.&lt;/p&gt;




&lt;h2&gt;
  
  
  🍽️ The Restaurant, Properly This Time
&lt;/h2&gt;

&lt;p&gt;In Episode #1, I briefly compared the server to a restaurant kitchen. Let's now build the full picture, because this one analogy explains almost everything.&lt;/p&gt;

&lt;p&gt;A restaurant has two worlds:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The dining hall&lt;/strong&gt; — beautiful tables, a menu, a waiter who takes your order. This is everything the customer sees and touches.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The kitchen&lt;/strong&gt; — the recipes, the ingredients, the pantry, the locked cash box. Customers never enter. There is literally a door with a "STAFF ONLY" sign.&lt;/p&gt;

&lt;p&gt;Every app you have ever used is built exactly like this:&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs2441srlpu6feo7fkzat.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs2441srlpu6feo7fkzat.png" alt=" " width="800" height="427"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The frontend is the dining hall.&lt;/strong&gt; It runs on &lt;em&gt;your&lt;/em&gt; device — your browser, your phone. Buttons, forms, colors, animations. Its job is presentation: take your order, and serve the plate nicely.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The backend is the kitchen.&lt;/strong&gt; It runs on computers you will never see. It holds the recipes (business logic), the pantry (the database), the gatekeeper (authentication), and the safe (secrets and keys).&lt;/p&gt;

&lt;p&gt;And the waiter walking between the two worlds, carrying orders in and plates out?&lt;/p&gt;

&lt;p&gt;That's &lt;strong&gt;HTTP&lt;/strong&gt; — the request/response cycle from Episode #1.&lt;/p&gt;




&lt;h2&gt;
  
  
  🚪 The One Sentence That Explains Everything
&lt;/h2&gt;

&lt;p&gt;Here it is. If you remember nothing else from this episode, remember this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;The frontend runs on the user's machine. The backend runs on yours.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Why does that one sentence matter so much?&lt;/p&gt;

&lt;p&gt;Because &lt;em&gt;anything&lt;/em&gt; that runs on the user's machine belongs to the user.&lt;/p&gt;

&lt;p&gt;They can read it. They can copy it. They can modify it. Every line of JavaScript, every hidden field, every "please don't touch this" comment — it is all sitting on &lt;em&gt;their&lt;/em&gt; device, fully under &lt;em&gt;their&lt;/em&gt; control.&lt;/p&gt;

&lt;p&gt;The backend is the only part of your app that users &lt;strong&gt;cannot open, cannot read, and cannot edit&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Which means it is the only place where you can keep:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Truth&lt;/strong&gt; (the real data)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rules&lt;/strong&gt; (the real logic)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Secrets&lt;/strong&gt; (the real keys)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now let's use this one idea to answer all 5 questions from last episode.&lt;/p&gt;




&lt;h2&gt;
  
  
  🏦 Question 3 First — The Bank Balance Experiment
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;"If DevTools lets me edit any website live on my screen, why can't I change my bank balance?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;You absolutely can change the number on your screen. Try it! Open your bank's website, press F12, find the balance, type ₹99,99,999.&lt;/p&gt;

&lt;p&gt;Congratulations — you are rich.&lt;/p&gt;

&lt;p&gt;For about four seconds.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw1kuwg8ytk96cmq2a2jz.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw1kuwg8ytk96cmq2a2jz.png" alt=" " width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here is why it means nothing. What you edited was your &lt;strong&gt;local copy&lt;/strong&gt; — pixels on your machine. The bank's &lt;em&gt;actual&lt;/em&gt; record of your money never left the bank's server.&lt;/p&gt;

&lt;p&gt;The moment you try to &lt;em&gt;do&lt;/em&gt; anything — withdraw, transfer, even refresh the page — your browser must send a request across the wire. And on the other side, the server ignores your beautiful edited number completely. It checks &lt;strong&gt;its own database&lt;/strong&gt;, sees ₹500, and calmly replies:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;403 Forbidden — nice try.&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This gives us the golden rule of backend engineering:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;The frontend is a suggestion. The backend is the decision.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Editing the frontend is like crossing out the price on a restaurant menu with your own pen and writing "₹1". The kitchen doesn't care. The billing counter runs on &lt;em&gt;their&lt;/em&gt; price list, not your menu.&lt;/p&gt;




&lt;h2&gt;
  
  
  📱 Question 2 — Where Does Your Instagram Feed Live?
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;"When you check Instagram, where does that data actually live — on your phone, or somewhere else? And why there?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Think about what you expect from Instagram:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You post from your phone, and your friend in another city sees it &lt;strong&gt;instantly&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;You log in from a brand-new phone, and everything is &lt;strong&gt;still there&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;You and 2 billion other people see &lt;strong&gt;one consistent world&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of this is possible if the data lives on your phone.&lt;/p&gt;

&lt;p&gt;If your feed lived on your device, your friend's phone would have no way to know about your new post. Every phone would hold its own little disconnected universe.&lt;/p&gt;

&lt;p&gt;Shared data needs a &lt;strong&gt;shared home&lt;/strong&gt; — one central place that every device reads from and writes to. That home is the backend's database.&lt;/p&gt;

&lt;p&gt;Your phone holds, at most, a &lt;strong&gt;temporary copy&lt;/strong&gt; (a cache — Episode #1's favorite idea) so scrolling feels fast. The truth lives on the server.&lt;/p&gt;

&lt;p&gt;This is backend job #1: &lt;strong&gt;keep the data in one place, so everyone sees the same world.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🎬 Question 4 — Same URL, Different Content. How?
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;"Two users open the same website at the same moment and see completely different content. Same URL, same server — how?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Because the URL is not the whole request.&lt;/p&gt;

&lt;p&gt;Remember the HTTP request from Episode #1? It carried a &lt;strong&gt;cookie&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GET / HTTP/1.1
Host: instagram.com
Cookie: session=xyz789
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you logged in, the server gave your browser a cookie — think of it as a &lt;strong&gt;coat-check token&lt;/strong&gt;. Your browser attaches it to every future request automatically.&lt;/p&gt;

&lt;p&gt;So when two people request the same URL:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Request A arrives carrying &lt;em&gt;your&lt;/em&gt; token → the server looks it up → "this is Kush" → builds &lt;strong&gt;Kush's feed&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Request B arrives carrying &lt;em&gt;her&lt;/em&gt; token → "this is Aditee" → builds &lt;strong&gt;Aditee's feed&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Same door, same restaurant — but the waiter recognizes each regular customer and brings &lt;em&gt;their&lt;/em&gt; usual order.&lt;/p&gt;

&lt;p&gt;The page you see is not a file sitting on a server. It is &lt;strong&gt;cooked fresh, per person, per request&lt;/strong&gt; — by backend logic.&lt;/p&gt;




&lt;h2&gt;
  
  
  ✅ Question 5 — Why Validate Twice?
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;"Frontend validation already checks the email format. Why does the server check it again?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Here is the uncomfortable truth: &lt;strong&gt;attackers don't use your frontend.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Your pretty form with its red error messages? That's just one polite way to talk to your server. Anyone can skip it entirely and speak to your API directly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; POST https://yourapp.com/api/register &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{"email": "not-an-email-lol", "age": -50}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One line in a terminal — and every frontend check you wrote is bypassed. Never ran. Doesn't exist.&lt;/p&gt;

&lt;p&gt;So what is frontend validation for? &lt;strong&gt;Politeness.&lt;/strong&gt; It gives honest users instant feedback without a round trip. It is a UX feature.&lt;/p&gt;

&lt;p&gt;Backend validation is the actual &lt;strong&gt;security&lt;/strong&gt;. It is the airport: you check your passport at home (convenient), but the airport checks it again at the gate (mandatory) — because the airport cannot trust that everyone checked at home.&lt;/p&gt;

&lt;p&gt;Rule: &lt;strong&gt;frontend validation is for user experience, backend validation is for survival.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  💪 Question 1 — So Why Can't the Browser Be Everything?
&lt;/h2&gt;

&lt;p&gt;Now we can answer the big one properly.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"Browsers can run 3D games and edit videos. Why does a server need to exist at all?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Because power was never the problem. The browser fails for reasons no amount of power can fix:&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwqf1hg2ucryj2tho1mi6.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwqf1hg2ucryj2tho1mi6.png" alt=" " width="799" height="413"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Shared data needs one home.&lt;/strong&gt; Your feed, your messages, your orders — every device must see the same truth (Question 2).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Someone neutral must referee.&lt;/strong&gt; Two people grab the last movie seat in the same second. Two browsers can't settle that argument — a single central authority must decide who clicked first. (This gets a whole episode later: it's called a &lt;em&gt;race condition&lt;/em&gt;.)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Secrets can't be shipped.&lt;/strong&gt; Your app's payment keys, database passwords — anything sent to a browser can be read by anyone with F12. Secrets can only live where users can't look.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Nothing from the client can be trusted.&lt;/strong&gt; Questions 3 and 5. The backend is the last line of defense.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Heavy work needs big machines.&lt;/strong&gt; Searching a billion rows, resizing videos, sending 10,000 emails — no phone battery should ever do that.&lt;/p&gt;

&lt;p&gt;So even in a world of super-powerful browsers, we would still need backends. Not for &lt;em&gt;power&lt;/em&gt; — for &lt;strong&gt;shared truth, neutral refereeing, and trust.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🎯 What Interviewers Ask About This
&lt;/h2&gt;

&lt;p&gt;This exact topic, as it appears in real interviews:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. "What's the difference between frontend and backend?"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Weak answer: "frontend is what you see, backend is behind the scenes." Strong answer: &lt;em&gt;where the code runs&lt;/em&gt; — frontend runs on the user's device (untrusted), backend runs on servers you control (trusted). Everything else follows from that.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. "Why can't we do authorization on the frontend?"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Because the user controls the frontend. Hiding a button is cosmetic; the API behind it must do the real check, or anyone with curl walks right past your UI.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. "Client-side vs server-side validation — do we need both?"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Yes. Client-side for instant UX, server-side for security. Only the server-side one is mandatory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. "Where should sensitive keys be stored?"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Only on the backend (environment variables / secret managers). Anything in frontend code is public, no matter how well hidden.&lt;/p&gt;




&lt;h2&gt;
  
  
  🌱 The Key Idea Behind It All
&lt;/h2&gt;

&lt;p&gt;A backend is not "the hard part" or "the part with databases."&lt;/p&gt;

&lt;p&gt;A backend is simply: &lt;strong&gt;the part of your app that runs on machines the user cannot touch.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That single property — &lt;em&gt;out of the user's reach&lt;/em&gt; — is what makes it the only possible home for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Truth&lt;/strong&gt; — the real data, shared by everyone&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rules&lt;/strong&gt; — logic that no one can skip&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Secrets&lt;/strong&gt; — keys that no one can read&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The frontend proposes. The backend decides.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;This concludes Episode #2 of Backend Odyssey&lt;/strong&gt;, a series that starts from the very beginning and slowly explores what really happens behind the scenes when you use the internet.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Episode #3 is "Client vs Server — Explained With a Real Example"&lt;/strong&gt; — we take one real app and trace a complete conversation between client and server, message by message, so you can see exactly who says what, and when.&lt;/p&gt;

&lt;p&gt;Before you go — here are &lt;strong&gt;5 questions to sit with&lt;/strong&gt;. Try answering them in the comments; Episode #3 answers all five:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Your phone, your laptop, and your smart TV can all be "clients." What exactly makes something a client — the device, or something else?&lt;/li&gt;
&lt;li&gt;Can a server also be a client at the same time? (Hint: think about what happened in Episode #1, Step 5.)&lt;/li&gt;
&lt;li&gt;When you're typing in Google Docs and your friend sees your letters appear live — is that still request/response? Who is asking whom?&lt;/li&gt;
&lt;li&gt;A food delivery app shows the rider moving on the map every few seconds. How does your phone keep getting fresh locations — does the server "push," or does your phone keep "pulling"?&lt;/li&gt;
&lt;li&gt;If the server is so important, what happens to the app when the server goes down — and why do some features still work offline?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Think you know some of these? Drop your answers below — I'll tell you if you're right in Episode #3, and the best answers get a shoutout.&lt;/p&gt;

&lt;p&gt;If you found it useful, &lt;strong&gt;follow and subscribe&lt;/strong&gt; to receive future episodes as they are published.&lt;/p&gt;

&lt;p&gt;– Your friendly neighbourhood KS 🕸️&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Backend Odyssey — Ep 01: What Actually Happens When You Open a Website?</title>
      <dc:creator>Kush</dc:creator>
      <pubDate>Sun, 09 Aug 2026 14:13:39 +0000</pubDate>
      <link>https://dev.to/mavestorm/backend-odyssey-ep-01-what-actually-happens-when-you-open-a-website-29p2</link>
      <guid>https://dev.to/mavestorm/backend-odyssey-ep-01-what-actually-happens-when-you-open-a-website-29p2</guid>
      <description>&lt;p&gt;You type &lt;code&gt;dev.to&lt;/code&gt;, press Enter, and about &lt;strong&gt;200 milliseconds later&lt;/strong&gt; a full page appears on your screen.&lt;/p&gt;

&lt;p&gt;It feels like magic. But it is not magic — it is a chain of small, simple steps.&lt;/p&gt;

&lt;p&gt;Your request travels across cities. It gets translated into different languages that machines speak. It gets locked inside an envelope, wakes up a computer far away, asks a database a question, and comes all the way back — as the pixels you are looking at right now.&lt;/p&gt;

&lt;p&gt;This is &lt;strong&gt;Episode #1 of Backend Odyssey&lt;/strong&gt;, a series where we start from the very beginning and slowly explore what really happens behind the scenes when you use the internet.&lt;/p&gt;

&lt;p&gt;Today we answer the most famous question in all of backend engineering — the same one interviewers love to ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"What happens when you type a URL and press Enter?"&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let's follow one request on its full journey.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4377ilaj5jm9sz0hfyld.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4377ilaj5jm9sz0hfyld.png" alt=" " width="799" height="373"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  👜 Step 0 — The Browser Checks Its Pockets First
&lt;/h2&gt;

&lt;p&gt;Before touching the network, the browser asks itself one question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Have I been here recently?"&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Think about how you visit a friend. You don't look up their address every single time — you remember it after the first visit.&lt;/p&gt;

&lt;p&gt;The browser does the same. It keeps small notes from past visits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Browser cache&lt;/strong&gt; — "Do I already have a copy of this page saved?"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DNS cache&lt;/strong&gt; — "Do I already know this website's address?"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the answer is yes, whole steps of the journey get skipped.&lt;/p&gt;

&lt;p&gt;This is exactly why the &lt;strong&gt;second&lt;/strong&gt; visit to any website feels much faster than the first.&lt;/p&gt;

&lt;p&gt;Keep this idea in your head: &lt;strong&gt;never repeat work you have already done.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It is one of the most important ideas in backend engineering. We will meet it again and again — in Redis, in CDNs, in every caching system ever built.&lt;/p&gt;

&lt;p&gt;But today the pockets are empty. Time to find the address.&lt;/p&gt;




&lt;h2&gt;
  
  
  📞 Step 1 — DNS: The Internet's Phonebook
&lt;/h2&gt;

&lt;p&gt;Here is a surprising truth: &lt;strong&gt;the internet has no idea what "dev.to" means.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Computers do not find each other using names. They find each other using &lt;strong&gt;IP addresses&lt;/strong&gt; — numbers like &lt;code&gt;151.101.2.217&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Names exist only for us humans, because nobody wants to remember numbers.&lt;/p&gt;

&lt;p&gt;So the very first job is translation: &lt;strong&gt;turn the name into a number.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Think of calling a friend. You know their &lt;strong&gt;name&lt;/strong&gt;, but your phone needs their &lt;strong&gt;number&lt;/strong&gt; to place the call. The thing that converts name → number is your contacts list.&lt;/p&gt;

&lt;p&gt;The internet's contacts list is called &lt;strong&gt;DNS — the Domain Name System.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It is a giant phonebook, spread across the whole world, that no single company owns.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmk4oi03ct67ahwto4fup.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmk4oi03ct67ahwto4fup.png" alt=" " width="799" height="413"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When your browser doesn't know the number, a chain of questions begins:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Ask the Resolver&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Your computer asks a &lt;strong&gt;resolver&lt;/strong&gt; — usually run by your internet provider, or a public one like Google's &lt;code&gt;8.8.8.8&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The resolver is like a helpful librarian. It does all the searching for you.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Ask the Root Server&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The resolver asks a &lt;strong&gt;root server&lt;/strong&gt;: &lt;em&gt;"Who handles &lt;code&gt;.to&lt;/code&gt; websites?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The root server doesn't know dev.to. But it knows who to ask next.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Ask the TLD Server&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;TLD server&lt;/strong&gt; — the boss of all &lt;code&gt;.to&lt;/code&gt; domains — says: &lt;em&gt;"Ask dev.to's own nameserver."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Ask the Authoritative Nameserver&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The one server that truly knows, finally answers:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"dev.to lives at &lt;code&gt;151.101.2.217&lt;/code&gt;."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Notice the pattern. Nobody knows the full answer — but everybody knows &lt;strong&gt;who to ask next&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Just like asking for directions in a new city: &lt;em&gt;"I don't know that shop, but go ask at the market."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;And here is the clever part: the answer gets &lt;strong&gt;cached at every layer&lt;/strong&gt; — your browser, your operating system, the resolver — with an expiry time called a &lt;strong&gt;TTL&lt;/strong&gt; (time to live).&lt;/p&gt;

&lt;p&gt;For the next few minutes, nobody in this chain needs to ask again.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Try it yourself right now:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dig dev.to

&lt;span class="c"&gt;# the interesting part of the output:&lt;/span&gt;
&lt;span class="c"&gt;# ;; ANSWER SECTION:&lt;/span&gt;
&lt;span class="c"&gt;# dev.to.    300    IN    A    151.101.2.217&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That &lt;code&gt;300&lt;/code&gt; is the TTL, in seconds. For 5 minutes, this answer is remembered everywhere.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 &lt;strong&gt;Backend engineer's takeaway:&lt;/strong&gt; this is why changing your server's IP in production is never instant. Old cached answers around the world expire on &lt;em&gt;their&lt;/em&gt; schedule — not yours.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  🤝 Step 2 — TCP: Agreeing to Talk Before Talking
&lt;/h2&gt;

&lt;p&gt;Good — we have the number. Can we just start sending data now?&lt;/p&gt;

&lt;p&gt;Not yet.&lt;/p&gt;

&lt;p&gt;The internet is an unreliable place. Packets of data get lost, arrive twice, or arrive in the wrong order — &lt;strong&gt;all the time&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Before sending anything important, both sides need to be sure the other one is actually listening.&lt;/p&gt;

&lt;p&gt;Think of a phone call. You don't start speaking the moment you dial. First:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You: &lt;em&gt;"Hello?"&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Friend: &lt;em&gt;"Hello! Yes, I can hear you."&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;You: &lt;em&gt;"Great, I can hear you too."&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Only then does the real conversation begin.&lt;/p&gt;

&lt;p&gt;Computers do exactly this. It is called the &lt;strong&gt;TCP 3-way handshake&lt;/strong&gt;:&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fytgqbwtpaccqgeorg1j7.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fytgqbwtpaccqgeorg1j7.png" alt=" " width="800" height="360"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. SYN&lt;/strong&gt; — your browser says: &lt;em&gt;"Hey, can we talk?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. SYN-ACK&lt;/strong&gt; — the server replies: &lt;em&gt;"Yes! I hear you. Can you hear me?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. ACK&lt;/strong&gt; — your browser confirms: &lt;em&gt;"Loud and clear. Let's go."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;TCP also numbers every piece of data it sends — like numbering the pages of a letter.&lt;/p&gt;

&lt;p&gt;If page 3 goes missing in the post, the receiver notices the gap and asks for page 3 again. That is how TCP guarantees everything arrives, complete and in order.&lt;/p&gt;

&lt;p&gt;One important detail: this hello-hello costs &lt;strong&gt;one full round trip before any real data moves&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If the server is 150ms away, you pay 150ms just to say hello.&lt;/p&gt;

&lt;p&gt;Distance costs time on the internet. This is why companies place servers close to users — that's what a &lt;strong&gt;CDN&lt;/strong&gt; is. Latency is not a software bug. It is physics.&lt;/p&gt;

&lt;p&gt;One more small thing: your browser connects to a specific &lt;strong&gt;port&lt;/strong&gt; on that machine — port &lt;code&gt;443&lt;/code&gt; for secure websites.&lt;/p&gt;

&lt;p&gt;Think of the IP address as a building, and ports as its doors. One building, many doors, each for a different purpose.&lt;/p&gt;




&lt;h2&gt;
  
  
  ✉️ Step 3 — HTTPS: Sealing the Envelope
&lt;/h2&gt;

&lt;p&gt;Before the real conversation starts on port 443, one more handshake happens — the &lt;strong&gt;TLS handshake&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Two things get done here:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Identity check&lt;/strong&gt; — the server shows its &lt;strong&gt;certificate&lt;/strong&gt;. Think of it as an ID card that proves &lt;em&gt;"I really am dev.to, not an impostor."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Secret code&lt;/strong&gt; — both sides agree on encryption keys. From this moment, everything they exchange is scrambled.&lt;/p&gt;

&lt;p&gt;Sending data without TLS is like sending a &lt;strong&gt;postcard&lt;/strong&gt; — anyone who handles it on the way (the coffee shop Wi-Fi, your internet provider) can read it.&lt;/p&gt;

&lt;p&gt;With TLS, it becomes a &lt;strong&gt;sealed, locked envelope&lt;/strong&gt;. People can see that a letter is travelling. Nobody can read what is inside.&lt;/p&gt;

&lt;p&gt;That is the entire meaning of the padlock 🔒 in your address bar:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Identity verified. Envelope sealed.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  💬 Step 4 — HTTP: Finally Asking the Actual Question
&lt;/h2&gt;

&lt;p&gt;The line is open and secure. &lt;em&gt;Now&lt;/em&gt; the browser can finally ask for what it wanted all along.&lt;/p&gt;

&lt;p&gt;And here is the beautiful part — an HTTP request is just &lt;strong&gt;plain, readable text&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GET / HTTP/1.1
Host: dev.to
User-Agent: Mozilla/5.0 ...
Accept: text/html
Cookie: remember_token=abc123
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read it like a sentence:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"&lt;/em&gt;&lt;em&gt;GET&lt;/em&gt;* me the page at &lt;strong&gt;/&lt;/strong&gt;. I speak &lt;strong&gt;HTTP version 1.1&lt;/strong&gt;. I'm looking for the website called &lt;strong&gt;dev.to&lt;/strong&gt;. Here is my browser's name — and here is a &lt;strong&gt;cookie&lt;/strong&gt; so you remember who I am."*&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's it.&lt;/p&gt;

&lt;p&gt;The protocol that runs the entire web is text a human can read. No secret binary language. No magic.&lt;/p&gt;

&lt;p&gt;(Methods like GET and POST, headers, cookies — each gets its own episode very soon.)&lt;/p&gt;




&lt;h2&gt;
  
  
  🍳 Step 5 — The Server: Where the Backend Begins
&lt;/h2&gt;

&lt;p&gt;Everything until now was just &lt;em&gt;delivery&lt;/em&gt; — like a letter travelling through the postal system.&lt;/p&gt;

&lt;p&gt;This step is where someone actually &lt;strong&gt;opens the letter and does the work&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This is the backend. And it is what this entire series is about.&lt;/p&gt;

&lt;p&gt;Let's use a restaurant analogy. Your HTTP request is the food order. Here is what happens in the kitchen:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;the order arrives
   → middleware checks it     (real customer? allowed in? note it in the logbook)
   → the router reads it      "GET /  →  send this to the HomeController"
   → business logic runs      "this user needs their article feed"
   → the database is asked    SELECT ... FROM articles ORDER BY ... LIMIT 30
   → the response is cooked   raw data becomes HTML (or JSON)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two things here are worth pausing on.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. The database is a separate conversation.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Your server doesn't contain the data inside itself. It turns around and &lt;em&gt;asks another machine&lt;/em&gt; — the database — in its own language (SQL).&lt;/p&gt;

&lt;p&gt;The waiter takes your order. But the kitchen actually makes the food.&lt;/p&gt;

&lt;p&gt;Backends are chains of question-and-answer, all the way down.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. The server trusts nothing.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That cookie could be fake. The input could be malicious.&lt;/p&gt;

&lt;p&gt;The server checks everything itself, because it is the &lt;strong&gt;last line of defense&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;And this is the real answer to &lt;em&gt;"why do we even need a backend?"&lt;/em&gt; — which is exactly where Episode #2 begins.&lt;/p&gt;




&lt;h2&gt;
  
  
  🏠 Step 6 — The Response Comes Home
&lt;/h2&gt;

&lt;p&gt;The kitchen is done. The server sends back another plain-text message — and this one starts with a &lt;strong&gt;status code&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Set-Cookie: session=xyz789; HttpOnly; Secure

&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
  ...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;200 OK&lt;/code&gt; means &lt;em&gt;"everything went well, here is your page."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;It could have been:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;404&lt;/code&gt; — "no such page exists"&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;301&lt;/code&gt; — "this page moved"&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;500&lt;/code&gt; — "I crashed while cooking your order"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One glance at the number, and the browser knows how the story ended.&lt;/p&gt;

&lt;p&gt;The browser reads the HTML and discovers it needs more — stylesheets, scripts, images.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Each one repeats a smaller version of this entire journey.&lt;/strong&gt; A normal page fires off dozens of these little journeys.&lt;/p&gt;

&lt;p&gt;Then the browser arranges everything and paints the pixels.&lt;/p&gt;

&lt;p&gt;Total time: about 200 milliseconds. A worldwide phonebook lookup, two handshakes, a sealed envelope, a restaurant kitchen, a database question — and it all just &lt;em&gt;worked&lt;/em&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧪 Try It Yourself: Watch the Journey Live
&lt;/h2&gt;

&lt;p&gt;Don't take my word for any of this. Open a terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# 1. The phonebook lookup, done by hand&lt;/span&gt;
dig dev.to +short

&lt;span class="c"&gt;# 2. The physical route your data takes (every line = a real machine)&lt;/span&gt;
traceroute dev.to        &lt;span class="c"&gt;# on Windows: tracert dev.to&lt;/span&gt;

&lt;span class="c"&gt;# 3. The ENTIRE journey, with a stopwatch on every step&lt;/span&gt;
curl &lt;span class="nt"&gt;-v&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; /dev/null &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="nt"&gt;-w&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;DNS: %{time_namelookup}s&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;TCP: %{time_connect}s&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;TLS: %{time_appconnect}s&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;First byte: %{time_starttransfer}s&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;Total: %{time_total}s&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; https://dev.to
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That last command prints the time taken by every single step from this article.&lt;/p&gt;

&lt;p&gt;Run it twice — you will &lt;em&gt;see&lt;/em&gt; the DNS step become nearly zero on the second run. That's caching, live, on your own machine.&lt;/p&gt;

&lt;p&gt;You can also open &lt;strong&gt;DevTools → Network tab&lt;/strong&gt;, refresh any page, and click the first request. The "Timing" panel there is literally this blog post, measured.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎯 What Interviewers Ask About This
&lt;/h2&gt;

&lt;p&gt;This exact topic, as it appears in real interviews:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. "Walk me through what happens when you type google.com."&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The classic. A strong answer covers, in order: cache checks → DNS → TCP handshake → TLS → HTTP request → server work → response → rendering.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. "Why is the first visit to a website slower than the second?"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Caching at many layers — DNS cache, browser cache, and reused connections.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. "What's the difference between an IP address and a domain name?"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Names are for humans. DNS translates them into the numbers machines route with.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. "Why does latency matter even when internet speed is high?"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Handshakes cost full round trips &lt;em&gt;before&lt;/em&gt; any data flows. Distance is paid in round trips, not in megabits.&lt;/p&gt;




&lt;h2&gt;
  
  
  🌱 The Key Idea Behind It All
&lt;/h2&gt;

&lt;p&gt;The internet is not one big system. It is many small, simple systems — each doing one job, each handing off to the next.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The browser &lt;strong&gt;remembers&lt;/strong&gt; (caching)&lt;/li&gt;
&lt;li&gt;DNS &lt;strong&gt;translates&lt;/strong&gt; (names → numbers)&lt;/li&gt;
&lt;li&gt;TCP &lt;strong&gt;guarantees&lt;/strong&gt; (reliable delivery)&lt;/li&gt;
&lt;li&gt;TLS &lt;strong&gt;protects&lt;/strong&gt; (sealed envelopes)&lt;/li&gt;
&lt;li&gt;HTTP &lt;strong&gt;asks&lt;/strong&gt; (readable questions)&lt;/li&gt;
&lt;li&gt;The server &lt;strong&gt;thinks&lt;/strong&gt; (the backend)&lt;/li&gt;
&lt;li&gt;The database &lt;strong&gt;remembers everything&lt;/strong&gt; (the source of truth)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every box in the first diagram becomes its own deep-dive episode in this series.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;This concludes Episode #1 of Backend Odyssey&lt;/strong&gt;, a series that starts from the very beginning and slowly explores what really happens behind the scenes when you use the internet.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Episode #2 is "What Is a Backend? And Why Do We Need One?"&lt;/strong&gt; — we zoom into Step 5 of today's journey and draw the exact line between client and server.&lt;/p&gt;

&lt;p&gt;Before you go — here are &lt;strong&gt;5 questions to sit with&lt;/strong&gt;. Try answering them in the comments; Episode #2 answers all five:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Browsers today can run full 3D games and edit videos. So why can't the browser just &lt;em&gt;be&lt;/em&gt; the whole app — why does a server need to exist at all?&lt;/li&gt;
&lt;li&gt;When you check your Instagram feed, where does that data actually live — on your phone, or somewhere else? And why &lt;em&gt;there&lt;/em&gt;?&lt;/li&gt;
&lt;li&gt;If I open my browser's DevTools, I can edit any website's code live on my screen. Why doesn't that let me change my bank balance?&lt;/li&gt;
&lt;li&gt;Two users open the same website at the same moment and see completely different content. Same URL, same server — how?&lt;/li&gt;
&lt;li&gt;Frontend validation already checks that your email format is correct before submitting. Why does the server check it &lt;em&gt;again&lt;/em&gt;?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Think you know some of these? Drop your answers below — I'll tell you if you're right in Episode #2, and the best answers get a shoutout.&lt;/p&gt;

&lt;p&gt;If you found it useful, &lt;strong&gt;follow and subscribe&lt;/strong&gt; to receive future episodes as they are published.&lt;/p&gt;

&lt;p&gt;– Your friendly neighbourhood KS 🕸️&lt;/p&gt;

</description>
      <category>backend</category>
      <category>webdev</category>
      <category>interview</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
