<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: NK</title>
    <description>The latest articles on Forem by NK (@systemdesign).</description>
    <link>https://forem.com/systemdesign</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F982412%2Fe8830d3c-e288-4f5a-8618-0b63b1765039.png</url>
      <title>Forem: NK</title>
      <link>https://forem.com/systemdesign</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/systemdesign"/>
    <language>en</language>
    <item>
      <title>Announcement: System Design Case Studies Newsletter</title>
      <dc:creator>NK</dc:creator>
      <pubDate>Tue, 31 Oct 2023 20:52:00 +0000</pubDate>
      <link>https://forem.com/systemdesign/announcement-system-design-case-studies-newsletter-287n</link>
      <guid>https://forem.com/systemdesign/announcement-system-design-case-studies-newsletter-287n</guid>
      <description>&lt;p&gt;I want to inform you that I started a &lt;a href="https://newsletter.systemdesign.one/"&gt;weekly newsletter&lt;/a&gt; on system design case studies.&lt;/p&gt;

&lt;p&gt;Consider subscribing to the &lt;a href="https://newsletter.systemdesign.one/"&gt;system design newsletter&lt;/a&gt; to excel in system design interviews and software architecture. &lt;/p&gt;

&lt;p&gt;Also get the powerful template to system design on sign up for FREE.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>beginners</category>
      <category>career</category>
    </item>
    <item>
      <title>Maps System Design</title>
      <dc:creator>NK</dc:creator>
      <pubDate>Thu, 16 Feb 2023 19:01:27 +0000</pubDate>
      <link>https://forem.com/systemdesign/google-maps-system-design-5c55</link>
      <guid>https://forem.com/systemdesign/google-maps-system-design-5c55</guid>
      <description>&lt;p&gt;You can &lt;strong&gt;subscribe to the &lt;a href="https://newsletter.systemdesign.one/"&gt;system design newsletter&lt;/a&gt; to excel in system design interviews and software architecture&lt;/strong&gt;. The original &lt;a href="https://systemdesign.one/system-design-interview-cheatsheet/#google-maps"&gt;article&lt;/a&gt; was published on &lt;a href="https://systemdesign.one/"&gt;systemdesign.one&lt;/a&gt; website. The popular implementations of the navigation service are the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Google Maps&lt;/li&gt;
&lt;li&gt;OpenStreetMap&lt;/li&gt;
&lt;li&gt;Bing Maps&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Disclaimer: The system design questions are subjective. This article is written based on the research I have done on the topic. Feel free to share your feedback and ask questions in the comments. Some of the linked resources are affiliates.&lt;/p&gt;

&lt;h2&gt;
  
  
  Requirements
&lt;/h2&gt;

&lt;p&gt;The user (client) can find the nearby points of interest within a given radius&lt;br&gt;
The client can find the real-time estimated time of arrival (ETA) between two locations&lt;br&gt;
The client receive suggestions on the possible routes between the two locations&lt;/p&gt;

&lt;h2&gt;
  
  
  Data storage
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Database schema&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--txnkmtt0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wkdls7ucyr78zvgw755n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--txnkmtt0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wkdls7ucyr78zvgw755n.png" alt="Google Maps; Database schema" width="634" height="315"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The primary entities are the locations, the places, and the media tables&lt;/li&gt;
&lt;li&gt;The relationship between the locations and the places table is 1-to-many&lt;/li&gt;
&lt;li&gt;The relationship between the places and the media table is 1-to-many&lt;/li&gt;
&lt;li&gt;The spatial index using Geohash or R-tree is created on the locations table&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Type of data store&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SQL database such as Postgres persists the location data (latitude, longitude) and the vector tiles&lt;/li&gt;
&lt;li&gt;The PostGIS extension of Postgres is used to generate the spatial index&lt;/li&gt;
&lt;li&gt;The wide-column data store (LSM tree-based) such as Apache Cassandra is used to persist the trip data for high write throughput&lt;/li&gt;
&lt;li&gt;A cache server such as Redis is used to store the popular routes and the road segments&lt;/li&gt;
&lt;li&gt;A message queue such as Apache Kafka is used to handle heavy traffic&lt;/li&gt;
&lt;li&gt;The message queue is also configured as the pub-sub server&lt;/li&gt;
&lt;li&gt;NoSQL document store such as MongoDB is used to store the metadata of the road segments&lt;/li&gt;
&lt;li&gt;The media files and raster tiles are stored in a managed object storage such as AWS S3&lt;/li&gt;
&lt;li&gt;The CDN caches the popular tiles and the media files&lt;/li&gt;
&lt;li&gt;Lucene-based inverted-index data store such as Apache Solr is used to store the index data of locations&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Newsletter
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://newsletter.systemdesign.one/"&gt;Subscribe to my newsletter&lt;/a&gt; and never miss a new blog post again, as you'll get notified via email every time I publish something. You will also receive the ultimate guide to approaching system design interviews on &lt;a href="https://newsletter.systemdesign.one/"&gt;newsletter sign-up&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Further system design learning resources
&lt;/h2&gt;

