<?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: Mustapha El Idrissi</title>
    <description>The latest articles on DEV Community by Mustapha El Idrissi (@swissknifetech).</description>
    <link>https://dev.to/swissknifetech</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1169104%2F1ec72171-4ba9-4c95-9088-cdf809c70423.jpg</url>
      <title>DEV Community: Mustapha El Idrissi</title>
      <link>https://dev.to/swissknifetech</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/swissknifetech"/>
    <language>en</language>
    <item>
      <title>From AWS to a Single Server: 15 Engineering Lessons from Building an E-Commerce Platform</title>
      <dc:creator>Mustapha El Idrissi</dc:creator>
      <pubDate>Wed, 28 Oct 2026 17:23:16 +0000</pubDate>
      <link>https://dev.to/techlabma/from-aws-to-a-single-server-15-engineering-lessons-from-building-an-e-commerce-platform-2fj7</link>
      <guid>https://dev.to/techlabma/from-aws-to-a-single-server-15-engineering-lessons-from-building-an-e-commerce-platform-2fj7</guid>
      <description>&lt;p&gt;Building an e-commerce platform is about much more than creating product pages and a checkout button. Behind the user interface, there are architectural decisions, security concerns, data consistency challenges, and production problems that can make or break the entire system.&lt;/p&gt;

&lt;p&gt;My team and I built an e-commerce website for a Paris-based startup. Throughout the project, we faced different engineering challenges, evaluated trade-offs, and learned lessons that went beyond writing code.&lt;/p&gt;

&lt;p&gt;In this article, I'll walk through the main architectural and engineering decisions behind the project, from migrating infrastructure to securing authentication, modeling inventory, preventing inconsistent transactions, and diagnosing production outages.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The Journey: From AWS to a Single High-Resource Server
&lt;/h2&gt;

&lt;p&gt;Our initial architecture was built on AWS.&lt;/p&gt;

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

&lt;p&gt;The architecture used several managed services to handle different responsibilities.&lt;/p&gt;

&lt;p&gt;After a while, we migrated to another Infrastructure-as-a-Service (IaaS) platform and ended up running most of our services on a single high-resource compute 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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fphwcknlv3cjqhhbs05b5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fphwcknlv3cjqhhbs05b5.png" alt="Single-server architecture" width="800" height="507"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This change was an important architectural trade-off. Instead of distributing most of our services across multiple infrastructure components, we consolidated them onto a single machine.&lt;/p&gt;

&lt;p&gt;The experience highlighted an important lesson: infrastructure decisions should be driven by actual requirements, operational constraints, and trade-offs rather than architectural trends alone.&lt;/p&gt;

&lt;p&gt;A simpler deployment can reduce operational complexity, but consolidating services also introduces a larger single point of failure.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Why We Chose an API-First Architecture
&lt;/h2&gt;

&lt;p&gt;One of our key decisions was to separate the frontend from the backend.&lt;/p&gt;

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

&lt;h3&gt;
  
  
  Server-Side Rendering vs. Client-Side Rendering
&lt;/h3&gt;

&lt;p&gt;With Server-Side Rendering (SSR), the server generates HTML containing the data needed by the client. Depending on the technology, this might involve PHP templates, EJS, or another server-side rendering approach.&lt;/p&gt;

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

&lt;p&gt;In a tightly coupled implementation, the frontend's rendering logic and backend application are closely connected. This can make changing the frontend technology or reusing the backend for other clients more difficult.&lt;/p&gt;

&lt;p&gt;Client-Side Rendering (CSR), on the other hand, allows the frontend and backend to communicate through a defined API contract.&lt;/p&gt;

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

&lt;p&gt;The frontend can use a framework such as React, while the backend exposes endpoints that communicate through a protocol such as REST.&lt;/p&gt;

&lt;p&gt;We chose React for the frontend and an API-first approach because it gave us greater flexibility.&lt;/p&gt;

&lt;p&gt;The backend could potentially serve different clients without requiring a complete redesign, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A web application built with another frontend framework&lt;/li&gt;
&lt;li&gt;A mobile application&lt;/li&gt;
&lt;li&gt;A frontend deployed independently on a Content Delivery Network (CDN)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The main benefit was separation of responsibilities. The frontend handled presentation, while the backend exposed the application's business capabilities through APIs.&lt;/p&gt;

