Introduction to RDS for MySQL Database Proxies
Context
In read-intensive workloads, a single DB instance may be unable to handle the read pressure. If this happens, performance deteriorates and, under peak loads, workloads will suffer.
To scale the read capacity of your instance, RDS for MySQL allows you to create read replicas and enable read/write splitting. With read/write splitting enabled, write requests are routed to the primary instance and read requests to read replicas. The read pressure on the primary instance is reduced, and database performance improves.
Function Description
A database proxy enables read and write requests to be automatically routed through a read/write splitting address. You can enable read/write splitting after read replicas are created. Write requests are automatically routed to the primary DB instance and read requests are routed to read replicas by user-defined weights.
Basic Concepts
- Proxy address
After purchasing a database proxy, you can view the proxy address on the Database Proxy page. The database proxy sends write requests to the primary instance and read requests to read replicas through this address.
- Transaction splitting
Database proxies support transaction splitting. With this feature enabled, the read requests prior to write operations in a transaction are routed to read replicas, offloading read pressure from the primary instance.
For more information about transaction splitting, see Configuring Transaction Splitting.
- Connection pool
Database proxies provide session-level connection pools, which help reduce the database load caused by frequent establishment of short connections.
For more information about connection pools, see Configuring Connection Pools.
- Routing policy
RDS for MySQL database proxies support weighted and load balancing routing policies.
- Weighted: Read requests are routed based on the read weights you specify.
- Load balancing: Read requests are routed to database nodes with fewer active connections. With this policy enabled, you do not need to configure the weights of nodes.
For more information about routing policies, see Configuring the Delay Threshold and Routing Policy.
Billing
Database proxy can be enabled only for purchased DB instances. After it is enabled, it is separately billed on a pay-per-use basis.
The database proxy service is available for commercial use. It is billed by node. When you purchase a database proxy instance on the console, two nodes are created by default. The total fee is calculated as follows: Total fee = Number of nodes x Unit price. For details about the unit price, see the price of database proxy in RDS Pricing Details.
Scenario
- Read/write splitting enables read and write requests to be automatically routed. If your application requires more proxies, you can request additional proxy nodes with just a few clicks.
- Read requests are distributed to your read replicas based on weights to balance your database traffic and improve resource utilization.
- A proxy routes read requests of your application only to the read replicas you specify for the proxy.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.