Organizations using Debezium Change Data Capture (CDC) connectors on Amazon Aurora PostgreSQL-Compatible Edition face challenges during major database version upgrades. In-place upgrades require downtime, while blue/green deployments disrupt CDC event pipelines. A method using PostgreSQL's native logical replication allows migration between a source cluster (current version) and a target cluster (new major version) without a full connector re-snapshot. This approach minimizes risks of data loss and allows existing Debezium connectors to operate on the source during synchronization. The cutover process involves disabling the replication subscription, synchronizing sequences, creating a new Debezium replication slot on the target, and redirecting the connector, resulting in a brief pause for Kafka consumers.
Prerequisites for this method include enabling logical replication on the source cluster, ensuring the target cluster is provisioned in the same VPC, and confirming that tables participating in CDC have primary keys. The process involves configuring parameter groups, creating publications, and establishing subscriptions for logical replication. During cutover, application writes are halted, and replication lag must be monitored to ensure it reaches zero before proceeding. After the cutover, ongoing monitoring of replication health and Kafka consumer offsets is necessary.
Common failure scenarios include Aurora writer failover, Debezium connector stalls, large messages exceeding Kafka limits, DDL changes during synchronization, and long-running transactions blocking lag drain. Each scenario has specific symptoms, detection methods, and resolutions. Post-migration, organizations should establish monitoring for replication lag growth and Kafka consumer offset divergence.
Automation can streamline the migration process for organizations managing multiple clusters, utilizing AWS Cloud Development Kit (CDK) constructs for cluster provisioning, schema replication, and cutover orchestration. After verifying stable operation on the target cluster, the old Debezium connector and source cluster can be decommissioned. Limitations include the absence of failover slots on Aurora PostgreSQL 17 and the need to handle TOAST columns appropriately.