Upgrade RDS PostgreSQL from 13 to 17 with minimal downtime. How?

AdvancedScenarioData and databases
Answer

Situation read → An in-place major upgrade takes the database down for the whole upgrade. RDS Blue/Green Deployments let you upgrade a copy and switch over in about a minute.

What I'd do →

  1. Check extensions and their versions for compatibility, and run the app's tests against PostgreSQL 17 in staging.
  2. Create a Blue/Green deployment; the green environment is upgraded and kept in sync with logical replication.
aws rds create-blue-green-deployment --blue-green-deployment-name pg17-upgrade \
  --source arn:aws:rds:ap-south-1:111122223333:db:prod-db \
  --target-engine-version 17.4 --target-db-parameter-group-name pg17-prod
  1. Prerequisites for logical replication: rds.logical_replication = 1 and primary keys on replicated tables, and no DDL during the sync.
  2. Run ANALYZE on green; planner statistics aren't carried over by a major upgrade.
  3. Switch over in a low-traffic window; endpoints keep the same names, so apps just reconnect.
  4. Keep blue for a few days as a fallback.

Why → Upgrade and validation happen on a copy; the user-facing downtime is only the switchover.

Interview tip → Mention running ANALYZE after a major upgrade; skipping it causes slow queries the next morning.

All Real-World Interview questions Roadmap: Interview readiness

More on Data and databases