Choosing a Cloud: AWS vs GCP vs Azure vs Open Source

System Design · Production in the Cloud · Advanced · 15 min

The same building blocks with different names, and how to pick.

Four hardware stores selling the same hammers under different brand names. You don't pick the shop with the cheapest hammer on the shelf; you add the price tag to the hours you'll spend learning the aisles and fixing what you bought, then choose.

The idea in everyday words

AWS, Google Cloud and Azure are like three huge hardware stores. They all sell hammers, nails and paint, just with different brand names and prices. Open source is building your own tools: cheaper per item, but you do the maintenance.

How to choose (the honest answer)

  • AWS: biggest catalogue, most jobs and docs. A safe default.
  • GCP: strong in data and analytics (BigQuery), Kubernetes (GKE) and AI (Vertex AI, TPUs).
  • Azure: a natural fit if the company already runs on Microsoft (Entra ID, Microsoft 365, .NET), and for OpenAI models through Azure.
  • Open source / self-hosted (Kubernetes, Postgres, Kafka, Valkey/Redis on any VM): avoids vendor lock-in and can be cheaper at large, steady scale, but means much more ops work.

Decision checklist

  1. What does the team already know?
  2. Compliance / region requirements?
  3. Managed service vs ops cost trade-off.
  4. Special needs (AI chips, analytics, Microsoft stack).
  5. Pricing & credits.

In interviews: say "I'd use a managed queue such as SQS, or Pub/Sub on GCP" to show you know the concepts, not just one vendor.

Go deeper (senior / staff)

Lock-in is a spectrum. Postgres on RDS is easy to leave; a design built on DynamoDB Streams, Step Functions and IAM policies is not. The senior answer: accept lock-in where a managed service saves the most ops time (databases, queues, identity), and keep cheap portable seams elsewhere (containers, OpenTelemetry, Terraform, standard SQL).

Data gravity and egress. Moving compute is easy; moving petabytes is slow and billed. Data transfer into AWS is generally free, but transfer out to the internet or another cloud costs money. A multi-cloud design that calls across providers on the hot path pays latency and egress on every request. If you need a second provider, give it a separable workload (analytics, a DR copy), not half of a request path.

Failure domains. Most outages hit one service or one Region, so multi-AZ, then multi-region on one provider, buys most of the resilience. Multi-cloud for availability means duplicating identity, networking, deployment pipelines and on-call skills for two platforms. Justify it with a regulator, a contract or a concrete risk, not a hunch.

Cost reasoning. Compare total cost: bill + people + risk + migration effort. Commitments (Savings Plans, Reserved Instances), Spot for interruptible work and Graviton (Arm) instances often move the bill more than switching providers would. Use the AWS Pricing Calculator for real numbers.

Governance at scale. AWS Organizations with SCPs (deny unused Regions, protect audit logs), a Control Tower landing zone and one account per team or environment limit the blast radius of mistakes. GCP (folders and organization policies) and Azure (management groups and Azure Policy) have the same idea.

Step by step

  1. Compute:

    EC2 / Compute Engine / Azure VMs / any Linux VM.

  2. Serverless:

    Lambda / Cloud Functions / Azure Functions / OpenFaaS.

  3. Containers:

    EKS / GKE / AKS / plain Kubernetes.

  4. Storage:

    S3 / Cloud Storage / Blob Storage / MinIO.

  5. Pick:

    Match to team skills, cost and special needs.

Code example

costs = {"aws": 120, "gcp": 110, "azure": 125, "self-hosted": 90}
ops_hours = {"aws": 2, "gcp": 2, "azure": 2, "self-hosted": 20}
hourly_rate = 5
total = {k: costs[k] + ops_hours[k] * hourly_rate for k in costs}
print(total)
print("best:", min(total, key=total.get))

Interview tips

  • Know at least the AWS names: EC2, S3, RDS, DynamoDB, SQS, Lambda, CloudFront, ElastiCache.

  • Total cost = bill + people time.

  • Say why, not just what: 'GCP because we need BigQuery for analytics.'

Challenge: Cheapest Provider

Given a dict/object of monthly costs per provider and ops_hours per provider, plus an hourly_rate, return the provider name with the lowest total = cost + ops_hours × hourly_rate. (Assume no ties.)

Example: cheapest({"aws":100,"diy":60}, {"aws":1,"diy":10}, 5) → "aws"

Solve it in the browser with tests, hints and an AI coach.

Practice problems

More in Production in the Cloud

Previous: AWS Well-Architected & Cost Optimization · Next: Interview Walkthrough: URL Shortener