This topic describes how to enable the read-only routing endpoint of an ApsaraDB RDS for SQL Server instance. ApsaraDB RDS allows you to manage read-only RDS instances and provides a read-only routing endpoint. You can add the endpoint of a primary RDS instance and the read-only routing endpoint to your application. In this case, ApsaraDB RDS routes write requests to the primary RDS instance and read requests to the read-only routing endpoint. Then, the read-only routing endpoint distributes the read requests to the read-only RDS instances based on the read weights of these instances.

Prerequisites

Precautions

  • If this is your first time to enable the read-only routing endpoint, your database system automatically upgrades the backend administration systems of the primary and read-only RDS instances to the latest version. This ensures service availability. When the read-only routing endpoint is being enabled, a transient connection error of 30 seconds or less occurs on the primary RDS instance. During this period, all the read-only RDS instances of the primary RDS instance are inaccessible. We recommend that you enable the read-only routing endpoint during off-peak hours and make sure that your application is configured to automatically reconnect to your database system. This prevents interruptions to your business.
  • If you restarted or changed the specifications of the primary and read-only RDS instances at least once after March 8, 2017, the backend administration systems of these instances are automatically upgraded to the latest version. In this situation, when you enable the read-only routing endpoint, your database system does not restart these instances, and no transient connection errors occur.
  • The generated read-only routing endpoint is fixed. It does not change even when you enable or disable the read-only routing endpoint multiple times. You do not need to perform a regular update of the configuration data on your application. This reduces maintenance costs.
    Note The read-only routing endpoint cannot be manually modified.
  • The read-only routing endpoint is free of charge. However, you still need to pay for the read-only RDS instances that you use. For more information, see Overview of read-only ApsaraDB RDS for SQL Server instances.
  • The read-only routing endpoint is unavailable in the classic network.

Procedure

  1. Log on to the ApsaraDB RDS console.
  2. Find the primary RDS instance and click its ID.
  3. In the left-side navigation pane, click Cluster management.
  4. Click Enable now.
  5. Configure the following parameters.
    Parameter Description
    Network Type The type of the read-only routing endpoint.
    • Intranet address (VPC): RDS instances that run SQL Server 2017 on RDS Cluster Edition support only the virtual private cloud (VPC) network type. Therefore, the read-only routing endpoint must be of the VPC network type.
    • Internet address: The read-only routing endpoint is connected over the Internet. However, the Internet is prone to fluctuations. We recommend that you connect to the read-only routing endpoint by using an internal network.
    Read Weight Distribution The method to assign read weights. A higher read weight indicates more read requests to process. For example, if a primary RDS instance has three read-only RDS instances whose read weights are 100, 200, and 200, the three read-only RDS instances process read requests at the 1:2:2 ratio.
    • Automatic Distribution: ApsaraDB RDS assigns a read weight to each read-only RDS instance based on the instance specifications. If you create more read-only RDS instances for the same primary RDS instance, ApsaraDB RDS still assigns read weights to these read-only instances. You do not need to manually specify the read weights. For more information, see Rules of weight distribution by the system.
    • Customized Distribution: You must manually specify a read weight for each read-only RDS instance. Valid values: 0 to 10000. If you create more read-only RDS instances for the same primary RDS instance, the default read weights of these read-only RDS instances are 0. You must manually modify the read weights.
  6. Click OK.

What to do next

  • After you add the endpoint of a primary RDS instance and the read-only routing to your application, ApsaraDB RDS routes write requests to the primary RDS instance and read requests to the read-only routing endpoint. Then, the read-only routing endpoint distributes the read requests to the read-only RDS instances based on the read weights of these instances.
  • You can view the ID, status, and read weight of each read-only RDS instance. You can also click Manage in the Actions column for a read-only RDS instance to manage the instance.