&lt;p&gt;Of course, CSR is not automatically better than SSR. Rendering strategy should depend on requirements such as SEO, performance, caching, and the user experience. In our case, frontend flexibility was a major consideration.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Authentication Architecture: JWTs, Cookies, and Sessions
&lt;/h2&gt;

&lt;p&gt;Authentication was another important part of the project.&lt;/p&gt;

&lt;p&gt;One security risk we considered was Cross-Site Scripting (XSS). An XSS vulnerability can allow an attacker to execute malicious JavaScript in a user's browser.&lt;/p&gt;

&lt;p&gt;If sensitive authentication tokens are stored in JavaScript-accessible storage, such as &lt;code&gt;localStorage&lt;/code&gt;, an attacker who successfully exploits an XSS vulnerability may be able to steal them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why HttpOnly Cookies?
&lt;/h3&gt;

&lt;p&gt;We used &lt;code&gt;HttpOnly&lt;/code&gt; cookies to prevent client-side JavaScript from directly reading authentication cookies.&lt;/p&gt;

&lt;p&gt;The browser automatically includes eligible cookies in requests to the backend, subject to cookie settings and browser rules.&lt;/p&gt;

&lt;p&gt;This reduces the risk of token theft through JavaScript, although it does not eliminate XSS or other authentication risks.&lt;/p&gt;

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

&lt;h3&gt;
  
  
  Why Use Sessions and JWTs Together?
&lt;/h3&gt;

&lt;p&gt;We also used JWTs as a way to represent information associated with an authenticated user, such as their role.&lt;/p&gt;

&lt;p&gt;For example, users might have roles such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;client&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;editor&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;superadmin&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sessions and JWTs serve different purposes, and using both requires a clear reason and lifecycle design.&lt;/p&gt;

&lt;p&gt;In our implementation, session rotation was our primary strategy for invalidating sessions after a suspected compromise. Rotating session identifiers forces affected clients to authenticate again when the old sessions are invalidated.&lt;/p&gt;

&lt;p&gt;JWTs can also be rotated or revoked through appropriate mechanisms, but doing so introduces additional considerations.&lt;/p&gt;

&lt;p&gt;The important lesson is that authentication architecture should be designed around the threat model and invalidation requirements, not simply around the popularity of a technology.&lt;/p&gt;

&lt;h3&gt;
  
  
  Role-Based Access Control (RBAC)
&lt;/h3&gt;

&lt;p&gt;We used Role-Based Access Control (RBAC) to secure API endpoints.&lt;/p&gt;

&lt;p&gt;RBAC made sense for our permission model because access could be granted according to a user's assigned role.&lt;/p&gt;

&lt;p&gt;For applications requiring more granular authorization based on attributes such as ownership, resource properties, or environmental conditions, Attribute-Based Access Control (ABAC) could be a better fit.&lt;/p&gt;

&lt;p&gt;The authorization model should match the complexity of the business requirements.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Modeling Inventory Across Multiple Stocks
&lt;/h2&gt;

&lt;p&gt;One unexpected challenge involved inventory management.&lt;/p&gt;

&lt;p&gt;Our client stored merchandise across multiple stock locations. Initially, we didn't have that information, so the application had been designed around a single stock location during checkout.&lt;/p&gt;

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

&lt;p&gt;Fortunately, our database model was flexible enough to accommodate the new requirement.&lt;/p&gt;

&lt;p&gt;We adapted the application so that a single product in an order could be fulfilled from one or multiple stock locations, using different quantities.&lt;/p&gt;

&lt;p&gt;For example, if a customer ordered 10 units of a product, the application could allocate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;6 units from Stock A&lt;/li&gt;
&lt;li&gt;4 units from Stock B&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The checkout process had to handle these allocations without introducing discrepancies in inventory records.&lt;/p&gt;

&lt;p&gt;This experience reinforced the importance of flexible data modeling.&lt;/p&gt;

&lt;p&gt;Business requirements change. A good data model should make reasonable changes possible without requiring a complete redesign.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Modeling the Order Lifecycle as a State Machine
&lt;/h2&gt;

&lt;p&gt;An order doesn't simply move from creation to completion in one step.&lt;/p&gt;

&lt;p&gt;It passes through different stages, and the application needs to manage those transitions consistently.&lt;/p&gt;

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

