<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Asmaa Hadar on Medium]]></title>
        <description><![CDATA[Stories by Asmaa Hadar on Medium]]></description>
        <link>https://medium.com/@asmaehadar32?source=rss-2b78272c2aba------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Z2aXsJLALI_JPEsJZOweVg.jpeg</url>
            <title>Stories by Asmaa Hadar on Medium</title>
            <link>https://medium.com/@asmaehadar32?source=rss-2b78272c2aba------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 01:00:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@asmaehadar32/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[What Happens When You Type “google.com” in Your Browser and Press Enter]]></title>
            <link>https://medium.com/@asmaehadar32/what-happens-when-you-type-google-com-in-your-browser-and-press-enter-f3dbe5f2d17c?source=rss-2b78272c2aba------2</link>
            <guid isPermaLink="false">https://medium.com/p/f3dbe5f2d17c</guid>
            <category><![CDATA[web]]></category>
            <category><![CDATA[devoops]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[web-server]]></category>
            <category><![CDATA[request]]></category>
            <dc:creator><![CDATA[Asmaa Hadar]]></dc:creator>
            <pubDate>Sun, 15 Oct 2023 23:11:12 GMT</pubDate>
            <atom:updated>2023-10-15T23:11:12.245Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>In this article, we’ll explore what happens when you type “google.com” into your web browser’s address bar and press Enter. We’ll take a journey through the various steps involved in the web browsing experience, from DNS requests to the final rendering of the webpage. But first, let’s understand what it means to be a Full Stack Software Engineer.</p><h3>Full Stack Software Engineers</h3><p>Full Stack Software Engineers, often referred to as Full Stack Developers, are versatile professionals who are comfortable interacting with any layer of the software stack. They possess a broad range of skills that encompass both front-end and back-end development. Here, we’ll outline the knowledge and responsibilities of a Full Stack Software Engineer.</p><p>1. Front End Development A Full Stack SE should excel in creating user interfaces using various technologies. They must prioritize creating user-friendly interfaces and ensure cross-browser compatibility.</p><p>2. Back-End Development Full Stack SEs are adept at back-end development, creating dynamic applications that communicate with databases using various technologies. They should also have skills in database administration and query writing. Security is paramount, and they must protect their applications from common web vulnerabilities.</p><p>3. DevOps Full Stack SEs work with version control systems like Git, enabling collaboration. They also understand deployment strategies and CI/CD (Continuous Integration/Continuous Deployment). Debugging skills are essential.</p><p>4. Project Management Knowledge of design patterns and tools, along with Agile methodologies, aids project planning. Effective communication and collaboration skills are critical for group projects.</p><p>In summary, Full Stack Software Engineers are passionate problem solvers with a wealth of knowledge and experience in various technologies.</p><h3>The Web Browsing Experience</h3><p>Let’s dive into the web browsing experience by using the example of typing “<a href="https://www.google.com/">https://www.google.com</a>&quot; into your browser. Here’s what happens:</p><ul><li>DNS Request: The first station, the domain name has to be translated into its mapped IP address by the DNS server. Domain names can be easily memorized by humans as to IP addresses, that is the purpose behind DNS servers.</li><li>TCP/IP: In order to get the requested page <a href="https://www.google.com,/">https://www.google.com,</a> The client has to establish a connection to the server. This is done with the help of the protocol TCP/IP. It establishes a connection in a very reliable way.</li><li>Firewall: It is employed to secure the connection between the client and server.</li><li>HTTPS/SSL: Google.com uses the secure HTTPS protocol, certified by SSL, to protect data during transmission.</li><li>Load Balancer: Google utilizes load balancers to distribute the overwhelming volume of requests efficiently among its servers.</li><li>Web Server: The client’s request reaches Google’s web server, the Google Web Server (GWS), which handles the requests.</li><li>Application Server: For requests that require specific logical analysis, an application server comes into play.</li><li>Database: It is pivotal for retrieving various data.</li></ul><p>This journey happens seamlessly, and these elements work together to provide us with the famous search engine we all know.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f3dbe5f2d17c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Concepts about the SSH connection.]]></title>
            <link>https://medium.com/@asmaehadar32/concepts-about-the-ssh-connection-a480dc532784?source=rss-2b78272c2aba------2</link>
            <guid isPermaLink="false">https://medium.com/p/a480dc532784</guid>
            <category><![CDATA[rsa]]></category>
            <category><![CDATA[ssh]]></category>
            <category><![CDATA[configuration]]></category>
            <category><![CDATA[sftp]]></category>
            <category><![CDATA[sshd]]></category>
            <dc:creator><![CDATA[Asmaa Hadar]]></dc:creator>
            <pubDate>Mon, 25 Sep 2023 19:25:36 GMT</pubDate>
            <atom:updated>2023-09-25T19:25:36.329Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0HLRB2BhVcqGHugTQIJ9Qg.png" /></figure><p>This blog will contain the information that you need to get started with an SSH connection, enjoy!</p><h3>INSTALLATION</h3><p>To install SSH on Linux, start with updating the system.</p><pre>sudo apt update</pre><p>For Debian systems use the following commands.</p><pre>sudo apt install openssh-server<br>sudo apt install openssh-client</pre><p>And finally, you can start the SSH service.</p><pre>sudo service ssh start</pre><p>Notice how we installed the OpenSSH server and client. That way we will be able to connect to a server using SSH, and other computers to connect to our computer using the necessary credentials making it a server.</p><h3>SECURE SHELL (SSH)</h3><p>It is a network protocol and cryptographic technology used for secure communication and remote access over an unsecured network. It is used to provide security during data transmission. It provides tools like SCP and SFTP for secure copy protocol and SSH file transfer protocol. One of the cool things about it is that it creates a secure tunnel for clients to access remote services on remote servers. You might wonder what services can we access with SSH. The services range from email, web, and database connections… One thing to note is that it is not possible to just log into a machine using SSH without it containing an OPEN SSH DAEMON.</p><h3>OPEN SSH DAEMON (SSHD)</h3><p>An important component of the OpenSSH software suite. It runs on a server and allows secure remote access and communication using SSH protocol. It is responsible for the following:</p><ul><li>Securing access: It listens for SSH connections and manages its secure remote access to a server.</li><li>Authentication: At the connection of a client to the server, the SSHD allows authentication either by password or a key (SSH key pair).</li><li>Encryption: One of the SSHD’s responsibilities is the encryption of the communication between the client and the server.</li><li>Access control: The SSHD can allow or deny access to users based on pre-configurations set by administrators. The access can be filtered based on usernames and IP addresses …</li><li>Port: By default, the SSH listens on port 22 for incoming connections, however, it can still be configured.</li><li>Keeping log: The SSHD keeps a log of activities that can be monitored. The log file can be found in /var/log/auth.log.</li></ul><h3>SSH CONFIGURATION FILE</h3><p>It is a plain text file containing the configurations used by the SSH client and server. It is located in ~/.ssh or the /etc/ssh folder. Keep in mind each SSH server and SSH client has a configuration file. For the server, it is called sshd_config while for the client it is called ssh_config. Try to display both their content.</p><pre>cat /etc/ssh/ssh_config<br>cat /etc/ssh/sshd_config</pre><p>Here is a simple SSH config file.</p><pre># Global settings (apply to all hosts)<br>Host *<br>    Port 2222               # Use port 2222 for all SSH connections<br>    User john               # Default username<br>	# Default private key for authentication<br>	IdentityFile ~/.ssh/my_key   <br># Custom settings for specific hosts<br>Host example.com<br>    HostName example.com     # Hostname or IP address<br>    User alice              # Specific username for this host<br>    # Private key for this host<br>    IdentityFile ~/.ssh/alice_key</pre><h3>AUTHENTICATION</h3><p>To authenticate with the server you can follow the password method which is the default, or the key method. To authenticate with a server use this command:</p><pre>ssh user@hostName     # Host name or the ip address</pre><p>If after this command you were prompted with the password that is because you didn’t set up the SSH key. If you were prompted with a message saying: <strong>Are you sure you want to continue connecting</strong> say yes. It will be the last time you’ll see this message 🧙‍♂️. And ta-da, now you are using a server✨.</p><p>Type exit to get out. To make it easier for you, we should set up the SSH key, that way you won&#39;t have to use the stupid password again. It is not only easier and much more efficient, but it is also <strong>safer</strong> because the password can be brute forced. To set up your SSH key follow these steps.</p><pre>ssh-keygen</pre><p>This command will generate two keys for you.</p><p>☝️ Private RSA key. [id_rsa]</p><p>✌️ Public RSA key. [id_rsa.pub]</p><p>Don’t worry about RSA I will explain that later and you are going to love it.</p><pre>ssh-keygen -f Mykey -N &quot;secret&quot; -b 4096</pre><p>This command will generate a key containing 4094 bits, add a passphrase “secret”, and save the keys under the name Mykey.</p><p><strong>PassPhrases</strong> are used to add a layer of security. They are used to protect cryptographic keys. They are similar to passwords but are typically longer and more complex.</p><p>If you want to check the keys created, they will be in your home folder in the /.ssh folder. The (.) means it is a <em>hidden</em> folder.</p><pre>cat ~/.ssh/id_rsa<br>cat ~/.ssh/id_rsa.pub</pre><p>In the same folder, /.ssh you will find another cool thing. Theauthorized_keys file. Your public key will be in there. If it doesn&#39;t exist you can create it. It is a file that keeps the authorized keys of machines that are granted access. Next, you want to either authenticate with the public key to the server or copy your public key and add it to the authorized keys in the server. To Authenticate without copying the key:</p><pre>ssh -i ~/.ssh/id_rsa.pub user@hostName</pre><p>To copy the key to the server:</p><pre>cat ~/.ssh/id_rsa.pub | ssh brad@192.168.1.29 &quot;mkdir -p ~/.ssh &amp;&amp; chmod 700 ~/.ssh &amp;&amp; cat &gt;&gt;  ~/.ssh/authorized_keys</pre><p>This command is simple, it caters to your public key, takes the output, and connects to the server using SSH. Then create a directory (the -p option makes sure that any parents of the directory required for the path will be created if they don’t exist). the /.ssh is then given the following permission: 700 = rwx ___ ___, allowing only the user (owner) to have all the rights. And then the public key is appended to the authorized_keys file (&gt;&gt; is to append and &gt; is to replace). Another way to copy files to the remote server is by using a <strong>secure copy</strong>.</p><pre># Exit from the server.<br>touch testFile<br>scp ~/testFile user@hostName:~  # To put it in the HOME ~</pre><p>Remember SSH is a very secure protocol, but to enhance its security, you can do <strong>SSH key rotation</strong>. Which is a name for periodically changing the SSH key on the remote server.</p><h3>SECURE FILE TRANSFER PROTOCOL</h3><p>It is an encrypted file transfer protocol used for transferring files and managing remote file systems over a secure channel, over SSH connection. I am sure you heard of FTP, the protocol that transmits data in plain text, well, SFTP is what you call a secure alternative since it encrypts the transferred data. To open an interactive SFTP session use this command.</p><pre>sftp user@hostName</pre><p>You will then be prompted with :</p><p>Connected to hostname.</p><p>sftp&gt;</p><p>You are now able to perform any file transfer operation. The following are a few of the operations.</p><ul><li>File upload: You can upload files to the remote server from your computer using the <strong>put</strong>.</li></ul><pre>put file.txt</pre><ul><li>File download: You can get files from the server by using <strong>get</strong>.</li></ul><pre>get file.txt</pre><ul><li>List content: While in the SFTP mode, you can list the content of the remote server using <strong>ls</strong>.</li><li>Change directory: You can navigate directories normally, using <strong>cd</strong>. You can use the shell commands.</li><li>Exit SFTP: Use <strong>exit</strong>, or even better, use <strong>bye 👋</strong>.</li></ul><h3>CRYPTOGRAPHIC ALGORITHMS</h3><p>SSH uses a set of cryptographic algorithms. These algorithms are used for various purposes within SSH. Here is a list of the things that require encryption, and the algorithms used in each.</p><ul><li>Key exchange: <strong>Elliptic Curve Diffie-Hellman (ECDH)</strong> It is a variant of the Diffie-Hellman key exchange algorithm, offering strong security with a small size, the common ECDH sizes include (256-bit, 384-bit, 521 bit)</li><li>Encryption: SSH uses symmetric encryption to encrypt the transferred data. <strong>AES</strong> <strong>Advanced Encryption Standard</strong> Is an algorithm used for that purpose. <strong>3DES Triple Data Encryption Standard</strong> An older variant that is less commonly used for SSH configurations.</li><li>Message authentication code: <strong>HMAC Hash-based Message Authentication</strong></li><li>Public key: <strong>RSA</strong> <strong>Rivest Shamir-Adleman</strong> It is used for public key-based authentication. <strong>Ed25519</strong> It is an elliptic curve digital signature algorithm used for authentication in SSH. SSH uses different algorithms at each stage of the connection to ensure security, integrity, and authentication.</li></ul><h3>RSA ENCRYPTION</h3><p>Time to learn about RSA😋. Invented by Ron Rivest, Adi Shamir, and Leonard Adleman. It is an encryption algorithm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HLtm0aE83XB4yNJs.png" /></figure><p>A simple way of looking at how this works is the following. <strong>Abo</strong> is a person who wants to send a message to a person named <strong>Abir</strong>. <strong>Abir</strong> has generated two keys, one public and another private. <strong>Abo</strong> will encrypt the message he wants to send to <strong>Abir</strong>, he encrypts it using the public key of <strong>Abir</strong>. Sends the message, then <strong>Abir</strong> will decrypt it using the private key and reads the message. How is that possible that the message was encrypted using a key just to be decrypted using a different key? Well, the two keys that <strong>Abir</strong> generated use two mathematically related keys. The <strong>Strength</strong> of RSA encryption depends on the size of the key (number of bits).</p><p>This DevOps topic is really interesting, especially the cryptography part. Really interesting stuff. See you in the next one. I’ll leave you with this quote that we stay with longer.</p><blockquote><em>It is not that I’m so smart. But I stay with the questions much longer.</em></blockquote><blockquote><em>Albert Einstein</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/128/0*A4xnNllmCBpwqIAF.png" /></figure><h3>IMPORTANT RESOURCES</h3><p>WinScp [SSH GUI] <a href="https://winscp.net/eng/download.php">https://winscp.net/eng/download.php</a></p><p>FileZilla [Ftp client GUI] <a href="https://filezilla-project.org/">https://filezilla-project.org/</a></p><p>SSHCheatSheet [The SSH commands] <a href="https://gist.github.com/bradtraversy/f03df587f2323b50beb4250520089a9e">https://gist.github.com/bradtraversy/f03df587f2323b50beb4250520089a9e</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a480dc532784" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Web infrastructure design]]></title>
            <link>https://medium.com/@asmaehadar32/web-infrastructure-design-fb123a53cb05?source=rss-2b78272c2aba------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb123a53cb05</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[web]]></category>
            <category><![CDATA[servers]]></category>
            <category><![CDATA[infrastructure]]></category>
            <category><![CDATA[network]]></category>
            <dc:creator><![CDATA[Asmaa Hadar]]></dc:creator>
            <pubDate>Thu, 07 Sep 2023 19:02:45 GMT</pubDate>
            <atom:updated>2023-09-07T19:02:45.308Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pAyWjj9HtKCbmpopdcA7bw.jpeg" /></figure><p>Learn about some of the basics of how the WEB works.</p><p>Lately, I have been studying a bit of web infrastructure, most concepts were new to me, These are kind of my notes on this subject altered and proofread to share with people trying to learn about this topic. I have searched for these concepts myself and tried to summarize them in a way that will hopefully be understood.</p><p>From servers and load balancers to security and scalability, we’ll break down these complex topics into bite-sized pieces. It is going to taste great. 🍰.</p><h3>Server</h3><p>Let’s begin with an essential component — servers. A server is a robust computer system equipped with software to manage and process incoming requests from other computers, known as clients, over a specific network. Servers provide services, resources, and various functionalities, with numerous types available.</p><p><strong>Server Types</strong></p><ul><li><em>Web Server:</em> Stores and handles HTTP requests, serving web pages. Notable examples include Apache and Nginx.</li><li><em>File Server:</em> Manages files, offering the ability to upload, download, or access files over the network.</li><li><em>Database Server:</em> Handles database management, with well-known examples like MySQL, PostgreSQL, and Microsoft SQL Server.</li><li><em>Mail Server:</em> Manages sending, receiving, and storing emails. Notable options include Microsoft Exchange Server and Postfix.</li><li><em>DNS Server:</em> Translates human-readable domains into IP addresses, enabling computers to locate each other over the internet.</li><li><em>Proxy Server:</em> Acts as an intermediary between clients and servers, often used for request filtering and security purposes.</li><li><em>Media Server:</em> Stores and delivers media content, such as videos, music, and images, and is commonly used for streaming.</li></ul><p>For a server to handle multiple simultaneous requests effectively, it must possess high processing power, ample storage space, and robust capacity.</p><h3>Domain Name</h3><p>A domain name is a user-friendly way of accessing and navigating the web, eliminating the need to memorize complex IP addresses.</p><p><strong>DNS (Domain Name System)</strong> The DNS is responsible for translating the human-readable domain name entered by the user into the corresponding IP address of the website they want to visit.</p><p>Domain names are globally unique and are typically chosen to represent a brand or provide a meaningful association with the content or purpose of the website.</p><h3>World Wide Web (WWW)</h3><p>The term “WWW” stands for “World Wide Web,” often referred to simply as “the web.” It represents the vast interconnected system of information where we access web pages over the network. The World Wide Web has revolutionized how we share and access information globally🌐, and we’re indeed grateful it exists! 😄</p><h3>Web Server</h3><p>A web server is a remarkable piece of technology that plays a vital role in handling clients’ requests, typically in the form of HTTP requests, and delivering the requested content. Here are some key aspects of web servers:</p><ul><li><strong>Dynamic Content Generation:</strong> One fascinating feature of web servers is their ability to generate content in real time. They accomplish this by running scripts using technologies like PHP and Python, which generate HTML and send it to the client. This dynamic content generation allows for dynamic web applications and personalized user experiences.</li><li><strong>Caching:</strong> Web servers employ a mechanism called caching to temporarily store frequently accessed content. This cache reduces the server load and significantly improves content delivery speed, enhancing the overall user experience.</li><li><strong>Encryption (HTTPS):</strong> Web servers enforce encryption through HTTPS (Hypertext Transfer Protocol Secure), ensuring that data exchanged between clients and the server remains secure and encrypted. This security measure is crucial for protecting sensitive information and maintaining user privacy.</li><li><strong>Logging:</strong> Web servers can keep detailed logs of incoming requests. These logs are invaluable for troubleshooting issues, monitoring traffic patterns, and gaining insights into the server’s performance and security.</li><li><strong>Versatility:</strong> Web servers are incredibly versatile and can host a wide range of web pages. They can serve static web pages with fixed content or fully dynamic websites that generate content on the fly based on user input and database queries.</li></ul><p>Web servers are the backbone of the internet, making it possible for users to access a vast array of information and services with just a few clicks.</p><h3>Application Server</h3><p>Think of the application server as the cerebral cortex of a web application. Similar to the human brain’s cerebral cortex, the application server is responsible for handling complex cognitive functions within the web application. Here are key roles and responsibilities of an application server:</p><ul><li><strong>Logic Processing:</strong> The application server processes user input, performs necessary calculations, and manages the interaction with the database. It is the brain behind the scenes, ensuring that the web application functions as intended.</li><li><strong>Data Presentation:</strong> One of its primary tasks is to ensure that the correct data is presented to the user. It formats and organizes information for display, enhancing the user experience.</li><li><strong>Server-Side Processing:</strong> Application servers excel in server-side processing, enabling tasks like data validation, form submissions, and complex business logic execution to be executed on the server rather than in the client’s browser.</li><li><strong>Session Management:</strong> In applications that require user authentication and personalized experiences, application servers manage user sessions. They keep track of user activity, session data, and authentication status to deliver a seamless and secure user experience.</li><li><strong>Access Control:</strong> Application servers often manage access to specific features of the application based on the user’s role. This ensures that users can only access functionalities and data that are relevant to their permissions, enhancing security and data integrity.</li></ul><p>In essence, the application server serves as the control center of a web application, orchestrating various components to deliver a robust and user-friendly experience.</p><h3>Database</h3><p>The database is arguably the most crucial component of any dynamic application. It serves as the repository for data, enabling a wide range of operations collectively referred to as CRUD:</p><ul><li><strong>Create:</strong> Involves creating the database itself, defining tables, and structuring the data schema.</li><li><strong>Read:</strong> Allows for retrieving data from the database, often involving querying tables to access specific information.</li><li><strong>Update:</strong> Involves modifying existing data, updating fields, and altering content as needed.</li><li><strong>Delete:</strong> Provides the capability to remove databases, tables, records, or specific data fields.</li></ul><p>Beyond these fundamental operations, databases also support user management, allowing the creation of users with specific access permissions. This helps secure data and limit access to authorized individuals or systems.</p><p>Databases also play a vital role in data analysis, supporting functions like SUM, AVG, COUNT, and more, making them essential tools for extracting meaningful insights from the stored data.</p><p>Some notable database systems include MySQL, PostgreSQL, MongoDB, Cassandra, and Redis, each designed to cater to specific use cases and requirements. These diverse database types empower developers to choose the right tool for the job, and we appreciate the versatility they bring to the world of technology.</p><p><strong>ISP (Internet Service Provider)</strong> An Internet Service Provider, often abbreviated as ISP, serves as the connection provider in our diagrams. It facilitates the connection between our clients and the vast realm of the internet, enabling users to access web applications, content, and services seamlessly.</p><h3>SIMPLE WEB STACK INFRASTRUCTURE</h3><p>In this one-server web infrastructure, we host a website accessible via <a href="http://www.foobar.com/">www.foobar.com</a>. The diagram illustrates the components of the server and the communication between the server and a client requesting <a href="http://foobar.com/">foobar.com</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nE6QEGdecUAdNtJv.png" /></figure><h4>EVENTS</h4><ul><li><strong>REQUEST:</strong> The user enters a memorable URL and submits it from their favorite browser.</li><li><strong>DNS RESOLUTION:</strong> The computer sends a DNS request to convert the human-readable URL to the website’s actual IP address.</li><li><strong>TCP CONNECTION:</strong> The computer establishes a Transmission Control Protocol (TCP) connection with the web server.</li><li><strong>HTTP REQUEST:</strong> The computer is ready to send an HTTP request to the web server.</li><li><strong>PROCESSING:</strong> The web server processes the HTTP request, generating the requested data. This data can be fetched from the database by the application server or accessed from the codebase.</li><li><strong>HTTP RESPONSE:</strong> The data is prepared to be transmitted back to the user.</li><li><strong>RENDERING:</strong> The browser displays the information received from the server.</li><li><strong>INTERACTION:</strong> The user can interact with the content and trigger events within it.</li></ul><h3>ISSUES</h3><p><strong>Single Point of Failure (SPOF)</strong></p><p>A Single Point of Failure is a situation where a system relies on a single factor, and if that factor fails, the entire system can crash. In this structure, there are several SPOFs to consider:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hEfg2dyJUHn3SgJr.png" /></figure><ul><li><strong>POWER SUPPLY:</strong> If the power supply relies on a single source, an outage can disrupt the entire system.</li><li><strong>ISP SPOF:</strong> If the connection from the Internet Service Provider (ISP) stops, the connection between the computer and the server will cease.</li><li><strong>CAPACITY OVERFLOW:</strong> With only one server receiving requests, it may become overwhelmed and unable to handle the load during traffic spikes.</li><li><strong>DNS SPOOFING ATTACK:</strong> This consists of manipulating the Domain Name System (DNS) to redirect users to a malicious website. This not only poses a security threat but also creates a communication SPOF.</li><li><strong>DOWNTIME:</strong> Deploying new code or performing server maintenance, including software updates, hardware maintenance, database maintenance, or configuration changes, may lead to service interruptions.</li><li><strong>SCALING TRAFFIC:</strong> The potential for a sudden surge in traffic can disrupt service since there’s only one server to handle requests.</li></ul><p>A robust infrastructure design addresses these SPOFs to ensure reliable and uninterrupted service.</p><h3>DISTRIBUTED WEB INFRASTRUCTURE</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FGrJuwViIDWDGd0k.png" /></figure><p>In this three-server web infrastructure, we host the website <a href="http://www.foobar.com/">www.foobar.com</a>. This modification enhances our infrastructure&#39;s reliability and resilience. Let&#39;s explore the changes:</p><ul><li><strong>Adding Another Server:</strong> We’ve introduced an additional server for each component (Web server, Application server, and Database server). This setup minimizes the risk of a Single Point of Failure (SPOF). Both servers run simultaneously, ensuring uninterrupted service even if one server encounters issues.</li><li><strong>Load Balancer:</strong> The Load Balancer acts as a traffic cop, distributing incoming requests among multiple servers. Its role is to optimize resource utilization, improve responsiveness, and enhance overall performance and availability.</li></ul><h4>LOAD BALANCER</h4><p>The Load Balancer serves as the intermediary between clients and servers. It receives HTTP requests and redirects them to the appropriate server. Load balancers analyze incoming requests and determine distribution methods based on factors such as server load, health, or algorithms.</p><p><strong>Load Balancer Algorithms:</strong></p><ul><li><em>Round Robin:</em> Distributes traffic evenly in a circular fashion, ensuring relatively equal distribution.</li><li><em>Least Connections:</em> Redirects HTTP requests to the server with the fewest connections.</li></ul><p>These are just a few examples of load balancer algorithms. In our case, assuming both servers have the same capacity, we can use <em>Round Robin</em>. However, if load-based distribution is preferred, <em>Least Connections</em> can be a good choice.</p><p><strong>Load Balancer Modes:</strong></p><p>Load balancers can operate in either of these two modes:</p><ul><li><em>Active-Active:</em> All resources linked to the load balancer are active and running. It distributes traffic among resources using the selected distribution algorithm. This mode offers high scalability, utilization, and fault tolerance but can be complex to manage.</li><li><em>Active-Passive:</em> In this mode, one resource runs while others are on standby. They come into play when the primary resource fails. While offering high availability, it has a failover time, causing brief service interruptions.</li></ul><h4>PRIMARY-REPLICA DATABASES</h4><p>Also known as a master-slave database cluster, this setup aims for high availability and fault tolerance in database systems.</p><ul><li>The primary database handles all operations (CRUD), while the replica is read-only.</li><li>The primary server maintains a log (Binary log) of changes and communicates with replica servers to keep them updated.</li><li>Replica servers receive updates from the primary server and apply changes for synchronization, potentially located in different locations to enhance user experience.</li></ul><h3>ISSUES</h3><p>Here are potential Single Points of Failure (SPOFs) and security risks that this infrastructure may face:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5suHZkdkrHFhlF6s.png" /></figure><ul><li><strong>FIREWALL:</strong> Security devices that monitor traffic based on predetermined security rules. In this infrastructure, two firewalls are essential: one between the client and the ISP (client-side firewall) and one between the ISP and the server (network firewall).</li><li><strong>HTTPS:</strong> HyperText Transfer Protocol Secure, a protocol that applies encryption to secure data exchange between the user’s browser and the web server, ensuring confidentiality.</li><li><strong>MONITORING:</strong> Real-time tracking of the system’s health, performance, and security is vital to address potential issues promptly.</li></ul><h3>SECURED AND MONITORED WEB INFRASTRUCTURE</h3><p>In this three-server web infrastructure hosting <a href="http://www.foobar.com/">www.foobar.com</a>, security, encryption, and monitoring are paramount. We&#39;ve implemented the following enhancements:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5QibwPJKq4JqrJyp.png" /></figure><ul><li><strong>3 Firewalls:</strong> These firewalls bolster security by ensuring a client’s request for information from a server undergoes rigorous scrutiny.</li><li><strong>1 SSL Certificate:</strong> To serve <a href="http://www.foobar.com/">www.foobar.com</a> Over HTTPS, Secure Sockets Layer (SSL) ensures the encryption of data transmitted between users and the server, providing data integrity and authentication.</li><li><strong>3 Monitoring Clients:</strong> Monitoring is essential for tracking resource performance, including servers, applications, and databases. It monitors CPU and memory usage, response times, storage availability, hardware health, and system logs to identify security risks and ensure a positive user experience.</li></ul><h4>SSL (Secure Sockets Layer)</h4><p>SSL is a protocol that facilitates secure communication over a computer network. It provides encryption, data integrity, and authentication, safeguarding data transmitted between users and servers.</p><h4>SERVING OVER HTTPS</h4><p>Serving over HTTPS is crucial for several reasons related to security, including data encryption, data integrity, and user privacy.</p><h4>MONITORING</h4><p>Monitoring involves tracking resource performance, system health, and security. It ensures resources are available and operational, and provides quick alerts in case of issues. Monitoring also identifies security threats by analyzing system logs and patterns.</p><p>Real-Life Monitoring</p><p><em>In practice, various tools and components like Nagios and Zabbix are used to collect data from different components of an IT infrastructure. Larger IT environments often use a centralized monitoring server as a control center for analysis and alerting.</em></p><p>QUERY PER SECOND (QPS)</p><p><em>QPS measures the rate at which queries or requests are made to a system per second.</em></p><p>MONITORING THE QPS OF A WEB-SERVER</p><p><em>Monitoring the QPS of a web server helps gauge its capacity to handle HTTP requests per second, providing insights into performance and resource utilization. Tools like Nagios and Zabbix can monitor QPS.</em></p><h3>ISSUES</h3><p><strong>HAVING ONE MYSQL SERVER THAT ACCEPTS WRITES</strong></p><p>While an architecture with high availability and fault tolerance offers distributed read traffic and backup capabilities, it can be complex and introduce delays. Having only one server that accepts writes may lead to overwhelming write requests.</p><p><strong>ALL THE SERVERS HAVE THE SAME COMPONENTS</strong></p><p>In this architecture, component failures can affect other servers. Specialization is lacking, resulting in under-utilization of resources. For example, a bug in the primary database can impact all replicas.</p><p>This has been a glimpse into the inner workings of the web, and I hope it’s been helpful and informative for those diving into this fascinating topic. If you’d like to share your thoughts, have comments, or spot any mistakes in what I’ve written, feel free to reach out to me on any of my social media accounts.</p><p>As this marks my first public blog, I truly hope you’ve enjoyed the journey. To wrap it up, here’s one of my favorite quotes by <em>Miyamoto Musashi</em>, keep this one in mind while learning new things.</p><blockquote><em>“Once you understand the way broadly, you can see it in all things.”</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HqxrFPEVL5wpZJP9IlCWfg.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb123a53cb05" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>