&lt;p&gt;Are you preparing for a system design interview and feeling overwhelmed by the complexity of the process? Do you want to gain the knowledge and confidence to ace the interview and advance your career in software engineering? Then you need to check out the &lt;a href="https://www.designgurus.io/course/grokking-the-system-design-interview?aff=8kfwtq"&gt;Grokking the System Design Interview course&lt;/a&gt; by DesignGurus!&lt;/p&gt;

&lt;p&gt;This comprehensive course is designed to help you master the system design interview process by breaking down complex concepts into easy-to-understand explanations. With a focus on practical, real-world examples, you’ll learn how to design scalable, fault-tolerant, and high-performance systems that can handle the most challenging problems.&lt;/p&gt;

&lt;p&gt;Don’t miss this opportunity to take your system design skills to the next level and achieve your career goals. Sign up for the &lt;a href="https://www.designgurus.io/course/grokking-the-system-design-interview?aff=8kfwtq"&gt;Grokking the System Design Interview course&lt;/a&gt; by DesignGurus today and take the first step towards success!&lt;/p&gt;

&lt;h2&gt;
  
  
  High-level design
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EeTUy6R1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q4rnbnrd929fd38r9g09.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EeTUy6R1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q4rnbnrd929fd38r9g09.png" alt="Navigation service" width="800" height="435"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Calculation of ETA is the shortest path in a directed weighted graph problem&lt;/li&gt;
&lt;li&gt;The graph is partitioned and the routes are precomputed for scalability&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QqYlca2V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/89mezc704xs2igkeko5j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QqYlca2V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/89mezc704xs2igkeko5j.png" alt="Google Maps; Map matching" width="786" height="170"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The map matching is performed to improve the accuracy of ETA&lt;/li&gt;
&lt;li&gt;The Kalman filter is used for map matching&lt;/li&gt;
&lt;li&gt;The cache and data stores are replicated and sharded geographically through consistent hashing to handle hotspots&lt;/li&gt;
&lt;li&gt;Monitoring and fallback can be configured for high availability&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How to find the Points of Interest?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--i7zWXtRh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qjyxwyw1xah7aiiy7zto.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--i7zWXtRh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qjyxwyw1xah7aiiy7zto.png" alt="Google Maps; Points of interest" width="800" height="683"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The client executes a DNS query to resolve the domain name&lt;/li&gt;
&lt;li&gt;The client queries the CDN to check if the nearby points of interest are cached on the CDN&lt;/li&gt;
&lt;li&gt;The client creates a WebSocket connection on the load balancer for real-time updates&lt;/li&gt;
&lt;li&gt;The load balancer delegates the client's connection to a server with free capacity&lt;/li&gt;
&lt;li&gt;The server queries the trie server to provide autocompletion functionality&lt;/li&gt;
&lt;li&gt;The server delegates the search query of the client to the search service&lt;/li&gt;
&lt;li&gt;The search service queries the inverted index data store to find the relevant locations&lt;/li&gt;
&lt;li&gt;The server delegates the points of interest query from the client to the location service&lt;/li&gt;
&lt;li&gt;The location service calculates the Geohash from the request and queries the location cache to fetch the list of nearby points of interest IDs&lt;/li&gt;
&lt;li&gt;The location database (replica) is queried on a cache miss&lt;/li&gt;
&lt;li&gt;The location service queries the places cache to fetch the metadata of a place&lt;/li&gt;
&lt;li&gt;The places data store (replica) is queried on a cache miss&lt;/li&gt;
&lt;li&gt;The location service queries the object store to fetch the relevant media files and the raster tiles&lt;/li&gt;
&lt;li&gt;The tile server on the location service provides SQL functionality on vector tiles&lt;/li&gt;
&lt;li&gt;LRU policy is used to evict the cache&lt;/li&gt;
&lt;li&gt;GPS signals are not accurate for the identification of the static location due to the multipath effect (reflection from a building)&lt;/li&gt;
&lt;li&gt;The WiFi access point is used in addition to GPS signals to find the static location of a client accurately&lt;/li&gt;
&lt;li&gt;The map is displayed on a web browser by placing multiple smaller vector tiles and raster tiles next to each other to make up a single bigger picture&lt;/li&gt;
&lt;li&gt;The raster tiles (png, jpg) are useful for off-road trajectories to speed up the loading of detected map errors&lt;/li&gt;
&lt;li&gt;Vector tiles allow the reduction of bandwidth by restricting data transfer to the current viewport and zoom level&lt;/li&gt;
&lt;li&gt;Vector tiles allow to apply styling on the fly on the client and thereby reduce the server load&lt;/li&gt;
&lt;li&gt;Vector tiles transfer the vector information (path and polygon) instead of transferring the image tiles&lt;/li&gt;
&lt;li&gt;Vector information is grouped into tiles for caching and partitioning&lt;/li&gt;
&lt;li&gt;The tiles can be pre-generated and cached to improve latency&lt;/li&gt;
&lt;li&gt;Each zoom level shows a unique set of tiles with a different granularity of information&lt;/li&gt;
&lt;li&gt;The number of tiles doubles when the user zooms out&lt;/li&gt;
&lt;li&gt;Geohash is used to identify the tile on the map&lt;/li&gt;
&lt;li&gt;The viewport of the client encloses the container that assigns absolute positions to the tiles&lt;/li&gt;
&lt;li&gt;The container is moved when the user pans the map&lt;/li&gt;
&lt;li&gt;Street view and satellite imagery are used to identify places in the world&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  How to calculate the Estimated Time of Arrival?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--o6_4ioGu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t04wmyvo1v7j265uko84.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--o6_4ioGu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t04wmyvo1v7j265uko84.png" alt="Google Maps; Estimated Time of Arrival" width="800" height="517"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The client executes a DNS query to resolve the domain name&lt;/li&gt;
&lt;li&gt;The client queries the CDN to check if the requested route is cached on the CDN&lt;/li&gt;
&lt;li&gt;The client creates a WebSocket connection on the load balancer for real-time bi-directional communication on ETA, trip, and traffic data&lt;/li&gt;
&lt;li&gt;The load balancer delegates the client's request to a server with free capacity&lt;/li&gt;
&lt;li&gt;The server queries the route cache to fetch the list of possible routes to the destination&lt;/li&gt;
&lt;li&gt;The route database (replica) is queried on a cache miss&lt;/li&gt;
&lt;li&gt;The server queries the road segment cache to fetch the metadata of the road segments on the suggested route&lt;/li&gt;
&lt;li&gt;The road segment data store (replica) is queried on a cache miss&lt;/li&gt;
&lt;li&gt;The server queries the trip data store to recalculate the real-time ETA&lt;/li&gt;
&lt;li&gt;The server queries the map-matching service to calculate the ETA accurately&lt;/li&gt;
&lt;li&gt;The map-matching service queries the trip data store to fetch the list of recent GPS signals&lt;/li&gt;
&lt;li&gt;The map matching service queries the road segment data store to identify the nearest road segments&lt;/li&gt;
&lt;li&gt;The weather service publishes the latest weather data on the pub-sub server&lt;/li&gt;
&lt;li&gt;The traffic service (HyperLogLog based) publishes the latest traffic data on the pub-sub server&lt;/li&gt;
&lt;li&gt;The server fetches the latest weather and traffic data using the publish-subscribe pattern&lt;/li&gt;
&lt;li&gt;The server queries the route ranking service to filter and sort the result&lt;/li&gt;
&lt;li&gt;The server publishes the GPS signals on the message queue for asynchronous processing&lt;/li&gt;
&lt;li&gt;Apache Spark executes jobs on the trip data to detect changes in roads, hot spots, and traffic patterns&lt;/li&gt;
&lt;li&gt;Apache Spark job asynchronously updates the route database with any detected changes&lt;/li&gt;
&lt;li&gt;The physical map is represented as a graph with road segments as the directed edges and road intersections as the nodes&lt;/li&gt;
&lt;li&gt;The route between the origin and destination on the road network should be calculated in the least cost (function of time and distance)&lt;/li&gt;
&lt;li&gt;Map matching is the problem of matching the raw GPS signals to the relevant road segments&lt;/li&gt;
&lt;li&gt;The embedded sensors on the smartphones are used to geo-localize the users&lt;/li&gt;
&lt;li&gt;The graph can be partitioned to pre-compute the possible routes within the partitions with time complexity of sqrt(n), where n = number of road intersections&lt;/li&gt;
&lt;li&gt;The partitions can be created on different granularities (country, city) to improve the latency of long-distance queries&lt;/li&gt;
&lt;li&gt;The interactions are applied on the boundaries of the partitions to improve the accuracy and scalability&lt;/li&gt;
&lt;li&gt;Dijkstra's algorithm (sub-optimal due to scalability) provides a time complexity of O(nlogn) for route calculation, where n = number of road intersections&lt;/li&gt;
&lt;li&gt;The shortest path algorithm on the weighted graph such as the Bellman-Ford provides a time complexity of O(ve) for route calculation, where v = number of vertices and e = number of edges&lt;/li&gt;
&lt;li&gt;The edge weight of the graph is populated with weather and traffic data&lt;/li&gt;
&lt;li&gt;The popular partitions and routes can be cached to improve the latency&lt;/li&gt;
&lt;li&gt;Alternate routes can be suggested if applying the weather and traffic data on the shortest distanced route returns a delayed ETA&lt;/li&gt;
&lt;li&gt;The time series data (seasonality), map data, routing, and machine learning can be used to predict the ETA&lt;/li&gt;
&lt;li&gt;Viterbi algorithm (dynamic programming) can be used to identify the most probable sequence of road segments using a sequence of GPS signals&lt;/li&gt;
&lt;li&gt;Alternatively, the KNN algorithm with a minimum radius (k = 2) can be executed on the Geohash to identify the closest road segments&lt;/li&gt;
&lt;li&gt;The marginalized particle filter running on an unscented Kalman filter is used for real-time map matching&lt;/li&gt;
&lt;li&gt;Kalman filter is an optimal algorithm that uses multiple GPS signals to estimate the accurate road segment of the client&lt;/li&gt;
&lt;li&gt;Kalman filter is also applied to the seasonality of the time series data&lt;/li&gt;
&lt;li&gt;Additional data types such as traffic and weather can be added to marginalized particle filter&lt;/li&gt;
&lt;li&gt;Machine learning on the time series historical data helps to predict traffic conditions&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Newsletter
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://newsletter.systemdesign.one/"&gt;Subscribe to my newsletter&lt;/a&gt; and never miss a new blog post again, as you'll get notified via email every time I publish something. You will also receive the ultimate guide to approaching system design interviews on &lt;a href="https://newsletter.systemdesign.one/"&gt;newsletter sign-up&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Support
&lt;/h2&gt;

