SyntaxStudy
Sign Up
MySQL Replication in the Cloud
MySQL Intermediate 4 min read

Replication in the Cloud

Cloud Replication

Cloud providers (AWS RDS, Google Cloud SQL, Azure) offer managed replication with automatic failover, read replicas, and point-in-time recovery.

Example
-- AWS RDS Read Replica (console or CLI)
aws rds create-db-instance-read-replica \
  --db-instance-identifier mydb-replica \
  --source-db-instance-identifier mydb-primary
-- Promote read replica to standalone (for migration/failover):
aws rds promote-read-replica --db-instance-identifier mydb-replica
-- Monitor lag in RDS:
-- CloudWatch metric: AmazonRDS > ReplicaLag (seconds)
-- Multi-AZ (automatic failover, not a read replica):
-- aws rds modify-db-instance --multi-az --apply-immediately
Pro Tip

RDS Multi-AZ provides automatic failover in ~60s; read replicas scale reads but require manual promotion.