An ApsaraDB MyBase for SQL Server Always On instance is built based on the Always On availability groups feature and decouples computing from storage. By default, an ApsaraDB MyBase for SQL Server Always On instance consists of one primary instance and one read-only instance. You can increase the number of read-only instances based on your business requirements. If you need to split read and write requests, you can enable read/write splitting and configure a read-only routing endpoint for an ApsaraDB MyBase for SQL Server Always On instance. This allows ApsaraDB MyBase to offload read requests from the primary instance to read-only instances. This way, the read performance of the ApsaraDB MyBase for SQL Server Always On instance is improved. This topic describes how to use an ApsaraDB MyBase for SQL Server Always On instance.

Benefits

  • An ApsaraDB MyBase for SQL Server Always On instance can be scaled out to improve the read performance.
    You can increase the number of read-only instances. This helps improve the read performance of your ApsaraDB MyBase for SQL Server Always On instance in a linear manner. The specifications of the read-only instances can differ from those of the primary instance. Therefore, you can create read-only instances that have higher specifications than the primary instance. This helps improve the read performance of your ApsaraDB MyBase for SQL Server Always On instance.
    Note By default, a read-only instance does not provide high availability. To ensure high availability, create at least two read-only instances for an ApsaraDB MyBase for SQL Server Always On instance.
  • Costs can be controlled in a flexible manner.

    The read-only instances of an ApsaraDB MyBase for SQL Server Always On instance are cost-effective and belong to the general-purpose instance family. You can increase the number of read-only instances to offload read requests from the primary instance. This helps you optimize the configurations of your ApsaraDB MyBase for SQL Server Always On instance. The read-only instances can have lower specifications than the primary instance. You can use read-only instances of low specifications to process read requests from background applications such as intelligent analytics applications. This can reduce costs.

Scenarios

  • Use read-only instances to offload read requests from the primary instance during peak hours.

    ApsaraDB MyBase for SQL Server Always On instances are suitable for new retail enterprises. During peak hours, you can increase the number of read-only instances of high specifications and enable read/write splitting and traffic throttling to handle traffic spikes. For example, you can use read-only instances to process read requests during Double 11. This way, the amount of network traffic that an ApsaraDB MyBase for SQL Server Always On instance can process increases by multiple times.

  • Offload data analytics tasks from the primary instance to read-only instances.

    Enterprises need to analyze data in an intelligent way. An ApsaraDB MyBase for SQL Server Always On instance can provide an independent read-only instance for data analytics. This reduces the probability of blocked requests on the primary instance, increases the concurrency of requests, and decreases interruptions to crucial workloads. This way, service stability is ensured.

Prerequisites

An ApsaraDB MyBase for SQL Server dedicated cluster is created. For more information, see Create an ApsaraDB MyBase for SQL Server dedicated cluster.

Hosts are created in the ApsaraDB MyBase for SQL Server dedicated cluster. For more information, see Create hosts in an ApsaraDB MyBase for SQL Server dedicated cluster.

Create an ApsaraDB MyBase for SQL Server dedicated cluster

Procedure

  1. Log on to the ApsaraDB MyBase console.
  2. In the top navigation bar, select the region where you want to create a dedicated cluster.
  3. On the Clusters page, click Create Dedicated Cluster.
    Create a dedicated cluster
  4. In the Create Dedicated Cluster panel, configure the following parameters.
    Parameter Description
    Engine

    The database engine of the dedicated cluster. Select SQL Server.

    Dedicated Cluster Name The name of the dedicated cluster.
    VPC The virtual private cloud (VPC) to which the dedicated cluster is connected. If you need to create a VPC, log on to the VPC console.
    Note Make sure that the specified VPC meets your business requirements. After the dedicated cluster is created, you cannot change the VPC. To connect your dedicated cluster to a different VPC, you must delete the existing dedicated cluster and then recreate the dedicated cluster in the desired VPC.
    Resource Allocation Policy Select the default policy that is used to allocate database instances in the dedicated cluster.
    Grant OS Permissions Specify whether to enable the feature that allows you to have OS permissions on the hosts in the dedicated cluster.
    Note If you enable this feature for a dedicated cluster that runs the SQL Server database engine, you can log on to the hosts in the dedicated cluster to perform operations. For example, you can upload, download, and install software. Make sure that you configure the Grant OS Permissions parameter based on your business requirements. After the dedicated cluster is created, you cannot change the parameter setting.
  5. This step is required only when you create a dedicated cluster in ApsaraDB MyBase for the first time.

    The first time that you create a dedicated cluster in ApsaraDB MyBase, the following message is displayed in the lower part of the panel: You must authorize permissions on ECS ENIs and security groups. Click Authorize Now. On the Cloud Resource Access Authorization page, click Confirm Authorization Policy.

    Confirm authorization
    Note After you grant the permissions, the AliyunRDSDedicatedHostGroupRole role is displayed on the RAM Roles page in the Resource Access Management (RAM) console. If you want to use ApsaraDB MyBase, retain this role. If this role is deleted, you must grant the permissions again before you create a dedicated cluster.
  6. Click OK.

