ApsaraDB MyBase for MySQL Master-replica Edition supports multiple types of architectures, including the architecture that contains one primary instance and multiple read-only instances. You can create up to five read-only instances for an ApsaraDB MyBase for MySQL Master-replica Edition instance. This topic describes three common architectures and also describes how to create instances for these architectures.

Prerequisites

ApsaraDB MyBase for MySQL hosts are created. For information about how to create a host, see Create a host in an ApsaraDB MyBase for MySQL dedicated cluster.

Architectures

ArchitectureDescriptionAdvantages and disadvantagesScenarios
Single nodeThis architecture contains only one primary instance and no read-only instances.
  • Advantages: low cost.
  • Disadvantages: When you restart the primary instance, modify the instance configurations, or the instance fails, your service may be unavailable for an extended period of time.
  • Test environments.
  • Individual use for learning.
Two nodesThis architecture contains one primary instance and one read-only instance.
Advantages:
  • Cost-effectiveness: The primary instance and the read-only instance are single-node instances. The resource utilization of this type of instances is higher than the resource utilization of ApsaraDB MyBase for MySQL High-availability Edition instances.
  • High availability: If the primary instance fails to run as expected, the system automatically promotes the read-only instance to be the new primary instance.
Disadvantages: This architecture is not suitable for scenarios in which read traffic is high.
Note After the previous primary instance fails to run as expected, all read traffic is allocated to the new primary instance. If the read traffic is high, the new primary instance may become unavailable.
  • Production environments that require high availability and do not require services to process high read traffic.
  • Scenarios that require cross-zone dual-data center disaster recovery.
Three nodesThis architecture contains one primary instance and two read-only instances.
  • Cost-effectiveness: The primary instance and each read-only instance contain only one node. The resource utilization of this type of instance is higher than the resource utilization of ApsaraDB MyBase for MySQL High-availability Edition instances.
  • High availability: If the primary instance fails to run as expected, the system automatically promotes a read-only instance to be the new primary instance.
  • This architecture can support high read traffic.
  • Production environments that require high availability and require services to process high read traffic.
  • Scenarios that require cross-zone triple-data center disaster recovery.

Create an instance

  1. In the left-side navigation pane, choose Instances > MySQL.
  2. Click Create Instance. The following list describes how to create a single-node instance, a dual-node instance, and a triple-node instance.
    • Create a single-node instance. In the Create Instance panel, specify Standalone as the architecture type of the instance. Single node
    • Create a dual-node instance. The following table describes how to configure the Recommended Architecture and Read-only Instance parameters to create a dual-node instance. Two nodes
      ParameterDescription
      Recommended ArchitectureSelect Master-replica.
      Read-only InstanceSpecify the zone where you want to deploy the read-only instance, a vSwitch, and whether to enable the automatic failover feature. To ensure the high availability of your service and to perform dual-data center disaster recovery, we recommend that you configure the read-only instance based on the following suggestions:
      • Zone: Specify a zone that is different from the zone of the primary instance.
      • Failover: Use the default configuration. The failover feature is enabled.
    • Create a triple-node instance. The following table describes how to configure the Recommended Architecture and Read-only Instance parameters to create a triple-node instance. Three nodes
      ParameterDescription
      Recommended ArchitectureSelect Master-replica.
      Read-only InstanceCreate two read-only instances. You can click Create Read-Only Instance to add a read-only instance. Specify a zone and a vSwitch, and configure the Failover parameter for each read-only instance. To ensure the high availability of your service and to perform triple-data center disaster recovery, we recommend that you configure the read-only instances based on the following suggestions:
      • Zone: Specify different zones for different instances.
        Note You can create up to five read-only instances in three zones for an ApsaraDB MyBase for MySQL Master-replica Edition instance.
      • Failover: Enable the failover feature for one read-only instance and disable this feature for the other read-only instance.
      Note We recommend that you configure the read and write weights for the primary and read-only instances based on the information that is described in the following list:
      • Distribute 20% to 25% of the read traffic to the read-only instance for which the failover feature is enabled.
      • Distribute more than 75% of the read traffic to the read-only instance for which the failover feature is not enabled.
      • Distribute less than 10% of the read traffic to the primary instance.
    Note For information about how to configure parameters to create an instance, see Create an ApsaraDB MyBase for MySQL instance.
  3. Click Create.
    Note You can view the status of the instance by choosing Instances > MySQL.
    After the instance is created, you can go to the instance details page and click Service Availability in the left-side navigation pane to view the topology of the instance. For information about how to view the topology of an instance, see View the topology of an instance.
    • Sample topology of a single-node instanceSample topology of a single-node instance
    • Sample topology of a dual-node instanceSample topology of a dual-node instance
    • Sample topology of a triple-node instanceSample topology