<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Rahul Nagpure</title>
    <description>The latest articles on DEV Community by Rahul Nagpure (@rahulnagpure).</description>
    <link>https://dev.to/rahulnagpure</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1007428%2F11800817-0bc6-4ca7-90d3-be03156c6063.png</url>
      <title>DEV Community: Rahul Nagpure</title>
      <link>https://dev.to/rahulnagpure</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rahulnagpure"/>
    <language>en</language>
    <item>
      <title>Multi-Cloud Architecture with AWS and GCP</title>
      <dc:creator>Rahul Nagpure</dc:creator>
      <pubDate>Sun, 12 Feb 2023 06:53:51 +0000</pubDate>
      <link>https://dev.to/rahulnagpure/multi-cloud-architecture-with-aws-and-gcp-2k33</link>
      <guid>https://dev.to/rahulnagpure/multi-cloud-architecture-with-aws-and-gcp-2k33</guid>
      <description>&lt;p&gt;In recent years, cloud computing has become increasingly popular as a way for organizations to run their applications and workloads. The benefits of cloud computing include reduced costs, improved scalability and flexibility, and the ability to quickly deploy new services and applications. However, many organizations have found that relying on a single cloud provider can limit their options and lead to vendor lock-in. That's why more and more organizations are turning to multicloud architecture as a way to run their applications on multiple cloud platforms.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Multicloud Architecture?
&lt;/h2&gt;

&lt;p&gt;Multicloud architecture refers to the use of multiple cloud computing platforms by an organization to run their applications and workloads. A multicloud architecture can include a combination of public clouds, such as Amazon Web Services (AWS) and Google Cloud Platform (GCP), as well as private clouds and on-premise infrastructure.&lt;/p&gt;

&lt;p&gt;In a multicloud architecture, each cloud platform is selected for specific workloads based on factors such as cost, performance, security, and compliance requirements. For example, an organization might choose to use AWS for running web applications, GCP for big data processing, and a private cloud for sensitive data that requires strict security and compliance controls.&lt;/p&gt;

&lt;h2&gt;
  
  
  Advantages of Multicloud Architecture
&lt;/h2&gt;

&lt;p&gt;Multicloud architecture provides organizations with several key advantages over relying on a single cloud provider. These advantages include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Flexibility&lt;/strong&gt;: By using multiple cloud platforms, organizations can choose the best solution for each workload based on their specific requirements. This allows organizations to quickly and easily deploy new services and applications, and to scale their infrastructure as needed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost optimization&lt;/strong&gt;: Multicloud architecture allows organizations to take advantage of the cost benefits of each cloud platform, optimizing their costs by choosing the most cost-effective platform for each workload.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Improved resilience&lt;/strong&gt;: With a multicloud architecture, organizations can distribute their workloads across multiple platforms, reducing the risk of downtime due to a single point of failure.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Avoiding vendor lock-in&lt;/strong&gt;: By using multiple cloud platforms, organizations can avoid becoming dependent on a single vendor, reducing the risk of vendor lock-in and increasing their bargaining power.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Challenges of Multicloud Architecture
&lt;/h2&gt;