&lt;p&gt;If you enjoy the blog and would like to support my work, you can make a one-time donation on &lt;a href="https://ko-fi.com/systemdesign"&gt;Ko-fi&lt;/a&gt; or &lt;a href="https://www.buymeacoffee.com/systemdesignone"&gt;Buy Me a Coffee&lt;/a&gt; or become a Patron on &lt;a href="https://www.patreon.com/systemdesign"&gt;Patreon&lt;/a&gt;. Your support will help me continue to create quality content and bring new ideas to the blog. Thank you for your generosity!&lt;/p&gt;

&lt;h2&gt;
  
  
  License
&lt;/h2&gt;

&lt;p&gt;CC BY-NC-ND: This license allows reusers to copy and distribute the images in this article in any medium or format in unadapted form only, for noncommercial purposes only, and only so long as attribution is given to the creator. The original article must be backlinked.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Antin Harasymiv, &lt;a href="https://medium.com/google-design/google-maps-cb0326d165f5"&gt;Prototyping a Smoother Map&lt;/a&gt; (2018), medium.com&lt;/li&gt;
&lt;li&gt;&lt;a href="https://wiki.openstreetmap.org/wiki/File:OSM_Components.svg"&gt;wiki.openstreetmap.org&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Sreeta Gorripaty, &lt;a href="https://www.youtube.com/watch?v=FEebOd-Pdwg"&gt;What's My ETA?&lt;/a&gt; (2018), Uber Engineering&lt;/li&gt;
&lt;li&gt;Karan Parikh, &lt;a href="https://www.youtube.com/watch?v=ChtumoDfZXI"&gt;Map Matching&lt;/a&gt; (2018), Uber Engineering&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>career</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>What happens when you type a URL into your browser?</title>
      <dc:creator>NK</dc:creator>
      <pubDate>Sat, 03 Dec 2022 16:24:06 +0000</pubDate>
      <link>https://forem.com/systemdesign/what-happens-when-you-type-a-url-into-your-browser-3ba4</link>
      <guid>https://forem.com/systemdesign/what-happens-when-you-type-a-url-into-your-browser-3ba4</guid>
      <description>&lt;p&gt;You can &lt;strong&gt;subscribe to the &lt;a href="https://newsletter.systemdesign.one/" rel="noopener noreferrer"&gt;system design newsletter&lt;/a&gt; to excel in system design interviews and software architecture&lt;/strong&gt;. This article aims the following audiences:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;tech workers&lt;/li&gt;
