<?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 Kahanahamed on Medium]]></title>
        <description><![CDATA[Stories by Kahanahamed on Medium]]></description>
        <link>https://medium.com/@kahanahamed42?source=rss-e17344d862b5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*b9hRjDgOHQzg3FJqDX2aMg.png</url>
            <title>Stories by Kahanahamed on Medium</title>
            <link>https://medium.com/@kahanahamed42?source=rss-e17344d862b5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 11:26:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kahanahamed42/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[Production‑Grade CI/CD Pipeline for Spring PetClinic on GCP]]></title>
            <link>https://medium.com/@kahanahamed42/production-grade-ci-cd-pipeline-for-spring-petclinic-on-gcp-e5bcb8ec56d6?source=rss-e17344d862b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/e5bcb8ec56d6</guid>
            <dc:creator><![CDATA[Kahanahamed]]></dc:creator>
            <pubDate>Fri, 10 Oct 2025 14:01:03 GMT</pubDate>
            <atom:updated>2025-10-10T14:01:03.048Z</atom:updated>
            <content:encoded><![CDATA[<h4>From Code to Container to Cloud — automated, secure, and scalable.</h4><p>This guide shows how to build a modern CI/CD pipeline using Jenkins, Terraform, Ansible, Docker, Trivy, and Google Cloud Platform. Fully automated from code commit to infrastructure provisioning, containerization, deployment, and alerting.</p><h3>📦 Tools &amp; Stack</h3><p>Tool Purpose<strong> Jenkins </strong>Orchestrates the entire pipeline<strong>. Terraform </strong>Provision GCP infrastructure (VPC, VM, CloudSQL)<strong> Ansible </strong>Configure VMs (Docker, Swarm Manager setup)<strong> Docker </strong>Containerize Spring PetClinic app<strong>Trivy</strong>Scan Docker images for vulnerabilities<strong>GCP</strong>Host infrastructure and application</p><h3>🔄 Workflow in Brief</h3><ol><li><strong>Change Detection</strong></li></ol><ul><li>Jenkins checks if Terraform (terraform/) or Ansible (Ansible/) files changed.</li></ul><p><strong>2. Terraform Stages</strong></p><ul><li><strong>Init</strong>: Set up Terraform, configure GCP backend</li><li><strong>tfsec + validate</strong>: Security &amp; syntax checks</li><li><strong>Plan</strong>: Creates plan, halts if drift or destructive changes detected</li><li><strong>Apply</strong>: Applies the plan only if safe and approved</li></ul><p><strong>3. Ansible Stages</strong></p><ul><li><strong>Install Galaxy roles</strong></li><li><strong>Lint playbooks</strong></li><li><strong>Run playbook</strong>: Installs Docker, configures Swarm</li></ul><p><strong>4. Docker Image Pipeline</strong></p><ul><li>Reads release.yml for version and tag</li><li>Builds Docker image</li><li>Scans with Trivy, fails on critical/high findings</li><li>Pushes to Docker Hub</li></ul><p><strong>5. Deploy to Docker Swarm</strong></p><ul><li>Copies docker-compose.yml to Swarm manager</li><li>Runs docker stack deploy</li></ul><p><strong>6. Notification</strong></p><ul><li>Jenkins sends an email with release details and status</li></ul><h3>🛠️ Pipeline Enhancements</h3><ul><li><strong>Drift Detection</strong>: Checks Terraform plan for unexpected ~ or - changes</li><li><strong>Security First</strong>: tfsec and Trivy embedded early in the flow</li><li><strong>Conditional Execution</strong>: Only runs stages for changed components</li><li><strong>Secrets Handling</strong>: Jenkins credentials, Docker Swarm secrets, GCP IAM</li><li><strong>Automated Alerts</strong>: Email on success/failure of critical stages</li></ul><h3><strong>Code snippets</strong>:</h3><ul><li>Jenkinsfile stages</li><li>docker-compose.yml with secrets</li><li>release.yml with versioning</li></ul><h3>🔐 Setup Checklist</h3><ul><li>✅ Install Jenkins plugins: GitHub, Docker, Terraform, Ansible, Credentials, Email</li><li>✅ Create Jenkins credentials: GCP service account, SSH key, Docker Hub, server IP</li><li>✅ Create Docker secret on Swarm Manager: docker secret create db_password -</li><li>✅ Add GitHub Webhook to Jenkins pipeline (trigger on push)</li></ul><h3>🎯 Why It Matters</h3><ul><li>Automates end‑to‑end delivery, from infra to app</li><li>Emphasizes security at each stage</li><li>Prevents unintended production changes</li><li>Easy to extend (Slack alerts, tests, multi-cloud, etc.)</li></ul><h3>✅ Ready for More?</h3><ul><li>Fork the repo: <a href="https://github.com/KahanHM/spring-petclinic-rest">https://github.com/KahanHM/spring-petclinic-rest</a></li><li>Grab the <strong>full Jenkinsfile</strong>, <strong>Terraform modules</strong>, and <strong>Engineer‑ready docs</strong> — DM me!</li><li>Follow me on Medium and LinkedIn for more DevOps recipes.</li></ul><p><strong>Tags:</strong> #DevOps #CICD #Terraform #Docker #Jenkins #Trivy #GCP #Ansible #Security #IaC #SpringBoot</p><p><strong>Enjoyed this?</strong><br> Clap ❤️, share, or comment with thoughts and suggestions!</p><p>Let me know if you’d like the editable diagram, full code reviews, or deployment help — I’d be happy to help!</p><p>— <em>Kahan Ahamed</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5bcb8ec56d6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automating CI/CD with Jenkins Organization Folder and AWS S3 Hosting]]></title>
            <link>https://medium.com/@kahanahamed42/automating-ci-cd-with-jenkins-organization-folder-and-aws-s3-hosting-d563fbefcfd5?source=rss-e17344d862b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/d563fbefcfd5</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[s3-bucket]]></category>
            <category><![CDATA[jenkins-pipeline]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Kahanahamed]]></dc:creator>
            <pubDate>Fri, 28 Feb 2025 16:33:00 GMT</pubDate>
            <atom:updated>2025-02-28T16:35:21.082Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Setting up <strong>Jenkins Organization Folder</strong> for a GitHub organization can <strong>automate CI/CD workflows</strong> across multiple repositories. This guide walks through the <strong>entire setup</strong>: creating the Organization Folder in Jenkins, configuring AWS EC2 with IAM roles, setting up Docker agents, and deploying static sites to <strong>Amazon S3</strong>.</p><h3>Step 1: Create a GitHub Organization (If Not Already Created)</h3><p>If you don’t have a GitHub organization, create one:</p><ol><li>Go to <a href="https://github.com/account/organizations">GitHub Organizations</a>.</li><li>Click <strong>“New Organization”</strong>.</li><li>Choose a <strong>plan</strong> (Free/Enterprise).</li><li>Provide <strong>Organization Name</strong> and admin email.</li><li>Click <strong>“Create Organization”</strong>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*zQHUXaT1uBkm8Zc-BpocGg.png" /></figure><h3>Step 2: Set Up an AWS EC2 Instance for Jenkins</h3><h3>1. Launch EC2 Instance</h3><ol><li>Log in to AWS and navigate to <strong>EC2 Dashboard</strong>.</li><li>Click <strong>“Launch Instance”</strong>.</li><li>Select <strong>Amazon Linux 2</strong> or <strong>Ubuntu</strong>.</li><li>Choose an instance type (t2.micro for free tier).</li><li>Configure <strong>IAM Role (next step)</strong>.</li><li>Enable TCP(8080) for access to Jenkins &amp; SSH (22) in security groups.</li><li>Launch the instance and connect via SSH:</li></ol><pre>ssh -i your-key.pem ec2-user@your-instance-ip</pre><h3>2. Attach IAM Role for AWS Access</h3><ol><li>Navigate to <strong>IAM &gt; Roles</strong>.</li><li>Click <strong>“Create Role”</strong> &gt; Select <strong>EC2</strong>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PBNxfwI5GcCBuXqaLRQXgw.png" /></figure><p>3.Attach policies:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xr-71vOW6MBnaks-lhoPEQ.png" /></figure><pre>AmazonS3FullAccess</pre><p>4. Name the role JenkinsEC2Role and assign it to the EC2 instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KiKemW_MSo-Wbi-ruQ1Rwg.png" /></figure><h3>Step 3: Install Jenkins &amp; Docker on EC2</h3><h3>1. Install Java and Jenkins based on the OS</h3><pre>sudo yum update -y<br>sudo amazon-linux-extras enable java-openjdk11<br>sudo yum install java-11-openjdk -y<br>sudo wget -O /etc/yum.repos.d/jenkins.repo \<br>    https://pkg.jenkins.io/redhat-stable/jenkins.repo<br>sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key<br>sudo yum install jenkins -y<br>sudo systemctl enable jenkins<br>sudo systemctl start jenkins</pre><h3>2. Install Docker and Start Service</h3><pre>sudo yum install docker -y<br>sudo systemctl start docker<br>sudo systemctl enable docker<br>sudo usermod -aG docker jenkins</pre><h3>Step 4: Configure Jenkins Organization Folder</h3><h3>1. Access Jenkins</h3><ol><li>Get Jenkins initial admin password:</li></ol><pre>sudo cat /var/lib/jenkins/secrets/initialAdminPassword</pre><p>2. Open and log in.</p><pre>http://your-ec2-public-ip:8080</pre><p>3. Install the suggested plugins.</p><ul><li>Ensure Jenkins is running (preferably the latest LTS version).</li></ul><h3>Install required plugins:</h3><ol><li><strong>GitHub Branch Source Plugin</strong></li><li><strong>Pipeline Plugin</strong></li><li><strong>Git Plugin</strong></li><li><strong>GitHub Plugin</strong></li></ol><h3>2. <strong>GitHub Personal Access Token (PAT)</strong>:</h3><h4>Configure <strong>GitHub credentials</strong> (Personal Access Token required)</h4><h4>1.Create a PAT with the following scopes:</h4><ol><li><strong>repo </strong>:(full control of private repositories).</li><li><strong>admin</strong>: repo_hook (manage repository webhooks)</li><li><strong>read</strong>:org (read organization membership)Summary of Required</li></ol><pre>          Permissions<br>Category                     Permission           Access Level Reason<br>Repository Access           All repositories       Read and write   Access all repos in the organization.<br>Repository Permissions      Contents               Read and write   Read Jenkinsfile and trigger builds.<br>                            Metadata               Read-only Access repository metadata (e.g., repo names, branches).<br>                            Pull requests          Read and write   Discover and manage pull requests.<br>                            Webhooks               Read and write   Create and manage webhooks for automatic build triggers.<br>Account Permissions         Email addresses        Read-only Associate commits with (optional)</pre><h4>2.Create a GitHub PAT:</h4><ol><li>Log in to GitHub.</li><li>Go to <strong>Settings</strong> → <strong>Developer settings</strong> → <strong>Personal access tokens</strong> → <strong>Token (classic)</strong>.</li></ol><p>3. Click <strong>Generate new token</strong> → <strong>Generate new token (classic)</strong>.</p><p>4. Configure the token:</p><p><strong>5. Token name</strong>: Jenkins-HM-Techies</p><p><strong>6. Expiration</strong>: 90 days (or longer)</p><p><strong>7. Scopes</strong>: repo, admin:repo_hook, read:org</p><p>Click <strong>Generate token</strong> and copy the token immediately.</p><h3>Add PAT to Jenkins</h3><ol><li>In Jenkins, go to:<br><strong>Dashboard</strong> → <strong>Manage Jenkins</strong> → <strong>Credentials</strong> → <strong>System</strong> → <strong>Global credentials</strong>.</li><li>Click <strong>Add Credentials</strong>:</li><li><strong>Kind</strong>: Secret text</li><li>Secret: Paste your GitHub PAT</li><li>ID: {ANY Name} (use a meanigfull name)</li><li>Description: “PAT for HM-Techies Org Access”</li><li>Click Create.</li></ol><h3>Configure GitHub Server in Jenkins</h3><ol><li>e using the public GitHub.com (e.g., <a href="https://github.com)./">https://github.com).</a></li><li><strong>Reason</strong>: If your repositories are hosted on github.com, you don’t need to configure an enterprise server. Jenkins can directly connect to GitHub’s public API.</li></ol><h4>Configuration Steps:</h4><ol><li>Go to <strong>Manage Jenkins</strong> → <strong>Configure System</strong>.</li><li>Under <strong>GitHub</strong>:</li></ol><ul><li><strong>GitHub Server</strong>: Add a new server.</li><li><strong>API URL</strong>: <a href="https://api.github.com/">https://api.github.com</a> (default for GitHub.com).</li><li><strong>Credentials</strong>: Add your GitHub PAT (Personal Access Token).</li><li><strong>Name</strong>: GitHub (optional, for identification).</li></ul><p>Click <strong>Save</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WSaXLF8QlWC9aEWYBRF2WQ.png" /></figure><p>Click <strong>Generate token</strong> and copy the token immediately.</p><h3>3. Create GitHub Organization Folder</h3><ol><li>In Jenkins Dashboard, click <strong>“New Item”</strong>.</li><li>Select <strong>“GitHub Organization”</strong>.</li><li>Enter a name (e.g., MyGitHubOrgPipelines).you can use any name</li><li>Under <strong>“Owner”</strong>, enter your GitHub Organization name.</li><li>Configure <strong>GitHub credentials</strong> (Personal Access Token required).</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rQl9nEmVLlqh9rr3rocKMA.png" /><figcaption>Add the credentials and use it</figcaption></figure><ol><li>Click <strong>“Save”</strong>.</li><li>Jenkins will scan and discover repositories automatically.</li></ol><h3>Step 5: Create a Pipeline for Static Site Deployment to S3</h3><h3>1. Add a Jenkinsfile to Your Repository</h3><p>Create a Jenkinsfile in your repository:</p><pre>pipeline {<br>     options {<br>        skipDefaultCheckout()  //skip the default clone option <br>    }<br>    agent {<br>        docker {<br>            image &#39;kahanhm/hm-tech-custom-nodejs-aws-cli&#39;  // Pre-built image for the pipline you can build your one using the Dockerfile<br>            reuseNode true<br>        }<br>    }<br><br>    environment {<br>        AWS_REGION = &#39;ap-south-1&#39;<br>        S3_BUCKET = &#39;kahan-portfolio.com&#39;<br>    }<br><br>    stages {<br>        stage(&#39;Checkout Code&#39;) {<br>            steps {<br>              git branch: &#39;main&#39;, url: &#39;https://github.com/HM-Techies/portfolio.git&#39;<br>            }<br>        }<br><br>        stage(&#39;Install &amp; Build&#39;) {<br>            steps {<br>                sh &#39;npm ci --cache .npm --prefer-offline&#39;<br>                sh &#39;npm run build&#39;<br>                sh &quot;ls -la&quot;<br>            }<br>        }<br>        stage(&#39;Deploy to S3&#39;) {<br>            steps {<br>                script {<br>                    // Check if bucket exists<br>                    def bucketExists = sh(<br>                        script: &quot;aws s3api head-bucket --bucket $S3_BUCKET 2&gt;/dev/null &amp;&amp; echo &#39;true&#39; || echo &#39;false&#39;&quot;,<br>                        returnStdout: true<br>                    ).trim()<br><br>                    // Create bucket if it doesn&#39;t exist<br>                    if (bucketExists == &#39;false&#39;) {<br>                        echo &quot;Bucket does not exist. Creating bucket: $S3_BUCKET&quot;<br>                        sh &quot;&quot;&quot;<br>                            aws s3api create-bucket \<br>                                --bucket $S3_BUCKET \<br>                                --region $AWS_REGION \<br>                                --create-bucket-configuration LocationConstraint=$AWS_REGION<br>                        &quot;&quot;&quot;<br>                    } else {<br>                        echo &quot;Bucket already exists: $S3_BUCKET&quot;<br>                    }<br><br>                    // Upload build files<br>                    sh &#39;aws s3 sync build/ s3://$S3_BUCKET --delete&#39;<br><br>                    // Configure static website hosting<br>                    sh &quot;&quot;&quot;<br>                        aws s3 website s3://$S3_BUCKET \<br>                            --index-document index.html \<br>                            --error-document index.html<br>                    &quot;&quot;&quot;<br>                }<br>            }<br>        }<br>        stage(&#39;Set Public Access Policy&#39;) {<br>    steps {<br>        script {<br>            sh &quot;&quot;&quot;<br>            # Disable &quot;Block Public Access&quot; settings<br>            aws s3api put-public-access-block --bucket $S3_BUCKET --public-access-block-configuration &#39;{<br>                &quot;BlockPublicAcls&quot;: false,<br>                &quot;IgnorePublicAcls&quot;: false,<br>                &quot;BlockPublicPolicy&quot;: false,<br>                &quot;RestrictPublicBuckets&quot;: false<br>            }&#39;&quot;&quot;&quot;<br><br>           <br>           // Write bucket policy to a file<br>                def policy = &quot;&quot;&quot;<br>                    {<br>                        &quot;Version&quot;: &quot;2012-10-17&quot;,<br>                        &quot;Statement&quot;: [<br>                            {<br>                                &quot;Effect&quot;: &quot;Allow&quot;,<br>                                &quot;Principal&quot;: &quot;*&quot;,<br>                                &quot;Action&quot;: &quot;s3:GetObject&quot;,<br>                                &quot;Resource&quot;: &quot;arn:aws:s3:::${S3_BUCKET}/*&quot;<br>                            }<br>                        ]<br>                    }<br>                    &quot;&quot;&quot;<br>                    writeFile file: &#39;policy.json&#39;, text: policy.trim()<br><br>                    // Apply bucket policy<br>                    sh &#39;aws s3api put-bucket-policy --bucket $S3_BUCKET --policy file://policy.json&#39;<br>        }<br>    }<br>}<br><br><br>        stage(&#39;Show URL&#39;) {<br>            steps {<br>                echo &quot;Application URL: http://${S3_BUCKET}.s3-website-${AWS_REGION}.amazonaws.com&quot;<br>            }<br>        }<br>    }<br><br>    }<br>    post {<br>        always {<br>            cleanWs()<br>            script {<br>                sh &#39;rm -f policy.json || true&#39;  <br>            }<br>        }<br>    }</pre><h3>2. Run the Pipeline</h3><ol><li>In Jenkins, go to your <strong>GitHub Organization Folder</strong>.</li><li>Click <strong>“Scan Organization”</strong> to discover repositories. Otherwise, it automatically scan the repository a period of time; you can change this time on the pipeline</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t5kMQRZZhA4nYJYhRM-4RQ.png" /></figure><ol><li>Run the pipeline from the repository where the Jenkinsfile is added.</li></ol><h3>Step 6: Access Your Static Website</h3><p>Once deployed, your website will be available at:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ugjiM9H7xtVEjcgRE4PCAg.png" /></figure><h3>GitHub Repository</h3><p><a href="https://github.com/HM-Techies/portfolio.git">https://github.com/HM-Techies/portfolio.git</a></p><h3>Conclusion</h3><p>The Jenkins <strong>Organization Folder</strong> enables <strong>automated builds</strong> for all repositories in your GitHub org</p><p>Using <strong>Docker agents</strong>, we ensure <strong>consistent environments</strong>.<br> AWS <strong>S3 hosting</strong> provides <strong>scalable, cost-effective deployment</strong></p><p><strong>This setup reduces manual configurations &amp; speeds up deployments!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d563fbefcfd5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Virtualization types in distributed system]]></title>
            <link>https://medium.com/@kahanahamed42/virtualization-types-in-distributed-system-43c97337b55d?source=rss-e17344d862b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/43c97337b55d</guid>
            <category><![CDATA[virtualization]]></category>
            <category><![CDATA[trends]]></category>
            <category><![CDATA[network-virtualization]]></category>
            <category><![CDATA[vmware]]></category>
            <category><![CDATA[storage-virtualization]]></category>
            <dc:creator><![CDATA[Kahanahamed]]></dc:creator>
            <pubDate>Thu, 12 Oct 2023 06:17:19 GMT</pubDate>
            <atom:updated>2023-10-12T06:17:19.331Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is virtualization?</h3><p>Virtualization is the creation of a virtual — rather than actual — version of something, such as an operating system (OS), a server, a storage device or network resources.</p><h3>types of virtualization</h3><ol><li><strong>Network Virtualization</strong></li><li><strong>Storage Virtualization</strong></li><li><strong>Desktop Virtualization</strong></li><li><strong>Application Virtualization</strong></li></ol><h3>Network Virtualization</h3><p><strong>Definition:</strong></p><p>Network virtualization is a technology that abstracts and separates physical network infrastructure into multiple virtual network segments or overlays. These virtual networks operate independently of the underlying physical hardware, allowing for improved flexibility, scalability, and isolation of network resources. It enables the creation of multiple logical networks on a single physical network infrastructure.</p><h4>Advantages of Network Virtualization:</h4><ol><li>Isolation and Segmentation: Network virtualization allows the creation of isolated virtual networks, providing security and privacy for different network segments. This is particularly useful in multi-tenant data centers or cloud environments.</li><li>Resource Optimization: It enables efficient use of network resources by dynamically allocating bandwidth and other network services based on the needs of specific virtual networks or applications.</li><li>Simplified Network Management: Virtualized networks are easier to manage as they abstract the complexities of physical network infrastructure. Network administrators can configure and maintain virtual networks independently, reducing operational overhead.</li><li>Scalability: Network virtualization makes it easier to scale network resources, enabling the creation of new virtual networks or the expansion of existing ones without significant changes to the physical infrastructure.</li><li>Flexibility: Network configuration and changes become more flexible and less disruptive because they are performed at the virtualization layer, not directly on the physical hardware.</li><li>Improved Disaster Recovery: Network virtualization can simplify disaster recovery planning by allowing for the easy migration of virtual network configurations in case of hardware failure or data center relocation.</li></ol><h4>Disadvantages of Network Virtualization:</h4><ol><li>Complexity: Implementing network virtualization can be complex, particularly in larger environments. It requires an understanding of both the virtual and physical networking components.</li><li>Performance Overhead: Network virtualization may introduce some level of performance overhead due to the additional layer of abstraction and processing required for packet forwarding and routing.</li><li>Compatibility: Not all network hardware is compatible with network virtualization technologies, which can limit the adoption of this approach in certain environments.</li><li>Security Risks: While network virtualization can enhance security by isolating networks, misconfigurations or security vulnerabilities in the virtualization layer can also introduce risks.</li></ol><p><strong>How Network Virtualization Works:</strong></p><p>Network virtualization is achieved through various technologies, including Virtual LANs (VLANs), Software-Defined Networking (SDN), and Network Function Virtualization (NFV). Here’s a simplified explanation of how network virtualization works:</p><ol><li>Abstraction: Network virtualization begins with the abstraction of physical network resources. This abstraction is typically managed by a controller or software layer that creates virtual networks.</li><li>Virtual Network Creation: Network administrators define and createvirtual networks. These networks can have their own IP address schemes, routing policies, and security settings.</li><li>Isolation: Each virtual network is isolated from others, meaning that the traffic within one virtual network doesn’t interact with the traffic in another, even though they share the same physical infrastructure.</li><li>Network Services: Virtual networks can be provisioned with network services such as firewalls, load balancers, and quality of service (QoS) policies to meet specific application or user requirements.</li><li>Traffic Routing: Network virtualization software routes traffic within and between virtual networks according to the rules and configurations set for each virtual network.</li><li>Scalability: Network virtualization makes it easy to add or remove virtual networks as needed, providing scalability without significant changes to the physical network.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*DiC7tGoqW9z-K5Jjh0H0lw.jpeg" /></figure><h3>Storage Virtualization</h3><p><strong>Definition</strong></p><p>Storage Virtualization is a technology that abstracts and aggregates physical storage devices, such as hard drives, SSDs, and storage arrays, to create a single, virtualized storage pool that can be efficiently managed and allocated to different applications or users. It decouples the logical view of storage from its physical implementation, making storage management more flexible and efficient. Here’s an overview of storage virtualization, its advantages, and disadvantages:</p><h4>Advantages of Storage Virtualization:</h4><ol><li>Efficient Resource Utilization: Storage virtualization enables the efficient utilization of available storage resources. It allows multiple physical storage devices to be combined into a single, manageable pool, eliminating the need for manual provisioning and ensuring that storage space is used optimally.</li><li>Simplified Management: Storage virtualization simplifies storage management by providing a unified view of storage resources. Administrators can allocate, de-allocate, and manage storage more easily, leading to time and cost savings.</li><li>Data Migration: Virtualization simplifies data migration by allowing data to be moved between storage devices or tiers without impacting the application layer. This flexibility is valuable for data center upgrades or maintenance.</li><li>Improved Scalability: Storage virtualization makes it easier to scale storage capacity by adding new physical devices to the virtualized pool without disrupting existing applications or data.</li><li>Load Balancing: Virtualization can balance the storage workload across different devices, ensuring that no single device is overloaded and that data access remains efficient.</li><li>Data Redundancy: Some storage virtualization solutions offer built-in redundancy and fault tolerance, improving data availability and resilience.</li></ol><h4>Disadvantages of Storage Virtualization:</h4><ol><li>Complexity and Learning Curve: Implementing storage virtualization may introduce complexity, and administrators may need to learn how to manage the virtualized storage environment effectively</li><li>Performance Overhead: Depending on the virtualization solution, there may be a slight performance overhead introduced due to the additional layer of abstraction between the application and the physical storage.</li><li>Compatibility Issues: Integrating storage virtualization with existing storage hardware and software can be challenging, and there may be compatibility issues to address.</li></ol><h4>How Storage Virtualization Works:</h4><ol><li>Abstraction: Storage virtualization begins by abstracting physical storage devices, such as hard drives, RAID arrays, or SANs. This abstraction creates a logical layer of storage that hides the complexity of the physical devices from the applications and users.</li><li>Aggregation: The virtualization layer aggregates the capacity and performance of multiple physical storage devices into a unified storage pool. This pool can span different types of storage media and devices.</li><li>Allocation: Administrators can allocate storage to applications, users, or specific use cases from the virtualized storage pool. This allocation is typically done based on policies or user-defined criteria.</li><li>Monitoring and Management: The virtualized storage environment is monitored and managed through a central management console. This console allows administrators to track storage utilization, allocate resources, and make adjustments as needed.</li><li>Data Migration: Storage virtualization often includes data migration capabilities, allowing data to be moved between storage devices seamlessly. Data can be migrated without disrupting access or causing downtime.</li><li>Load Balancing and Redundancy: Storage virtualization can distribute data and I/O requests across available resources to ensure optimal performance and reliability. Redundancy features can provide data protection and failover capabilities.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*HKp-vIlG1NK5-bdj9SUyLw.jpeg" /></figure><h3>Desktop Virtualization:</h3><p>Definition:</p><p>Desktop virtualization, also known as VDI (Virtual Desktop Infrastructure), is a technology that allows multiple virtual desktop environments to run on a single physical computer or server. Each virtual desktop functions as an independent, self-contained system, complete with its own operating system, applications, and user settings. Users can access these virtual desktops remotely, typically using thin clients, web browsers, or software clients from their local devices.</p><h4>Advantages</h4><ol><li>Centralized Management: All virtual desktops can be managed centrally from a single server, making it easier to deploy, update, and secure desktop environments. IT administrators can apply consistent policies and updates across all virtual desktops.</li><li>Cost Efficiency: Desktop virtualization can lead to cost savings. It reduces the need for individual, high-end workstations, as users can access virtual desktops from less powerful, lower-cost devices.</li><li>Improved Security: Data is stored and managed on the server rather than individual devices. This can enhance data security and reduce the risk of data loss in the event of device theft or failure.</li><li>Remote Access: Users can access their virtual desktops from anywhere with an internet connection, facilitating remote work and improving productivity.</li><li>Scalability: It’s relatively easy to scale desktop virtualization. As the organization grows, you can add more virtual desktops without the need for significant hardware investments.</li><li>Disaster Recovery: Desktop virtualization simplifies disaster recovery planning. In case of a server or hardware failure, virtual desktops can be restored quickly, minimizing downtime.</li></ol><h4>Disadvantages:</h4><ol><li>Initial Costs: Implementing desktop virtualization can require substantial upfront costs for server hardware, software licenses, and network infrastructure.</li><li>Complexity: Managing a virtual desktop infrastructure can be complex and may require specialized expertise. It can also be challenging to balance resource allocation for optimal performance.</li><li>Network Dependency: Remote access depends on a stable and robust network connection. If the network experiences issues, it can lead to performance problems for remote users.</li><li>Resource Intensive: Desktop virtualization can be resource-intensive, especially if many virtual desktops are running simultaneously. It’s crucial to ensure the server hardware can meet the demands.</li><li>Licensing Costs: Licensing costs for virtualization software and virtual desktop operating systems can add to the overall expense.</li></ol><p><strong>How It Works:</strong></p><ol><li>Hypervisor and Server: A hypervisor is installed on a physical server, which becomes the host for virtual desktops. The hypervisor manages and allocates resources to create and run multiple virtual machines (VMs), each of which represents a virtual desktop.</li><li>Virtual Desktop Creation: Virtual desktops are created as VMs on the server. Each VM includes its own operating system, applications, and user profiles. These VMs are isolated from each other.</li><li>Access and Connection: Users access their virtual desktops from client devices. This can be done via thin clients, web browsers, or dedicated software clients. They connect to the server hosting the virtual desktop infrastructure.</li><li>Resource Allocation: The hypervisor allocates CPU, memory, storage, and network resources to each VM based on its configuration and resource demands.</li><li>User Interaction: Users interact with their virtual desktops as if they were using physical desktop computers. They can run applications, access files, and customize their desktop environments.</li><li>Centralized Management: IT administrators can manage and maintain all virtual desktops from a central management interface. They can update software, enforce security policies, and monitor performance.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*EIr8SzZuBRYiGUaLpzNftg.jpeg" /></figure><h3>Application Virtualization:</h3><p><strong>Definition:</strong></p><p>Application virtualization is a technology that allows applications to run in isolated, virtualized environments separate from the underlying operating system. It decouples applications from the OS, enabling them to operate without conflicts and simplifying deployment and management.</p><h4>Advantages of Application Virtualization:</h4><ol><li>Isolation: Applications run in their own virtual environments, preventing conflicts with other applications or the operating system. This ensures stability and reliability.</li><li>Compatibility: It allows you to run multiple versions of the same application or different applications with conflicting dependencies on a single system.</li><li>Portability: Virtualized applications can be easily moved or copied to other systems with minimal compatibility issues.</li><li>Simplified Deployment: Application packages are self-contained and do not require complex installation procedures. This simplifies application deployment and updates.</li><li>Resource Efficiency: By sharing common components, such as system libraries, multiple virtualized applications can be more resource-efficient than installing each application separately.</li><li>Security: Application virtualization can enhance security by sandboxing applications. Malicious software or system changes within a virtual environment typically do not affect the host system.</li><li>Centralized Management: It allows for centralized control and management of applications, making it easier to enforce security policies and updates across a network.</li></ol><h4>Disadvantages of Application Virtualization:</h4><ol><li>Performance Overhead: Running applications within virtualized environments can introduce a slight performance overhead due to the additional layer of abstraction.</li><li>Complexity: Implementing application virtualization can be complex, especially for organizations that are new to the technology. It may require specialized software and expertise.</li><li>Limited Hardware Access: Some applications may require direct access to hardware, which can be restricted in virtualized environments.</li><li>Licensing Costs: Some application virtualization solutions require licenses, which can add to the overall cost of deploying virtualized applications.</li></ol><h4>How Application Virtualization Works:</h4><ol><li>Application Packaging: In application virtualization, each application is packaged into a self-contained container or virtual environment that includes the application’s files, settings, and dependencies.</li><li>Isolation: The virtualized application operates within an isolated environment that shields it from conflicts with other applications and the host operating system. It can also have its registry and file system.</li><li>Compatibility Layers: The application virtualization software provides compatibility layers that intercept calls from the virtualized application to the operating system. These layers redirect the application’s requests to the appropriate resources within its virtual environment.</li><li>Execution: When a user or system initiates the virtualized application, the application virtualization software creates a runtime instance of the virtual environment and executes the application within it.</li><li>Interactions: The virtualized application interacts with the virtualized environment instead of directly interacting with the host operating system. Any changes made by the application, such as file writes or registry updates, are contained within its virtual environment.</li><li>Management: Application virtualization solutions often provide management tools for deploying, updating, and maintaining virtualized applications. These tools can also help with license management and access control.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/973/1*Unxohzw7DmoaUu_1fqUzpA.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43c97337b55d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Distributed system]]></title>
            <link>https://medium.com/@kahanahamed42/distributed-system-c4b4efa7b378?source=rss-e17344d862b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4b4efa7b378</guid>
            <category><![CDATA[distributed-architecture]]></category>
            <category><![CDATA[future-technology]]></category>
            <category><![CDATA[tech-trends]]></category>
            <category><![CDATA[distributed-systems]]></category>
            <dc:creator><![CDATA[Kahanahamed]]></dc:creator>
            <pubDate>Thu, 12 Oct 2023 05:18:29 GMT</pubDate>
            <atom:updated>2023-10-12T05:18:29.545Z</atom:updated>
            <content:encoded><![CDATA[<h4>Introduction to Distributed Systems</h4><p>A distributed system, also known as distributed computing, is a system with multiple components located on different machines that communicate and coordinate actions in order to appear as a single coherent system to the end-user</p><h4>Key Characteristics of Distributed Systems:</h4><ul><li><strong><em>Reliability</em></strong></li><li><strong><em>Scalability</em></strong></li><li><strong><em>Maintainability</em></strong></li><li><strong><em>Availability</em></strong></li><li><strong><em>Consistency</em></strong></li></ul><h3>1) Reliability</h3><p>Reliability is a system’s ability to continue to work correctly in spite of faults. A distributed system is usually made of several smaller sub-components that together work to deliver a service. A reliable system can be banked upon to continue to work without degradation of service if a part of the overall system fails. The reliability concept can be extended to include a system’s ability to continue to perform with the expected functionality, tolerate human errors and unexpected use of the system, maintain performance under high data volume load, and, prevent any unauthorized use or abuse of the system when failures do happen.</p><h3>Fault vs. failure</h3><p>The terms “fault” and “failure” are often used interchangeably but mean different things. When a part of a system experiences failure but the system as a whole can still continue to operate reliably, we label the system as <strong>fault-tolerant</strong> or <strong>resilient</strong>. The system can tolerate components deviating from the spec but still function correctly. A failure occurs when the system as a whole fails. No system can be made fault-tolerant from all types of possible faults and can always potentially fail as a whole.</p><p>Netflix’s <a href="https://netflix.github.io/chaosmonkey/">Chaos Monkey</a> is an example of a tool designed to test the resiliency of services in the Netflix ecosystem. The tool randomly terminates service instances to uncover service failures.</p><h3>2) Scalability</h3><p>A system is said to be <strong>scalable</strong> if it can continue to work correctly as the <strong>load</strong> on the system increases.</p><h3>Load</h3><p>Load can be measured by a variety of metrics, including the number of requests per second received by a web server, the number of <strong>reads from</strong> vs <strong>writes</strong> to a cache, the frequency of a data back-up, the number of supported concurrent users, and more. When considering scalability, we generally question if the system can continue to perform well when one of the load parameters increases.</p><h3>Examples</h3><p>Let’s look at some well-known products and examples of their load parameters:</p><ul><li><strong>Microsoft Word:</strong> The number of geographically distributed users who can concurrently modify a document in collaboration mode without affecting usability for each user.</li><li><strong>Facebook:</strong> The number of users able to view a live broadcast from, say, a celebrity. It becomes harder to broadcast a live feed to all users if there are many users viewing a particular live broadcast.</li><li><strong>Google:</strong> Storage costs for indexing the web as the web grows.</li><li><strong>Twitter:</strong> Adding a tweet by a popular user instantly to the timeline of all the followers. A tweet by an account with several million followers, if stored in a database, will be fetched millions of times when computing the timelines for each of the account followers and is a potential bottleneck.</li></ul><h3>Measuring performance</h3><p>When the load parameters increase, a scalable system is expected to keep its expected performance. Amazon’s <a href="https://aws.amazon.com/s3/sla/">S3 service level agreement</a> (SLA), for example, promises a certain performance benchmark to its users. For instance, the customers are entitled to service credits if S3’s monthly uptime is less than 99.9%.</p><p>Let’s consider another example. Instagram has an internal SLA to load a user’s home page in less than X milliseconds; let’s say 5 milliseconds. However, the team can’t guarantee that every home page will load at exactly 5ms. Thus, performances are measured in percentiles. Instagram engineers can set standards such as 99.9% of users will have their home pages loaded in under 10ms, 70% will have their home pages loaded in under 7ms and the median load time would be 5ms. Median implies that half the Instagram users would have their home screens loaded in under 5ms. Theoretically, there could be a very thin minority that sees load times greater than 10ms and due to random events outside the developer’s control. Generally, optimizing for very high percentiles, e.g., 99.99th percentile (1 in 10,000) comes with diminishing returns and is usually not worth optimizing for.</p><h3>Horizontal vs. vertical scaling</h3><p>Once load starts to increase on a system, it may be necessary to re-architect the system to handle the new load. There are generally two ways to scale a system demanding more resources:</p><ol><li><strong>Vertical scaling</strong>: Add a more expensive or beefier machine than the one on which the current system runs. Consider a MySQL server that runs slowly on the current machine. If we replace it with a new machine with ten times the memory and computing power than the current one, the database server will be able to process a much larger number of queries.</li><li><strong>Horizontal scaling</strong>: Horizontal scaling refers to distributing load across several smaller machines. There’s a ceiling to vertical scaling as machines can only become so powerful before they run into the limits of physics. This is assuming you don’t hit the budget limits of your company in the first place. Scaling horizontally brings complexity with it, especially for stateful services. A distributed database is not a trivial service to maintain when spread across several machines. However, stateless services are much easier to scale horizontally.</li></ol><p>In practice, a hybrid approach is usually selected to address scaling issues which uses more powerful machines that also spread load horizontally. Note that there is no one-size-fits-all architecture for distributed applications operating at scale, as each application can have unique load parameters. Access patterns may be different and so too the SLA’s response time requirements.</p><h3>3) Maintainability</h3><p>One of the cornerstones of good software design is maintainability. There are three major aspects to maintainability:</p><ul><li><strong>Ongoing operations</strong>: Software should be simple for operators to work with and provide support for.</li><li><strong>Developer ease</strong>: Folks working on the code base should easily be able to grasp the logic and functionality of the software.</li><li><strong>Extensibility</strong>: Software should be easily extensible to address new, related, or unanticipated use cases.</li></ul><h3>4) Availability</h3><p>Availability is another key characteristic of distributed systems. Though availability is quantified mathematically, we can, for our purposes, think of availability as the length of time a system is responsive and functioning within a specified period of time. We’ll say the system is 100% available if the system is always responsive and functioning as intended within a given period of time. As a crude example, consider an API server that reports weather data. When the server’s API is unavailable for whatever reason and the server doesn’t respond, its availability metrics will be affected. Imagine the web server isn’t responding because the backing database with the weather data is down. The designer of the service could choose to respond to requests in such a scenario with stale data from the server’s cache, thus improving availability. However, failure to include the latest writes in the database implies the server isn’t consistent anymore. Generally, there’s a tradeoff between availability and consistency. In the industry, you’ll often see cloud products advertised as being available ninety nine percent and higher.</p><h3>5) Consistency</h3><p>In our web server example, if we designed the service to always return the latest data from the database, the service will not always be available if the database is down, but it will still be considered consistent. In distributed systems, there are generally several instances of a server. The clients of the system are generally talking to only one such instance. In that context, consistency implies that the client receives the same response from any one of the instances that it sends its request to. The CAP (consistency, availability and partition) theorem captures the relationship between consistency and availability. The crux of the theorem says that intermittent network failures among the different components of a distributed system can’t be ruled out and, under such a scenario, the system can choose to be either available all the time at the cost of serving inconsistent data or always serve consistent data to its customers at the risk of losing availability.</p><h3>Architectural Models in Distributed Systems:</h3><h4>1)Client-Server Model</h4><p>Definition: The client-server model is a widely used architectural model in distributed systems. In this model, the system is divided into two main components: clients and servers. Clients initiate requests for services or resources, while servers provide those services and manage resources. This architectural model is characterized by the client’s request and the server’s response, which can be implemented in various forms, including web applications and networked services.</p><p><strong>Pros of the Client-Server Model:</strong></p><ol><li>Centralized Management: One of the key advantages of the client-server model is centralized management. Servers act as central points of control, making it easier to monitor, maintain, and update the system. This simplifies system administration.</li><li>Scalability: The model allows for easy scalability. Additional clients can be accommodated by adding more servers or optimizing server resources to handle increased demand. This scalability is essential for growing systems.</li><li>Resource Sharing: Servers facilitate resource sharing. They can manage and provide access to resources such as databases, files, and hardware peripherals, allowing efficient utilization of resources across the network.</li><li>Security Control: Security measures can be implemented more effectively in the client-server model. Access control, authentication, and encryption can be centralized on servers to protect sensitive data and resources.</li><li>Efficient Load Distribution: Load distribution is more efficient as servers can balance the workload and allocate resources based on the incoming requests. This ensures that no single server becomes overwhelmed.</li><li>Reliability and Fault Tolerance: Servers can be designed with redundancy and fault tolerance mechanisms to ensure the system remains operational even in the event of server failures. This enhances the system’s reliability.</li></ol><p><strong>Cons of the Client-Server Model:</strong></p><ol><li>Single Point of Failure: While fault tolerance can be implemented, servers can still represent single points of failure. If a server experiences issues, it can disrupt the entire system.</li><li>Network Overhead: Communication between clients and servers typically occurs over a network, which introduces network overhead. Network latency and bandwidth limitations can affect the system’s performance.</li><li>Scalability Limits: There are limits to how far a client-server system can scale. At some point, the centralized server can become a bottleneck, hindering further expansion.</li><li>Complexity: Implementing a client-server architecture can be complex, particularly in large and distributed systems. Managing and coordinating the interactions between clients and servers can be challenging.</li><li>Cost: Centralized servers and their maintenance can be costly. This includes expenses related to hardware, software, and IT personnel.</li><li>Reduced Offline Functionality: The client-server model relies on network connectivity. If clients cannot connect to the server, certain features or functionalities may become unavailable, limiting offline capabilities.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/288/1*GtUB_u11hR2UlPH7-8bO8w.png" /></figure><h4>Peer-to-Peer (P2P) Model</h4><p>Definition: The Peer-to-Peer (P2P) model is an architectural model in distributed systems where all participating nodes, or “peers,” have equal standing and can act both as consumers and providers of resources or services. Unlike the client-server model, there is no central server. Instead, peers communicate directly with each other, sharing and accessing resources. P2P networks are characterized by decentralized control, where each peer contributes to the overall functionality of the system.</p><h4>Pros of the Peer-to-Peer (P2P) Model:</h4><ol><li>Decentralization: P2P systems are inherently decentralized. There is no single point of control or failure, which can enhance fault tolerance and system resilience.</li><li>Resource Redundancy: Each peer can contribute resources, such as files or computing power, to the network. This redundancy can improve resource availability and reduce the risk of data loss.</li><li>Scalability: P2P networks can be highly scalable, as each new peer can contribute to the network’s resources and capabilities, making them suitable for large and growing systems.</li><li>Privacy and Anonymity: P2P systems can offer a degree of privacy and anonymity because they don’t rely on central authorities or intermediaries. Peers interact directly with each other, reducing the need for revealing personal information.</li><li>Self-Organization: P2P networks can be self-organizing, with peers discovering each other and forming connections autonomously. This makes them suitable for applications where nodes may come and go frequently.</li><li>Content Distribution: P2P is often used for efficient content distribution. Content can be distributed across multiple peers, reducing the load on any single source and improving download speeds.</li></ol><h4>Cons of the Peer-to-Peer (P2P) Model:</h4><ol><li>Lack of Centralized Control: While decentralization is a strength, it can also be a weakness. Without centralized control, it can be challenging to implement security measures, enforce policies, or manage the network effectively.</li><li>Network Efficiency: P2P networks can lead to increased network traffic, which can be problematic in terms of bandwidth and latency. This can negatively affect other network activities.</li><li>Security Risks: P2P networks can be vulnerable to security risks, including the potential for malware distribution, illegal file sharing, and privacy concerns.</li><li>Quality of Service: Ensuring a consistent quality of service (QoS) can be challenging in P2P systems, as there is no central authority to manage and allocate resources.</li><li>Unpredictable Performance: The performance of a P2P network can be unpredictable and highly dependent on the behavior of individual peers. Variability in peer behavior can affect the system’s performance.</li><li>Data Integrity: P2P networks can struggle with data integrity and reliability since there is no central authority ensuring the accuracy and availability of data.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/1*dMt_1tZyMNI_N6OWu7JhDA.png" /></figure><h4>Microservices Architecture</h4><p>Definition: Microservices architecture is an architectural approach in distributed systems that structures an application as a collection of small, independently deployable services, each responsible for specific functionality. These services communicate with each other through APIs or messaging, and they can be developed, deployed, and scaled independently. This modular approach aims to make it easier to develop, maintain, and scale complex applications.</p><h4>Pros of Microservices Architecture:</h4><ol><li>Scalability: Microservices can be individually scaled based on demand. This allows for efficient resource utilization and eliminates the need to scale the entire application.</li><li>Agility and Rapid Development: Each microservice can be developed and deployed independently, enabling faster development cycles. Teams can work on different services simultaneously.</li><li>Fault Isolation: When one microservice fails or experiences issues, it typically doesn’t affect the entire application. Isolation of faults is a key benefit, enhancing system robustness.</li><li>Technology Diversity: Teams can use different technologies and programming languages for different microservices, allowing for the use of the best tools for each specific task.</li><li>Improved Maintenance: It’s easier to maintain and update individual microservices without affecting the entire application. This reduces the risk of introducing new bugs during updates.</li><li>Enhanced Testability: Isolated microservices are easier to test, leading to more accurate and comprehensive testing.</li><li>Resource Efficiency: Microservices can run on the same server, optimizing resource usage and cost-effectiveness.</li><li>Improved Developer Productivity: Smaller, focused teams can work on specific microservices, leading to increased productivity and ownership of services.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/321/1*0mbImZ1VSrKtVd1aBnjxyw.jpeg" /></figure><h4>Cons of Microservices Architecture:</h4><ol><li>Complexity: Microservices introduce additional complexity in terms of service discovery, load balancing, and inter-service communication. Managing this complexity can be challenging.</li><li>Increased Latency: Communication between microservices can introduce network latency, especially when services are distributed across different servers or even data centers.</li><li>Data Consistency: Maintaining data consistency across multiple microservices can be challenging. Ensuring that data remains synchronized and accurate can require additional effort.</li><li>Operational Overhead: Managing a large number of microservices may lead to operational challenges. Each service needs monitoring, logging, and security measures.</li><li>Deployment and Scaling Challenges: Coordinating the deployment and scaling of multiple microservices can be complex. Ensuring they work together seamlessly is crucial.</li><li>Testing Challenges: Integration testing across multiple microservices can be difficult, as changes to one service may affect others.</li><li>Initial Development Complexity: Designing and implementing a microservices architecture can be more complex compared to monolithic applications.</li></ol><h4>Service-Oriented Architecture (SOA)</h4><p>Definition: Service-Oriented Architecture (SOA) is an architectural approach in distributed systems that structures the system into loosely coupled and reusable services. In an SOA, various components or services are designed to perform specific tasks and communicate with each other through well-defined, standardized protocols, often using technologies like SOAP (Simple Object Access Protocol) or REST (Representational State Transfer). The primary focus of SOA is to create a modular, flexible, and interoperable system.</p><h4>Pros of Service-Oriented Architecture (SOA):</h4><ol><li>Modularity and Reusability: SOA encourages the creation of services that perform specific tasks, making the system more modular. These services can be reused in different applications, reducing development time and promoting consistency.</li><li>Interoperability: SOA emphasizes standardized communication protocols, enabling services to interact seamlessly regardless of the underlying technologies or platforms. This promotes interoperability between diverse components.</li><li>Flexibility: SOA allows for easier modification and adaptation of the system. Changes to one service do not necessarily require changes in other services, minimizing the impact on the entire system.</li><li>Scalability: Services can be scaled independently. As demand grows for a particular service, additional instances of that service can be deployed without affecting the rest of the system.</li><li>Resource Sharing: SOA facilitates the sharing of resources, such as databases and data, among services. This promotes efficient resource utilization and reduces redundancy.</li><li>Improved Maintenance: Changes and updates to individual services can be carried out without affecting the overall system. This simplifies maintenance and reduces downtime.</li><li>Easier Integration: SOA is well-suited for integrating legacy systems and third-party services, making it ideal for systems that need to interact with external components</li></ol><h4>Cons of Service-Oriented Architecture (SOA):</h4><ol><li>Complexity: Implementing an SOA can be complex. Managing a large number of services, their dependencies, and ensuring proper orchestration can be challenging.</li><li>Performance Overhead: The use of standardized protocols like SOAP or REST can introduce some performance overhead due to additional processing required for serialization and deserialization of data.</li><li>Versioning Challenges: Managing the versions of services can be complicated. As services evolve, backward compatibility must be maintained to avoid breaking existing consumers of the service.</li><li>Security Concerns: SOA systems can introduce security challenges, particularly if services handle sensitive data. Proper authentication, authorization, and data encryption are critical but can add complexity.</li><li>Cost: The development and maintenance of services, along with the infrastructure required to manage them, can be costly. Proper governance and resource management are necessary to control expenses.</li><li>Governance Issues: Managing a large number of services requires effective governance to ensure that services adhere to standards and best practices. Without governance, service sprawl can occur.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/234/1*7lwcjkuxyqQXlbAi9D07sA.png" /></figure><h4>Layered Architectures</h4><h4>Definition:</h4><p>Layered architectures in distributed systems refer to a design approach where the system is organized into multiple distinct layers or tiers. Each layer represents a specific level of abstraction and functionality, and these layers work together to deliver a complete system. Communication typically occurs between adjacent layers, following a well-defined protocol. Layering aims to modularize the system, making it more manageable and allowing for easier maintenance and scalability.</p><h4>Pros of Layered Architectures:</h4><ol><li>Modularity and Separation of Concerns: Layering promotes modularity, allowing each layer to focus on specific functions and concerns. This separation of concerns simplifies development, debugging, and maintenance.</li><li>Interoperability: Layers can be designed to have standardized interfaces or protocols, enhancing interoperability. This is particularly useful in complex distributed systems where different components may come from various sources.</li><li>Scalability: Layers can be scaled independently as needed. For instance, in a web application, you can scale the web server layer separately from the database layer, optimizing resource allocation.</li><li>Reusability: Each layer can be reused in different applications or contexts, reducing development time and effort.</li><li>Abstraction: Layers provide abstraction, allowing developers to work with high-level concepts and not worry about the lower-level details of the layers below</li><li>Security and Access Control: Security measures can be implemented at each layer, ensuring that only authorized access occurs between layers. This is vital for protecting sensitive data.</li></ol><h4>Cons of Layered Architectures:</h4><ol><li>Complexity: As the number of layers increases, so does the complexity of the system. Managing and debugging issues that span multiple layers can be challenging.</li><li>Performance Overhead: Each layer adds a level of abstraction and can introduce some performance overhead. Communication between layers might also result in network or processing delays.</li><li>Rigidity: Overly rigid layering can hinder flexibility. It might be difficult to adapt to changes or to integrate new technologies if the layers are tightly coupled.</li><li>Increased Latency: Communication between layers can introduce latency, which may be unacceptable for real-time applications or systems with strict performance requirements.</li><li>Resource Consumption: Running multiple layers consumes more resources, such as memory and processing power, which can lead to increased costs.</li><li>Protocol and Versioning Issues: Layers must adhere to well-defined protocols, and changes in protocols or versions can lead to compatibility issues. Ensuring backward and forward compatibility can be challenging</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/240/1*Ef-JpW4YE3U8li2gTT37Zw.jpeg" /></figure><h4>Object-Based Architectures</h4><p><strong>Definition:</strong></p><p>Object-based architectures in distributed systems are designed around the concept of objects, which encapsulate data and behavior within a single unit. These objects are distributed across the network and can communicate with each other through well-defined interfaces. Object-oriented programming principles, such as encapsulation, inheritance, and polymorphism, often underpin these architectures. Objects can represent various entities, such as data structures, services, or even components, making it a versatile approach to distributed system design.</p><h4>Pros of Object-Based Architectures:</h4><ol><li>Modularity and Reusability: Objects are highly modular and encapsulate data and functionality, promoting code reusability. In distributed systems, this can lead to more efficient development and maintenance.</li><li>Encapsulation: Objects hide their internal implementation details, providing a clear interface for other objects to interact with. This encapsulation enhances security and reduces the risk of unintended side effects.</li><li>Interoperability: Object-based architectures often use standard interfaces, allowing objects developed in different languages or on different platforms to communicate seamlessly. This promotes interoperability in heterogeneous environments.</li><li>Simplified Maintenance: Objects can be maintained independently, making updates and fixes more manageable. Changes to an object’s internal logic do not necessarily affect the overall system.</li><li>Scalability: Objects can be distributed across multiple nodes or servers, which aids in scalability. New nodes can be added to accommodate increasing loads.</li><li>Distributed Processing: Objects can perform distributed processing tasks. This is particularly useful for parallel or distributed computing where multiple objects work in concert to accomplish a task.</li></ol><h4>Cons of Object-Based Architectures:</h4><ol><li>Complexity: Implementing an object-based architecture can be more complex compared to other architectural models. Developers need to manage the interaction between distributed objects, handle remote method invocations, and ensure data consistency.</li><li>Latency: Distributed objects may introduce network latency, especially when objects are located on remote servers. This can affect system performance, particularly for real-time or latency-sensitive applications.</li><li>Versioning and Compatibility: Ensuring backward and forward compatibility of distributed objects can be challenging. Changes in the object’s structure or behavior may affect clients and require careful version management.</li><li>Security Concerns: Distributing objects across a network can introduce security vulnerabilities if not properly managed. Unauthorized access to objects or malicious objects can pose threats to the system.</li><li>Resource Overhead: Managing distributed objects can introduce resource overhead. There may be additional memory and processing requirements for object serialization, network communication, and object lifecycle management.</li><li>Potential for Distributed Deadlocks: Object-based architectures may face issues like distributed deadlocks, where objects or processes are waiting for resources held by others, leading to a standstill in the system</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/253/1*O_B2PzeKKD1CvLzTAacr-A.png" /></figure><h4>Resource-Centered Architectures</h4><p><strong>Definition:</strong></p><p>Resource-centered architectures in distributed systems focus on organizing and managing resources, such as data, services, or devices, as central components. These architectures emphasize making resources available and accessible to various clients or applications. The key concept is to centralize resource management for efficient distribution, utilization, and coordination.</p><h4>Pros of Resource-Centered Architectures:</h4><ol><li>Resource-Centricity: Resources are the core focus, making it easier to organize and manage them efficiently.</li><li>Resource Discovery: Clients can easily discover and access resources by querying a centralized resource directory or database.</li><li>Optimized Resource Usage: Resource allocation and utilization can be optimized, reducing resource wastage.</li><li>Efficient Resource Sharing: Centralized resource management facilitates efficient sharing of resources among clients or applications, enhancing overall system efficiency.</li><li>Consistency and Data Integrity: With centralized resource control, maintaining data consistency and ensuring data integrity becomes more manageable.</li><li>Scalability: Resource-centered architectures can be designed for scalability, allowing for the addition of new resources or clients as needed.</li></ol><h4>Cons of Resource-Centered Architectures:</h4><ol><li>Single Point of Failure: Centralized resource management can create a single point of failure. If the resource management component fails, it can disrupt access to all resources.</li><li>Network Overhead: Resource access and management often rely on network communication, introducing network overhead and potential latency.</li><li>Complexity: Implementing resource-centered architectures can be complex, especially as the number of resources and clients grows.</li><li>Cost: The centralization of resources may lead to higher costs, including hardware, software, and maintenance expenses.</li><li>Performance Bottlenecks: If resource management becomes a bottleneck due to a high number of resource requests or clients, it can negatively impact system performance.</li><li>Limited Offline Functionality: Depending on network connectivity for resource access, these architectures may offer limited offline functionality.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/280/1*UUG22HYuSkt4sEDdea52JQ.png" /></figure><h4>Event-Based Architectures</h4><p><strong>Definition:</strong></p><p>Event-based architecture is an architectural model used in distributed systems where components communicate and interact primarily through the generation, transmission, and handling of events. Events are occurrences or notifications that can include messages, changes in system state, user actions, or any other significant events that trigger specific responses within the system. This architecture focuses on the flow of events and how components respond to these events in a decoupled and asynchronous manner.</p><h4>Pros of Event-Based Architectures:</h4><ol><li>Asynchronous Communication: Event-based architectures promote asynchronous communication, allowing components to operate independently and respond to events at their own pace. This can lead to improved system responsiveness.</li><li>Scalability: This architecture can easily scale because events can be distributed and processed across multiple nodes or services. It supports horizontal scalability, making it well-suited for modern, distributed, and cloud-native applications.</li><li>Loose Coupling: Components in an event-based system are loosely coupled, meaning they have minimal direct dependencies on each other. This reduces the risk of ripple effects when making changes or updates to specific components.</li><li>Flexibility: Event-driven systems are flexible and can accommodate a wide range of applications and use cases. They are particularly suitable for real-time, data streaming, and reactive systems.</li><li>Fault Tolerance: Due to its loosely coupled nature and distributed processing, event-based architectures can be inherently fault-tolerant. If one component fails, the system can continue processing events with minimal disruption.</li><li>Real-Time and Near-Real-Time Processing: Event-based systems are well-suited for real-time or near-real-time processing of data and events. They can respond to events as they occur, which is essential for applications such as IoT and monitoring systems.</li></ol><h4>Cons of Event-Based Architectures:</h4><ol><li>Complexity: Designing and implementing event-based architectures can be complex. Event-driven systems often require careful planning to manage event flow, state changes, and potential race conditions.</li><li>Debugging and Monitoring: Debugging and monitoring an event-based system can be challenging. Tracing the flow of events and understanding how components interact can be more complex than traditional request-response systems.</li><li>Message Ordering: Ensuring the correct order of events, especially in distributed environments, can be a challenge. Event sequencing and ordering may require additional mechanisms to maintain consistency.</li><li>Increased Latency: While asynchronous processing can improve responsiveness, it can also introduce some level of latency, as event handlers may not immediately respond to events.</li><li>Error Handling: Handling errors and exceptions in an event-based system can be complex. Components need to be designed to handle failures gracefully and ensure that events are not lost or misinterpreted.</li><li>Complex Event Processing: Some event-based systems require complex event processing engines to analyze and derive insights from large streams of events. Implementing these engines can be resource-intensive.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/359/1*YJmKCva4wnTfSJfLTXzgDA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4b4efa7b378" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Design Patterns in software engineering]]></title>
            <link>https://medium.com/@kahanahamed42/design-patterns-software-engineering-afcab5020131?source=rss-e17344d862b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/afcab5020131</guid>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Kahanahamed]]></dc:creator>
            <pubDate>Sun, 27 Aug 2023 13:23:42 GMT</pubDate>
            <atom:updated>2023-08-27T13:24:22.062Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>a software design pattern is a general, reusable solution of how to solve a common problem when designing an application or system.</em></blockquote><blockquote><em>Design Patterns are categorized mainly into three categories:</em></blockquote><p><em>1.Creational Design Pattern</em></p><p><em>2.Structural Design Pattern</em></p><p><em>3. Behavioral Design Pattern</em></p><h3><em>Creational Design Pattern</em></h3><ul><li>creational design patterns are design patterns that deal with object creation mechanisms, trying to create objects in a manner suitable to the situation</li></ul><h4>Types of creational design patterns</h4><ol><li>Factory Method Pattern</li><li>Abstract Factory Pattern</li><li>Singleton Pattern</li><li>Prototype Pattern</li><li>Builder Pattern</li><li>Object Pool Pattern</li></ol><p>1: <em>Factory Method Pattern</em></p><ul><li>is a creational design pattern that provides an interface for creating objects in a superclass, but allows subclasses to alter the type of objects that will be created.</li></ul><p><strong><em>Example in Php</em></strong></p><ul><li>class Car {<br> private $color = null;<br> public function __construct() {<br> $this-&gt;color = “white”;<br> }<br> public function setColor($color) {<br> $this-&gt;color = $color;<br> }<br> public function getColor() {<br> return $this-&gt;color;<br> }<br>}</li></ul><p>In the <strong>factory class</strong>, <strong>methods</strong> for “red” and “blue” cars and a private method for the actual class creation <strong>are introduced</strong></p><ul><li>class CarFactory {<br> private function __construct() {<br> }<br> public static function getBlueCar() {<br> return self::getCar(“blue”);<br> }<br> public static function getRedCar() {<br> return self::getCar(“red”);<br> }<br> private static function getCar($color) {<br> $car = new Car();<br> $car-&gt;setColor($color);<br> return $car;<br> }<br>}</li></ul><p><strong>=&gt;Advantages</strong></p><p><em>Modular expandability of the application</em></p><p><em>Good testability</em></p><p><em>Significant method names</em></p><p><strong>=&gt;Disadvantages</strong></p><p>High number of required classes</p><p>Extension of the application is very elaborate</p><h4>2: <strong><em>Abstract Factory Pattern</em></strong></h4><ul><li>Abstract Factory Pattern says that just <strong>define an interface or abstract class for creating families of related (or dependent) objects but without specifying their concrete sub-classes.</strong></li></ul><p><strong><em>Example in java</em></strong></p><p>Here’s the <em>Animal</em> interface:</p><ul><li>public interface Animal {<br> String getAnimal();<br> String makeSound();<br>}</li></ul><p>and a concrete implementation <em>Duck</em>:</p><p>public class Duck implements Animal {</p><p><a href="http://twitter.com/Override">@Override</a><br> public String getAnimal() {<br> return “Duck”;<br> }</p><p><a href="http://twitter.com/Override">@Override</a><br> public String makeSound() {<br> return “Squeks”;<br> }<br>}</p><p>=&gt;<strong>Advantages</strong></p><ul><li>Abstract Factory Pattern isolates the client code from concrete (implementation) classes.</li><li>It eases the exchanging of object families.</li><li>It promotes consistency among objects.</li></ul><p>=&gt;Disa<strong>dvantages</strong></p><ul><li>increase in complexity in the code</li><li>increase in the number of classes required for the code</li></ul><h4>3 : Singleton Pattern</h4><ul><li>Singleton Pattern says that just<strong>”define a class that has only one instance and provides a global point of access to it”</strong></li></ul><p>Example</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/1*k6h9KQ5Tg597vEdSQQzkhA.png" /></figure><p>In such case, we create the instance of the class in synchronized method or synchronized block, so instance of the class is created when required.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*s-Ir550Zn9rf0iRLJpSQkQ.png" /></figure><h4>4 : Prototype Pattern</h4><ul><li>Prototype Pattern says that <strong>cloning of an existing object instead of creating new one and can also be customized as per the requirement</strong>.</li></ul><h4>Advantages</h4><ul><li>t reduces the need of sub-classing.</li><li>It hides complexities of creating objects.</li><li>The clients can get new objects without knowing which type of object it will be.</li><li>It lets you add or remove objects at runtime.</li></ul><h4>Disadvantages</h4><ul><li>Overkill for a project that uses very few objects and/or does not have an underlying emphasis on the extension of prototype chains.</li><li>It also hides concrete product classes from the client</li></ul><p>Example</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*DjBiiwjvzsnm3MtGMLqWOQ.png" /></figure><p>clone method is overridden to provide a deep copy of the employees list. Here is the prototype design pattern example test program that will show the benefit of prototype pattern. PrototypePatternTest.java</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/895/1*-gCfnHypJGYy6fFRz9safA.png" /></figure><h4>5 : Builder Pattern</h4><ul><li>Builder Pattern says that <strong>“construct a complex object from simple objects using step-by-step approach”</strong></li></ul><h4><strong>Advantage :</strong></h4><ul><li>They are reusable in multiple projects.</li><li>They provide the solutions that help to define the system architecture.</li><li>They capture the software engineering experiences.</li><li>They provide transparency to the design of an application.</li></ul><h4>Disadvantages.</h4><ul><li>The use of the builder pattern can make the code more verbose and harder to read</li></ul><h4>Example</h4><p>package com.journaldev.design.builder;</p><p>public class Computer {<br> <br> //required parameters<br> private String HDD;<br> private String RAM;<br> <br> //optional parameters<br> private boolean isGraphicsCardEnabled;<br> private boolean isBluetoothEnabled;</p><p>public String getHDD() {<br> return HDD;<br> }</p><p>public String getRAM() {<br> return RAM;<br> }</p><p>public boolean isGraphicsCardEnabled() {<br> return isGraphicsCardEnabled;<br> }</p><p>public boolean isBluetoothEnabled() {<br> return isBluetoothEnabled;<br> }<br> <br> private Computer(ComputerBuilder builder) {<br> this.HDD=builder.HDD;<br> this.RAM=builder.RAM;<br> this.isGraphicsCardEnabled=builder.isGraphicsCardEnabled;<br> this.isBluetoothEnabled=builder.isBluetoothEnabled;<br> }<br> <br> //Builder Class<br> public static class ComputerBuilder{</p><p>// required parameters<br> private String HDD;<br> private String RAM;</p><p>// optional parameters<br> private boolean isGraphicsCardEnabled;<br> private boolean isBluetoothEnabled;<br> <br> public ComputerBuilder(String hdd, String ram){<br> this.HDD=hdd;<br> this.RAM=ram;<br> }</p><p>public ComputerBuilder setGraphicsCardEnabled(boolean isGraphicsCardEnabled) {<br> this.isGraphicsCardEnabled = isGraphicsCardEnabled;<br> return this;<br> }</p><p>public ComputerBuilder setBluetoothEnabled(boolean isBluetoothEnabled) {<br> this.isBluetoothEnabled = isBluetoothEnabled;<br> return this;<br> }<br> <br> public Computer build(){<br> return new Computer(this);<br> }</p><p>}</p><p>}</p><ul><li><strong>Computer class has only getter methods and no public constructor. So the only way to get a Computer object is through the ComputerBuilder class. Here is a builder pattern example test program showing how to use Builder class to get the object</strong></li></ul><p>package com.journaldev.design.test;</p><p>import com.journaldev.design.builder.Computer;</p><p>public class TestBuilderPattern {</p><p>public static void main(String[] args) {<br> //Using builder to get the object in a single line of code and <br> //without any inconsistent state or arguments management issues <br> Computer comp = new Computer.ComputerBuilder(<br> “500 GB”, “2 GB”).setBluetoothEnabled(true)<br> .setGraphicsCardEnabled(true).build();<br> }</p><p>}</p><h4>6 : Object Pool Pattern</h4><p>Object Pool Pattern says that “ to reuse the object that are expensive to create”</p><h4>Advantage</h4><ul><li>It boosts the performance of the application significantly.</li><li>It is most effective in a situation where the rate of initializing a class instance is high.</li><li>It manages the connections and provides a way to reuse and share them.</li><li>It can also provide the limit for the maximum number of objects that can be created.</li></ul><h4>Disadvantages</h4><ul><li>Object Pools Recap. …</li><li>Requires explicit free. …</li><li>Contents not released when returned to pool. …</li><li>Multiple references to pooled object. …</li><li>Hard to pool collections. …</li><li>Adds overhead to pooled types. …</li><li>Not thread-safe by default. …</li><li>No default constructor.</li></ul><p><strong>Example</strong></p><p>public class Oliphaunt {</p><p>private static final AtomicInteger counter = new AtomicInteger(0);</p><p>private final int id;</p><p>public Oliphaunt() {<br> id = counter.incrementAndGet();<br> try {<br> Thread.sleep(1000);<br> } catch (InterruptedException e) {<br> e.printStackTrace();<br> }<br> }</p><p>public int getId() {<br> return id;<br> }</p><p><a href="http://twitter.com/Override">@Override</a><br> public String toString() {<br> return String.format(“Oliphaunt id=%d”, id);<br> }<br>}</p><ul><li>The ObjectPool and more specifically OliphauntPool</li></ul><p>public abstract class ObjectPool&lt;T&gt; {</p><p>private final Set&lt;T&gt; available = new HashSet&lt;&gt;();<br> private final Set&lt;T&gt; inUse = new HashSet&lt;&gt;();</p><p>protected abstract T create();</p><p>public synchronized T checkOut() {<br> if (available.isEmpty()) {<br> available.add(create());<br> }<br> var instance = available.iterator().next();<br> available.remove(instance);<br> inUse.add(instance);<br> return instance;<br> }</p><p>public synchronized void checkIn(T instance) {<br> inUse.remove(instance);<br> available.add(instance);<br> }</p><p><a href="http://twitter.com/Override">@Override</a><br> public synchronized String toString() {<br> return String.format(“Pool available=%d inUse=%d”, available.size(), inUse.size());<br> }<br>}</p><p>public class OliphauntPool extends ObjectPool&lt;Oliphaunt&gt; {</p><p><a href="http://twitter.com/Override">@Override</a><br> protected Oliphaunt create() {<br> return new Oliphaunt();<br> }<br>}</p><p>finally object pool</p><p>var pool = new OliphauntPool();<br> var oliphaunt1 = pool.checkOut();<br> var oliphaunt2 = pool.checkOut();<br> var oliphaunt3 = pool.checkOut();<br> pool.checkIn(oliphaunt1);<br> pool.checkIn(oliphaunt2);<br> var oliphaunt4 = pool.checkOut();<br> var oliphaunt5 = pool.checkOut();</p><h3><em>Structural Design Pattern</em></h3><ul><li>Structural design patterns are those that simplify the design of large object structures by identifying relationships between them</li></ul><h4>Types of Structural Design Pattern</h4><p>1 . Adapter Pattern.</p><ul><li>Adapter Pattern says that just <strong>“converts the interface of a class into another interface that a client wants”</strong></li></ul><h4>Advantage</h4><ul><li>It allows two or more previously incompatible objects to interact.</li><li>It allows reusability of existing functionality.</li></ul><h4>Disadvantage</h4><ul><li>it introduces additional overhead and complexity to your code</li></ul><p>2 . Bridge Pattern.</p><ul><li>A Bridge Pattern says that just <strong>“decouple the functional abstraction from the implementation so that the two can vary independently”</strong></li></ul><h4>Advantage</h4><ul><li>It enables the separation of implementation from the interface.</li><li>It improves the extensibility.</li><li>It allows the hiding of implementation details from the client.</li></ul><h4>Disadvantage</h4><ul><li>it increases the number of classes and objects in your system</li><li>make your code more difficult to understand and manage.</li></ul><p>3 . Composite Pattern.</p><ul><li>A Composite Pattern says that just <strong>“allow clients to operate in generic manner on objects that may or may not represent a hierarchy of objects</strong></li></ul><h4>Advantage</h4><ul><li>It defines class hierarchies that contain primitive and complex objects.</li><li>It makes easier to you to add new kinds of components.</li><li>It provides flexibility of structure with manageable class or interface.</li></ul><h4>Disadvantage</h4><ul><li>all classes in the hierarchy must follow the abstract interface it can lead to overly general classes</li></ul><p>4 . Decorator Pattern.</p><ul><li>A Decorator Pattern says that just <strong>“attach a flexible additional responsibilities to an object dynamically”</strong></li></ul><h4>Advantage</h4><ul><li>It provides greater flexibility than static inheritance.</li><li>It enhances the extensibility of the object, because changes are made by coding new classes.</li><li>It simplifies the coding by allowing you to develop a series of functionality from targeted classes instead of coding all of the behavior into the object.</li></ul><h4>Disadvantage</h4><ul><li>pattern increases the complexity of the software</li></ul><p>5 . Facade Pattern.</p><ul><li>A Facade Pattern says that just <strong>“just provide a unified and simplified interface to a set of interfaces in a subsystem, therefore it hides the complexities of the subsystem from the client”</strong></li></ul><h4>Advantage</h4><ul><li>It shields the clients from the complexities of the sub-system components.</li><li>It promotes loose coupling between subsystems and its clients.</li></ul><h4>Disadvantage</h4><ul><li>it can limit the flexibility and customization of the clients.</li></ul><p>6 . Flyweight Pattern.</p><ul><li>Flyweight Pattern says that just <strong>“to reuse already existing similar kind of objects by storing them and create new object when no matching object is found”</strong>.</li></ul><h4>Advantage</h4><ul><li>It reduces the number of objects.</li><li>It reduces the amount of memory and storage devices required if the objects are persisted</li></ul><h4>Disadvantage</h4><ul><li>moving the state outside the object breaks encapsulation</li><li>less efficient than keeping the state intrinsic.</li></ul><p>7 . Proxy Pattern.</p><ul><li>Simply, proxy means an object representing another object.</li><li>According to GoF, a Proxy Pattern <strong>“provides the control for accessing the original object”</strong></li></ul><h4>Advantage</h4><ul><li>It provides the protection to the original object from the outside world.</li></ul><h4>Disadvantage</h4><ul><li>Complexity: We have to write repeated code as the proxy is similar to the actual object. …</li><li>Extra Effort: To update the application, the developer must concurrently update the proxy object alongside the real object</li></ul><h3><em>Behavioral Design Pattern</em></h3><ul><li>Behavioral design patterns are concerned with algorithms and the assignment of responsibilities between objects.</li></ul><p><strong>Types of Behavioral Design Pattern</strong></p><p>1 . Chain of Responsibility Pattern.</p><ul><li>“avoid coupling the sender of a request to its receiver by giving multiple objects a chance to handle the request”</li></ul><h4>Advantage</h4><ul><li>It reduces the coupling.</li><li>It adds flexibility while assigning the responsibilities to objects.</li><li>It allows a set of classes to act as one; events produced in one class can be sent to other handler classes with the help of composition.</li></ul><h4>Disadvantage</h4><ul><li>The request must be received not guarantee.</li><li>The performance of the system will be affected, but also in the code debugging is not easy may cause cycle call.</li><li>It may not be easy to observe the characteristics of operation, due to debug.</li></ul><p>2 . Command Pattern.</p><ul><li>“<em>encapsulate a request under an object as a command and pass it to invoker object. Invoker object looks for the appropriate object which can handle this command and pass the command to the corresponding object and that object executes the command</em>”.</li><li>It is also known as <strong>Action or Transaction.</strong></li></ul><h4>Advantage</h4><ul><li>It separates the object that invokes the operation from the object that actually performs the operation.</li><li>It makes easy to add new commands, because existing classes remain unchanged.</li></ul><h4>Disadvantage</h4><ul><li>There are a high number of classes and objects working together to achieve a goal. Application developers need to be careful developing these classes correctly.</li><li>Every individual command is a ConcreteCommand …</li></ul><p>3 . Template Pattern.</p><ul><li>“to define a representation of grammar of a given language, along with an interpreter that uses this representation to interpret sentences in the language”</li></ul><h4>Advantage</h4><ul><li>It is easier to change and extend the grammar.</li><li>Implementing the grammar is straightforward.</li></ul><h4>Disadvantage</h4><ul><li>Complexity: The pattern can become complex as the number of grammar rules increases.</li><li>Performance: Recursive traversal of the abstract syntax tree can be slow for large expressions.</li></ul><p>4 . Iterator Pattern.</p><ul><li>&quot;to access the elements of an aggregate object sequentially without exposing its underlying implementation”</li></ul><h4>Advantage</h4><ul><li>It supports variations in the traversal of a collection.</li><li>It simplifies the interface to the collection.</li></ul><h4>Disadvantage</h4><ul><li>Overhead: The Iterator pattern can introduce some overhead, especially when dealing with large collections of objects.</li></ul><p>5 . Observer Pattern.</p><ul><li>“just define a one-to-one dependency so that when one object changes state, all its dependents are notified and updated automatically”.</li></ul><h4>Advantage</h4><ul><li>It describes the coupling between the objects and the observer.</li><li>It provides the support for broadcast-type communication.</li></ul><h4>Disadvantage</h4><ul><li>successive or repeated updates to the Observers when there is a series of incremental changes to the data.</li></ul><p>6 . State Pattern.</p><ul><li>“the class behavior changes based on its state”. In State Pattern, we create objects which represent various states and a context object whose behavior varies as its state object changes</li></ul><h4>Advantage</h4><ul><li>It keeps the state-specific behavior.</li><li>It makes any state transitions explicit.</li></ul><h4>Disadvantage</h4><ul><li>requires a lot of code to be written.</li></ul><p>7 . Memento Pattern.</p><ul><li>“to restore the state of an object to its previous state”. But it must do this without violating Encapsulation. Such case is useful in case of error or failure.</li><li>The Memento pattern is also known as <strong>Token</strong>.</li></ul><h4>Advantage</h4><ul><li>It preserves encapsulation boundaries.</li><li>It simplifies the originator.</li></ul><h4>Disadvantage</h4><ul><li>The application will consume a huge amount of RAM if the user creates mementos many times.</li></ul><p>8 . Strategy Pattern.</p><ul><li>“defines a family of functionality, encapsulate each one, and make them interchangeable”.</li><li>The Strategy Pattern is also known as Policy</li></ul><h4>Advantage</h4><ul><li>It provides a substitute to subclassing.</li><li>It defines each behavior within its own class, eliminating the need for conditional statements.</li><li>It makes it easier to extend and incorporate new behavior without changing the application.</li></ul><h4>Disadvantage</h4><ul><li>The application must be aware of all the strategies to select the right one for the right situation.</li><li>Context and the Strategy classes normally communicate through the interface specified by the abstract Strategy base class.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=afcab5020131" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Amazon Aws]]></title>
            <link>https://medium.com/@kahanahamed42/amazon-aws-14a132123482?source=rss-e17344d862b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/14a132123482</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[amzon]]></category>
            <dc:creator><![CDATA[Kahanahamed]]></dc:creator>
            <pubDate>Sat, 17 Sep 2022 15:19:48 GMT</pubDate>
            <atom:updated>2022-09-17T15:19:48.871Z</atom:updated>
            <content:encoded><![CDATA[<ul><li>WS (Amazon Web Services) is a comprehensive, evolving cloud computing platform provided by Amazon that includes a mixture of infrastructure as a service (IaaS), platform as a service (PaaS) and packaged software as a service (SaaS) offerings. AWS services can offer an organization tools such as compute power, database storage and content delivery services.</li></ul><p>How aws works</p><ul><li>AWS is separated into different services; each can be configured in different ways based on the user’s needs. Users should be able to see configuration options and individual server maps for an AWS service.</li></ul><p><strong>AWS Advantages</strong></p><ol><li><strong><em>User-friendly</em></strong></li></ol><ul><li>AWS is easy to use as the platform is specially designed for quick and secure access. Users can modify their data whenever they want, wherever they wan</li></ul><p>2.<strong><em> Flexible</em></strong></p><ul><li>It always lets you use those operating systems, programming languages, and web application platforms that you are comfortable with. With a service like AWS EC2, you can build your virtual computing environment by setting up your preferable operating systems and applications</li></ul><p>3<strong>. Secure</strong></p><ul><li>Security is one of the best benefits of AWS cloud computing. As we know, security is the uppermost priority for any company that is data-driven. AWS provides a highly secure infrastructure to ensure the privacy of your data</li></ul><p>4.<strong><em> Cost-effective</em></strong></p><ul><li>If you follow traditional methods, then you should build your own servers for storing your data and applications, which consumes a good amount of both your time and money. So instead of building your own expensive servers, you can use AWS where you need to pay only for the tools and services that you use. AWS offers a pay-as-you-go pricing method, which means that a company will only pay for the services that it needs and has used for a period of time</li></ul><p>5.<strong><em> Reliable</em></strong></p><ul><li>Amazon offers the highest reliability for its customers. AWS serves over a million active clients in more than 200 nations all over the world. An ultimate team of tech professionals is working on data security</li></ul><p>6. <strong><em>Scalable and Elastic</em></strong></p><ul><li>AWS is scalable because the AWS Auto Scaling service automatically increases the capacity of constrained resources as per requirements so that the application is always available. Spinning up new servers is easy in AWS. If you want to add more servers, AWS enables you to use them within minutes.</li></ul><p>7.<strong><em> Highly Performant</em></strong></p><ul><li>High-performance computing (HPC) is the ability to process a massive amount of data at high speed. Companies find it more crucial for productivity and to compete with other companies. AWS offers a high-performance computing service so that the companies need not worry about the speed.</li></ul><p><strong><em>Disadvantages of AWS</em></strong></p><ol><li><strong><em>Limitations</em></strong></li></ol><ul><li>This comes first in the list of a few disadvantages of AWS Cloud Computing. In AWS, there are some limitations regarding EC2 and security. Companies that are using AWS will have default resources to use, but the problem comes when default resource limits vary from region to region</li></ul><p><strong><em>2.Lack of Experts</em></strong></p><ul><li>AWS is the latest invention with a complex infrastructure. Companies using AWS as their Cloud Computing platform are looking to hire professionals to work on the cloud infrastructure. However, only a few professionals are skilled in AWS or any cloud provider. Companies are ready to invest in them but are facing difficulty in finding the right professionals to work on AWS who can lead these organizations to better performance</li></ul><p><strong><em>3. Price Variations</em></strong></p><ul><li>The price of AWS services varies based on factors such as the cost of land, fiber, electricity, and taxes from region to region. Variations also occur when you need additional tech support. Developer, Business, and Enterprise are the three available packages you can choose from, and the price varies accordingly</li></ul><p>4. <strong><em>General Issues</em></strong></p><ul><li>Amazon is a huge family with millions of customers, so it has some temporary Cloud Computing issues. Users sometimes face downtime with servers. It may be because of the power loss or network connectivity with the cloud provider</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=14a132123482" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Keys in DBMS]]></title>
            <link>https://medium.com/@kahanahamed42/keys-in-dbms-aec87127035b?source=rss-e17344d862b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/aec87127035b</guid>
            <category><![CDATA[keys-in-dbms]]></category>
            <dc:creator><![CDATA[Kahanahamed]]></dc:creator>
            <pubDate>Fri, 02 Sep 2022 14:39:08 GMT</pubDate>
            <atom:updated>2022-09-02T14:39:08.262Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>A key refers to an attribute/a set of attributes that help us identify a row (or tuple) uniquely in a table (or relation)</strong>.</p><p>* A key is also used when we want to establish relationships between the different columns and tables of a relational database.</p><p><strong>What are the different types of Keys in DBMS?</strong></p><ol><li>Primary Key</li><li>Foreign Key</li><li>Super Key</li><li>Alternate Key</li><li>Composite Key</li><li>Unique Key</li><li>Candidate Key</li></ol><h3>Primary Key</h3><ul><li>The primary key refers to a column or a set of columns of a table that helps us identify all the records uniquely present in that table. A table can consist of just one primary key. Also, this primary key cannot consist of the same values reappearing/repeating for any of its rows. All the values of a primary key have to be different, and there should be no repetitions.</li><li>The PK (PRIMARY KEY) constraint that we put on a column/set of columns won’t allow these to have a null value or a duplicate. Any table can consist of only a single primary key constraint. A foreign key (explained below) that refers to it can never change the values present in the primary key.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/285/1*qf0FhgtMOvtdp5OhnhyxPg.png" /></figure><h3>Foreign Key</h3><ul><li>We use a foreign key to establish relationships between two available tables. The foreign key would require every value present in a column/set of columns to match the referential table’s primary key. A foreign key helps us to maintain data as well as referential integrity.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/441/1*gRRm8N7aBy4osixwrRZqTA.png" /><figcaption>Foreign Key</figcaption></figure><h3>Super Key</h3><ul><li>A super key refers to the set of all those keys that help us uniquely identify all the rows present in a table. It means that all of these columns present in a table that can identify the columns of that table uniquely act as the super keys.</li><li>A super key is a candidate key’s superset (candidate key has been explained below). We need to pick the primary key of any table from the super key’s set so as to make it the table’s identity attribute.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*_AcZWZ1kR4Js9IKDE4lYCQ.png" /></figure><h3>Alternate Key</h3><ul><li>we have stated above, any table can consist of multiple choices for the primary key. But, it can only choose one. Thus, all those keys that did not become a primary key are known as alternate keys.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*_T5y4zF6XUjQ0K8cLPfwsA.png" /></figure><h3>Composite Key</h3><ul><li>The composite key refers to a set of multiple attributes that help us uniquely identify every tuple present in a table. The attributes present in a set may not be unique whenever we consider them separately. Thus, when we take them all together, it will ensure total uniqueness.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/499/1*94bYNcF1h3fblvy1Vlcq-A.jpeg" /></figure><h3>Unique Key</h3><ul><li>A unique key refers to a column/a set of columns that identify every record uniquely in a table. All the values in this key would have to be unique. Remember that a unique key is different from a primary key. It is because it is only capable of having one null value. A primary key, on the other hand, cannot have a null value.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/324/1*9uS8yAE4gvoifxnHcg8zDA.png" /></figure><h3>Candidate Key</h3><ul><li>The candidate keys refer to those attributes that identify rows uniquely in a table. In a table, we select the primary key from a candidate key. Thus, a candidate key has similar properties as that of the primary keys that we have explained above. In a table, there can be multiple candidate keys.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*_Ko_BOdAB1by5AohBZPFOA.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aec87127035b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Evaluation of DBMS]]></title>
            <link>https://medium.com/@kahanahamed42/evaluation-of-dbms-59866c2791bb?source=rss-e17344d862b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/59866c2791bb</guid>
            <category><![CDATA[evaluation]]></category>
            <category><![CDATA[dbms]]></category>
            <dc:creator><![CDATA[Kahanahamed]]></dc:creator>
            <pubDate>Thu, 21 Jul 2022 12:41:42 GMT</pubDate>
            <atom:updated>2022-07-21T12:41:42.346Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>DBMS is a structured system of collection of programs that enable users to create and maintain a data base and interfaces with the various users as data base administrator, online users, application programmers and naive users.</blockquote><blockquote><strong>T</strong>he controlled integration of data, so as to avoid the inefficiency and inconsistency of duplicated data</blockquote><blockquote>The separation of physical data storage from the logic of the applications using the data, to aid flexibility and ease of change in a dynamic environment</blockquote><blockquote>A single control of all data, permitting controlled concurrent use by a number of independent on-line users</blockquote><blockquote>Provision for complex file structures and access paths, such that relevant relationships between data units can be readily expressed and data can be retrieved most efficiently for a variety of applications</blockquote><blockquote>Generalized facilities for the rapid storage, modification, reorganization, analysis and retrieval of data, so that the use of a database system imposes no restrictions upon the user.</blockquote><blockquote>Privacy controls to prevent unauthorized access to specific units of data, types of data or combinations of data.</blockquote><blockquote>Integrity controls to prevent misuse or corruption of stored data, and facilities to provide complete reconstruction in the event of hardware or software failure.</blockquote><blockquote>Performance, both in a batch mode and on-line, that is consistent, measurable, and capable of being optimized.</blockquote><blockquote>Compatibility with major programming language, existing source programs, a variety of hardware systems and operating systems, and data external to the database</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59866c2791bb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[File system vs DBMS]]></title>
            <link>https://medium.com/@kahanahamed42/file-system-vs-dbms-ee17b853ce2?source=rss-e17344d862b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee17b853ce2</guid>
            <category><![CDATA[filesystem]]></category>
            <category><![CDATA[dbms]]></category>
            <dc:creator><![CDATA[Kahanahamed]]></dc:creator>
            <pubDate>Thu, 07 Jul 2022 05:07:47 GMT</pubDate>
            <atom:updated>2022-07-07T05:09:10.603Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Let see what is File system and DBMS ?</blockquote><h4><strong>* A file system is a process that manages how and where data on a storage disk, typically a hard disk drive (HDD), is stored, accessed and managed</strong></h4><ul><li>It is a logical disk component that manages a disk’s internal operations as it relates to a computer and is abstract to a human user</li></ul><h4>=&gt; some File SYSTEM examples</h4><ul><li><strong>NTFS</strong></li></ul><figure><img alt="NTFS" src="https://cdn-images-1.medium.com/max/378/1*s0iDeYDVx7ivE_0RRfCRQQ.png" /></figure><ul><li><strong>FAT</strong></li><li><strong>GFS</strong></li><li><strong>HFS</strong></li><li><strong>UDF</strong></li></ul><h4><strong>* Database Management Systems (DBMS) are software systems used to store, retrieve, and run queries on data</strong></h4><ul><li>A DBMS serves as an interface between an end-user and a database, allowing users to create, read, update, and delete data in the database.</li></ul><p><strong>=&gt; Four types of database management systems</strong></p><ul><li>hierarchical database systems</li></ul><figure><img alt="hierarchical database systems" src="https://cdn-images-1.medium.com/max/720/1*8HoxRmZCMopw6rcxrQ61tw.jpeg" /></figure><ul><li>network database systems</li></ul><figure><img alt="network database systems" src="https://cdn-images-1.medium.com/max/1024/1*LYCVFfkLGJz2v7UKSLjTEg.png" /></figure><ul><li>object-oriented database systems</li></ul><figure><img alt="object-oriented database systems" src="https://cdn-images-1.medium.com/max/267/1*zcRYS9VB5uM1DFithccTcQ.png" /></figure><ul><li>relational database management system</li></ul><figure><img alt="relational database management system" src="https://cdn-images-1.medium.com/max/635/1*Lxl7N3fmV5p3vyUCbU6MpA.gif" /></figure><h4><strong>=&gt; some examples of DBMS</strong></h4><ul><li><strong>MySQL</strong></li><li><strong>SQL Server</strong></li><li><strong>MongoDB</strong></li><li><strong>Oracle Database</strong></li></ul><h3>Let see Difference between File system vs DBMS</h3><h4>* File system</h4><p>The file system is software that manages and organizes the files in a storage medium within a computer.</p><h4>*DBMS</h4><p>DBMS is software for managing the database.</p><h4>* File system</h4><p>Redundant data can be present in a file system.</p><h4>*DBMS</h4><p>In DBMS there is no redundant data.</p><h4>* File system</h4><p>It doesn’t provide backup and recovery of data if it is lost.</p><h4>*DBMS</h4><p>It provides backup and recovery of data even if it is lost.</p><h4>* File system</h4><p>There is no efficient query processing in the file system.</p><h4>*DBMS</h4><p>Efficient query processing is there in DBMS.</p><h4>* File system</h4><p>There is less data consistency in the file system.</p><h4>*DBMS</h4><p>There is more data consistency because of the process of normalization.</p><h4>* File system</h4><p>It is less complex as compared to DBMS.</p><h4>*DBMS</h4><p>It has more complexity in handling as compared to the file system.</p><h4>* File system</h4><p>File systems provide less security in comparison to DBMS.</p><h4>*DBMS</h4><p>DBMS has more security mechanisms as compared to file systems.</p><h4>* File system</h4><p>It is less expensive than DBMS.</p><h4>*DBMS</h4><p>It has a comparatively higher cost than a file system.</p><h4>* File system</h4><p>There is no data independence.</p><h4>*DBMS</h4><p>In DBMS data independence exists.</p><h4>* File system</h4><p>Only one user can access data at a time.</p><h4>*DBMS</h4><p>Multiple users can access data at a time.</p><h4>* File system</h4><p>The user has to write procedures for managing databases</p><h4>*DBMS</h4><p>The user not required to write procedures.</p><h4>* File system</h4><p>Data is distributed in many files. So, not easy to share data</p><h4>*DBMS</h4><p>Due to centralized nature sharing is easy</p><h4>* File system</h4><p>It give details of storage and representation of data</p><h4>*DBMS</h4><p>It hides the internal details of Database</p><h4>* File system</h4><p>Integrity Constraints are difficult to implement</p><h4>*DBMS</h4><p>Integrity constraints are easy to implement</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee17b853ce2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>