&lt;p&gt;While multicloud architecture provides several key benefits, it also comes with its own set of challenges. These challenges include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Complexity&lt;/strong&gt;: Managing multiple cloud platforms can be complex and time-consuming, requiring specialized skills and expertise.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Interoperability&lt;/strong&gt;: Ensuring that applications and workloads can be moved between different cloud platforms can be challenging, requiring specialized tools and technologies.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security&lt;/strong&gt;: Ensuring the security of data and applications across multiple cloud platforms can be challenging, requiring the implementation of specialized security controls and processes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost&lt;/strong&gt;: Implementing a multicloud architecture can be more expensive than relying on a single cloud provider, as organizations need to manage multiple contracts, billing systems, and support arrangements.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are several AWS and GCP services that can be configured together to build a multicloud architecture. Some of the most common configurations include:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Cross-cloud Load Balancing:&lt;/strong&gt;&lt;br&gt;
To configure cross-cloud load balancing, you need to create an AWS Application Load Balancer (ALB) and a GCP Network Load Balancer (NLB). You then need to create a load balancer rule in each cloud that directs traffic to the appropriate instances. To route traffic between the two clouds, you need to set up a VPN connection or a Direct Connect link between AWS and GCP.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Cross-cloud Storage:&lt;/strong&gt;&lt;br&gt;
To configure cross-cloud storage, you need to create an AWS Simple Storage Service (S3) bucket and a GCP Cloud Storage bucket. You can then use tools like Amazon S3 Transfer Acceleration or Cloud Storage Transfer Service to transfer data between the two clouds. You can also mount the S3 bucket as a file system in GCP or use the Cloud Storage Interoperability API to access the data in the S3 bucket from GCP.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Cross-cloud Databases:&lt;/strong&gt;&lt;br&gt;
To configure cross-cloud databases, you need to create an AWS Relational Database Service (RDS) instance and a GCP Cloud SQL instance. You can then set up a VPN connection or a Direct Connect link between AWS and GCP to allow the instances to communicate with each other. You can also use database replication to replicate data between the two instances.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Cross-cloud Networking:&lt;/strong&gt;&lt;br&gt;
To configure cross-cloud networking, you need to create an AWS Virtual Private Cloud (VPC) and a GCP Virtual Private Cloud (VPC). You then need to set up a VPN connection or a Direct Connect link between the two clouds to allow communication between the VPCs. You can also use VPC peering to allow the VPCs to communicate with each other directly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Cross-cloud Containers:&lt;/strong&gt;&lt;br&gt;
To configure cross-cloud containers, you need to create an AWS Elastic Container Service (ECS) cluster and a GCP Kubernetes Engine (GKE) cluster. You can then use a managed Kubernetes service like Amazon EKS or Google Anthos to run and manage containers in both AWS and GCP. You can also use tools like AWS App Mesh or Google Istio to manage microservices in a multicloud environment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Cross-cloud Big Data:&lt;/strong&gt;&lt;br&gt;
To configure cross-cloud big data, you need to create an AWS Elastic MapReduce (EMR) cluster and a GCP Cloud Dataproc cluster. You can then use a managed big data service like Amazon EMR or Google Cloud Dataproc to process and analyze large data sets in both AWS and GCP. You can also use tools like Amazon S3 or Google Cloud Storage to store and manage data in both clouds.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Cross-cloud Machine Learning:&lt;/strong&gt;&lt;br&gt;
To configure cross-cloud machine learning, you need to create an AWS SageMaker workspace and a GCP AI Platform workspace. You can then use a managed machine learning service like Amazon SageMaker or Google AI Platform to build and deploy machine learning models in both AWS and GCP. You can also use tools like Amazon S3 or Google Cloud Storage to store and manage data in both clouds.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Multicloud architecture is an increasingly popular way for organizations to run their applications and workloads, offering greater flexibility, cost optimization, improved resilience, and vendor independence. While implementing a multicloud architecture can be challenging, the benefits are clear, and organizations that take the time to develop a well-designed multicloud architecture will be well positioned to take advantage of the benefits of cloud computing in the years to come.&lt;/p&gt;

</description>
      <category>security</category>
      <category>discuss</category>
      <category>systemdesign</category>
    </item>
    <item>
      <title>Automatic failover for legacy multi-port application on AWS Cloud</title>
      <dc:creator>Rahul Nagpure</dc:creator>
      <pubDate>Mon, 16 Jan 2023 12:18:48 +0000</pubDate>
      <link>https://dev.to/rahulnagpure/automatic-failover-for-legacy-multi-port-application-on-aws-cloud-3bm0</link>
      <guid>https://dev.to/rahulnagpure/automatic-failover-for-legacy-multi-port-application-on-aws-cloud-3bm0</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Clients are implementing migration strategies to transition their legacy systems to cloud and are seeking active-failover solutions for their monolithic applications that operate on multiple ports and are not compatible with load balancing mechanisms.&lt;/p&gt;