&lt;li&gt;students&lt;/li&gt;
&lt;li&gt;product managers&lt;/li&gt;
&lt;li&gt;marketing team&lt;/li&gt;
&lt;li&gt;sales team&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are no prerequisites to reading this article. I assume that you have used a web browser to navigate across the internet. The original article was published on &lt;a href="https://systemdesign.one/what-happens-when-you-type-url-into-your-browser/" rel="noopener noreferrer"&gt;systemdesign.one&lt;/a&gt; website.&lt;/p&gt;

&lt;p&gt;Disclaimer: The system design questions are subjective. This article is written based on the research I have done on the topic. Feel free to share your feedback and ask questions in the comments. Some of the linked resources are affiliates.&lt;/p&gt;

&lt;h2&gt;
  
  
  What happens when you type amazon.com or google.com in the browser?
&lt;/h2&gt;

&lt;p&gt;At a high level, the following operations happen in the background when you type a URL into your browser and press Enter:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;DNS resolution&lt;/li&gt;
&lt;li&gt;TCP three-way handshake&lt;/li&gt;
&lt;li&gt;HTTPS upgrade&lt;/li&gt;
&lt;li&gt;HTTP Request/Response&lt;/li&gt;
&lt;li&gt;Browser rendering the response from the server&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The following &lt;strong&gt;terminology&lt;/strong&gt; might be useful for you:&lt;/p&gt;

