G
GuideDevOps
Lesson 12 of 12

Monitoring & Multi-Cloud Strategies

Part of the Cloud Computing tutorial series.

Why Multi-Cloud?

Vendor Lock-In Risk

Single Cloud Problem:

  • Proprietary APIs (AWS Lambda, Azure Functions)
  • Difficult to migrate workloads
  • Negotiating power limited
  • Single point of failure

Multi-Cloud Benefits

πŸ“„ Flexibility: Move workloads based on cost/performance πŸ’° Negotiating Power: Play providers against each other πŸ”„ Resilience: Not dependent on single provider πŸš€ Optimization: Use best service from each cloud πŸ“‘ Compliance: Meet regional data residency laws


Multi-Cloud Challenges

❌ Complexity: Multiple login portals, billing, support ❌ Skills Gap: Need expertise across all platforms ❌ Cost: Potential inefficiencies, duplicate resources ❌ Data Movement: Moving data between clouds costs money ❌ Operational Overhead: Multiple monitoring systems


Common Multi-Cloud Architectures

1. Active-Active (Truly Distributed)

     Internet
        ⬆️
        β”‚
    DNS Router
   /    |    \
  AWS  Azure  GCP
  API   API   API

Pros: True redundancy, lowest latency Cons: Most complex, data sync challenges

2. Active-Passive (Hot-Standby)

     Internet
        ⬆️
        β”‚
    AWS (Primary)
        β”‚
        πŸ”„ (Replicates to)
        β”‚
    Azure (Standby)

Pros: Simpler, handles primary failure Cons: Unused resources in passive, RTO is non-zero

3. Service-Based (Different services per cloud)

Web Tier:       AWS (CDN + ALB)
App Tier:       Azure (App Service)
Database:       GCP (Cloud SQL)
Analytics:      GCP (BigQuery)

Pros: Uses each cloud's strengths Cons: Complex integrations, data flow management


Container Orchestration (Cloud-Agnostic)

Kubernetes

Run same workload on any cloud

# Deploy on AWS EKS
kubectl create deployment app --image=myapp:latest
kubectl expose deployment app --port=80
 
# Same deployment works on:
# - Azure AKS
# - GCP GKE
# - On-premise Kubernetes

Docker

FROM python:3.9
COPY app.py .
CMD ["python", "app.py"]

Runs identically on any Docker-compatible platform.


Infrastructure as Code (IaC)

Manage resources across clouds with same tool

Terraform (Cloud-Agnostic)

# AWS provider
provider "aws" {
  region = "us-east-1"
}
 
# Deploy EC2
resource "aws_instance" "web" {
  ami           = "ami-0c55b159cbfafe1f0"
  instance_type = "t2.micro"
}
 
# Azure provider
provider "azurerm" {
  features {}
}
 
# Deploy VM
resource "azurerm_virtual_machine" "web" {
  name                  = "web-vm"
  location              = "East US"
  resource_group_name   = azurerm_resource_group.example.name
  vm_size               = "Standard_B1s"
}
terraform init
terraform plan   # Show what will be created
terraform apply  # Create resources
terraform destroy  # Delete resources

CloudFormation (AWS-specific)

AWSTemplateFormatVersion: '2010-09-09'
Resources:
  MyEC2Instance:
    Type: AWS::EC2::Instance
    Properties:
      ImageId: ami-0c55b159cbfafe1f0
      InstanceType: t2.micro

ARM Templates (Azure-specific)

{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "resources": [{
    "type": "Microsoft.Compute/virtualMachines",
    "apiVersion": "2021-03-01",
    "name": "myVM"
  }]
}

Data Portability

Use Open Standards

βœ… PostgreSQL (not Amazon Aurora) βœ… RabbitMQ/Kafka (not AWS SQS) βœ… Redis (not AWS ElastiCache proprietary) βœ… Object storage with S3 API (not Azure Blob proprietary) βœ… Kubernetes (not AWS ECS proprietary) ❌ Avoid proprietary APIs/services

Data Migration Challenges

# AWS to Azure S3 to copy data
 
# Download from AWS
aws s3 sync s3://aws-bucket ./data
 
# Upload to Azure
az storage blob upload-batch --source ./data --destination mycontainer
 
# Cost: $0.02/GB for AWS data egress
# Example: 100 GB = $2,000 one-time cost

Cost Arbitrage

Use cheapest cloud for each workload

Compute pricing comparison:
AWS t2.large:    $0.094/hour
Azure B2s:       $0.096/hour
GCP n1-standard: $0.0475/hour (-50%!)

# Run compute jobs on GCP, save 50%

Strategy

  1. Benchmark - Test same workload on all 3
  2. Measure - Compare costs, performance, latency
  3. Automate - Route workloads to cheapest cloud
  4. Monitor - Prices change quarterly

Multi-Cloud Deployments

AWS + Azure Hybrid

# Azure Arc: Manage AWS and on-prem resources from Azure portal
 
# Connect AWS EC2 to Azure Arc
az connectedmachine create --name aws-instance --machine-name myec2 \
  --resource-group myRG

GitOps (Multi-Cloud)

# ArgoCD can deploy to any Kubernetes cluster
spec:
  source:
    repoURL: https://github.com/myorg/infra
    path: k8s/
  destination:
    server: https://eks.aws.com  # or gke.gcp.com or aks.azure.com

Best Practices

βœ… Use Terraform for infrastructure (works everywhere) βœ… Use Kubernetes for workloads (cloud-agnostic) βœ… Use open standards (PostgreSQL not RDS MySQL) βœ… Monitor and compare costs across clouds βœ… Plan for data egress costs βœ… Document architecture and dependencies βœ… Regular disaster recovery tests βœ… Don’t over-engineer early - start concentrated, then diversify

❌ Don’t use too many clouds initially (operational burden) ❌ Don’t assume multi-cloud is always cheaper ❌ Don’t use proprietary services across clouds ❌ Don’t forget compliance requirements per region


Reality Check

Most organizations don't need true multi-cloud:

Single Cloud is fine if:

  • Small/medium workload
  • No compliance requirements
  • Not mission-critical
  • Team understands one cloud well

Multi-Cloud makes sense if:

  • Very large scale (Netflix level)
  • Mission-critical apps
  • Regulatory requirements
  • Cost optimization critical
  • Want to avoid lock-in