You need to enable JavaScript to run this app.
RDS for MySQL

RDS for MySQL

Copy page
Download PDF
Managing blue-green deployment
Creating a blue-green deployment
Copy page
Download PDF
Creating a blue-green deployment
RDS for MySQL supports creating blue-green deployments for instances, which provides seamless switching with zero downtime to ensure business continuity and stability. This article describes the steps to create a blue-green deployment for an instance.​
Prerequisites​
  • To create a pay-as-you-go green instance, ensure that your account balance is 100 yuan or more.​
  • To create a subscription-based green instance, ensure your account has a sufficient balance to pay for the order.​
Supported regions​
The blue-green deployment feature is currently available only in the following regions:​
  • China (Beijing)​
  • China (Shanghai)​
  • China (Guangzhou)​
  • Asia Pacific (Johor)​
Limitation​
  • Creating blue-green deployments for disaster recovery instances is not supported.​
  • A green instance can be created for an instance with Transparent Data Encryption enabled. However, a blue-green switch is not supported because Transparent Data Encryption cannot be disabled once it is enabled.​
  • A green instance can be created for an instance with SSL encryption enabled, but SSL encryption must be disabled before the blue-green switch.​
  • The engine type of the green instance must be the same as that of the blue instance and cannot be changed.​
  • Creating green instances for MySQL 8.4 instances is not supported.​
Precautions​
After a blue-green deployment is created, the green instance is in global read-only mode. Do not modify this mode. If this mode is modified, a blue-green switch cannot be performed.​
Procedure​
  1. Log on to the RDS for MySQL console.​
  1. In the upper-left corner of the top menu bar, select the project and region for the instance.​