&lt;p&gt;DNS: data store that contains the mapping from domain name to IP address&lt;br&gt;
HTTP: standard application-level protocol used to exchange files on the internet&lt;br&gt;
HTTPS: secure (encrypted) version of HTTP&lt;br&gt;
TCP: standard that defines how to establish and maintain a network conversation between a client and a server&lt;br&gt;
Client: web browser or a mobile device that lets you perform different actions on the internet&lt;br&gt;
Server: a computer that stores files and information in the form of a website&lt;br&gt;
URL: web address to identify a web resource on the internet&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;When you type a Uniform Resource Locator (URL) into the browser and press Enter, a multitude of actions is executed in the background.&lt;/p&gt;

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

&lt;p&gt;The browser (client) must find the Internet protocol (IP) address of the server that hosts the website. The client subsequently requests the IP address of the server to transfer or retrieve data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Newsletter
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://newsletter.systemdesign.one/" rel="noopener noreferrer"&gt;Subscribe to my newsletter&lt;/a&gt; and never miss a new blog post again, as you'll get notified via email every time I publish something. You will also receive the ultimate guide to approaching system design interviews on &lt;a href="https://newsletter.systemdesign.one/" rel="noopener noreferrer"&gt;newsletter sign-up&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Further system design learning resources
&lt;/h2&gt;

&lt;p&gt;Are you preparing for a system design interview and feeling overwhelmed by the complexity of the process? Do you want to gain the knowledge and confidence to ace the interview and advance your career in software engineering? Then you need to check out the &lt;a href="https://www.designgurus.io/course/grokking-the-system-design-interview?aff=8kfwtq" rel="noopener noreferrer"&gt;Grokking the System Design Interview course&lt;/a&gt; by DesignGurus!&lt;/p&gt;

&lt;p&gt;This comprehensive course is designed to help you master the system design interview process by breaking down complex concepts into easy-to-understand explanations. With a focus on practical, real-world examples, you’ll learn how to design scalable, fault-tolerant, and high-performance systems that can handle the most challenging problems.&lt;/p&gt;

&lt;p&gt;Don’t miss this opportunity to take your system design skills to the next level and achieve your career goals. Sign up for the &lt;a href="https://www.designgurus.io/course/grokking-the-system-design-interview?aff=8kfwtq" rel="noopener noreferrer"&gt;Grokking the System Design Interview course&lt;/a&gt; by DesignGurus today and take the first step towards success!&lt;/p&gt;

&lt;h2&gt;
  
  
  What is domain name resolution?
&lt;/h2&gt;

&lt;p&gt;Domain Name System (DNS) is a data store that stores the mapping from a domain name (such as google.com) to its IP address (142.250.185.78). You could compare DNS to an address book or a telephone book [1].&lt;/p&gt;

&lt;p&gt;You need a domain name (instead of using an IP address directly) because it’s trivial to remember domain names for a human. Each server (for example, google.com) should have a unique IP address on the internet. The DNS lets you find the IP address of the specific server on the internet using its domain name.&lt;/p&gt;

