tencent cloud

All product documents
TDSQL-C for MySQL
DocumentationTDSQL-C for MySQLPractical TutorialImplementing Multiple RO Groups with Multiple Database Proxy Connection Addresses
Implementing Multiple RO Groups with Multiple Database Proxy Connection Addresses
Last updated: 2023-11-09 14:17:52
Implementing Multiple RO Groups with Multiple Database Proxy Connection Addresses
Last updated: 2023-11-09 14:17:52

Background

An RO group is a set of read-only instances that can be configured with weights for traffic load balancing. You can create one or multiple RO groups for a database. By deploying RO groups as needed, you can send read requests to the corresponding read-only instances based on certain rules, significantly improving the read capacity of the database. The TDSQL-C for MySQL database proxy supports setting multiple proxy connection addresses, allowing different read-only instances to be mounted at different addresses. You can associate multiple proxy connection addresses with the same cluster as needed on your application, enabling the implementation of multiple RO groups scenario similar to traditional databases and providing additional advantages.

Multiple RO groups in traditional database
Example: Source instance [connection address]: 10.0.1.22:3306. RO group [connection address A]: 10.0.1.78:3306; mounted RO instance: RO1. RO group [connection address B]: 10.0.1.80:3306; mounted RO instances: RO2, RO3.
Multiple connection addresses for database proxy
Example:
Database proxy [connection address A]: 172.20.0.10:3306; mounted RO instance: RO1. Database proxy [connection address B]: 172.20.0.12:3306; mounted RO instances: RO2, RO3.
Note:
The above are examples of the IP address, RO group private network address, and database proxy connection address of the source instance, and no access connection service is provided.
After enabling the TDSQL-C MySQL database proxy, you can configure multiple database proxy connection addresses to mount different read-only instances, so that you can achieve multiple RO groups scenario similar to traditional databases. (Database proxy connection addresses A and B are equivalent to the RO group connection addresses A and B respectively in traditional database). Additionally, compared to traditional databases with multiple RO groups, this setup offers the following advantages:
Support mounting multiple read-only instances, which outnumbers the traditional databases.
Support mounting with the read-write instances.
Support transaction split
‌Support connection pool
‌‌Support load rebalancing.
Support setting a consistency level
Support setting access mode

Mounting different instances through the database proxy connection address

Step 1. Enable the database proxy

For more information, see Enabling Database Proxy.
Note:
With the database proxy enabled, you can create as many connection addresses as there are nodes. To achieve a multiple RO groups scenario, you must configure at least two nodes when enabling the database proxy.

Step 2. Mount an instance

Mounting an instance at a single database proxy connection address

After enabling the database proxy in TDSQL-C for MySQL, a proxy connection address will be provided by default, referred to as proxy connection address A. You can find this address by navigating to the Database Proxy tab > Overview > Connection Address.

Below is a description of the steps to mount the read-only instance RO1 at the proxy connection address A.
1. You can also find the target access address in Database Proxy tab > Overview > Connection Address. Then, click Adjust Configurations in the Operation column.
2. In the pop-up window, set Read/Write Attribute as Read-Only, complete the configuration for other policies, and click Next.
3. On the Assign Read Weight field, enable the read-only instance RO1, set its weight as needed, and click OK.

Mounting instances at multiple database proxy connection addresses

After mounting the read-only instance at a single database proxy connection address, you can also create multiple database proxy connection addresses to mount instances. Below is a description of how to add a new database proxy connection address B under the database proxy and then mount read-only instances RO2 and RO3.
1. On the Database Proxy tab, and click Add Access Address next to Connection Address.

2. In the Create Connection window, complete network configurations and click Next.
3. In the configuration policy window, set Read/Write Attribute as Read-Only, complete the configuration for other policies, and click Next.
4. On the Assign Read Weight field, enable the read-only instances RO2 and RO3, set their weights as needed, and click OK.

Step 3. Configure the application

After enabling the database proxy and mounting instances at the proxy connection addresses, you can configure the database proxy addresses A and B separately for different business purposes. By using these proxy addresses, requests can be routed through the proxy cluster to different instances within the access cluster. This achieves the functionality provided by traditional databases with multiple RO groups and offers additional advantages.
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon