<?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: Vigneshkumar Selvaraj</title>
    <description>The latest articles on DEV Community by Vigneshkumar Selvaraj (@vigneshkumars-dev).</description>
    <link>https://dev.to/vigneshkumars-dev</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%2F4005295%2Fa4817dec-5842-4207-bd14-85a68ccb8d5c.jpg</url>
      <title>DEV Community: Vigneshkumar Selvaraj</title>
      <link>https://dev.to/vigneshkumars-dev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vigneshkumars-dev"/>
    <language>en</language>
    <item>
      <title>DNS Explained for Beginners: How Does the Internet Find a Website?</title>
      <dc:creator>Vigneshkumar Selvaraj</dc:creator>
      <pubDate>Fri, 30 Oct 2026 13:12:12 +0000</pubDate>
      <link>https://dev.to/vigneshkumars-dev/dns-explained-for-beginners-how-does-the-internet-find-a-website-19l3</link>
      <guid>https://dev.to/vigneshkumars-dev/dns-explained-for-beginners-how-does-the-internet-find-a-website-19l3</guid>
      <description>&lt;p&gt;Have you ever wondered what happens when you type &lt;code&gt;www.google.com&lt;/code&gt; into your browser and press Enter?&lt;/p&gt;

&lt;p&gt;Within seconds, Google's homepage appears on your screen. But how does your computer know where Google is hosted? How does it find the correct server among millions of servers connected to the internet?&lt;/p&gt;

&lt;p&gt;The answer is &lt;strong&gt;DNS (Domain Name System)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I recently started exploring DNS as part of my AWS Cloud Quest learning journey. Initially, concepts like Root Nameservers, TLD Nameservers, Authoritative Nameservers, and DNS Resolvers were a little confusing.&lt;/p&gt;

&lt;p&gt;So, I decided to explain DNS in simple words, using real-world examples.&lt;/p&gt;

&lt;p&gt;If you are new to AWS, cloud computing, or networking, this article is for you!&lt;/p&gt;

&lt;h2&gt;
  
  
  1. What is DNS?
&lt;/h2&gt;

&lt;p&gt;DNS stands for &lt;strong&gt;Domain Name System&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In simple terms, DNS translates human-readable domain names into IP addresses that computers use to communicate with each other.&lt;/p&gt;

&lt;p&gt;Let's understand this with an example.&lt;/p&gt;

&lt;p&gt;Imagine you want to call your friend Rahul.&lt;/p&gt;

&lt;p&gt;You don't remember his phone number, but you remember his name. You open your phone contacts, search for Rahul, find his phone number, and make the call.&lt;/p&gt;

&lt;p&gt;DNS works in a similar way.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Domain name: &lt;code&gt;www.google.com&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;IP address: &lt;code&gt;142.250.183.68&lt;/code&gt; (example IP address)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Humans find domain names easier to remember, while computers use IP addresses to communicate.&lt;/p&gt;

&lt;p&gt;DNS helps find the IP address associated with a domain name.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Think of DNS as the phonebook of the internet.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Why Do We Need DNS?
&lt;/h2&gt;

&lt;p&gt;Imagine if we had to remember the IP address of every website we visited.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Google: An IP address&lt;/li&gt;
&lt;li&gt;YouTube: An IP address&lt;/li&gt;
&lt;li&gt;Amazon: An IP address&lt;/li&gt;
&lt;li&gt;Netflix: An IP address&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It would be difficult to remember all these numbers.&lt;/p&gt;

&lt;p&gt;Instead, we use simple domain names such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;google.com&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;youtube.com&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;amazon.com&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;netflix.com&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When we enter a domain name in the browser, DNS helps our computer find the corresponding IP address.&lt;/p&gt;

&lt;p&gt;That's why DNS is an important part of internet communication.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. How Does DNS Actually Work?
&lt;/h2&gt;

&lt;p&gt;Now let's understand the interesting part.&lt;/p&gt;

&lt;p&gt;Suppose you open your browser and enter:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;www.example.com&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;How does your computer find the server hosting this website?&lt;/p&gt;

&lt;p&gt;DNS resolution involves several components working together.&lt;/p&gt;

&lt;p&gt;Before looking at the complete process, let's understand the four important components.&lt;/p&gt;

&lt;h3&gt;
  
  
  A. DNS Resolver
&lt;/h3&gt;

&lt;p&gt;A DNS Resolver is the component that handles DNS queries on behalf of your computer.&lt;/p&gt;

&lt;p&gt;Think of it as an assistant who searches for the IP address of a website for you.&lt;/p&gt;

&lt;p&gt;Your DNS resolver might be provided by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your Internet Service Provider (ISP)&lt;/li&gt;
&lt;li&gt;Google Public DNS (8.8.8.8)&lt;/li&gt;
&lt;li&gt;Cloudflare DNS (1.1.1.1)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When you request a website, your computer sends a DNS query to the resolver.&lt;/p&gt;

&lt;p&gt;If the resolver already has the answer in its cache, it can return it immediately.&lt;/p&gt;

&lt;p&gt;Otherwise, it starts looking for the answer.&lt;/p&gt;

&lt;h3&gt;
  
  
  B. Root Nameserver
&lt;/h3&gt;

&lt;p&gt;The Root Nameserver is the starting point of the DNS hierarchy.&lt;/p&gt;

&lt;p&gt;There are 13 logical root server identities, operated by multiple organisations across many physical locations.&lt;/p&gt;

&lt;p&gt;The Root Nameserver doesn't normally provide the actual IP address of the website.&lt;/p&gt;

&lt;p&gt;Instead, it directs the resolver to the appropriate Top-Level Domain (TLD) nameserver.&lt;/p&gt;

&lt;p&gt;For example, if you are looking for &lt;code&gt;www.example.com&lt;/code&gt;, the Root Nameserver tells the resolver where to find information about &lt;code&gt;.com&lt;/code&gt; domains.&lt;/p&gt;

&lt;h3&gt;
  
  
  C. TLD Nameserver
&lt;/h3&gt;

&lt;p&gt;TLD stands for Top-Level Domain.&lt;/p&gt;

&lt;p&gt;It is the last part of a domain name.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Domain&lt;/th&gt;
&lt;th&gt;TLD&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;google.com&lt;/td&gt;
&lt;td&gt;.com&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;amazon.in&lt;/td&gt;
&lt;td&gt;.in&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;wikipedia.org&lt;/td&gt;
&lt;td&gt;.org&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;example.net&lt;/td&gt;
&lt;td&gt;.net&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The TLD Nameserver helps the resolver find the authoritative nameserver responsible for a particular domain.&lt;/p&gt;

&lt;p&gt;For example, when the resolver asks the &lt;code&gt;.com&lt;/code&gt; TLD Nameserver about &lt;code&gt;example.com&lt;/code&gt;, it provides the nameserver information for that domain.&lt;/p&gt;

&lt;h3&gt;
  
  
  D. Authoritative Nameserver
&lt;/h3&gt;

&lt;p&gt;This is where the actual DNS records for a domain are maintained.&lt;/p&gt;

&lt;p&gt;The Authoritative Nameserver knows the DNS information configured for a particular domain.&lt;/p&gt;

&lt;p&gt;For example, it might contain a DNS record like this:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Domain&lt;/td&gt;
&lt;td&gt;&lt;a href="http://www.example.com" rel="noopener noreferrer"&gt;www.example.com&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Record Type&lt;/td&gt;
&lt;td&gt;A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IP Address&lt;/td&gt;
&lt;td&gt;93.184.216.34&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;When the resolver asks for the IP address of &lt;code&gt;www.example.com&lt;/code&gt;, the Authoritative Nameserver returns the corresponding DNS record.&lt;/p&gt;

&lt;p&gt;Now the resolver has the answer!&lt;/p&gt;

&lt;h2&gt;
  
  
  4. DNS Query Process: Step by Step
&lt;/h2&gt;

&lt;p&gt;Let's connect all these components.&lt;/p&gt;

&lt;p&gt;Suppose you type:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;www.example.com&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;into your browser.&lt;/p&gt;

&lt;p&gt;Here is what happens behind the scenes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Your computer sends a DNS query&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Your computer first checks available DNS caches.&lt;/p&gt;

&lt;p&gt;If it doesn't already have a valid answer, it sends a DNS query to a DNS Resolver.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Resolver contacts the Root Nameserver&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If the resolver doesn't know the answer, it contacts a Root Nameserver.&lt;/p&gt;

&lt;p&gt;The Root Nameserver responds:&lt;/p&gt;

&lt;p&gt;"I don't have the IP address, but you can find information about .com domains through the .com TLD Nameserver."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Resolver contacts the TLD Nameserver&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The resolver contacts the &lt;code&gt;.com&lt;/code&gt; TLD Nameserver.&lt;/p&gt;

&lt;p&gt;The TLD Nameserver responds:&lt;/p&gt;

&lt;p&gt;"I don't have the website's IP address, but here are the authoritative nameservers responsible for example.com."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Resolver contacts the Authoritative Nameserver&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The resolver now contacts the authoritative nameserver for &lt;code&gt;example.com&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;It asks:&lt;/p&gt;

&lt;p&gt;"What is the IP address of &lt;a href="http://www.example.com?" rel="noopener noreferrer"&gt;www.example.com?&lt;/a&gt;"&lt;/p&gt;

&lt;p&gt;The authoritative nameserver checks its DNS records and returns the requested information.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;www.example.com → 93.184.216.34&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5: Resolver returns the IP address&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The DNS resolver sends the IP address back to your computer.&lt;/p&gt;

&lt;p&gt;Your browser can now connect to the web server using that IP address.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6: Website loads&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Your browser establishes a connection to the server and requests the website.&lt;/p&gt;

&lt;p&gt;Finally, the website appears on your screen!&lt;/p&gt;

&lt;p&gt;That's how DNS resolution works.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. What Are DNS Records?
&lt;/h2&gt;

&lt;p&gt;DNS records contain information about domain names.&lt;/p&gt;

&lt;p&gt;Different DNS record types are used for different purposes.&lt;/p&gt;

&lt;p&gt;Here are some important DNS records you should know.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Record Type&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A&lt;/td&gt;
&lt;td&gt;Maps a domain to an IPv4 address&lt;/td&gt;
&lt;td&gt;example.com → 192.0.2.1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AAAA&lt;/td&gt;
&lt;td&gt;Maps a domain to an IPv6 address&lt;/td&gt;
&lt;td&gt;example.com → IPv6 address&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CNAME&lt;/td&gt;
&lt;td&gt;Points one domain name to another domain name&lt;/td&gt;
&lt;td&gt;
&lt;a href="http://www.example.com" rel="noopener noreferrer"&gt;www.example.com&lt;/a&gt; → example.com&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MX&lt;/td&gt;
&lt;td&gt;Specifies mail servers for a domain&lt;/td&gt;
&lt;td&gt;Mail server information&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NS&lt;/td&gt;
&lt;td&gt;Identifies authoritative nameservers&lt;/td&gt;
&lt;td&gt;Nameserver information&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;TXT&lt;/td&gt;
&lt;td&gt;Stores text information&lt;/td&gt;
&lt;td&gt;Domain verification&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;One important thing to remember:&lt;/p&gt;

&lt;p&gt;An A record points to an IPv4 address, while a CNAME record points to another domain name.&lt;/p&gt;

&lt;p&gt;These records are important when configuring domains and applications in AWS.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. What Is DNS Caching and TTL?
&lt;/h2&gt;

&lt;p&gt;Imagine you visit Google.&lt;/p&gt;

&lt;p&gt;Your computer sends a DNS query, and the resolver finds Google's IP address.&lt;/p&gt;

&lt;p&gt;Now, what happens if you visit Google again after a few seconds?&lt;/p&gt;

&lt;p&gt;Does the resolver need to contact the Root, TLD, and Authoritative Nameservers again?&lt;/p&gt;

&lt;p&gt;Usually, no!&lt;/p&gt;

&lt;p&gt;The resolver can temporarily store the DNS response and reuse it for subsequent requests.&lt;/p&gt;

&lt;p&gt;This is called &lt;strong&gt;DNS Caching&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;TTL stands for Time To Live.&lt;/p&gt;

&lt;p&gt;It determines how long a DNS record can be cached.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;TTL = 3600 seconds&lt;/p&gt;

&lt;p&gt;This means the DNS response can be cached for up to one hour.&lt;/p&gt;

&lt;p&gt;Why is caching useful?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reduces DNS lookup time.&lt;/li&gt;
&lt;li&gt;Improves performance.&lt;/li&gt;
&lt;li&gt;Reduces unnecessary DNS queries.&lt;/li&gt;
&lt;li&gt;Helps reduce the load on DNS infrastructure.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  7. What Is Amazon Route 53?
&lt;/h2&gt;

&lt;p&gt;Now that we understand DNS, let's connect it to AWS.&lt;/p&gt;

&lt;p&gt;Amazon Route 53 is AWS's managed Domain Name System (DNS) service.&lt;/p&gt;

&lt;p&gt;It helps you manage domain names and route incoming requests to your applications and other resources.&lt;/p&gt;

&lt;p&gt;Imagine you have deployed a Python FastAPI application on AWS ECS.&lt;/p&gt;

&lt;p&gt;Your application is accessible through an Application Load Balancer.&lt;/p&gt;

&lt;p&gt;However, you don't want users to access your application using a long AWS-generated load balancer address.&lt;/p&gt;

&lt;p&gt;Instead, you want users to access it through:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;api.mycompany.com&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This is where Amazon Route 53 becomes useful.&lt;/p&gt;

&lt;p&gt;You can configure a DNS record in Route 53 to direct users to your Application Load Balancer.&lt;/p&gt;

&lt;p&gt;The simplified flow looks like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A user enters &lt;code&gt;api.mycompany.com&lt;/code&gt; in the browser.&lt;/li&gt;
&lt;li&gt;The DNS resolver looks up the domain.&lt;/li&gt;
&lt;li&gt;Route 53, acting as the authoritative DNS service, provides the configured DNS response.&lt;/li&gt;
&lt;li&gt;The browser connects to the destination through the Application Load Balancer.&lt;/li&gt;
&lt;li&gt;The load balancer forwards the request to your application running on ECS.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now users can access your application using a simple domain name!&lt;/p&gt;

&lt;h3&gt;
  
  
  Important Route 53 Concepts
&lt;/h3&gt;

&lt;p&gt;While exploring Route 53, you will come across these terms.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hosted Zone&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A Hosted Zone is a container for DNS records belonging to a domain.&lt;/p&gt;

&lt;p&gt;For example, if you own &lt;code&gt;mycompany.com&lt;/code&gt;, you can create a Hosted Zone for it and configure records such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;www.mycompany.com&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;api.mycompany.com&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;mail.mycompany.com&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Record Sets&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;These are the DNS records you configure inside a Hosted Zone.&lt;/p&gt;

&lt;p&gt;For example, you can create an A record, CNAME record, MX record, or other supported record types.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Routing Policies&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Route 53 supports different routing policies to control how DNS queries are answered.&lt;/p&gt;

&lt;p&gt;Some important routing policies include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Simple Routing: Routes traffic to a single resource.&lt;/li&gt;
&lt;li&gt;Weighted Routing: Distributes traffic across multiple resources based on assigned weights.&lt;/li&gt;
&lt;li&gt;Latency-Based Routing: Routes users to resources based on network latency.&lt;/li&gt;
&lt;li&gt;Failover Routing: Routes traffic to a healthy resource when the primary resource becomes unavailable.&lt;/li&gt;
&lt;li&gt;Geolocation Routing: Routes users based on their geographic location.&lt;/li&gt;
&lt;li&gt;Geoproximity Routing: Routes traffic based on the geographic location of users and resources, with optional bias.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These routing policies become especially useful when building highly available and globally distributed applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. DNS vs Amazon Route 53
&lt;/h2&gt;

&lt;p&gt;You might wonder whether DNS and Route 53 are the same thing.&lt;/p&gt;

&lt;p&gt;They are not.&lt;/p&gt;

&lt;p&gt;DNS is the overall system used to translate domain names into IP addresses.&lt;/p&gt;

&lt;p&gt;Amazon Route 53 is an AWS service that provides managed DNS functionality and additional routing features.&lt;/p&gt;

&lt;p&gt;Think of it this way:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;DNS is the concept.&lt;/li&gt;
&lt;li&gt;Route 53 is one service that helps implement and manage DNS.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are other DNS providers as well, such as Cloudflare and Google Cloud DNS.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. What I Learned
&lt;/h2&gt;

&lt;p&gt;While learning AWS through Cloud Quest, DNS was one of the concepts I wanted to understand beyond just remembering definitions.&lt;/p&gt;

&lt;p&gt;The most important thing I learned is that when we enter a website name in a browser, several components work together behind the scenes to find the correct server.&lt;/p&gt;

&lt;p&gt;Here is a quick recap:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Responsibility&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;DNS Resolver&lt;/td&gt;
&lt;td&gt;Searches for the requested DNS information&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Root Nameserver&lt;/td&gt;
&lt;td&gt;Directs the resolver to a TLD nameserver&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;TLD Nameserver&lt;/td&gt;
&lt;td&gt;Directs the resolver to an authoritative nameserver&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Authoritative Nameserver&lt;/td&gt;
&lt;td&gt;Provides the actual DNS records&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Amazon Route 53&lt;/td&gt;
&lt;td&gt;AWS managed DNS service&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Understanding these concepts makes it easier to work with AWS services such as Route 53, EC2, ECS, and Elastic Load Balancing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;DNS is one of the fundamental building blocks of the internet.&lt;/p&gt;

&lt;p&gt;Every time we access a website using a domain name, DNS helps our computer find the correct destination.&lt;/p&gt;

&lt;p&gt;If you are starting your AWS journey, I recommend understanding DNS resolution before moving on to Amazon Route 53 and its advanced routing features.&lt;/p&gt;

&lt;p&gt;I hope this explanation helps someone who is learning DNS for the first time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Happy Learning!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you found this article useful, feel free to share your thoughts or ask questions in the comments.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/Welcome.html" rel="noopener noreferrer"&gt;AWS Route 53 Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.cloudflare.com/learning/dns/what-is-dns/" rel="noopener noreferrer"&gt;How DNS Works – Cloudflare&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.icann.org/resources/pages/dns-2012-02-25-en" rel="noopener noreferrer"&gt;ICANN – DNS Basics&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>networking</category>
      <category>cloud</category>
      <category>beginners</category>
      <category>dns</category>
    </item>
    <item>
      <title>How Redis Caching Actually Works (Explained Like You're 5, But for Developers)</title>
      <dc:creator>Vigneshkumar Selvaraj</dc:creator>
      <pubDate>Sat, 18 Jul 2026 14:17:01 +0000</pubDate>
      <link>https://dev.to/vigneshkumars-dev/how-redis-caching-actually-works-explained-like-youre-5-but-for-developers-4kbm</link>
      <guid>https://dev.to/vigneshkumars-dev/how-redis-caching-actually-works-explained-like-youre-5-but-for-developers-4kbm</guid>
      <description>&lt;p&gt;When I started learning Redis, I had one big question: &lt;strong&gt;"If thousands of people are using the same app at the same time, how does the app know whose data belongs to whom?"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Turns out, the answer is simpler than I thought, but it took me a while to fully connect the dots. So I'm writing this post the way I wish someone had explained it to me: in plain English, no jargon left unexplained.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Redis, in one sentence?
&lt;/h2&gt;

&lt;p&gt;Redis is a super-fast, temporary storage box that sits between your app's backend and your database. Instead of asking the (slower) database the same question over and over, your app can ask Redis first. If Redis already has the answer stored, it replies instantly.&lt;/p&gt;

&lt;p&gt;Think of it like a librarian who keeps the 10 most-requested books on her desk instead of walking to the back shelf every single time someone asks for them.&lt;/p&gt;

&lt;h2&gt;
  
  
  The big question: how does Redis know which data belongs to which user?
&lt;/h2&gt;

&lt;p&gt;Redis doesn't magically "know" anything. It's just a &lt;strong&gt;giant dictionary&lt;/strong&gt;. You give it a key, it gives you back a value. That's it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;key   → value
"hello" → "world"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So the real trick isn't in Redis itself. It's in &lt;strong&gt;how your backend code names the keys&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  The pattern: build the key from the user's identity
&lt;/h3&gt;

&lt;p&gt;Every time a user logs in, they get some kind of unique ID (a session ID, a token, whatever). Your backend uses that ID to build a unique key for each piece of data:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;user:123:profile
user:123:cart
user:456:profile
user:456:cart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;User 123 and user 456 never touch each other's data, because they're stored under completely different keys, even though it's the exact same Redis, being hit by both users at the exact same time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Simple analogy:&lt;/strong&gt; imagine a huge wall of PO boxes at a post office. Every box has a number. Redis is just the wall of boxes, it doesn't care who owns which box. Your app's job is to always use the right box number (key) for the right person.&lt;/p&gt;

&lt;h2&gt;
  
  
  What about the same question with different details?
&lt;/h2&gt;

&lt;p&gt;Here's where it got interesting for me. Say a user asks for "my orders," but sometimes they want &lt;em&gt;pending&lt;/em&gt; orders, sometimes &lt;em&gt;delivered&lt;/em&gt; orders, sometimes page 1, sometimes page 2. It's the "same" request, just with different filters (called query parameters).&lt;/p&gt;

&lt;p&gt;The solution: &lt;strong&gt;the filters become part of the key too.&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;user:123:orders:status=pending
user:123:orders:status=delivered
user:123:orders:page=1
user:123:orders:page=2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Same user, same "operation," but different filters means different Redis entries. Next time the exact same filters come in, the backend rebuilds the exact same key, finds the cached answer, and skips the slow database call entirely.&lt;/p&gt;

&lt;h3&gt;
  
  
  A neat trick: hashing long filters
&lt;/h3&gt;

&lt;p&gt;If there are a lot of filters, keys can get messy. So a common trick is to squish all the filters into one short fingerprint using something called a &lt;strong&gt;hash function&lt;/strong&gt; (like MD5 or a faster one like xxHash):&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="err"&gt;Input:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"pending"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"page"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"limit"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt;Output:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;e&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="err"&gt;d&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="err"&gt;f&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="err"&gt;b&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="err"&gt;ed&lt;/span&gt;&lt;span class="mi"&gt;2e42&lt;/span&gt;&lt;span class="err"&gt;d&lt;/span&gt;&lt;span class="mi"&gt;15898&lt;/span&gt;&lt;span class="err"&gt;f&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="err"&gt;b&lt;/span&gt;&lt;span class="mi"&gt;27&lt;/span&gt;&lt;span class="err"&gt;b&lt;/span&gt;&lt;span class="mi"&gt;019&lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;(a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;fixed-length&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;code)&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Same input always produces the same fingerprint. So instead of matching keys, the backend just re-generates the fingerprint from the new request and checks if it already exists in Redis. No decoding needed, you never need to reverse a hash, you just recreate it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; this fingerprint is purely an internal backend detail. The frontend never sees it, never sends it, and doesn't need to know it exists. The frontend just sends normal filters like &lt;code&gt;?status=pending&lt;/code&gt;, and gets back normal data like JSON. Nothing about hashing or Redis is visible to it.&lt;/p&gt;

&lt;h2&gt;
  
  
  "But doesn't the whole website get cached too?"
&lt;/h2&gt;

&lt;p&gt;This was my next confusion, since the UI (the buttons, layout, colors) looks the same for every user, is &lt;em&gt;that&lt;/em&gt; cached in Redis too?&lt;/p&gt;

&lt;p&gt;Nope. That's a completely different system called a &lt;strong&gt;CDN (Content Delivery Network)&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CDN&lt;/strong&gt; = caches the &lt;em&gt;static&lt;/em&gt; stuff (HTML, CSS, JavaScript, images) that's identical for every visitor. It stores copies of these files on servers physically located all around the world, so you always download them from whichever copy is nearest to you, instead of from one single far-away server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Redis&lt;/strong&gt; = caches the &lt;em&gt;personal&lt;/em&gt; stuff (your cart, your profile, your orders) that's different for every user.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Simple analogy:&lt;/strong&gt; a CDN is like a chain of local libraries, each holding a copy of a popular book so you don't have to travel across the country to the one original library. Redis is like your own personal mailbox, nobody else's mail goes into it, no matter how many mailboxes are on the same street.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's actually try it: Redis with Python
&lt;/h2&gt;

&lt;p&gt;Reading about Redis is one thing, but running it yourself makes it click much faster. Here's the minimum you need to get hands on.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Download and install Redis
&lt;/h3&gt;

&lt;p&gt;You can get Redis (and see the official docs) from redis.io. On Mac, the easiest way is Homebrew:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;redis
brew services start redis
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On Linux, you can install it through your package manager, and on Windows, the official docs point you toward using WSL or Docker. Once installed, you can test the server directly with the command line tool that ships with it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;redis-cli ping
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If it replies &lt;code&gt;PONG&lt;/code&gt;, Redis is running and ready.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Try some basic Redis commands
&lt;/h3&gt;

&lt;p&gt;You don't even need Python yet to get a feel for how Redis stores data. Open &lt;code&gt;redis-cli&lt;/code&gt; and try:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;SET user:123:name &lt;span class="s2"&gt;"Vignesh"&lt;/span&gt;
GET user:123:name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;SET user:123:cart &lt;span class="s2"&gt;"2 items"&lt;/span&gt;
EXPIRE user:123:cart 60
TTL user:123:cart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;DEL user:123:name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A quick rundown of what each command does:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;SET key value&lt;/code&gt; stores a value under a key.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;GET key&lt;/code&gt; fetches the value back.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;EXPIRE key seconds&lt;/code&gt; makes the key automatically disappear after a set number of seconds (useful for temporary cached data).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;TTL key&lt;/code&gt; tells you how many seconds are left before a key expires.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;DEL key&lt;/code&gt; deletes a key immediately.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 3: Install Redis in Python
&lt;/h3&gt;

&lt;p&gt;The official Python client is called &lt;code&gt;redis&lt;/code&gt;. Install it with pip:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;redis
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want faster response parsing, you can install it with an optional extra:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="s2"&gt;"redis[hiredis]"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 4: Use Redis from Python
&lt;/h3&gt;

&lt;p&gt;Here's a small working example, connecting to Redis, setting a value, and reading it back:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;redis&lt;/span&gt;

&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;redis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Redis&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;localhost&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;6379&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;decode_responses&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;  &lt;span class="c1"&gt;# returns normal strings instead of bytes
&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# check the connection
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ping&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;  &lt;span class="c1"&gt;# True
&lt;/span&gt;
&lt;span class="c1"&gt;# store a value, matching the user:id:resource pattern from earlier
&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user:123:cart&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;2 items&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# read it back
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user:123:cart&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;  &lt;span class="c1"&gt;# "2 items"
&lt;/span&gt;
&lt;span class="c1"&gt;# set a value that expires after 60 seconds
&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setex&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user:123:session&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;active&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# store multiple fields under one key using a hash
&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;hset&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user:123:profile&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mapping&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Vignesh&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;student&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;hgetall&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user:123:profile&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the exact same pattern discussed earlier in this post, just written in real, runnable code. Once you connect this into a small Flask or FastAPI app, you have the full picture: a request comes in, the backend builds a key like &lt;code&gt;user:123:orders&lt;/code&gt;, checks Redis first with &lt;code&gt;r.get()&lt;/code&gt;, and only hits the database if it's a cache miss.&lt;/p&gt;

&lt;h2&gt;
  
  
  Putting it all together
&lt;/h2&gt;

&lt;p&gt;Here's the full journey of a single click, from a fresh understanding:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You open a website. Static UI files load from the nearest &lt;strong&gt;CDN&lt;/strong&gt; location.&lt;/li&gt;
&lt;li&gt;You click something. The app calls the &lt;strong&gt;backend&lt;/strong&gt;, sending your user ID.&lt;/li&gt;
&lt;li&gt;The backend builds a specific &lt;strong&gt;key&lt;/strong&gt; using your user ID plus what you asked for.&lt;/li&gt;
&lt;li&gt;It checks &lt;strong&gt;Redis&lt;/strong&gt; first. If the answer's already there, it replies instantly.&lt;/li&gt;
&lt;li&gt;If not, it asks the actual &lt;strong&gt;database&lt;/strong&gt;, gets the answer, saves it in Redis for next time, and replies to you.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Two completely different caching systems, solving two completely different problems, but built on the exact same core idea: &lt;strong&gt;don't redo expensive work if you already have the answer stored somewhere fast.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;If you're learning backend development or AWS, I'd love to hear what confused you the most when you first learned about caching. Drop a comment below!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>redis</category>
      <category>python</category>
      <category>backenddevelopment</category>
      <category>memory</category>
    </item>
  </channel>
</rss>
