Running Managed Databases with Amazon RDS - Multi-AZ and Read Replica Design

Ensure high availability with Multi-AZ and distribute read workloads with read replicas. This article introduces Blue/Green Deployments and RDS Proxy usage patterns.

Overview of RDS

RDS is a service that provides managed relational databases. Compared to installing a database on EC2, OS patching, DB patching, backups, and failover are all automated. Aurora is an AWS-proprietary engine compatible with RDS that delivers up to 5x the throughput of standard MySQL/PostgreSQL.

Multi-AZ and Read Replicas

Multi-AZ deployment places a primary instance and a standby instance in different Availability Zones, replicating data through synchronous replication. When the primary fails, automatic failover is triggered and the DNS endpoint switches to the standby. Read replicas create read-only copies through asynchronous replication, reducing the primary's load by directing report and analytics queries to the read replicas. Performance Insights visualizes database load by wait event and SQL query, helping identify slow queries and lock contention.

Blue/Green Deployments and Proxy

RDS Blue/Green Deployments safely execute major version upgrades and parameter changes. A green environment (new version) is created, data is synchronized via replication, and then a switchover redirects traffic within one minute. RDS Proxy provides database connection pooling and faster failover. For workloads with many short-lived connections like Lambda, it reduces database connection counts and automates connection switching during failover. Performance Insights analyzes SQL query performance to identify bottlenecks. To learn managed databases from basics to advanced topics, books on Amazon offer a systematic approach.

RDS Cost Optimization

RDS pricing consists of instance hours, storage (gp3: approximately $0.08 per GB per month), backup storage, and data transfer. Reserved Instances offer discounts of up to 72%. Multi-AZ adds the cost of the standby instance, so choose based on your availability requirements. gp3 storage is 20% cheaper than gp2 and allows independent configuration of IOPS and throughput. Consider distributing read workloads to read replicas and downsizing the primary instance.

Summary

RDS is a managed service that automates relational database operations. Multi-AZ ensures high availability, and read replicas distribute read workloads. Blue/Green Deployments safely execute major version upgrades, and RDS Proxy pools large numbers of connections from Lambda. Performance Insights identifies SQL query bottlenecks, and gp3 storage optimizes costs.