tip​
If the project of the instance has not been set, the project should be selected as All resources.​
  1. In the left navigation bar, click Instances to view the list of RDS for MySQL instances.​
  1. On the Instances page, click the name of the target instance to go to the Summary tab.​
  1. On the Connectivity tab, in the Instance topology area, click Create green instance to go to the Create green instance page.​
  1. On the Create green instance page, after completing the settings, click Confirm order to go to the Confirm order page.​
  • ​
    Parameter​
    Description​
    Instance name​
    You cannot set the instance name for the green instance during creation. The default instance name is the name of the blue instance+-green+-a six-digit random code.​
    tip​
    Since an RDS for MySQL instance name cannot exceed 128 characters, and the `-green` and `-six-digit random code` suffixes take up a fixed 13 characters. If the name of the blue instance exceeds 115 characters, only the first 115 characters are kept.​
    Compatible version​
    Select the compatible version for the green instance. RDS for MySQL supports two compatible versions, MySQL 5.7 and MySQL 8.0. The rules for selecting a compatible version for the green instance are as follows:​
    • If the compatible version of the blue instance is MySQL 5.7, you can select MySQL 5.7 or MySQL 8.0 as the compatible version for the green instance.​
    • If the compatible version of the blue instance is MySQL 8.0, you can only select MySQL 8.0 as the compatible version for the green instance.​
    Kernel version​
    Select the compatible version for the green instance. The rules for selecting the kernel version for the green instance are as follows:​
    • If the compatible version is the same for both the blue and green instances, you can select a kernel version for the green instance that is equal to or higher than that of the blue instance.​
    • If the compatible versions of the blue and green instances are different (for example, the compatible version of the blue instance is MySQL 5.7, and that of the green instance is MySQL 8.0), you can only select the latest kernel version for the green instance.​
    tip​
    For more information about the kernel versions released for RDS for MySQL, refer to Kernel minor version release notes.​
    Instance type​
    Select the instance type for the green instance. RDS for MySQL provides Single node, Double node, and Multiple node instance types. The rules for selecting the instance type for the green instance are as follows:​
    • If the blue instance is a single-node type, you can select a single-node or double-node type for the green instance.​
    • If the blue instance is a double-node type, you can select a double-node or multiple-node type for the green instance.​
    • If the blue instance is a multiple-node type, you can only select the multiple-node type for the green instance.​
    Specification type​
    Select the specification type for the green instance. RDS for MySQL provides two specification types: General type (formerly 'Shared type') and Dedicated type (formerly 'General type').​
    • General type: Exclusive use of allocated memory and storage resources, shares CPU resources with other shared instances in the same physical machine.CPU utilization is maximized through resource reuse, with high cost performance. CPU utilization is maximized through resource reuse, with high cost performance.​
    • Dedicated type: Fully exclusive use of allocated CPU, memory, and storage resources, with stable performance, not affected by other instances in the physical machine.​
    tip​
    The specification type of the green instance is the same as the blue instance by default and can be modified. If the instance type of the blue instance is Single node, the specification type of the green instance can only be General type.​
    Node specification​
    Configure the node specification, availability zone, and number of nodes for the green instance. The node configuration for the green instance is the same as the blue instance by default, but it can be adjusted. The specific configuration rules are as follows:​
    • If you choose the instance type as Double node:​
    • Up to 10 read-only nodes can be added, and the data on each node is exactly the same as the primary node.​
    • You can specify different availability zones in the same region for the primary node and the secondary node.​
    tip​
    For zone-level disaster recovery, it is recommended to deploy the primary and secondary nodes in different availability zones.​
    • The specification of the secondary node is consistent with that of the primary node.​
    • Up to 10 read-only nodes can be added, and the specifications of the read-only nodes can be set on demand.​
    tip​
    If the specification of a read-only node is lower than that of the primary node, high load on the primary node may cause latency or even OOM in the read-only node. It is recommended to select the same or a higher specification for the read-only nodes as that of the primary node.​
    • Primary, secondary, and read-only nodes can be deployed in up to three availability zones.​
    • If you choose the instance type as Multiple node:​
    • The specification of the secondary node is consistent with that of the primary node.​
    • You can add up to 8 secondary nodes, and at least 1 secondary node needs to be reserved.​
    • Nodes can be distributed in at most 3 availability zones.​
    tip​
    For zone-level disaster recovery, it is recommended to deploy the primary and secondary nodes in different availability zones.​
    tip​
    • If the blue instance is a double-node type and you select the multiple-node type for the green instance, the read-only node configuration of the blue instance will not be retained for the green instance.​
    • For multi-node instances, it is recommended to reserve an independent secondary node that does not carry business, so that it can be switched to the primary node if necessary. RDS for MySQL assumes no responsibility for any risks or losses incurred due to the failure to configure independent secondary nodes or the inability to complete the primary node switching due to excessive latency of all secondary nodes.​
    • If the instance type is Single node, you only need to set the specification and availability zone for the primary node.​
    Storage type​
    Select the storage type for the instance. You can select Local SSD, Cloud ESSD FlexPL, Cloud ESSD PL0, or High performance cloud disk as the storage type.​
    • Local SSD disk: An SSD disk on the same node as the database engine. Storing data on the local SSD disk reduces I/O latency.​
    • Cloud ESSD FlexPL: High throughput, high IOPS, and low latency, suitable for large I/O-intensive business scenarios.​
    • Cloud ESSD PL0: Balanced IOPS and throughput, and low latency, suitable for scenarios with certain IO performance requirements.​
    • High performance cloud disk: Built on Cloud ESSD FlexPL, it provides additional IO bursting capabilities to meet IO demands during business peaks. Suitable for scenarios with high I/O loads and I/O fluctuations.​
    tip​
    If the instance type is Single node, you can only select Cloud ESSD FlexPL, Cloud ESSD PL0, or High performance cloud disk as the storage type. Local SSD disk is supported, and the SSD must be in the same node as the database engine.​
    Storage space​
    Storage space includes data space, system file space, Binlog file space, and transaction file space. Enter a storage space from 20 GiB to 32,000 GiB in 10 GiB increments based on your business requirements.​
    tip​
    The storage space of the green instance must be greater than or equal to both the storage space of the blue instance and the minimum space of the instance specification. For more information on the value range of storage space corresponding to each specification, refer to Product specifications.​
    Deletion protection​
    Set whether to enable deletion protection for the green instance. Deletion protection is a feature provided by RDS for MySQL to protect instances from accidental deletion. After this feature is enabled, the instance cannot be deleted directly. You must disable the deletion protection for the instance before it can be deleted.​
    tip​
    Deletion protection is enabled by default for the green instance.​
    Network protocol type​
    Set the network protocol type of the green instance. The green instance must use the same network protocol type as the blue instance.​
    Virtual private cloud​
    The green instance must use the same virtual private cloud as the blue instance. This setting cannot be changed.​
    Subnet​
    Select the subnet for the green instance. The subnet used by the blue instance is selected by default. You can also select another subnet within the virtual private cloud of the blue instance.​
    Database proxy​
    Configure the database proxy for the green instance. The following rules apply when configuring the database proxy for a green instance:​
    • If the green instance is a Double node instance, you can enable or disable its database proxy.​
    • If the instance type of the blue instance is multiple node, the database proxy for the green instance can only be enabled.​
    Number of proxy cores​
    Set the number of cores for the database proxy service of the green instance. The value range for the number of cores for the proxy service varies by instance type:​
    • Maximum: 1024.​
    • Minimum value:​
    • Multiple node instance: The greater of 2 or (Number of primary node CPU cores * 0.125).​
    • Double node instance: The greater of 2 or (Number of primary node CPU cores * 0.5).​
    • Default value:​
    • Multiple node instance: (Total number of CPU cores of all available nodes in the instance * 0.25), rounded up.​
    • Double node instance: (Total number of CPU cores of all available nodes in the instance * 0.5), rounded up.​
    Parameter configuration​
    Configure parameters for the green instance. The rules for configuring parameters for the green instance are as follows:​
    • If the blue and green instances have the same compatible version, you can set the parameter configuration for the green instance to Inherit the blue instance or Select parameter template.​
    • If the blue and green instances have different compatible versions, the parameter configuration for the green instance can only be set to Select parameter template.​
    Parameter templates​
    If Parameter configuration is set to Select parameter template, select a parameter template for the green instance. You can select a system or custom parameter template for the green instance from the drop-down list.​
    Kernel version upgrade policy​
    Method for upgrading the database kernel minor version. The following types are supported.​
    • Automatic: When a new kernel minor version is released, the instance is automatically upgraded to the latest kernel version during the configured Maintenance window.​
    tip​
    If an instance's kernel minor version exceeds its maintenance cycle, the system temporarily ignores the upgrade policy and automatically upgrades the kernel minor version.​
    Billing method​
    Select the billing method for the green instance. RDS for MySQL supports two billing methods: Pay-as-you-go and Subscription.​
    • Pay-as-you-go: If you plan to use your MySQL instance for a short period of time, choose pay-as-you-go (hourly rate). You can release the instance when it is no longer needed, saving money.​
    • Subscription: If you plan to use your MySQL instance for a long period of time, select Subscription (one-time payment) and choose the duration of the purchase in the lower left corner of the page. Subscription is more affordable than pay-as-you-go, and the longer you buy, the more discounts you get.​
    tip​
    You can also create a pay-as-you-go instance first and confirm that the instance meets the requirements before switching to a yearly/monthly subscription.​
    Subscription duration​
    If you choose Subscription, you need to select the purchase duration. Support monthly purchase (can purchase 1~9 months) and yearly purchase (can purchase 1~3 years).​
    Automatic renewal​
    If you select Subscription, you can also configure Automatic renewal. If enabled, the platform automatically renews the subscription on a monthly basis before the instance expires, without requiring manual renewal. You can also modify the renewal configuration. For more information, please refer to Renewal Management.​
    ​
  1. On the Confirm order page, confirm the order details. After reading and selecting Database Products and Services Terms and Unsubscription rules, click Buy now to create a green instance.​
tip​
  • On the Create green instance page, the creation progress of the green instance is displayed. Click Task center on the page to go to the task page in the task center and view the details for creating the green instance. If the Create green instance page is closed, click Green instance creation progress in the Instance topology area of the blue instance to reopen the page.​
  • After the green instance is created, it appears in the Instances list.​
  • Billing for the green instance starts upon its creation. Click Create synchronization link as soon as possible to establish a synchronization link between the blue and green instances.​
  • After the green instance is created, the blue and green instances are labeled "Blue" and "Green" respectively.​
Subsequent steps​
Related API​
​
API​
Description​
Call the CreateDBBlueGreenInstance API to create a blue-green deployment for an instance.​
Call the DescribeDBBlueGreenInstance API to query the blue-green deployment information for the instance.​
​
Last updated: 2026.08.05 14:44:57