&lt;p&gt;This blog shows a way to build a low-cost active-failover for monolithic, multi-port internal applications using Route53 and CloudWatch. This is only for the application running on multiple ports and wants to failover if any one of the ports goes down.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;An AWS account with console access administrative previlages&lt;/li&gt;
&lt;li&gt;Route53 Private Hosted zone and Health Check&lt;/li&gt;
&lt;li&gt;CloudWatch Metrics&lt;/li&gt;
&lt;li&gt;Linux EC2 Instances.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Understanding overall design
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Internal users connect to legacy application running on AWS cloud.&lt;/li&gt;
&lt;li&gt;Application has configured in a way to send all traffic to only primary server. &lt;/li&gt;
&lt;li&gt;One small lightweight shell script monitors all running ports inside the primary server and update CloudWatch metrics. &lt;/li&gt;
&lt;li&gt;If any one of the ports goes down, CloudWatch alarm will be triggered and Route53 will re-route whole traffic to secondary server in next 5 minutes.&lt;/li&gt;
&lt;li&gt;Once the primary server start working again, Route53 will route whole traffic back to primary server.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;h2&gt;
  
  
  Server and Simple Shell script
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Create IAM Role to update the CloudWatch Metrics&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Primary server must have permission to update the CloudWatch to generate the metrics. &lt;/li&gt;
&lt;li&gt;You may need at least following permissions.&lt;/li&gt;
&lt;li&gt;Assign this role to your servers.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{

    "Version": "2012-10-17",

    "Statement": [

        {

            "Sid": "VisualEditor0",

            "Effect": "Allow",

            "Action": "cloudwatch:PutMetricData",

            "Resource": "*"

        }

    ]

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Put the following shell script in root user crontab in the server.
Change the instance ID and Ports according to your configuration in the script.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash

for port in "22" "25" "8080" "80"

do

lsof -i:"$port"  -P | grep IPv4  | grep LISTEN &amp;gt; /dev/null

if [ $? -eq 1 ]; then

   echo "$port is not listening"

   exit

fi

done

aws cloudwatch put-metric-data --metric-name Drives-health --dimensions Instance=i-066111111111100a66 --namespace "Custom" --value 1 --profile &amp;lt;default&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;CloudWatch Alarm configuration&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Shell script will sends health check in form of binary value "1" to the CloudWatch.
&lt;/li&gt;
&lt;li&gt;CloudWatch will generate metric based on health-check data.
&lt;/li&gt;
&lt;li&gt;Configure a CloudWatch alarm with following conditions and send notification to desired SNS topic.&lt;/li&gt;
&lt;/ol&gt;

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

&lt;h2&gt;
  
  
  Section3:Route53 and Health Checks
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Route53 Health Checks&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Create route53 health-check &lt;/li&gt;
&lt;li&gt;Select "state of monitoring alarm"&lt;/li&gt;
&lt;li&gt;Select CloudWatch alarm created in privious step&lt;/li&gt;
&lt;li&gt;Route53 will monitor CloudWatch alarm with this health-check service.&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Route53 DNS Records&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Create A record for your application with failover routing policy. &lt;/li&gt;
&lt;li&gt;While creating primary failover record type, make sure to select health check ID which is created in previous step.&lt;/li&gt;
&lt;li&gt;Do not select any Health check ID while creating failover record type.&lt;/li&gt;
&lt;/ol&gt;

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

&lt;h2&gt;
  
  
  Testing
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Access A record url from your browser and check the server receiving the incoming requests.&lt;/li&gt;
&lt;li&gt;Stop any one of the port on primary server, wait for minumum five minutes and access url again. &lt;/li&gt;
&lt;li&gt;All request should route to secondary server. &lt;/li&gt;
&lt;li&gt;You can failback to primary server by starting the stopped port.&lt;/li&gt;
&lt;/ol&gt;

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

&lt;p&gt;This pattern is for legacy monolithic applications those do not support load balancer and running on multiple ports. I have given very simple method to set up this application which can easily failvoer within five minutes without any AWS load balancer.&lt;/p&gt;

</description>
      <category>go</category>
      <category>devto</category>
      <category>discuss</category>
    </item>
  </channel>
</rss>