&lt;p&gt;The domain name space (DNS hierarchy) is an inverted tree structure. The DNS hierarchy has a single domain at the top level known as the root domain.&lt;/p&gt;

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

&lt;p&gt;The DNS resolution starts at the root domain, TLD, and works its way down to the second-level domain. The DNS resolution might traverse through multiple third-level domains until the hostname of the website resolves to an IP address.&lt;/p&gt;

&lt;p&gt;A URL consists of the following parts [2]:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;protocol (scheme)&lt;/li&gt;
&lt;li&gt;subdomain&lt;/li&gt;
&lt;li&gt;domain (second-level)&lt;/li&gt;
&lt;li&gt;top-level domain&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;The protocol section of the URL informs the web server which protocol to use on accessing a website. The subdomain indicates the services offered by the website such as maps or mail. The second-level domain indicates the name of the website. The top-level domain indicates the type of entity the organization registers on the internet.&lt;/p&gt;

&lt;p&gt;The DNS resolution is a sequential process. The subsequent steps of DNS resolution get executed only if the cache in the former step does not have the relevant DNS entry.&lt;/p&gt;

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

&lt;p&gt;The following operations get executed in sequential order for DNS resolution:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The browser (client) checks if the hostname to IP address mapping exists in the local cache of the client.&lt;/li&gt;
&lt;li&gt;If the last step failed, the client checks the Operating System (OS) local cache by executing a system call (syscall).&lt;/li&gt;
&lt;li&gt;If the last step failed, the client makes a DNS request to the Gateway/Router and checks the local cache of the Router.&lt;/li&gt;
&lt;li&gt;If the last step failed, the router forwards the request to Internet Service Provider (ISP) and checks the DNS cache of the ISP.&lt;/li&gt;
&lt;li&gt;If the last step failed, the DNS resolver queries the root servers (there are 13 root servers with replicas in the world).&lt;/li&gt;
&lt;li&gt;DNS resolver queries Top Level Domain (TLD) servers such as .com, or .org.&lt;/li&gt;
&lt;li&gt;DNS resolver queries Authoritative name servers such as google.com.&lt;/li&gt;
&lt;li&gt;Optionally, the DNS resolver queries Authoritative subdomain servers such as maps.google.com depending on your query.&lt;/li&gt;
&lt;/ol&gt;

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

&lt;p&gt;Once the DNS query is resolved, the intermediate components in the DNS resolution process would cache the result with a Time-to-live (TTL) expiry time limit. If you change the IP address of a website, the client should wait until TTL has elapsed to automatically invalidate the cache. The cache also improves the latency of subsequent client requests.&lt;/p&gt;

&lt;h2&gt;
  
  
  TCP three-way handshake
&lt;/h2&gt;

&lt;p&gt;The client should create a connection to the server to transfer and receive data. Transmission Control Protocol (TCP) is one of the underlying protocols in Hypertext Transfer Protocol (HTTP).&lt;/p&gt;

&lt;p&gt;You can compare HTTP to an abstract or a high-level protocol (Application layer or layer 7 in the OSI model) used between the client and the server to transfer data. Data transferred in HTTP is human-readable. TCP is a lower-level protocol (Transport layer or layer 4 in the OSI model) that handles error detection and retransmission of data packets [3].&lt;/p&gt;

&lt;p&gt;The client performs a three-way handshake with the server to establish a TCP connection. TCP requires a three-way handshake because of the bi-directional communication channel. If you make a two-way handshake, you can only start a single-directional communication channel.&lt;/p&gt;

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

&lt;p&gt;The following synchronize (SYN) and acknowledge (ACK) messages are sent between the client and the server to open a TCP connection:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The client sends an SYN request with a random sequence number (x).&lt;/li&gt;
&lt;li&gt;The server responds with SYN-ACK. The acknowledgment number is set to one more than the received sequence number (x+1). The server sends another random sequence number (y).&lt;/li&gt;
&lt;li&gt;The client sends ACK. The client sends an acknowledgment number that is one more than the received sequence number (y+1).&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  HTTPS Upgrade
&lt;/h2&gt;

&lt;p&gt;Hypertext Transfer Protocol Secure (HTTPS) is an extension of Hypertext Transfer Protocol (HTTP). The data transferred through HTTP is not encrypted and therefore anyone can eavesdrop on the data packets that are transferred. HTTPS encrypts the transferred data and thereby prevents man-in-the-middle attacks [4]. Most of the modern websites on the internet enable HTTPS for secure communication. HTTPS uses port 443 by default while HTTP uses port 80.&lt;/p&gt;

