Ojasa Mirai

Ojasa Mirai

Cloud

Loading...

Learning Level

🟢 Beginner🔵 Advanced
⚙️ Compute Services⚡ Serverless Functions🗄️ SQL Database Services📊 NoSQL Database Services📁 Storage Services🌐 Networking Services⚖️ Load Balancing Services🚀 CDN Services🔐 Security & Auth Services📊 Monitoring & Logging Services📬 Message Queue Services🔌 API Gateway Services🐳 Container Orchestration💾 Caching Services🌐 Domain & DNS Services💾 Backup & Recovery Services
Cloud/Cloud Concepts Comparison/Database Services

🗄️ SQL Database Services - Provider Comparison

Introduction

Relational databases are fundamental to most applications. Each provider offers fully managed SQL databases with automatic backups, replication, and scaling.

Quick Comparison

AspectAWSGCPAzure
ServiceRDSCloud SQLSQL Database
EnginesMySQL, PostgreSQL, MariaDB, Oracle, SQL ServerMySQL, PostgreSQL, SQL ServerSQL Server, MySQL, MariaDB
Fully ManagedYesYesYes
Auto BackupsYesYesYes
Auto ScalingRead replicasStorage autoscaleElastic pools
Multi-AZYesHigh availabilityGeographic replication

AWS RDS (Relational Database Service)

Creating a MySQL Database

aws rds create-db-instance \
  --db-instance-identifier my-database \
  --db-instance-class db.t3.micro \
  --engine mysql \
  --master-username admin \
  --master-user-password mypassword \
  --allocated-storage 20

Pricing

  • **db.t3.micro:** $0.017/hour (~$12/month)
  • **Multi-AZ:** 1.5x cost (for high availability)
  • **Storage:** $0.23 per GB/month
  • **Backups:** $0.095 per GB/month

Features

  • 5+ database engines
  • Read replicas for scaling
  • Automated backups (35 days retention)
  • Automatic failover with Multi-AZ
  • Performance Insights

Connection Example

const mysql = require('mysql2/promise');

const connection = await mysql.createConnection({
  host: 'mydb.c9akciq32.us-east-1.rds.amazonaws.com',
  user: 'admin',
  password: 'mypassword',
  database: 'mydatabase'
});

const [rows] = await connection.execute('SELECT * FROM users');
console.log(rows);

GCP Cloud SQL

Creating a PostgreSQL Database

gcloud sql instances create my-database \
  --database-version POSTGRES_13 \
  --tier db-f1-micro \
  --region us-central1

Pricing

  • **db-f1-micro:** $0.028/hour (~$20/month)
  • **Storage:** $0.18 per GB/month
  • **Backups:** Included

Features

  • MySQL, PostgreSQL, SQL Server
  • Automatic storage increase
  • High availability (regional)
  • Integrated backups
  • Simple replication setup

Connection Example

const { Pool } = require('pg');

const pool = new Pool({
  host: '35.192.123.45',
  user: 'postgres',
  password: 'mypassword',
  database: 'mydatabase'
});

const result = await pool.query('SELECT * FROM users');
console.log(result.rows);

Azure SQL Database

Creating a SQL Database

az sql db create \
  --resource-group myResourceGroup \
  --server myServer \
  --name myDatabase \
  --service-objective S0

Pricing

  • **S0 (Basic):** $5/month
  • **S1 (Standard):** $30/month
  • **P1 (Premium):** $200+/month

Features

  • SQL Server, MySQL, MariaDB
  • Elastic pools for multi-tenant
  • Geo-replication
  • Advanced threat protection
  • Built-in performance tuning

Connection Example

const sql = require('mssql');

const config = {
  server: 'myserver.database.windows.net',
  authentication: {
    type: 'default',
    options: {
      userName: 'sqladmin',
      password: 'mypassword'
    }
  },
  options: {
    database: 'mydatabase'
  }
};

const pool = new sql.ConnectionPool(config);
await pool.connect();
const result = await pool.request().query('SELECT * FROM users');

Comparison Table

FeatureAWS RDSGCP Cloud SQLAzure SQL
Engines5+33
Min Cost$12/mo$20/mo$5/mo
Auto BackupYesYesYes
ReplicationRead replicasHigh availabilityGeo-replication
FailoverAutomatic (Multi-AZ)AutomaticAutomatic
Connection PoolRDS ProxyCloud SQL ProxyElastic pools

Key Features Comparison

High Availability

AWS: Multi-AZ (synchronous replication, automatic failover)

GCP: High availability (one standby replica)

Azure: Zone redundancy (across availability zones)

Backups

AWS: Automated daily + on-demand snapshots

GCP: Automated backups (automatic retention)

Azure: Automated backups (configurable retention)

Scaling

AWS: Read replicas + manual vertical scaling

GCP: Automatic storage scaling + manual compute scaling

Azure: Elastic pools for multi-tenant + vertical scaling

Common Patterns

Read Scaling

Write to Primary → Read Replicas
AWS: Read replicas in any region
GCP: Regional read replicas
Azure: Read-only replicas

High Availability

Primary DB (Primary Region)
    ↓
Standby DB (Automatic Failover)
    ↓
Backup Storage (Multi-region)

Cost Optimization

1. Use smaller instances: Most apps don't need large DBs

2. Enable automatic scaling: Store only what you need

3. Configure appropriate backups: Don't over-backup

4. Use read replicas smartly: Only when needed

5. Right-size instances: Monitor and adjust

Migration Considerations

AWS RDS: Best if already on AWS

GCP Cloud SQL: Best if using Google Cloud

Azure SQL: Best if using Microsoft stack

Can migrate between providers using:

  • Database Migration Service (DMS)
  • Third-party tools (Sequel Pro, DbSchema)
  • Custom scripts with data exports

Decision Guide

Use AWS RDS if:

  • Already using AWS ecosystem
  • Need Oracle database
  • Want mature, feature-rich service

Use GCP Cloud SQL if:

  • Using Google Cloud services
  • Want simpler pricing model
  • Need automatic storage scaling

Use Azure SQL if:

  • Using Microsoft technologies (C#, .NET)
  • Need SQL Server specifically
  • Want competitive pricing

Key Takeaways

  • **All three offer fully managed databases** with automatic backups
  • **AWS RDS most mature** with most engine options
  • **GCP Cloud SQL simplest** pricing and storage scaling
  • **Azure SQL best value** for SQL Server workloads
  • **Pricing is similar** but GCP generally cheaper for small workloads
  • **High availability mandatory** for production (use Multi-AZ/HA/Zone-redundancy)
  • **Backups critical** - all providers make this easy
  • **Test migration first** - each platform has quirks

Next Steps

  • Review provider documentation
  • Test with free tiers
  • Plan backup strategy
  • Set up monitoring

Resources

Python Docs

Ojasa Mirai

Master AI-powered development skills through structured learning, real projects, and verified credentials. Whether you're upskilling your team or launching your career, we deliver the skills companies actually need.

Learn Deep • Build Real • Verify Skills • Launch Forward

Courses

PythonFastapiReactJSCloud

© 2026 Ojasa Mirai. All rights reserved.

TwitterGitHubLinkedIn