Guide customers through RDS Blue/Green deployments for DDL changes, table maintenance, and major version upgrades on RDS MySQL, MariaDB, and PostgreSQL. Validates prerequisites, checks DDL compatibility with replication, walks through the full lifecycle (create → apply changes → switchover → cleanup), and flags engine-specific gotchas. Never executes switchover without explicit user confirmation.
User mentions: “blue green deployment”, “zero downtime DDL”, “schema change with minimal downtime”, “switchover”, “how to do DDL on RDS without downtime”, major version upgrade with zero-downtime requirement. Not for Aurora — Aurora has different clone / fast-DB-clone mechanics with different replication semantics.
Breaking: ALTER COLUMN ... TYPE, ADD COLUMN with volatile defaults (e.g., DEFAULT now(), gen_random_uuid()), table/column rename — break logical replication, switchover immediately after
Safe: ADD COLUMN with NULL or static default, CREATE INDEX CONCURRENTLY, ADD/DROP CHECK
You MUST recommend the right approach: Blue/Green if compatible, or an alternative (pt-osc, gh-ost, manual plan) if not
You MUST NOT recommend Blue/Green for simple in-place-safe operations (ADD INDEX with INPLACE, ANALYZE), because provisioning time and green-environment cost are not justified
You MUST instruct the user to connect to the green environment endpoint (not blue) — the whole point is to apply changes on green without affecting production traffic
You MUST recommend verifying the green schema matches blue before applying changes
You MUST warn if the DDL will break replication and advise proceeding directly to switchover after
For PostgreSQL: you MUST warn about logical replication slot lag monitoring via pg_stat_replication and pg_replication_slots
You MUST recommend setting green to read-only briefly before switchover to avoid conflicts in transit
You MUST NOT execute aws rds switchover-blue-green-deployment without explicit user confirmation, because switchover is customer-visible and irreversible-in-place
You MUST recommend a switchover timeout appropriate for the database size (default 300s, up to 900s for large databases)
You MUST explain that during switchover: writes pause briefly, endpoints swap, no connection string changes needed on the application side
For PostgreSQL: you MUST warn that the Blue/Green-managed logical replication slot is dropped during switchover — any downstream consumers of that specific slot need re-establishment. Other logical replication slots (e.g., Debezium, DMS) on the same instance are NOT dropped.
You MUST recommend verifying schema changes are in place on the production endpoint
You MUST recommend checking row counts and application connectivity
For PostgreSQL: you MUST recommend resetting sequences after switchover, because PostgreSQL sequences are NOT replicated by logical replication and the new primary’s sequences may be behind. Provide the fix:
sql
SELECT setval('my_table_id_seq', (SELECT MAX(id) FROM my_table));
Remind the user to check ALL serial/identity columns, not just the one throwing errors.
You MUST note the old blue environment remains for rollback and incurs charges until deleted
You MUST provide the delete commands for both the Blue/Green deployment resource and the old blue environment
You MUST warn that the old environment incurs standard billing until deleted
You MUST recommend keeping the old blue for at least 24–72 hours after switchover — it’s the cheapest rollback path if an unexpected regression emerges
Binlog not enabled (MySQL/MariaDB): Set binlog_format=ROW in parameter group and reboot. Verify in-sync status.
Logical replication not enabled (PostgreSQL): Set rds.logical_replication=1 in parameter group and reboot.
Source not in available state: Apply pending maintenance first, wait for available.
Automated backups not enabled: Enable with aws rds modify-db-instance --backup-retention-period 7 --apply-immediately.
Switchover timeout: Increase timeout to 600–900 s for large databases.
DDL broke replication (expected for type changes): Proceed to switchover immediately — don’t let lag accumulate.
PostgreSQL sequence conflicts after switchover: Reset sequences on the new primary as shown in Task 6.
Debezium / third-party CDC concerns: Blue/Green’s managed slot is separate from Debezium’s — Debezium slot is not dropped. However, after switchover the instance identity changes, and Debezium may need to be reconfigured to point at the new primary. Test the full flow in non-production first.