Introduction
What is a Database Proxy
Database proxy is a network proxy service based on the high availability cloud database UDB MySQL. It is located between the database service end and the application service end. The database proxy unifies the management of master-slave architecture databases and provides a unified network entry for the application service end. It has the characteristics of high availability, high performance, and easy expansion. The database proxy provides core functions such as read-write separation, SQL limiting, SQL statistics, automatic troubleshooting, etc., making the application service end more focused on the business.
Why Use Read-Write Separation
Data shows that 96.87% of relational databases are waiting for read I/O under OLTP business, while processor computing only accounts for 5.3%. This signifies that to improve the QPS performance of the database, one key point is to enhance the system's IO capabilities.
Another data shows that for most businesses, the access to the database is read more than write. Typical examples include e-commerce, O2O, internet finance, etc. The read-write ratio can reach 5:1 or even 10:1.
In addition to upgrading hardware and enhancing the disk I/O capabilities of a single node, an important method to improve IO capability is read-write separation. It is possible to deploy a master-slave replication cluster with one primary and multiple secondary. In this way, read requests are distributed to multiple database nodes for parallel processing. Considering that most of the business access to the database is read-based, read-write separation can bring noticeable gains to database performance.
Firstly, parallel reading of multiple nodes can provide several times the disk data reading capability of a single node.
Secondly, since read requests are distributed among multiple nodes, the I/O of a single node is reduced, and the I/O wait time is minimized.
Ultimately, the I/O capability of the whole system is effectively improved.
For OLAP business, because it involves a large amount of memory storage and computing, CPU and memory may become bottlenecks, read-write separation also has a certain meaning. By diverting data analysis requests to multiple nodes, different data analysis operations can be performed in parallel on multiple nodes. Inter-node interference is avoided, fully realizing the benefits of parallel processing.