&lt;p&gt;In asymmetric encryption, there is a key pair — public and private keys. The public keys can be shared with anyone on the internet while the private key should never be shared. In symmetric encryption, there is only a single private key and both parties should have access to the same key to encrypt or decrypt the message.&lt;/p&gt;

&lt;p&gt;You could compare asymmetric encryption to an email service. The public key would be your Email address and the private key would be the password used to access the email account. Anyone can easily verify that you sent the email by looking at the Email address of the sender. However, if anyone sends an Email to your account, only you can access it using the password.&lt;/p&gt;

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

&lt;p&gt;The following operations are executed between the client and server to upgrade HTTP to HTTPS before the transfer of any data packets:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The browser (client) uses the HTTP Request headers to make an HTTPS upgrade request to the server.&lt;/li&gt;
&lt;li&gt;The server responds to the client with a Secure Sockets Layer (SSL) certificate that contains the public key of the server, which was signed by the Certificate Authority (CA).&lt;/li&gt;
&lt;li&gt;The client by default has the public keys of popular CA (for example, Google CA). The client can use the public keys of the CA to verify the validity of the SSL certificate by checking the digital signature (digital signature in asymmetric encryption).&lt;/li&gt;
&lt;li&gt;The client creates a new symmetric private key and encrypts the new symmetric private key with the public key of the server.&lt;/li&gt;
&lt;li&gt;The server decrypts the new symmetric private key shared by the client using the server's private key.&lt;/li&gt;
&lt;li&gt;Any further communication between the client and the server would be encrypted using the new symmetric private key and therefore remains secure.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Anyone listening to the HTTP Upgrade request or response messages would not be able to capture any meaningful data because of the asymmetric encryption. Once HTTPS is upgraded, further communication between the client and the server utilizes symmetric encryption.&lt;/p&gt;

&lt;p&gt;To create an SSL certificate, the server executes a Certificate Signing Request (CSR) to the CA.&lt;/p&gt;

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

&lt;p&gt;The CSR transfers the public key of the server to the CA. The CA has a pair of public and private keys. The CA signs the public key of the server using the private key of the CA and creates an SSL certificate. Anyone on the internet who has access to the public key of the CA could easily verify the digital signature of the SSL certificate.&lt;/p&gt;

&lt;h2&gt;
  
  
  HTTP Request/Response
&lt;/h2&gt;

&lt;p&gt;Hypertext Transfer Protocol (HTTP) is a mechanism for transporting data between a client and a server. The client issues an HTTP(S) Request to the server to fetch or transfer data. The server responds with relevant content and completion status information about the request [5, 6].&lt;/p&gt;

&lt;p&gt;The client makes a GET HTTP Request to view a website (such as google.com). The client makes a POST HTTP Request if the client wants to submit data to the server (such as searching for some keyword in google.com).&lt;/p&gt;

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

&lt;p&gt;The URL can be broken down into multiple components. The domain name is used to identify the server. The URL path is used to identify the resource (a specific file or information) on the server. The query parameters are used to filter or sort the data (or transfer stateful information). The following is the simplified workflow when you view the google.com website on your client [7, 8]:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;client makes an HTTP GET method Request to the google.com server&lt;/li&gt;
&lt;li&gt;the server responds with a 200 OK status code if successful&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The HTTP Request is composed of the following entities:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Uniform Resource Locator (URL)&lt;/li&gt;
&lt;li&gt;HTTP headers&lt;/li&gt;
&lt;li&gt;HTTP body (optional)&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;The HTTP Request method (Verb) defines the type of action that should be performed on the server. Some of the popular HTTP methods are the following:&lt;/p&gt;

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

&lt;p&gt;The server (Nginx, Apache web server) delegates the HTTP Request to the Request handlers. The Request handler is a piece of code that is defined in any server-side programming language (such as Python, Node.js, or Java). The Request handler checks the HTTP headers of the Request (content-type, content-encoding, cookies, etc) and subsequently validates the HTTP Request body. The Request handler then generates an appropriate response in the content-type (JSON, XML) that was requested by the client.&lt;/p&gt;

&lt;p&gt;The HTTP server response is composed of the following entities:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HTTP headers&lt;/li&gt;
&lt;li&gt;HTTP body&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;The HTTP Response Status Code helps you to troubleshoot failures. The HTTP Status Codes can be categorised into the following [9, 10]:&lt;/p&gt;

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

&lt;p&gt;The HTTP Request and Response headers are used to control the cache, authorize the client, or compress the data that is transferred between the client and the server. For example, the user-agent HTTP request header helps the server to identify if the client is a mobile or a desktop client. Some of the most popular HTTP headers are the following:&lt;/p&gt;

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