&lt;p&gt;Finite State Machines (FSMs) define the states an entity can occupy and the transitions permitted between them.&lt;/p&gt;

&lt;p&gt;We used the concept of state machines to reason about the overall checkout process.&lt;/p&gt;

&lt;p&gt;Thinking in terms of explicit states helps developers understand which operations are valid at each stage and which transitions should be rejected.&lt;/p&gt;

&lt;p&gt;For example, an order should not be treated as successfully paid merely because it has been created.&lt;/p&gt;

&lt;p&gt;Separating order states and transitions makes complex business processes easier to reason about, test, and maintain.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Securing Database Access Through SSH Tunnels
&lt;/h2&gt;

&lt;p&gt;Many e-commerce deployments built around content management systems use web-based database administration tools such as phpMyAdmin.&lt;/p&gt;

&lt;p&gt;These tools can be useful, but exposing a database administration interface publicly introduces another potential attack surface.&lt;/p&gt;

&lt;p&gt;Attackers may attempt to guess credentials, exploit vulnerabilities in the administration software, or gain unauthorized access through misconfiguration.&lt;/p&gt;

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

&lt;h3&gt;
  
  
  Our Approach: SSH Tunneling
&lt;/h3&gt;

&lt;p&gt;We restricted database network access so that only the authorized Linux server could connect directly to the database.&lt;/p&gt;

&lt;p&gt;When we needed to access the database from our local development machines, we connected to the server through SSH and created a tunnel that forwarded traffic to the database.&lt;/p&gt;

&lt;p&gt;Conceptually, the SSH server acted as a secure bridge between the development machine and the database.&lt;/p&gt;

&lt;p&gt;This approach reduced direct exposure of the database and allowed us to administer it without making the database publicly accessible.&lt;/p&gt;

&lt;p&gt;Network restrictions should still be combined with strong authentication, least-privilege database accounts, and appropriate SSH configuration.&lt;/p&gt;

&lt;p&gt;The principle is straightforward: if a service doesn't need to be publicly accessible, don't expose it unnecessarily.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Hardening a Production Linux Server
&lt;/h2&gt;

&lt;p&gt;Securing the server was another important part of running the application in production.&lt;/p&gt;

&lt;p&gt;We applied several measures to reduce unnecessary exposure and improve the server's security posture.&lt;/p&gt;

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

&lt;p&gt;We restricted inbound traffic to the ports required by the application:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Port 80&lt;/strong&gt;: HTTP requests, redirected to HTTPS&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Port 443&lt;/strong&gt;: HTTPS traffic&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Port 22&lt;/strong&gt;: SSH administration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The SSH port was necessary for remote administration, but it still needed appropriate access restrictions.&lt;/p&gt;

&lt;p&gt;Depending on the deployment, additional hardening measures may include SSH key authentication, disabling password-based SSH login, applying security updates, monitoring logs, and limiting administrative privileges.&lt;/p&gt;

&lt;p&gt;The goal of server hardening is to minimize the number of unnecessary entry points and reduce the impact of potential attacks.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Why We Used an ORM and Database Migrations
&lt;/h2&gt;

&lt;p&gt;An Object-Relational Mapper (ORM) helped us manage the relationship between our JavaScript application and the underlying relational database.&lt;/p&gt;

&lt;p&gt;In our case, the ORM provided two particularly useful capabilities:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A way to map database structures and records to application objects&lt;/li&gt;
&lt;li&gt;A mechanism for managing database schema migrations&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fq9k3u7br9mwkuhdhfolq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fq9k3u7br9mwkuhdhfolq.png" alt="ORM and database migrations" width="800" height="327"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Migrations Matter
&lt;/h3&gt;

&lt;p&gt;Production databases evolve alongside applications.&lt;/p&gt;

&lt;p&gt;We may need to add a column, modify a table, introduce a relationship, or change how information is represented.&lt;/p&gt;

&lt;p&gt;Without a structured migration process, schema changes can become difficult to track and reproduce. Poorly planned changes can also introduce data consistency problems or make rollbacks difficult.&lt;/p&gt;

&lt;p&gt;Migrations provide a history of schema changes and a repeatable way to apply them across environments.&lt;/p&gt;

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

&lt;p&gt;An ORM also allows developers to perform database queries programmatically rather than manually constructing every SQL statement.&lt;/p&gt;

