This topic introduces proxy terminals. Proxy terminals are developed by Alibaba Cloud. You can use proxy terminals to customize the endpoints that are used to connect to an ApsaraDB RDS for MySQL instance. Each RDS instance supports up to seven proxy terminals. You can modify the read and write attributes of each proxy terminal based on your various business requirements.

Scenarios

Proxy terminals are suitable for read-only workloads. Proxy terminals are also suitable for workloads that need to be isolated.

For example, your database system consists of one primary RDS instance and four read-only RDS instances, and you have two applications, Application A and Application B. Application A initiates only read requests, and Application B initiates both read and write requests. In this case, you can use two read-only instances to create Proxy Terminal A with the Read-only attribute. Then, you can use the other two read-only instances to create Proxy Terminal B with the Read/Write attribute. This way, Application A and Application B are isolated from each other in your database system.

Read and write attributes

You can set the read and write attributes of each proxy terminal.

  • Read/Write: This attribute is used to support the read/write splitting feature. The read/write splitting feature allows you to linearly scale the volume of workloads that can be processed by your database system. For more information, see Read/write splitting.

    If you select this attribute for a proxy terminal, you must make sure that the proxy terminal is associated with at least one primary RDS instance and one read-only RDS instance. All write requests are routed to the primary RDS instance. In this case, the proxy terminal supports features such as transaction splitting and connection pool. For more information, see Use the transaction splitting feature on an ApsaraDB RDS for MySQL instance and Set the connection pool type of an ApsaraDB RDS for MySQL instance.

  • Read-only: This attribute is used to process only read requests. For example, if your application provides only the report service, you can select this attribute.

    If you select this attribute for a proxy terminal, you must make sure that the proxy terminal is associated with at least one read-only RDS instance. The proxy terminal does not route requests to the primary RDS instance. In addition, the proxy terminal does not support features such as transaction splitting and connection pool. For more information, see Use the transaction splitting feature on an ApsaraDB RDS for MySQL instance and Set the connection pool type of an ApsaraDB RDS for MySQL instance.

    If you select the Read-only attribute for a proxy terminal, the proxy terminal assigns connections to the associated read-only RDS instances based on a round-robin algorithm. Each database client is assigned only one connection to one read-only RDS instance. The connection to the primary RDS instance is not assigned by the proxy terminal. The total number of available connections is the sum of connections that are established to all the read-only RDS instances.

Note For more information about how to modify the read and write attributes of a proxy terminal, see Enable the proxy terminal feature for an ApsaraDB RDS for MySQL instance or Create a proxy terminal for an ApsaraDB RDS for MySQL instance.

Features

Proxy terminals support the following features:
  • Read/write splitting: This feature allows an application to connect to your database system by using a proxy endpoint. All the read and write requests from the application are sent to the proxy endpoint. Then, the proxy endpoint routes the received requests to the primary and read-only RDS instances based on the read weights of these instances. For more information, see Read/write splitting.
  • Connection pool: This feature is used to mitigate the heavy loads on your database system. Heavy load issues are caused by excessive connections or frequent short-lived connections (for example, PHP-based connections). For more information, see Set the connection pool type of an ApsaraDB RDS for MySQL instance.
  • Transaction splitting: This feature allows ApsaraDB RDS to route the read requests prior to write operations within a transaction to the read-only RDS instances. This reduces the loads on your primary RDS instance. For more information, see Use the transaction splitting feature on an ApsaraDB RDS for MySQL instance.
  • Secure Sockets Layer (SSL) encryption: This feature is used to encrypt the data that is destined for the protected proxy endpoint. This ensures the security of data in transit. For more information, see Configure SSL encryption for a dedicated proxy endpoint on an ApsaraDB RDS for MySQL instance.

Precautions

For more information, see Usage notes for read/write splitting.

Basic usage

For more information, see Enable the proxy terminal feature for an ApsaraDB RDS for MySQL instance and Create a proxy terminal for an ApsaraDB RDS for MySQL instance.