Create hosts in an ApsaraDB MyBase for SQL Server dedicated cluster

Before you create an ApsaraDB MyBase for SQL Server Always On instance, you must create at least two hosts that use the same storage type in an ApsaraDB MyBase for SQL Server dedicated cluster.

Procedure

  1. Find the dedicated cluster that you want to manage and click Details in the Actions column.
  2. In the left-side navigation pane, click Hosts. On the page that appears, click Add Host.
  3. On the page that appears, configure the following parameters.
    Parameter Description
    Product Type Select Dedicated Cluster.
    Note When you purchase a host that uses enhanced SSDs (ESSDs), you are charged only for the computing resources. Therefore, when you create an instance on a host that uses ESSDs, you are charged for the ESSDs based on the actual storage usage. You can select Storage Package to purchase a storage plan to reduce storage costs. A storage plan is billed based on the subscription billing method. You can use a storage plan to offset the storage costs of pay-as-you-go instances that are deployed in the same region as the storage plan.
    Region The region where you want to deploy the host. The host and the dedicated cluster to which the host belongs must be deployed in the same region.
    Dedicated Cluster The dedicated cluster in which the host is created.
    Zone The zone in which the host is created. To improve service availability, we recommend that you deploy hosts in different zones.
    Host Image The OS image of the host. Select A Windows Image, Which Contains the License (AlwaysOn) of the SQL Server Enterprise Edition.
    Storage Type The storage type of the host. Only Enhanced SSD (ESSD) is supported.
    Host Instance Type The specifications of the host.
    Network Type The VPC to which the host is connected.
    VSwitch The vSwitch to which the host is connected. If no vSwitches are available, follow the on-screen instructions to create a vSwitch.
    Quantity The number of hosts that you want to create. For more information, see Requirements for the number of hosts.
    Duration The subscription duration of the host. You can select Auto-renewal. The auto-renewal feature prevents the host from being released after the host expires. If this feature is enabled, the system renews the host based on the specified subscription duration. For example, if you specify a subscription duration of three months, the system renews the host once every three months.
  4. Click Buy Now. On the Confirm Order page, read and agree to the terms of service, and click Pay to complete the payment.

Create an ApsaraDB MyBase for SQL Server Always On instance

Procedure

  1. Find the dedicated cluster that you want to manage and click Details in the Actions column.
  2. In the left-side navigation pane, click Instances. On the page that appears, click Create Instance.
    Create an instance
  3. In the panel that appears, configure the following parameters.
    Parameter Description
    Database Engine The database engine that the instance runs. The database engine is SQL Server. You cannot change the database engine.
    Current Version The version of the database engine that the instance runs. Select 2019 EE Always On or 2017 EE Always On.
    Edition The edition of the instance. Only Always On is supported.
    Storage Type The storage type of the instance.
    Instance Type The specifications of the instance.
    Storage Capacity The storage capacity of the instance.
    Deployment Method You can select Default Policy or Specified Host as the deployment method.
    Note
    • If you select Default Policy, the balanced distribution policy is used. In this case, the system preferentially deploys instances on the hosts that have the most available resources.
    • If you select Specified Host, configure the Primary Host and Secondary Host parameters.
      • The primary instance of the ApsaraDB MyBase for SQL Server Always On instance is deployed on the primary host.
      • The read-only instances of the ApsaraDB MyBase for SQL Server Always On instance are deployed on the secondary host.
    VSwitch The vSwitch to which the host is connected. If no vSwitches are available, follow the on-screen instructions to create a vSwitch.
    Note This parameter is available only if you set Deployment Method to Default Policy.
    Billing Method Only Pay-As-You-Go is supported.
    Note When you purchase hosts that use ESSDs, you pay only for the computing resources. Therefore, when you create an instance on a host that uses ESSDs, you are charged for the ESSDs based on the actual storage usage. You can purchase a storage plan to reduce storage costs. A storage plan is billed based on the subscription billing method. You can use a storage plan to offset the storage costs of pay-as-you-go instances that are deployed in the same region as the storage plan.
  4. Click Create Now.

References