&lt;p&gt;However, ORMs don't eliminate the need to understand SQL, database constraints, indexes, transactions, or query performance.&lt;/p&gt;

&lt;p&gt;For a production e-commerce application, these fundamentals remain essential.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. The Cost of Neglecting Regression Testing
&lt;/h2&gt;

&lt;p&gt;Testing was one of the things we initially neglected.&lt;/p&gt;

&lt;p&gt;Eventually, we learned why that was a mistake.&lt;/p&gt;

&lt;p&gt;When fixing one bug, we sometimes introduced another problem in a part of the application that had previously worked correctly.&lt;/p&gt;

&lt;p&gt;This is exactly the kind of problem regression testing is designed to detect.&lt;/p&gt;

&lt;p&gt;Regression testing involves running existing tests after code changes to verify that previously working functionality continues to behave as expected.&lt;/p&gt;

&lt;p&gt;For an e-commerce application, regression tests can cover critical workflows such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Adding products to a cart&lt;/li&gt;
&lt;li&gt;Calculating order totals&lt;/li&gt;
&lt;li&gt;Applying inventory changes&lt;/li&gt;
&lt;li&gt;Processing checkout operations&lt;/li&gt;
&lt;li&gt;Handling payment responses&lt;/li&gt;
&lt;li&gt;Sending order-related emails&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Not every test needs to be an end-to-end test. Unit tests and integration tests can catch many problems earlier and more efficiently.&lt;/p&gt;

&lt;p&gt;The lesson we learned was simple: a feature isn't truly finished if we can't confidently verify that it works after the next change.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. Designing a Hybrid Image Storage Strategy
&lt;/h2&gt;

&lt;p&gt;Product images can be added, modified, and removed throughout the lifetime of an e-commerce application.&lt;/p&gt;

&lt;p&gt;Frontend build assets are different. They are generated during deployment and are often good candidates for CDN delivery.&lt;/p&gt;

&lt;p&gt;Product images, however, are dynamic assets that benefit from an explicit storage strategy.&lt;/p&gt;

&lt;p&gt;We wanted to avoid relying entirely on an external object storage service while also avoiding a design that depended exclusively on local files.&lt;/p&gt;

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

&lt;h3&gt;
  
  
  Content-Addressable Storage
&lt;/h3&gt;

&lt;p&gt;We implemented a hybrid approach in which uploaded file contents were hashed.&lt;/p&gt;

&lt;p&gt;Content-addressable storage uses a content-derived identifier to identify a file. This can help determine whether two files contain the same data and can support consistent file management.&lt;/p&gt;

&lt;p&gt;We stored copies both locally and remotely.&lt;/p&gt;

&lt;p&gt;The local copy was updated when a file with the corresponding identifier was uploaded, while the remote copy was managed through a wrapper abstraction.&lt;/p&gt;

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

&lt;p&gt;This abstraction helped keep the rest of the application independent of the details of the remote storage provider.&lt;/p&gt;

&lt;p&gt;The broader lesson is that storage implementations should be replaceable where practical, particularly when external services are involved.&lt;/p&gt;

&lt;h2&gt;
  
  
  11. Designing a Fallback Strategy for External Storage
&lt;/h2&gt;

&lt;p&gt;Using external storage introduces a dependency on another service.&lt;/p&gt;

&lt;p&gt;If that service becomes unavailable, image delivery can be affected.&lt;/p&gt;

&lt;p&gt;We therefore implemented a fallback mechanism for product images.&lt;/p&gt;

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

&lt;p&gt;The application attempted to fetch images from the external storage endpoints first.&lt;/p&gt;

&lt;p&gt;If an image couldn't be retrieved, it could fall back to the corresponding image in a publicly accessible directory on our own server.&lt;/p&gt;

&lt;p&gt;This gave us an alternative delivery path if the external storage service experienced a problem.&lt;/p&gt;

&lt;p&gt;Fallback strategies need careful implementation: missing files, permissions, caching, and actual provider outages should be distinguished appropriately.&lt;/p&gt;

&lt;p&gt;The important principle is to identify critical external dependencies and decide what the application should do when they fail.&lt;/p&gt;

&lt;h2&gt;
  
  
  12. Checkout Consistency, Transactions, and Race Conditions