&lt;h2&gt;
  
  
  Browser rendering the response from the server
&lt;/h2&gt;

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

&lt;p&gt;The browser might make multiple HTTP Requests to the server to fetch all the relevant data for a website such as Cascading Style Sheets (CSS), JavaScript files, Images, or Videos. Finally, the browser renders the HTML and the content received from the server [11].&lt;/p&gt;

&lt;p&gt;Depending on the HTTP response headers (Cache-control), the browser caches the response to prevent re-requesting the same data from the server. The cache improves the latency of the website.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;The client usually caches the DNS mapping and server response with an arbitrary Time-to-live (TTL) expiry time. The DNS server is not queried multiple times when you revisit the same website because of the local cache.&lt;/p&gt;

&lt;p&gt;In an internet-scale system, there are multiple components as intermediate layers to meet the incoming load demand. Content Delivery Networks (CDN), Load Balancers, and Reverse Proxy are some of the intermediate components that might appear in a large-scale system.&lt;/p&gt;

&lt;h2&gt;
  
  
  Newsletter
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://newsletter.systemdesign.one/" rel="noopener noreferrer"&gt;Subscribe to my newsletter&lt;/a&gt; and never miss a new blog post again, as you'll get notified via email every time I publish something. You will also receive the ultimate guide to approaching system design interviews on &lt;a href="https://newsletter.systemdesign.one/" rel="noopener noreferrer"&gt;newsletter sign-up&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Support
&lt;/h2&gt;

&lt;p&gt;If you enjoy the blog and would like to support my work, you can make a one-time donation on &lt;a href="https://ko-fi.com/systemdesign" rel="noopener noreferrer"&gt;Ko-fi&lt;/a&gt; or &lt;a href="https://www.buymeacoffee.com/systemdesignone" rel="noopener noreferrer"&gt;Buy Me a Coffee&lt;/a&gt; or become a Patron on &lt;a href="https://www.patreon.com/systemdesign" rel="noopener noreferrer"&gt;Patreon&lt;/a&gt;. Your support will help me continue to create quality content and bring new ideas to the blog. Thank you for your generosity!&lt;/p&gt;

&lt;h2&gt;
  
  
  Questions and Solutions
&lt;/h2&gt;

&lt;p&gt;If you would like to challenge your knowledge on the topic, visit the medium article: &lt;a href="https://medium.com/@system-design/knowledge-test-what-happens-when-you-type-a-url-into-your-browser-8b47056c59c" rel="noopener noreferrer"&gt;Knowledge Test&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  License
&lt;/h2&gt;

&lt;p&gt;CC BY-NC-ND: This license allows reusers to copy and distribute the images in this article in any medium or format in unadapted form only, for noncommercial purposes only, and only so long as attribution is given to the creator. The original article must be backlinked.&lt;/p&gt;

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

&lt;p&gt;[1] &lt;a href="https://en.wikipedia.org/wiki/Domain_Name_System" rel="noopener noreferrer"&gt;DNS operation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[2] &lt;a href="https://en.wikipedia.org/wiki/URL" rel="noopener noreferrer"&gt;URL Syntax&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[3] &lt;a href="https://en.wikipedia.org/wiki/Transmission_Control_Protocol" rel="noopener noreferrer"&gt;Transmission Control Protocol&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[4] &lt;a href="https://en.wikipedia.org/wiki/HTTPS" rel="noopener noreferrer"&gt;HTTPS&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[5] &lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers" rel="noopener noreferrer"&gt;MDN HTTP headers&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[6] &lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Status" rel="noopener noreferrer"&gt;MDN HTTP Status Code&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[7] &lt;a href="https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol?ref=hackernoon.com#Request_methods" rel="noopener noreferrer"&gt;HTTP methods&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[8] &lt;a href="https://www.cloudflare.com/en-gb/learning/ddos/glossary/hypertext-transfer-protocol-http/" rel="noopener noreferrer"&gt;HTTP explained&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[9] &lt;a href="https://learn.microsoft.com/en-us/azure/architecture/best-practices/api-design" rel="noopener noreferrer"&gt;Microsoft API design&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[10] &lt;a href="https://github.com/donnemartin/system-design-primer#communication" rel="noopener noreferrer"&gt;System Design Primer HTTP communication&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[11] &lt;a href="https://developer.mozilla.org/en-US/docs/Web/Performance/How_browsers_work" rel="noopener noreferrer"&gt;How browsers work&lt;/a&gt;&lt;/p&gt;

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