Skip to main content
Cloud basicsLesson 9 of 17

What a Managed Database Does for You

A managed database hands the engine, the OS and the hardware to the cloud provider. Follow one Amazon RDS for PostgreSQL instance (Cloud SQL and Azure Database work much the same) through failover, restore, maintenance and a connection storm, and see which parts are still your job.

Endpoint points toPrimary (AZ a)
Connections—
Restorable to—
Stateavailable
AZ aAZ bAZ cApp Pods50 replicas · pool 20Endpointmydb.xxxx.rds…ProxyRDS Proxy · PgBouncerProvider controlMonitors · patchesPrimaryPostgreSQL · writerStandbySync · not readableRead replicaAsync · own endpointBackupsSnapshots + logsLookupCNAME
RequestWatchAppears in a later step

What you will learn

  • What the provider runs and what you still own
  • Why a Multi-AZ failover still drops your connections
  • Read replicas vs. the standby
  • Point-in-time restore creates a new instance
  • Why connections run out, and how a proxy helps

Who does what​

TaskProviderYou
Hardware, OS, engine installRuns and patches themPick the instance class and engine version
High availabilityKeeps the standby, detects failure, flips DNSTurn Multi-AZ on; make the app reconnect and retry
Read scalingCreates and feeds replicasSend reads to the replica endpoint; handle lag
BackupsDaily snapshots, logs, point-in-time restoreSet retention; run restore drills; repoint the app after a restore
MaintenanceApplies patches and minor versions in the windowChoose the window; plan major upgrades (blue/green)
SettingsOffers parameter groupsCreate your own group; reboot for static parameters
ConnectionsSets max_connections from memory; offers a proxySize pools; add a proxy such as RDS Proxy or PgBouncer
Storage and encryptionGrows storage up to a limit; encrypts with KMSSet the maximum; enable encryption at creation
Schema, queries, indexes—All yours

Same ideas, other names: Google Cloud SQL calls Multi-AZ "high availability (regional instance)" and uses database flags; Azure Database for PostgreSQL flexible server calls it "zone-redundant high availability" and uses server parameters.

Try it yourself​

These are AWS CLI examples.

aws rds describe-db-instances --db-instance-identifier mydb \
--query 'DBInstances[].[Endpoint.Address,MultiAZ,AvailabilityZone,SecondaryAvailabilityZone,StorageEncrypted,MaxAllocatedStorage]'
dig +short mydb.xxxx.ap-northeast-2.rds.amazonaws.com # Where the endpoint CNAME points now
aws rds reboot-db-instance --db-instance-identifier mydb --force-failover # Drill a failover (staging!)
aws rds describe-events --source-identifier mydb --source-type db-instance --duration 60 # failover started / completed
aws rds describe-db-instances --db-instance-identifier mydb \
--query 'DBInstances[].[LatestRestorableTime,BackupRetentionPeriod,PreferredBackupWindow,PreferredMaintenanceWindow]'
aws rds restore-db-instance-to-point-in-time --source-db-instance-identifier mydb \
--target-db-instance-identifier mydb-restored --restore-time 2026-11-27T05:02:00Z \
--db-parameter-group-name my-pg17 # A NEW instance with its own endpoint
aws rds describe-pending-maintenance-actions # Required and optional updates
aws rds describe-db-parameters --db-parameter-group-name my-pg17 \
--query "Parameters[?ParameterName=='max_connections']" # Often a formula based on memory
SHOW max_connections;
SELECT count(*), state FROM pg_stat_activity GROUP BY state; -- who holds connections

Check yourself

  1. A Multi-AZ failover completes, but the app keeps failing for many minutes. What is the most likely cause?
  2. You restore to a point in time 5 minutes before a bad DELETE. What do you get?
  3. 50 Pods each open a pool of 20 and new connections fail, but CPU is low. What fixes it best?

Further reading: Multi-AZ failover (Amazon RDS) · Read replicas · Point-in-time restore · Maintaining a DB instance · RDS Proxy · Storage autoscaling · Encrypting RDS resources · Cloud SQL high availability · What Happens When an App Saves to a Database · When One Availability Zone Goes Down