<?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: appsbymuss</title>
    <description>The latest articles on DEV Community by appsbymuss (@appsbymuss).</description>
    <link>https://dev.to/appsbymuss</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%2F1169104%2F1ec72171-4ba9-4c95-9088-cdf809c70423.jpg</url>
      <title>DEV Community: appsbymuss</title>
      <link>https://dev.to/appsbymuss</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/appsbymuss"/>
    <language>en</language>
    <item>
      <title>Floating-Point Numbers</title>
      <dc:creator>appsbymuss</dc:creator>
      <pubDate>Tue, 24 Feb 2026 18:58:43 +0000</pubDate>
      <link>https://dev.to/techlabma/floating-point-numbers-1igo</link>
      <guid>https://dev.to/techlabma/floating-point-numbers-1igo</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;(This Blog post is part of a collaborative work between &lt;strong&gt;Me&lt;/strong&gt; and &lt;strong&gt;Youssef El Idrissi&lt;/strong&gt;, Consult his devTo page for more information: &lt;a href="https://dev.to/0xw3ston"&gt;https://dev.to/0xw3ston&lt;/a&gt;)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  The Backstory...
&lt;/h1&gt;

&lt;p&gt;Long ago Computer Engineers found themselves in a tricky pickle, they had no way to work with Numbers that are &lt;strong&gt;not "full-Integers"&lt;/strong&gt; (aka Numbers that have &lt;em&gt;fractions&lt;/em&gt; in them).&lt;/p&gt;

&lt;p&gt;They came up with something called &lt;strong&gt;"Fixed-Point Numbers"&lt;/strong&gt;:&lt;/p&gt;

&lt;h1&gt;
  
  
  Fixed-Point Numbers