&lt;/h2&gt;

&lt;p&gt;One of the most important challenges in the project was maintaining data consistency during checkout.&lt;/p&gt;

&lt;p&gt;A checkout operation can involve several database writes. For example, the application may need to create an order, insert its line items, record payment-related information, and update inventory.&lt;/p&gt;

&lt;p&gt;What happens if some operations succeed but another fails?&lt;/p&gt;

&lt;p&gt;Without appropriate safeguards, the database could be left in a partially updated state.&lt;/p&gt;

&lt;h3&gt;
  
  
  Database Transactions
&lt;/h3&gt;

&lt;p&gt;We used database transactions to group related operations into a unit of work.&lt;/p&gt;

&lt;p&gt;If all the required operations succeed, the transaction can be committed. If a failure occurs before the transaction commits, it can be rolled back.&lt;/p&gt;

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

&lt;p&gt;Transactions helped us avoid partial writes across the database operations included in the transaction.&lt;/p&gt;

&lt;p&gt;However, transactions alone don't automatically solve every concurrency problem or guarantee consistency across external services. Those require additional design decisions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Inventory Updates and Database Triggers
&lt;/h3&gt;

&lt;p&gt;We also used database triggers to automatically reduce product quantities in the relevant stock locations after payment confirmation.&lt;/p&gt;

&lt;p&gt;This helped automate inventory updates, but it also made the correctness of the payment-confirmation flow especially important.&lt;/p&gt;

&lt;p&gt;In production systems, payment events should be processed with appropriate idempotency and concurrency safeguards so that duplicate notifications don't cause repeated inventory deductions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Race Conditions
&lt;/h3&gt;

&lt;p&gt;Race conditions were among the trickiest issues to identify.&lt;/p&gt;

&lt;p&gt;We encountered one involving emails.&lt;/p&gt;

&lt;p&gt;Asynchronous execution can create situations where operations run in an unexpected order or where multiple operations interfere with one another.&lt;/p&gt;

&lt;p&gt;These problems can be difficult to reproduce because they may depend on timing.&lt;/p&gt;

&lt;p&gt;The experience taught us to pay close attention to asynchronous workflows, especially when they involve payment processing, inventory updates, notifications, or other side effects.&lt;/p&gt;

&lt;h3&gt;
  
  
  Integrating Payment Gateways and Delivery Platforms
&lt;/h3&gt;

&lt;p&gt;Another architectural challenge involved integrating external payment gateways and delivery platforms.&lt;/p&gt;

&lt;p&gt;Different providers often return different data structures.&lt;/p&gt;

&lt;p&gt;Instead of creating entirely separate database tables for every service, we generalized the common fields and stored provider-specific fields in a JSON column.&lt;/p&gt;

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

&lt;p&gt;This approach allowed us to support different providers without making the database schema unnecessarily rigid.&lt;/p&gt;

&lt;p&gt;The trade-off is that JSON-based fields require careful validation and can make querying provider-specific information more complex.&lt;/p&gt;

&lt;p&gt;The goal was to keep the common data model consistent while preserving the flexibility needed for external integrations.&lt;/p&gt;

&lt;h2&gt;
  
  
  13. Diagnosing Production Outages Caused by Memory Pressure
&lt;/h2&gt;

&lt;p&gt;One of the more surprising problems we encountered occurred when the Linux server became completely unresponsive, sometimes even preventing SSH access.&lt;/p&gt;

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

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

&lt;p&gt;After investigating the problem, we discovered that the machine had no swap space configured.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Is Swap?
&lt;/h3&gt;

&lt;p&gt;Swap is disk space that the operating system can use to hold memory pages when physical RAM is under pressure.&lt;/p&gt;

&lt;p&gt;When RAM becomes exhausted, swap can sometimes provide additional breathing room. However, disk storage is much slower than RAM, and heavy swapping can significantly degrade performance.&lt;/p&gt;

&lt;p&gt;Without swap, a system under severe memory pressure may become unstable or invoke the operating system's out-of-memory mechanisms.&lt;/p&gt;

&lt;p&gt;Adding swap can help in some situations, but it isn't a substitute for sufficient RAM or proper resource management.&lt;/p&gt;

&lt;p&gt;The experience reinforced an important operational lesson: understanding the server's memory behavior is just as important as understanding the application's code.&lt;/p&gt;

