Updated on 2026-11-17 GMT+08:00

RDS for MySQL Blue-Green Deployment

What Is Blue-Green Deployment?

Blue-green deployment is a service version upgrade strategy based on redundant deployment. It replicates the existing production environment (the blue environment) into a real-time synchronized test environment (the green environment) for testing and canary verification. By changing the mapping between virtual IP addresses (VIPs) and real nodes, you can quickly switch between the production and test environments. This approach requires no application-side modifications, minimizes service interruption, and supports rollback.

You can use an RDS for MySQL instance running an earlier version as the blue instance and create a new green instance with the target higher kernel version. The green instance synchronizes data with the blue instance through native binlog replication. After blue-green deployment is complete, you can initiate a blue-green switchover to direct service traffic to the green instance and verify whether workloads run properly on the higher-version instance. If compatibility issues occur, you can roll back the blue-green deployment to direct service traffic back to the blue instance.

Deployment Process

  • After you submit a blue-green deployment task, the system first restores a higher-version green instance based on the lower-version blue instance and establishes a replication relationship between the two instances. The system then waits for the green instance to catch up with the blue instance before creating a DRS synchronization task for potential rollback.
  • After you submit a blue-green switchover task, the system waits until the data in the blue and green instances is consistent, triggers a VIP switchover to direct read and write requests to the higher-version green instance, and then starts the DRS synchronization task to complete the switchover.
  • After you submit a blue-green rollback task, the system waits for the DRS synchronization task to catch up with the data, triggers a VIP switchover to direct read and write requests to the lower-version blue instance, and completes the rollback.

Notes and Constraints

Table 1 Notes and constraints

Phase

Notes

Feature Constraints

Phase 1: Creating a Blue-Green Deployment

  • Data synchronization is required for RDS blue-green deployment. Please wait until the synchronization is complete.
  • During blue-green deployment creation, the blue environment remains accessible. However, maintenance operation entry points, such as those for changing instance specifications, are disabled for the blue instance.
  • Blue instance billing: An existing instance is specified as the blue instance (the production environment instance) when you create a blue-green deployment. It continues to be billed as it was before the deployment.
  • Green instance billing: A new green instance is created when you create a blue-green deployment. It is billed on a pay-per-use basis.
  • To use the blue-green deployment feature, submit a service ticket.
  • Blue-green deployment supports minor and major kernel version upgrades, but does not support upgrades across major kernel versions. Before performing a major kernel version blue-green upgrade, ensure that the instance is running the latest minor version.
  • Only one blue-green deployment relationship can be created for a blue instance. To change the target version, delete the existing blue-green deployment relationship first.
  • Instances with HA read replicas are not supported.
  • Instances with database proxy enabled are not supported.
  • Instances associated with DDM instances are not supported.
  • Instances with TDE enabled are not supported.
  • Instances with SSL enabled are not supported.
  • Cluster instances are not supported.
  • Instances of version 5.7 that use local disk storage are not supported.
  • When upgrading a blue instance from version 8.0 to 8.4:
    • Set the log_bin_use_v1_row_events parameter to OFF before performing the blue-green deployment.
    • If the blue instance of version 8.0 contains foreign keys, each foreign key must reference a complete unique key (a primary key or unique index). Otherwise, blue-green rollback cannot be performed.
  • For primary/standby instances, blue-green deployment cannot be performed if the replication delay exceeds 300 seconds.
  • Blue-green deployment cannot be performed if the instance contains any abnormal nodes.
  • For other upgrade constraints, see the following topics:

Phase 2: After Blue-Green Deployment Is Complete

During the period in which the blue-green deployment relationship is maintained, entry points for maintenance operations, such as making changes to the blue and green instances, are disabled.

The DRS synchronization task is retained for three days by default after blue-green deployment is complete. You are advised to perform the blue-green switchover within three days to verify workload compatibility.

Phase 3: Performing the Blue-Green Switchover

  • After the blue-green switchover is complete, the data VIP is switched to the green instance and new workload requests are directed to the green instance.
  • During the blue-green switchover, both the blue and green instances experience a brief disconnection lasting approximately 30 seconds. Ensure that your applications support automatic reconnection, and perform the operation during off-peak hours whenever possible.
  • The blue-green switchover cannot be initiated if the replication delay between the blue and green instances exceeds 300 seconds.
  • The blue-green switchover cannot be initiated if either the blue or green instance, including any read replicas, contains abnormal nodes.
  • Restrictions on DDL operations during DRS data synchronization after the switchover: After the switchover is complete, you are advised not to perform DDL operations on the higher-version green instance, such as creating tables, modifying table structures, deleting tables, or creating or deleting indexes. For example, in cross-major-version upgrade scenarios, DDL operations may cause synchronization errors due to incompatibilities in character sets, collations, or syntax, which may result in data inconsistencies. Verify workload compatibility before performing the switchover.

Phase 4: Rolling Back the Blue-Green Deployment

  • After the blue-green rollback is complete, the data VIP is switched to the blue instance and new workload requests are directed to the blue instance.
  • During the blue-green rollback, both the blue and green instances experience a brief disconnection lasting about 60 seconds. Ensure that your applications support automatic reconnection, and perform the operation during off-peak hours whenever possible.
  • Blue-green rollback cannot be initiated if the DRS synchronization task from the green instance to the blue instance is in an abnormal state.
  • Blue-green rollback cannot be initiated if the blue instance, including any read replicas, contains abnormal nodes.
  • During rollback, the system must wait for the DRS synchronization task to catch up with the data. You are advised not to perform rollback during peak hours.

Phase 5: Deleting the Blue-Green Deployment Relationship

You can delete only the blue-green deployment relationship while retaining the green instance as an independent pay-per-use instance and leaving the blue instance unchanged.

  • After blue-green deployment is created: You can delete both the blue-green deployment relationship and the green instance. The green instance will be released.
  • After the blue-green switchover is complete: You can delete both the blue-green deployment relationship and the blue instance. At this point, workloads are running on the green instance, and the original blue instance will be released. Confirm this before deleting it.
  • After blue-green rollback is complete: You can delete both the blue-green deployment relationship and the green instance. The green instance will be released.

After the blue-green deployment relationship is deleted, the blue and green instances become independent instances. Blue-green switchover and rollback are no longer supported. Confirm this before deleting the relationship.

Procedure