&lt;/h1&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%2Fagbdf7v4f2dljfhhc0or.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%2Fagbdf7v4f2dljfhhc0or.png" alt=" " width="800" height="641"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The DOT in pink is called a &lt;strong&gt;radix point&lt;/strong&gt;, it's what separates the integer value from the decimal value.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Fixed-Point is about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;giving the integer side &lt;strong&gt;X bits&lt;/strong&gt; in order to represent it in binary&lt;/li&gt;
&lt;li&gt;giving the fraction side &lt;strong&gt;Y bits&lt;/strong&gt; in order to represent it in binary&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here are a few examples&lt;br&gt;
(&lt;strong&gt;In our examples we assign 4-bits for the fraction part, 4-bits for the integer part&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.amazonaws.com%2Fuploads%2Farticles%2Fdddwnjgmoqrgop2b9atu.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%2Fdddwnjgmoqrgop2b9atu.png" alt=" " width="800" height="469"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Examples &lt;strong&gt;1&lt;/strong&gt; and &lt;strong&gt;2&lt;/strong&gt; are normal since the 8 bits cover the value(s)&lt;/li&gt;
&lt;li&gt;however, in Examples &lt;strong&gt;3&lt;/strong&gt; and &lt;strong&gt;4&lt;/strong&gt; you can clearly see some issues arise when it comes on how to account for negative numbers and for accuracy.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For this reason there was another standard defined, &lt;strong&gt;"Floating-Point Numbers"&lt;/strong&gt;:&lt;/p&gt;

&lt;h1&gt;
  
  
  Floating-Point Numbers
&lt;/h1&gt;

&lt;p&gt;What makes Floating-Point Numbers so elegant is the direct inspiration they have drawn from Scientific notation writing. it is a formal standard (IEEE 754)&lt;/p&gt;

&lt;p&gt;In High School, it was taught to short-write either super big or super miniscule numbers like so.&lt;/p&gt;

&lt;p&gt;135600000 = 1,356 * 10^8&lt;br&gt;
and&lt;br&gt;
0,00005997758 = 5,997758 * 10^-5&lt;/p&gt;

&lt;p&gt;with a paper and pen (it's generally) okay to write numbers both ways (as they are, or in scientific notation)&lt;br&gt;
But with computers how data is stored  is very critical and requires bit-level accuracy to not get the wrong results.&lt;/p&gt;

&lt;h2&gt;
  
  
  Single-Precision Floating Point
&lt;/h2&gt;

&lt;p&gt;32-bit representation&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%2Fy2q8bhc0q058sj731x9s.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%2Fy2q8bhc0q058sj731x9s.png" alt=" " width="800" height="320"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There's multiple variations of &lt;strong&gt;Floating-Point Numbers&lt;/strong&gt;, one of them is a the &lt;strong&gt;32-bit&lt;/strong&gt; representation.&lt;/p&gt;

&lt;p&gt;Usually in all of the &lt;strong&gt;Floating-Point&lt;/strong&gt; variations we find three main components:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Mantissa&lt;/strong&gt;: This part represents the part of our number that cannot be further encoded&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Exponent&lt;/strong&gt;: That part represents the exponent by which we multiply the Mantissa to get the original number back.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sign&lt;/strong&gt;: this is a one bit flag that tells us if the number is negative or positive.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Encoding
&lt;/h3&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%2F54ty9jygt9osm6210o9z.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%2F54ty9jygt9osm6210o9z.png" alt=" " width="800" height="548"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To encode a number from &lt;code&gt;base-10&lt;/code&gt; to &lt;code&gt;base-2&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We take the &lt;strong&gt;integer side&lt;/strong&gt; and turn it into binary&lt;/li&gt;
&lt;li&gt;We take the &lt;strong&gt;fraction/decimal side&lt;/strong&gt; and turn it into binary&lt;/li&gt;
&lt;li&gt;We then slide the &lt;strong&gt;radix point&lt;/strong&gt; until we get a &lt;strong&gt;&lt;code&gt;1&lt;/code&gt;&lt;/strong&gt; on the left side&lt;/li&gt;
&lt;li&gt;And lastly we apply the &lt;strong&gt;"Bias"&lt;/strong&gt; which we will explain later.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Encoding&lt;/strong&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  Integer to Binary Conversion
&lt;/h5&gt;

&lt;p&gt;We do the following Calculation to turn the integer into binary&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Value (Integer)&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;bit&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;124 mod 2&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;62 mod 2&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;31 mod 2&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;15 mod 2&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;7 mod 2&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3 mod 2&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1 mod 2&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;code&gt;1111100&lt;/code&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  Fraction/Decimal to Binary Conversion
&lt;/h5&gt;

&lt;p&gt;We do the following Calculation to turn the decimal into binary&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Value (Fraction)&lt;/th&gt;
&lt;th&gt;bit&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;0.25568 . 2 = 0.51136&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.51136 . 2 = 1.02272&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.02272 . 2 = 0.04544&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.04544 . 2 = 0.09088&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.0988 . 2 = 0.18176&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.18176 . 2 = 0.36352&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.3652 . 2 = 0.72704&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.72704 . 2 = 1.45408&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.45408 . 2 = 0.90816&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.90816 . 2 = 1.81632&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.81632 . 2 = 1.63264&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.63264 . 2 = 1.26528&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.26528 . 2 = 0.53056&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.53056 . 2 = 1.06112&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;...&lt;/td&gt;
&lt;td&gt;...&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;code&gt;.01000001011101...&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;So once we are done we are left with &lt;code&gt;1111100.01000001011101&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;We have to normalize that to get the scientific notation for this number, we would slide the radix point to the left (or the right, depending on where the left upmost "1" exists) until there is exactly one single "1" on the left side of the radix point, like so&lt;br&gt;
&lt;code&gt;1111100.01000001011101100&lt;/code&gt;  = &lt;code&gt;1.11110001000001011101100 x 2^6&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then comes the &lt;strong&gt;Adding Bias&lt;/strong&gt; step, first what's a Bias ?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bias&lt;/strong&gt;: Bias is a fixed value added to the real exponent so the exponent can be stored as an &lt;strong&gt;unsigned integer&lt;/strong&gt;. Instead of storing negative exponents directly, we store: &lt;code&gt;Stored Exponent = Real exponent + Bias&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;for example &lt;strong&gt;Single-precision Floating-point&lt;/strong&gt; uses a bias of &lt;code&gt;127&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;So in this case The bias is &lt;code&gt;6 + 127&lt;/code&gt; which is &lt;code&gt;133&lt;/code&gt; and in binary &lt;code&gt;133 = 10000101&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;So we're left with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sign: 0 (positive number)&lt;/li&gt;
&lt;li&gt;Exponent: 10000101&lt;/li&gt;
&lt;li&gt;Mantissa: 111100....&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In normalized IEEE 754 numbers, the leading 1 (highlighted in red in the diagram below) before the radix point is &lt;strong&gt;implicit&lt;/strong&gt; and therefore not stored. This is known as the &lt;strong&gt;hidden bit&lt;/strong&gt; optimization.&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%2Fb93mh104uudzvbcz30c9.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%2Fb93mh104uudzvbcz30c9.png" alt=" " width="800" height="337"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Decoding
&lt;/h3&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%2F9dvh8wvddnpuriap8m93.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%2F9dvh8wvddnpuriap8m93.png" alt=" " width="800" height="320"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Decoding is fairly simple&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Extract the &lt;strong&gt;Exponent&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Remove the &lt;strong&gt;Bias&lt;/strong&gt; from the exponent to get the real exponent (which is &lt;code&gt;6&lt;/code&gt; in this case)&lt;/li&gt;
&lt;li&gt;Extract the &lt;strong&gt;Mantissa&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Reconstruct the equation &lt;strong&gt;mantissa x 2^exponent&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;which later on gives us&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%2F35nig2byjvf9ftjj8v87.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%2F35nig2byjvf9ftjj8v87.png" alt=" " width="800" height="422"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This way we managed to Decode the Floating Point.&lt;/p&gt;

&lt;h2&gt;
  
  
  Other Precision
&lt;/h2&gt;

&lt;h4&gt;
  
  
  Half-Precision Floating-Point
&lt;/h4&gt;

&lt;p&gt;Used mostly in AI and Graphics&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%2Foodnhabuxtemsdr7clbv.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%2Foodnhabuxtemsdr7clbv.png" alt=" " width="800" height="433"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Double-Precision Floating-Point
&lt;/h4&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%2Fgdhc2dp8kdhtmq5egps2.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%2Fgdhc2dp8kdhtmq5egps2.png" alt=" " width="800" height="116"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Mostly used in Scientific Computer such as Physics Simulations, Engineering calculations &amp;amp; Numerical methods.&lt;/p&gt;

&lt;h4&gt;
  
  
  Quad-Precision Floating-Point
&lt;/h4&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%2Ffwrj597j4p9rkol7ey7v.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%2Ffwrj597j4p9rkol7ey7v.png" alt=" " width="800" height="59"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Used in High-Precision scientific simulations &amp;amp; Financial systems where the error rate should be minimized aggressively, it is present in Astrophysics, Climate modeling, Computational number theory etc..&lt;/p&gt;

&lt;h4&gt;
  
  
  Octuple-Precision Floating-Point
&lt;/h4&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%2Fa6c4tg5d00ipr2z1w8mj.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%2Fa6c4tg5d00ipr2z1w8mj.png" alt=" " width="800" height="30"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Used in Cryptography research, symbolic mathematics, experimental physics and extremely sensitive numerical algorithms&lt;/p&gt;

</description>
      <category>learning</category>
      <category>computerscience</category>
      <category>softwareengineering</category>
      <category>science</category>
    </item>
    <item>
      <title>From the Market Stalls of Morocco to Building Tech Solutions for Europe</title>
      <dc:creator>appsbymuss</dc:creator>
      <pubDate>Thu, 24 Apr 2025 18:48:35 +0000</pubDate>
      <link>https://dev.to/techlabma/from-the-market-stalls-of-morocco-to-building-tech-solutions-for-europe-3lp9</link>
      <guid>https://dev.to/techlabma/from-the-market-stalls-of-morocco-to-building-tech-solutions-for-europe-3lp9</guid>
      <description>&lt;p&gt;I was born in &lt;strong&gt;Errachidia&lt;/strong&gt; and raised in &lt;strong&gt;Nador&lt;/strong&gt;, two small towns in &lt;strong&gt;Morocco&lt;/strong&gt;, in a family deeply rooted in &lt;strong&gt;B2B distribution&lt;/strong&gt; ; food, meat, and agricultural products through our family business, &lt;em&gt;2MP DIP Errachidia&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Summers were my earliest training ground. While other kids took vacations, I was at the local markets with my father and uncles, observing the rhythm of commerce and learning the subtle art of negotiation.&lt;/p&gt;

&lt;p&gt;At my uncle’s office , a real-world classroom ,I developed an instinct for &lt;strong&gt;positioning products&lt;/strong&gt;, understanding &lt;strong&gt;customer psychology&lt;/strong&gt;, and thinking in &lt;strong&gt;strategies&lt;/strong&gt; long before I opened my first marketing textbook.&lt;/p&gt;

&lt;h2&gt;
  
  
  From the Market to the Classroom
&lt;/h2&gt;

&lt;p&gt;These formative experiences shaped my academic direction. I pursued a &lt;strong&gt;BTS in Technico-Commercial&lt;/strong&gt;, followed by a &lt;strong&gt;professional bachelor's program in Management of Sales Forces&lt;/strong&gt;, seeking to reinforce practical knowledge with formal training.&lt;/p&gt;

&lt;p&gt;But in &lt;strong&gt;2019&lt;/strong&gt;, everything changed.&lt;/p&gt;

&lt;p&gt;I discovered the world of &lt;strong&gt;digital marketing&lt;/strong&gt;. I became fascinated by how websites rank, how algorithms behave, and how people interact with digital content. What started as curiosity quickly became a &lt;strong&gt;passion&lt;/strong&gt;, and that passion pointed me towards &lt;strong&gt;technology&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Diving into Tech
&lt;/h2&gt;

&lt;p&gt;I took a bold leap.&lt;/p&gt;

&lt;p&gt;Determined to dive deeper, I joined a &lt;strong&gt;vocational program in Full-Stack Web Development&lt;/strong&gt; at the &lt;em&gt;Institute Specialized Technology Applied&lt;/em&gt;. Later, I advanced my skills through the &lt;strong&gt;ALX Software Engineering Program&lt;/strong&gt;, specializing in &lt;strong&gt;Back-end Development&lt;/strong&gt;. This rigorous training empowered me to &lt;strong&gt;build scalable digital solutions from scratch&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;However, there was one major challenge: in &lt;strong&gt;Nador&lt;/strong&gt;, tech jobs were limited.&lt;/p&gt;

&lt;p&gt;Instead of waiting for opportunities, I decided to &lt;strong&gt;create them&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building a Bridge to Europe
&lt;/h2&gt;

&lt;p&gt;Drawing on my creative connections, particularly within the music and audiovisual arts community at &lt;strong&gt;Rif Records Studio&lt;/strong&gt;, I found an unexpected bridge to the &lt;strong&gt;European market&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Alongside fellow software engineer &lt;strong&gt;Youssef El Idrissi&lt;/strong&gt;, I co-founded the &lt;strong&gt;#./Techlab.MA Community&lt;/strong&gt;: a remote collective of five &lt;strong&gt;multidisciplinary freelancers&lt;/strong&gt; dedicated to delivering real-world tech solutions to startups and small businesses.&lt;/p&gt;

&lt;p&gt;With my strong background in business, I naturally stepped into the role of &lt;strong&gt;Business Lead&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Managing client relations&lt;/li&gt;
&lt;li&gt;Negotiating contracts&lt;/li&gt;
&lt;li&gt;Building sustainable partnerships&lt;/li&gt;
&lt;li&gt;Collaborating with our community in production&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Real Clients, Real Impact
&lt;/h2&gt;

&lt;p&gt;We’ve successfully collaborated with companies across &lt;strong&gt;Europe and Morocco&lt;/strong&gt;, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Sanhaji Production&lt;/strong&gt; and &lt;strong&gt;Ness Production&lt;/strong&gt; in &lt;em&gt;Belgium&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;lemiel.shop&lt;/strong&gt; in &lt;em&gt;France&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;22 Codes&lt;/strong&gt; in &lt;em&gt;Fes&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dima TV Press&lt;/strong&gt; and &lt;strong&gt;Opal Multiservices&lt;/strong&gt; in &lt;em&gt;Morocco&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These weren’t just freelance gigs. Each project was &lt;strong&gt;proof that talent, resilience, and results can come from anywhere&lt;/strong&gt; , even a small town like Nador.&lt;/p&gt;

&lt;h2&gt;
  
  
  Looking Ahead: A New Chapter in Germany
&lt;/h2&gt;

&lt;p&gt;Today, I’m actively preparing to pursue a &lt;strong&gt;Duales Studium in Wirtschaftsinformatik&lt;/strong&gt; in &lt;strong&gt;Germany&lt;/strong&gt;,a country where innovation meets precision and where theory is deeply connected to real-world practice.&lt;/p&gt;

&lt;p&gt;Germany’s dual education system aligns perfectly with my story: I’ve always learned by doing, from markets to codebases. Wirtschaftsinformatik allows me to blend my business roots with technical skills to help companies deliver smarter, faster, and more user-centered solutions.&lt;/p&gt;

&lt;p&gt;My goal is to &lt;strong&gt;become a bridge between business and development teams&lt;/strong&gt;, making sure that customer needs, tech possibilities, and strategic priorities stay aligned.&lt;/p&gt;

&lt;p&gt;This path offers the ideal convergence of my &lt;strong&gt;practical business experience&lt;/strong&gt; and &lt;strong&gt;technical expertise&lt;/strong&gt;, while immersing me in the heart of &lt;strong&gt;Europe’s innovation ecosystem&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For me, this isn’t just a career move, it’s a &lt;strong&gt;mission&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I aim to stand at the intersection of &lt;strong&gt;business and technology&lt;/strong&gt; to build impactful, sustainable, and inclusive solutions. The goal is not just to succeed, but to &lt;strong&gt;open doors for others like me&lt;/strong&gt;, self-taught, self-driven, and ready to make a difference.&lt;br&gt;
In the long term, I see myself growing into the role of a &lt;strong&gt;Product Owner&lt;/strong&gt;, then eventually a &lt;strong&gt;Chief Product Officer (CPO) or Chief Technology Officer (CTO)&lt;/strong&gt; in a forward-thinking tech company ,guiding strategy, innovation, and cross-functional collaboration at the highest level.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let’s Connect
&lt;/h2&gt;

&lt;p&gt;I’m currently open to &lt;strong&gt;collaborations&lt;/strong&gt;, &lt;strong&gt;mentorships&lt;/strong&gt;, and &lt;strong&gt;career opportunities&lt;/strong&gt; across the &lt;strong&gt;tech industry&lt;/strong&gt; from startups to established companies, across all disciplines.&lt;/p&gt;

&lt;p&gt;I’m especially interested in connecting with those working in Germany and also people works in :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;#businessinformatics&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;#softwaredevelopment&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Whether you’re a professional, student, founder, or mentor—if you’re passionate about tech and innovation, &lt;strong&gt;let’s connect and build the future together&lt;/strong&gt; .&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>softwareengineering</category>
      <category>career</category>
      <category>devjournal</category>
    </item>
    <item>
      <title>Real-Time Communication in Web</title>
      <dc:creator>appsbymuss</dc:creator>
      <pubDate>Thu, 06 Feb 2025 08:27:36 +0000</pubDate>
      <link>https://dev.to/techlabma/real-time-communication-in-web-1mbi</link>
      <guid>https://dev.to/techlabma/real-time-communication-in-web-1mbi</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;(This Blog post is part of a collaborative work between &lt;strong&gt;Me&lt;/strong&gt; and &lt;strong&gt;Youssef El Idrissi&lt;/strong&gt;, Consult his devTo page for more information: &lt;a href="https://dev.to/0xw3ston"&gt;https://dev.to/0xw3ston&lt;/a&gt;)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What is Real-Time Communication ?
&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%2Fn3i6gss3viu6u8ixm2bm.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%2Fn3i6gss3viu6u8ixm2bm.png" alt=" " width="800" height="216"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Real-Time Communication refers to the instant exchange of data between systems, often characterized by low latency, where responses are nearly immediate. This type of communication is critical in applications like messaging, live streaming, gaming, financial trading, and collaborative tools where updates need to be reflected immediately for a seamless user experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  Some use cases for using RT Comm. Mechanisms:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Video and Audio Streaming:&lt;/em&gt; RTC is essential for low-latency, real-time media streaming in applications like video conferencing, virtual events, and online broadcasting where any delay can disrupt the user experience.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Live Updates and Notifications:&lt;/em&gt; RTC is used to push real-time notifications and alerts to users, such as updates in social media feeds, new messages, stock price changes, or sports scores, allowing users to stay up-to-date without needing to reload the page.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Instant Messaging and Chat:&lt;/em&gt; RTC allows for real-time text, audio, or video messaging, which is essential for communication apps and customer support platforms. Users can see messages immediately without refreshing the app.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What ways/methods exist to achieve that ?
&lt;/h2&gt;

&lt;p&gt;There are 4 common ways to implement live data updates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Short Polling&lt;/em&gt;: It involves sending HTTP GET Requests every X seconds (most commonly 5 seconds) in order to fetch if there are any updates from the backend server&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%2Fgl1o0amdgfo1vawff883.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%2Fgl1o0amdgfo1vawff883.png" alt=" " width="800" height="496"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Long Polling&lt;/em&gt;: This one only sends the backend one single HTTP Request, which the backend tries to delay as much as possible for incase an Update occurs to let the user be notified of it.&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%2Fe5yosp6rnvo33sg85p8r.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%2Fe5yosp6rnvo33sg85p8r.png" alt=" " width="800" height="496"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;SSE (Server-Sent Events)&lt;/em&gt;: This method is Unidirectional (from Backend to Frontend), which means the Client cannot send data to the server (not using SSE's anyways).&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%2Fmy4n8da01wlunq7j348v.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%2Fmy4n8da01wlunq7j348v.png" alt=" " width="800" height="473"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;WebSockets&lt;/em&gt;: this is the best choice in terms of Bidirectional communication (it allows both the client and backend to communicate with eachother), it is the most common way of implementing real time communication.&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%2Fscqdjsufc1gmrnucqffe.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%2Fscqdjsufc1gmrnucqffe.png" alt=" " width="800" height="483"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;There are other ways such as WebRTC for video streaming but we won't cover that in this post.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>webdev</category>
      <category>learning</category>
      <category>interview</category>
      <category>career</category>
    </item>
    <item>
      <title>SSH Tunneling</title>
      <dc:creator>appsbymuss</dc:creator>
      <pubDate>Sat, 31 Aug 2024 17:11:05 +0000</pubDate>
      <link>https://dev.to/techlabma/ssh-tunneling-5ej6</link>
      <guid>https://dev.to/techlabma/ssh-tunneling-5ej6</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;(This Blog post is part of a collaborative work between &lt;strong&gt;Me&lt;/strong&gt; and &lt;strong&gt;Youssef El Idrissi&lt;/strong&gt;, Consult his devTo page for more information: &lt;a href="https://dev.to/0xw3ston"&gt;https://dev.to/0xw3ston&lt;/a&gt;)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What is SSH Tunneling
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;SSH tunneling&lt;/strong&gt;, also known as &lt;strong&gt;SSH port forwarding&lt;/strong&gt;, is a method of securely routing network traffic from one network to another through an encrypted SSH (Secure Shell) connection. This technique allows you to forward traffic for various types of network services through the SSH connection, effectively bypassing firewalls or securing communications over an untrusted network, such as the internet.&lt;br&gt;
There are 3 types of SSH Tunneling: Local, Remote and Dynamic&lt;/p&gt;

&lt;h3&gt;
  
  
  Local Port Forwarding
&lt;/h3&gt;

&lt;p&gt;This forwards traffic from a specific port on the local machine to a port on a remote machine through the SSH server. It's commonly used to access services behind a firewall or NAT that aren't directly accessible from the client machine.&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%2F7finpfu5l4gzb6syihs1.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%2F7finpfu5l4gzb6syihs1.png" alt=" " width="800" height="275"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; You have a MySQL server that is running a remote machine but you don't want to directly expose its port publicly, we can use a MySQL Client Tool (such as MySQL-Workbench) through a Local SSH Tunnel to access the DB without ever exposing said database publicly.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;command to execute:&lt;/strong&gt; &lt;code&gt;ssh -L [local_port]:[remote_host]:[remote_port] [user]@[ssh_server]&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;example&lt;/strong&gt;: ssh &lt;strong&gt;-L&lt;/strong&gt; 3008:remote.example.com:3306 &lt;a href="mailto:user@ssh-server.com"&gt;user@ssh-server.com&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Remote Port Forwarding
&lt;/h3&gt;

&lt;p&gt;This forwards traffic from a specific port on the SSH server to a port on a machine accessible to the client. It's used to expose a local service to the internet or a remote network.&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%2F9fzp9q40tfvbsttfnud1.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%2F9fzp9q40tfvbsttfnud1.png" alt=" " width="800" height="212"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; You have an Apache web server that you want to be exposed only to a single remote machine (or network) to maybe automate tests or something of the sort.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;command to execute:&lt;/strong&gt; &lt;code&gt;ssh -R [remote_port]:[local_host]:[local_port] [user]@[ssh_server]&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;example&lt;/strong&gt;: ssh &lt;strong&gt;-R&lt;/strong&gt; 8080:localhost:80 &lt;a href="mailto:user@ssh-server.com"&gt;user@ssh-server.com&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Dynamic Port Forwarding
&lt;/h3&gt;

&lt;p&gt;This turns the SSH client into a SOCKS proxy server, allowing it to dynamically forward traffic through the SSH server. It's useful for routing traffic from multiple applications through the SSH connection.&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%2Fi3thknv0x1i5kxbn466f.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%2Fi3thknv0x1i5kxbn466f.png" alt=" " width="800" height="215"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; There are geographical restrictions on some website you want to visit, therefor we use the Remote machine to act as a &lt;strong&gt;SOCKS Proxy&lt;/strong&gt; and essentially forward requests to the Internet on our behalf (in this case it's HTTP Requests)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;command to execute:&lt;/strong&gt; &lt;code&gt;ssh -D [local_port] [user]@[ssh_server]&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;example&lt;/strong&gt;: ssh &lt;strong&gt;-D&lt;/strong&gt; 1080 &lt;a href="mailto:user@ssh-server.com"&gt;user@ssh-server.com&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>What happens when you type google.com in your browser and press Enter</title>
      <dc:creator>appsbymuss</dc:creator>
      <pubDate>Sat, 20 Jul 2024 20:18:21 +0000</pubDate>
      <link>https://dev.to/appsbymuss/what-happens-when-you-type-googlecom-in-your-browser-and-press-enter-4nc7</link>
      <guid>https://dev.to/appsbymuss/what-happens-when-you-type-googlecom-in-your-browser-and-press-enter-4nc7</guid>
      <description>&lt;h2&gt;
  
  
  The Hidden Processus of a Website Request: From URL to You
&lt;/h2&gt;

&lt;p&gt;We navigate websites every day, effortlessly hopping from page to page. But have you ever paused to ponder the incredible journey your request takes, from typing "google.com" to seeing the search bar appear on your screen? It's a whirlwind adventure through a complex network of technologies, all working in perfect harmony at lightning speed.&lt;br&gt;
This article unveils that very journey, shining a light on the often-overlooked processes that power our online experiences. Whether you're a seasoned developer or simply curious about the inner workings of the internet, get ready to explore the fascinating world behind the URL.&lt;br&gt;
&lt;strong&gt;Here's a roadmap of our tour:&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;The Quest Begins - From Address Bar to DNS

&lt;ul&gt;
&lt;li&gt;1.1. Consulting the Address Book: The Role of DNS&lt;/li&gt;
&lt;li&gt;1.2. Unraveling the Hierarchy: The DNS Structure&lt;/li&gt;
&lt;li&gt;1.3. DNS Records: Mapping Names to Addresses&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Navigating the Network Highway: TCP/IP Takes Over

&lt;ul&gt;
&lt;li&gt;2.1. Layered Approach: Breaking Down Data Delivery&lt;/li&gt;
&lt;li&gt;2.2. Unpacking the Layers: A Journey through the TCP/IP Stack&lt;/li&gt;
&lt;li&gt;2.3. Data On the Move: A Simplified Journey&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Standing Guard: Firewall Security Check

&lt;ul&gt;
&lt;li&gt;3.1. Firewall: Protecting the Network's Periphery&lt;/li&gt;
&lt;li&gt;3.2. Firewall Arsenal: Tools of the Trade&lt;/li&gt;
&lt;li&gt;3.3. Network Guardians: Safeguarding Data Integrity&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Securing the Channel: HTTPS/SSL to the Rescue

&lt;ul&gt;
&lt;li&gt;4.1. HTTPS: Encryption as the Cornerstone&lt;/li&gt;
&lt;li&gt;4.2. SSL/TLS: The Encryption Powerhouse&lt;/li&gt;
&lt;li&gt;4.3. Certificates: Establishing Trust in a Digital World&lt;/li&gt;
&lt;li&gt;4.4. The HTTPS/SSL Handshake: Establishing a Secure Connection&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Sharing the Load: Enter the Load Balancer

&lt;ul&gt;
&lt;li&gt;5.1. Distributing the Workload: The Essence of Load Balancing&lt;/li&gt;
&lt;li&gt;5.2. Load Balancing Algorithms: Deciding the Destination&lt;/li&gt;
&lt;li&gt;5.3. Health Checks and Failover: Ensuring Uninterrupted Service&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Welcome to the Server: The Web Server's Domain

&lt;ul&gt;
&lt;li&gt;6.1. Serving the Web: The Core Function&lt;/li&gt;
&lt;li&gt;6.2. Serving Static vs. Dynamic Content&lt;/li&gt;
&lt;li&gt;6.3. Reverse Proxy: The Multi-Purpose Intermediary&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Behind the Curtain: The Application Server

&lt;ul&gt;
&lt;li&gt;7.1. Business Logic Powerhouse&lt;/li&gt;
&lt;li&gt;7.2. Common Application Server Technologies&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;The Journey Back: Returning the Treasure to Your Browser

&lt;ul&gt;
&lt;li&gt;8.1. Packing for Delivery: From Server to Network&lt;/li&gt;
&lt;li&gt;8.2. Traversing the Network: Retracing the Path&lt;/li&gt;
&lt;li&gt;8.3. Passing Through Security: The Firewall's Second Inspection&lt;/li&gt;
&lt;li&gt;8.4. Last Mile Delivery: Arriving at Your Doorstep&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;The Grand Finale: Rendering the Website

&lt;ul&gt;
&lt;li&gt;9.1. From Code to Content: Parsing and Rendering&lt;/li&gt;
&lt;li&gt;9.2. From Code to Canvas: The Magic of Browser Rendering&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A Kid-Friendly Exploration With Grown-Up Details (Ordering pizza online analogy)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Conclusion&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Let's embark on this thrilling expedition, unveiling the magic that unfolds with every web browser window we open!&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  1. The Quest Begins - From Address Bar to DNS
&lt;/h2&gt;

&lt;p&gt;The adventure starts with a simple action - you type "google.com" into your browser and hit enter.  This human-friendly address is akin to a nickname, but your computer, a language-fluent number-cruncher, requires its IP address - a unique set of digits that pinpoint its location on the vast internet. This is where DNS steps in - the internet's own address book.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.1. Consulting the Address Book: The Role of DNS&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;DNS, or the Domain Name System, acts as the interpreter, transforming those human-readable domain names (like "google.com") into their corresponding IP addresses. Imagine trying to find your friend's house with only their phone number.  Without DNS, navigating the internet would feel like a frantic guessing game.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.2. Unraveling the Hierarchy: The DNS Structure&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;DNS isn't a simple directory, but rather a globally distributed hierarchical system, designed for lightning-fast speed and efficiency. Think of it as a pyramid, each level serving a crucial role in pinpointing the right address:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Root Servers:&lt;/strong&gt; Positioned at the top, these act as the internet's master directory. They guide your request to the appropriate Top-Level Domain (TLD) server, like the one overseeing ".com."&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;TLD Servers:&lt;/strong&gt; These manage specific TLDs like ".com," ".org," ".net," or even country codes like ".uk." The ".com" server then directs you to the authoritative DNS server responsible for "google.com."&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Authoritative DNS Server:&lt;/strong&gt; This server holds the key! It stores the actual IP address associated with "google.com."  Your DNS quest culminates here, with this crucial piece of information in hand.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;1.3. DNS Records: Mapping Names to Addresses&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The authoritative DNS server holds different records linked to a domain name:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;A Record:&lt;/strong&gt; The most essential! It directly connects the domain name to its IPv4 address - the numerical identifier computers use to communicate.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;AAAA Record:&lt;/strong&gt;  This provides the IPv6 address - a newer, expansive addressing system designed to handle the booming number of internet devices.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;CNAME Record:&lt;/strong&gt; Creates aliases, allowing you to reach the same website using various names like "&lt;a href="http://www.google.com" rel="noopener noreferrer"&gt;www.google.com&lt;/a&gt;" or "google.com."&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;MX Record:&lt;/strong&gt;  Identifies mail servers, ensuring emails destined for &lt;a href="mailto:yourname@example.com"&gt;yourname@example.com&lt;/a&gt; reach the right inbox.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This invisible process seamlessly translates domain names into IP addresses, setting the stage for the next chapter of the journey. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;(Ready for the network highways? Let's dive into Chapter 2!)&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Navigating the Network Highway: TCP/IP Takes Over
&lt;/h2&gt;

&lt;p&gt;Equipped with Google's IP address, your request sets out on a journey through the vast, interconnected network of computers - the internet.  Picture this not as a straight line but as a complex expedition with numerous stops, utilizing intricate protocols to ensure your message arrives safely and in perfect order. Enter TCP/IP - the internet's universal language and trustworthy guide.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.1. Layered Approach: Breaking Down Data Delivery&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;TCP/IP (Transmission Control Protocol/Internet Protocol) is not one gigantic entity but rather a set of meticulously organized protocols forming layers. Each layer focuses on specific tasks, allowing data transmission across diverse network environments with unmatched flexibility and efficiency.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.2. Unpacking the Layers: A Journey through the TCP/IP Stack&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Imagine your data packed into a series of carefully labelled envelopes, each ready for delivery. Let's explore how these envelopes traverse the layers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Link Layer:&lt;/strong&gt; This is the starting point! It manages the direct connections between devices on a local network using protocols like Ethernet (for wired connections) and Wi-Fi (for wireless connections). This layer ensures your data moves smoothly from your computer to your router - the gateway to the broader internet.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Internet Layer:&lt;/strong&gt; Here's where logical addresses and routing come into play. The star of the show: The Internet Protocol (IP), responsible for assigning unique addresses to every device on the internet. IP ensures that your data packets (like meticulously addressed letters) arrive at their intended destination, even after journeying through countless routers and networks.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Transport Layer:&lt;/strong&gt;  While IP handles the delivery, it doesn't guarantee order or protect against loss - particularly during internet traffic jams!  This is where reliable delivery and order are established.

&lt;ul&gt;
&lt;li&gt;  Two main players in this layer are TCP (Transmission Control Protocol) and UDP (User Datagram Protocol). TCP, like a conscientious courier, prioritizes reliable delivery for sensitive data like web pages and emails. This ensures all packets arrive in the correct order and are correctly reassembled. UDP, however, prioritizes speed over guaranteed delivery. Like a live news broadcast where the occasional blip is expected, it's ideal for real-time applications like video streaming or online gaming.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;  &lt;strong&gt;Application Layer:&lt;/strong&gt;  This layer directly interacts with your applications, such as web browsers and email clients. For browsing, Hypertext Transfer Protocol (HTTP) is the go-to protocol. It dictates how your browser communicates with web servers, requesting and receiving the content you see on websites.&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2.3. Data on the Move: A Simplified Journey&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Visualize your request being meticulously divided into multiple envelopes (data packets). Each packet is labeled with source and destination IP addresses and sets off on its exciting adventure across the internet, potentially traveling through routers, fiber optic cables, or even bouncing between satellites, all guided by the IP addressing system. Along the way, routers function like traffic directors, analyzing packet headers and selecting the most efficient path to ensure your request reaches Google's servers.  Finally, these packets are meticulously reassembled, ready for processing. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;(Our journey takes a detour towards security! Let's see how the Firewall safeguards our data in Chapter 3.)&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Standing Guard: Firewall Security Check
&lt;/h2&gt;

&lt;p&gt;Before your request reaches Google, it encounters a vital checkpoint: The Firewall.  This digital bouncer scrutinizes incoming and outgoing network traffic, strictly enforcing rules to decide which connections should be allowed and blocked. The Firewall serves as a critical layer of protection against unauthorized access and malicious attacks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.1. Firewall: Protecting the Network's Periphery&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Picture a castle with a surrounding moat and drawbridge - The Firewall acts like a similar barrier for your network, meticulously guarding against unwelcome visitors (malicious data) seeking to infiltrate and wreak havoc.  The Firewall diligently examines each incoming packet's header information for any signs of harmful intent. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.2. Firewall Arsenal: Tools of the Trade&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Firewalls use several strategies to identify and neutralize threats:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Packet Filtering:&lt;/strong&gt; Like a border control officer, the Firewall carefully analyzes specific attributes of each data packet, including source and destination IP addresses, port numbers (identifying specific services on a device), and the protocol type being used.  If a packet meets pre-defined security criteria, it passes; otherwise, it's blocked. &lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Stateful Inspection:&lt;/strong&gt; Advanced Firewalls remember ongoing conversations (connections) by maintaining a record of acceptable traffic patterns. Incoming packets that don't fit within these established connections are deemed suspicious and are promptly blocked. &lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Application Layer Filtering:&lt;/strong&gt;  Sophisticated Firewalls take things a step further by analyzing the actual data contained within packets - this is like checking a letter's contents for suspicious material.  They can detect and prevent common hacking techniques like SQL injection attacks or other malicious activity.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3.3. Network Guardians: Safeguarding Data Integrity&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Working tirelessly behind the scenes, Firewalls are essential for online security. They provide a safety net for your network and your personal information, ensuring data integrity and confidentiality by protecting it from a constantly evolving landscape of cyber threats, from simple packet filtering to advanced intrusion detection.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;(Now that we've successfully passed the Firewall's security check, it's time for another layer of protection! Let's see how HTTPS keeps our data safe in transit in Chapter 4.)&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Securing the Channel: HTTPS/SSL to the Rescue
&lt;/h2&gt;

&lt;p&gt;Having bypassed the Firewall's scrutiny, your request continues its journey. But security now becomes even more paramount, especially when sensitive data like passwords or credit card numbers are involved. Enter the dynamic duo - HTTPS and SSL/TLS - they create a secure tunnel to protect your data from unwanted eyes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.1. HTTPS: Encryption as the Cornerstone&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Imagine sending a postcard with your credit card details - anyone could intercept it and easily read it. HTTPS (Hypertext Transfer Protocol Secure) prevents this by encrypting your communication with the website, converting it into a code that eavesdroppers can't decipher.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.2. SSL/TLS: The Encryption Powerhouse&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;HTTPS relies on SSL/TLS (Secure Sockets Layer/Transport Layer Security) protocols to establish this secure encrypted connection between your browser and the website's server.  Imagine a secret code language understood only by you and the recipient! These protocols utilize strong encryption algorithms to scramble your data into gibberish for any unauthorized parties, even if it is intercepted.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.3. Certificates: Establishing Trust in a Digital World&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To ensure this secure communication, websites employ SSL/TLS certificates - think of them as digital passports issued by trustworthy authorities known as Certificate Authorities (CAs). These certificates verify a website's authenticity and provide the necessary keys for unlocking encrypted communication. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.4. The HTTPS/SSL Handshake: Establishing a Secure Connection&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before any encrypted exchange can take place, a secure handshake occurs between your browser and the server:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Client Hello:&lt;/strong&gt; Your browser initiates the process by sending a "Client Hello" message, informing the server of the SSL/TLS versions and encryption methods it understands. &lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Server Hello:&lt;/strong&gt;  The server responds with a similar "Server Hello" message, confirming its capabilities and selecting specific algorithms for the session.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Certificate Exchange:&lt;/strong&gt; The server presents its SSL/TLS certificate, acting as its digital ID card.  Your browser meticulously analyzes the certificate, checking its validity, expiration date, and confirmation of its issuance by a recognized CA.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Key Exchange:&lt;/strong&gt;  Once the certificate is verified, a secure key exchange takes place.  The server creates temporary "session keys" - secret codes for this particular conversation - and encrypts them using its private key. Your browser, holding the server's public key from the certificate, decrypts the session keys and retrieves them. &lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Encrypted Communication:&lt;/strong&gt; Now, both sides can communicate securely! Your browser and the server utilize the shared session keys to encrypt all exchanged data, making eavesdropping impossible.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This sophisticated handshake, entirely invisible to you, serves as the cornerstone of secure online transactions, protecting your passwords, payment information, and personal details.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;(Our communication is now secure! But how does the server manage the tremendous influx of requests? Let's explore the role of Load Balancers in Chapter 5!)&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  5. Sharing the Load: Enter the Load Balancer
&lt;/h2&gt;

&lt;p&gt;Imagine millions of users across the globe simultaneously attempting to access Google. To handle this massive influx and ensure a seamless and speedy experience for everyone, a critical player emerges: The Load Balancer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5.1. Distributing the Workload: The Essence of Load Balancing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Picture a busy airport with multiple runways and an air traffic controller diligently directing incoming planes for smooth operations. Similarly, a Load Balancer distributes incoming traffic among a farm of servers, preventing any individual server from being overwhelmed.  This effectively optimizes resource utilization, enhances performance, and keeps Google up and running even during peak traffic times.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5.2. Load Balancing Algorithms: Deciding the Destination&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Load Balancers use various algorithms to decide which server should receive a request, each with its strengths for specific scenarios:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Round Robin:&lt;/strong&gt; This simple strategy assigns requests to servers in a sequential fashion, guaranteeing an even distribution of workload over time.  Imagine customers queuing up at a checkout line, with each cashier taking turns. &lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Least Connections:&lt;/strong&gt;  This dynamic algorithm prioritizes current server load, directing traffic to the server with the fewest active connections, optimizing resource usage.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;IP Hashing:&lt;/strong&gt;  This method generates a unique hash key based on the client's IP address, consistently directing requests from the same client to the same server.  This is particularly useful for websites that store user-specific data, maintaining consistency for each individual user.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;5.3. Health Checks and Failover: Ensuring Uninterrupted Service&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Load Balancers don't just distribute traffic; they vigilantly monitor the health of each server:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Health Checks:&lt;/strong&gt;  Periodically, they send test requests (heartbeats) to servers and analyze the responses.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Failover:&lt;/strong&gt;  If a server fails a health check (due to crashing, becoming too slow, etc.), the Load Balancer immediately removes it from the active pool and automatically redirects traffic to the remaining healthy servers.  This ensures that users experience no disruptions, keeping the website online even in the face of temporary issues.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;(Now that our request has navigated the traffic flow, let's see where it lands - The Web Server! Head to Chapter 6!)&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  6. Welcome to the Server: The Web Server's Domain
&lt;/h2&gt;

&lt;p&gt;After traversing the network labyrinth, your request finally arrives at its destination: The Web Server. This powerful machine stores all the components that constitute a website - HTML files, images, videos, and more - and meticulously prepares the requested information for delivery back to your browser. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6.1. Serving the Web: The Core Function&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Imagine a well-organized library with a dedicated librarian.  When you request a specific book, the librarian fetches it from the vast collection and hands it to you.  The Web Server operates similarly - it receives your request, retrieves the necessary data from its storage, and prepares it for transmission.  Its primary responsibility is to manage HTTP (or HTTPS) communication - the language browsers and servers use to talk. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6.2. Serving Static vs. Dynamic Content&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Web Servers can deliver content in two main forms:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Static Content:&lt;/strong&gt; This refers to unchanging files readily available on the server's disk. Picture a printed flyer - everyone receives the same information. Examples include images, videos, CSS files (defining the webpage's visual style), and HTML files structuring the website's layout.  Serving static content is straightforward - the server simply locates and delivers the requested file.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Dynamic Content:&lt;/strong&gt; This is where websites come alive! Dynamic content is generated on the fly, personalized based on the user or specific requests. Imagine ordering a custom pizza from a chef! When you interact with features requiring user-specific data, such as logging in, submitting a form, or making a purchase, the web server calls upon specialized software called Application Servers. These powerhouses, often housed on separate hardware, handle complex logic, database interactions, and calculations to personalize the content just for you.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;6.3. Reverse Proxy: The Multi-Purpose Intermediary&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Modern web servers frequently operate as Reverse Proxies - acting as gatekeepers to an exclusive event, managing and filtering all incoming requests.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Security:&lt;/strong&gt;  Reverse Proxies conceal the web server's true location from the public, protecting it from direct attacks. &lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Caching:&lt;/strong&gt;  They strategically store frequently accessed data like images or style sheets closer to users, accelerating delivery and minimizing server workload.  Picture placing copies of popular books in different library branches for easy access!&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Load Balancing:&lt;/strong&gt;  Similar to a dedicated traffic director, they distribute requests among multiple backend servers, preventing any single server from being overwhelmed, enhancing overall performance. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;(The web server is bustling, but what about dynamic content and user interactions?  Enter the mighty Application Server, which we explore in Chapter 7!)&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  7. Behind the Curtain: The Application Server
&lt;/h2&gt;

&lt;p&gt;While the Web Server primarily handles static content and HTTP communication, the Application Server is where the true magic of interactive websites unfolds.  Imagine a vibrant kitchen with chefs preparing delicious custom-made dishes based on your orders - that's the Application Server in action! &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7.1. Business Logic Powerhouse&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Application Servers are the brains behind sophisticated web applications. They are responsible for handling the behind-the-scenes logic, database interactions, and processes that make websites dynamic and responsive to your actions. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Processing Business Logic:&lt;/strong&gt; They execute the rules governing how the application behaves.  For example, when you book a flight online, the Application Server verifies your details, checks availability based on complex fare rules, processes your payment, and issues your confirmation, all following carefully defined logic.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Data Persistence:&lt;/strong&gt;  They manage how the application interacts with databases and other storage mechanisms. This involves storing your profile information, tracking your shopping cart items, remembering your preferences, and retrieving all necessary data for a personalized experience.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Session Management:&lt;/strong&gt;  Web applications need to "remember" your interactions for a seamless user experience.  The Application Server handles these "sessions", tracking logged-in users, preserving data between page transitions (like items in your online shopping cart), and personalizing your journey. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;7.2. Common Application Server Technologies&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Various application server technologies are available, catering to specific programming languages and requirements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Java EE Application Servers:&lt;/strong&gt;  Robust platforms designed for large-scale Java applications commonly used in enterprises. They employ technologies like JavaServer Pages (JSP), Java Servlets, and Enterprise JavaBeans (EJBs).&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;PHP Application Servers:&lt;/strong&gt;  Servers specifically optimized for executing PHP code, a popular language for web development.  They improve performance through caching and enhance security.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Node.js:&lt;/strong&gt;  A JavaScript-based environment, Node.js has gained popularity for creating fast, real-time web applications. Its efficient handling of concurrent connections makes it ideal for chat apps, collaborative tools, and data-intensive applications.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;(The request is processed!  It's now time for its return journey.  Let's see how the response makes its way back to your screen in Chapter 8.)&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  8. The Journey Back: Returning the Treasure to Your Browser
&lt;/h2&gt;

&lt;p&gt;After the server diligently processes your request, generates the required content, possibly consulting databases and applications, it's time to deliver the results - the treasure!  The carefully crafted response, containing the webpage, images, or data, embarks on its return journey to your eagerly awaiting browser.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8.1. Packing for Delivery: From Server to Network&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Just like your initial request, the response is packaged for travel across the internet. The Web Server meticulously bundles the information into HTTP (or HTTPS) response packets, prepared to retrace the path back to your device. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8.2. Traversing the Network: Retracing the Path&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;These data-filled packets start their journey homeward, guided by the same trusty IP protocol that delivered your original request. They traverse routers and networks, following the most efficient routes chosen by these intelligent traffic directors. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8.3. Passing Through Security: The Firewall's Second Inspection&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;As they near your network, the response packets encounter your vigilant Firewall once again, this time performing outbound inspection.  Just as before, the Firewall meticulously scrutinizes packet headers, verifying that the incoming data aligns with an established connection initiated by your device.  Once cleared, the packets enter your local network, drawing ever closer to their final destination - your browser. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8.4. Last Mile Delivery: Arriving at Your Doorstep&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Finally, after an epic adventure across the vast digital landscape, the response packets arrive at your computer. Your operating system, acting as the gatekeeper, receives the packets, recognizing they belong to your browser and swiftly delivers them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;(Our data has safely returned!  But the journey isn't complete yet. It's time for the grand finale, where raw data is transformed into the visual masterpiece we recognize as a website! Let's go to Chapter 9.)&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  9. The Grand Finale: Rendering the Website
&lt;/h2&gt;

&lt;p&gt;Our voyage through networks and servers reaches its climax here - the final stage unfolds entirely within your web browser. The raw data, delivered as a stream of bits and bytes, undergoes a remarkable transformation, rendering the interactive, visually-rich webpage that we experience. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;9.1. From Code to Content: Parsing and Rendering&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Imagine your browser as a skilled artisan carefully assembling raw materials to create a breathtaking masterpiece.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;HTML Parsing:&lt;/strong&gt; The browser receives the HTTP response, often a mixture of HTML, CSS, and JavaScript code. The HTML parser - a crucial component of the browser engine - deciphers this markup, identifying elements like headings, paragraphs, images, and links.  It meticulously arranges these elements into a structured, hierarchical representation known as the Document Object Model (DOM).  Picture the DOM as the scaffolding that will eventually support a beautiful building.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;CSS Styling:&lt;/strong&gt;  Next, the browser parses the accompanying CSS (Cascading Style Sheets), the language dictating the website's visual style. Like an interior designer, it applies these style rules to the DOM elements, defining colors, fonts, layout, and the overall visual presentation. &lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;JavaScript Execution:&lt;/strong&gt;  For interactive elements and dynamic behavior, the browser engages its JavaScript engine. Imagine bringing the website to life! JavaScript code, either embedded within the page or linked externally, enables features like animations, dynamic updates, responses to user interactions, and even fetching data from servers without needing a full page reload.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Layout and Painting:&lt;/strong&gt;  With the DOM structured, styles applied, and JavaScript executed, the browser arranges the content.  It meticulously calculates the position and size of each element based on the viewport dimensions (your screen size) and the defined styles. Finally, like an artist grabbing their brush, the browser paints the visual components - text, images, colors - onto the screen, following the carefully crafted blueprint defined by the code.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;9.2. From Code to Canvas: The Magic of Browser Rendering&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This multi-stage process - parsing, styling, executing, layout, and painting - unfolds at lightning speed, entirely invisible to the user. Today's browsers are exceptionally sophisticated. They seamlessly integrate multiple functionalities - interpreters, rendering engines, JavaScript virtual machines, and security managers - all while prioritizing performance for a smooth, visually appealing, and captivating experience for every website you visit. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;(Our journey draws to a close, but the magic of the internet continues.  Let's recap our adventure with a relatable example!  Onto Chapter 10.)&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  10. A Kid-Friendly Exploration With Grown-Up Details
&lt;/h2&gt;

&lt;p&gt;We've traversed complex networks and dissected server functions - let's simplify things! Imagine ordering pizza online - a relatable analogy, even for a 7-year-old, can highlight the key stages of our website journey.&lt;/p&gt;

&lt;p&gt;(Imagine you're craving pizza!) 🍕&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Finding the Pizza Place (DNS)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You want Pizza Hut, but your phone needs its address.  This is where DNS comes in - it translates "pizzahut.com" into an IP address - the numerical code your phone understands, like a phonebook translating names into phone numbers.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Kid-Friendly:&lt;/strong&gt; It's like looking up your friend's phone number to call them.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Technical:&lt;/strong&gt;  The DNS hierarchy begins with root servers, then progresses to TLD servers overseeing domains like ".com," ultimately reaching the authoritative DNS server storing the website's IP address.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 2: On the Road (TCP/IP)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Knowing the pizza place's address, your phone uses TCP/IP - the internet's delivery service - to send your order. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Kid-Friendly:&lt;/strong&gt; Your order is meticulously packed into a delivery truck and sent to Pizza Hut. &lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Technical:&lt;/strong&gt; TCP/IP breaks data down into packets, loads them for delivery, and ensures they arrive complete and in the correct order through its layered structure (Link, Internet, Transport, Application).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 3: The Security Check (Firewall)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;At Pizza Hut, a security guard checks incoming orders - the Firewall. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Kid-Friendly:&lt;/strong&gt;  The guard checks if your order looks okay and isn't trying to sneak in anything unwanted!&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Technical:&lt;/strong&gt; Firewalls analyze incoming and outgoing traffic based on pre-set rules, filtering malicious requests and allowing legitimate traffic.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 4: The Pizza Chef (Web Server)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Inside, the Web Server - the pizza chef - receives your order and begins preparing!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Kid-Friendly:&lt;/strong&gt; The chef sees your order and starts making your pizza!&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Technical:&lt;/strong&gt;  Web servers receive HTTP requests and process them, retrieving static content or collaborating with application servers for dynamic content. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 5: Pizza’s On Its Way (Response)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Pizza is ready! The Web Server packs it for delivery, sending it back through TCP/IP.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Kid-Friendly:&lt;/strong&gt;  The delivery truck is back, bringing your delicious pizza! &lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Technical:&lt;/strong&gt;  The Web Server prepares an HTTP response containing the requested information, packs it into data packets, and hands it off to TCP/IP for delivery.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 6: Enjoy Your Pizza! (Website Loads)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You get the delivery, unpack it, and savor your delicious meal! &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Kid-Friendly:&lt;/strong&gt;  You finally get to enjoy the pizza you ordered! &lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Technical:&lt;/strong&gt; Your browser receives the data packets and renders the website based on the code (HTML, CSS, Javascript), displaying the final visually-appealing page on your screen. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every website you visit, each link you click, triggers a journey like this - all unfolding in the blink of an eye!&lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion: A World Beneath the Surface
&lt;/h2&gt;

&lt;p&gt;From a simple keystroke to the dazzling array of information and interactivity at our fingertips, we've revealed the remarkable journey behind every website visit. It stands as a testament to human ingenuity - a sophisticated symphony of technologies working in perfect harmony, often within mere milliseconds, to deliver the seamless online experiences we have come to expect.&lt;/p&gt;

&lt;p&gt;The next time you type in a URL, remember the world beneath the surface - a bustling network infrastructure diligently working behind the scenes. DNS servers tirelessly translate names into addresses, TCP/IP packets speed across continents, Firewalls stand guard, and powerful servers meticulously process requests.  This intricate dance, invisible to most, showcases the beauty of interconnected systems - a digital choreography orchestrating the flow of information in our increasingly digital world.&lt;/p&gt;

&lt;p&gt;Understanding this journey, even on a high level, enhances our appreciation for the incredible technology we interact with every day. It serves as a reminder that beneath the sleek interfaces and instant gratification, lies a world of complex processes and innovative engineering, constantly evolving to power our expanding digital lives. &lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>networking</category>
      <category>interview</category>
    </item>
  </channel>
</rss>