&lt;p&gt;Monitoring RAM usage, investigating memory leaks, and configuring sensible resource limits can help prevent similar incidents.&lt;/p&gt;

&lt;h2&gt;
  
  
  14. Why We Put Nginx in Front of Express
&lt;/h2&gt;

&lt;p&gt;We needed a reliable entry point for incoming HTTP and HTTPS requests without exposing the Express application directly to the internet.&lt;/p&gt;

&lt;p&gt;We therefore placed Nginx in front of Express.&lt;/p&gt;

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

&lt;p&gt;Nginx handled incoming connections, served static assets where appropriate, terminated HTTPS, and forwarded application requests to Express.&lt;/p&gt;

&lt;p&gt;This separation provided several benefits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A dedicated entry point for incoming traffic&lt;/li&gt;
&lt;li&gt;Centralized TLS configuration&lt;/li&gt;
&lt;li&gt;Reverse proxying to the application server&lt;/li&gt;
&lt;li&gt;An appropriate place to configure request limits and other connection-level policies&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The architecture also allowed Express to focus on application logic rather than handling every aspect of public-facing traffic itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  15. Separating Production and Testing Environments
&lt;/h2&gt;

&lt;p&gt;We maintained separate testing and production environments.&lt;/p&gt;

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

&lt;p&gt;This allowed us to test API endpoints and external integrations using sandbox API keys before deploying changes to the live application.&lt;/p&gt;

&lt;p&gt;Keeping environments separate also helps prevent accidental interactions with production data and services during development.&lt;/p&gt;

&lt;p&gt;A useful separation strategy includes distinct credentials, environment-specific configuration, and controlled deployment procedures.&lt;/p&gt;

&lt;p&gt;The objective is to catch problems before they reach real customers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Building this e-commerce platform taught us that software engineering involves much more than implementing features.&lt;/p&gt;

&lt;p&gt;The project required us to think about infrastructure, security, database design, application architecture, asynchronous execution, and production reliability.&lt;/p&gt;

&lt;p&gt;Some of our most valuable lessons came from unexpected requirements and problems that appeared only after the application was running.&lt;/p&gt;

&lt;p&gt;If I had to summarize the main takeaways, they would be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Choose architecture based on requirements.&lt;/strong&gt; More infrastructure doesn't automatically mean a better solution.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep system boundaries clear.&lt;/strong&gt; An API-first design can make the frontend and backend easier to evolve independently.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Treat security as a system-wide concern.&lt;/strong&gt; Authentication, authorization, network restrictions, and server hardening all matter.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Design for changing business requirements.&lt;/strong&gt; Flexible data models can make unexpected changes easier to accommodate.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Protect data consistency.&lt;/strong&gt; Transactions, concurrency control, and carefully designed workflows are essential for checkout.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Invest in regression testing.&lt;/strong&gt; Fixing one bug shouldn't introduce another.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Plan for failures.&lt;/strong&gt; External services, limited resources, and asynchronous operations can all behave in unexpected ways.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Learn from production.&lt;/strong&gt; Some of the most important engineering lessons only become visible when a system is operating under real conditions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The best architecture isn't necessarily the most complex one. It's the one that meets the requirements, makes trade-offs explicit, and remains maintainable as the product evolves.&lt;/p&gt;

&lt;p&gt;I'd love to hear from other developers: &lt;strong&gt;What's the most important lesson you've learned from building or maintaining a production e-commerce system?&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>architecture</category>
      <category>aws</category>
      <category>ecommerce</category>
    </item>
    <item>
      <title>Floating-Point Numbers</title>
      <dc:creator>Mustapha El Idrissi</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="321"&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&amp;nbsp;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="338"&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="321"&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="423"&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="117"&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="794" 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="31"&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>Mustapha El Idrissi</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>Mustapha El Idrissi</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="497"&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="497"&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="799" 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>Mustapha El Idrissi</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="799" 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="213"&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="799" 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>Mustapha El Idrissi</dc:creator>
      <pubDate>Sat, 20 Jul 2024 20:18:21 +0000</pubDate>
      <link>https://dev.to/swissknifetech/what-happens-when-you-type-googlecom-in-your-browser-and-press-enter-4nc7</link>
      <guid>https://dev.to/swissknifetech/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>
