Updated on 2025-08-21 GMT+08:00

What Is Database Proxy?

Database Proxy is a network proxy service that sits between TaurusDB and applications. It is used to handle all requests from the applications to access TaurusDB instances.

Read/write splitting means that read and write requests are automatically forwarded through database proxy addresses. After creating a TaurusDB instance, you can create a proxy instance. With the proxy address, write requests are automatically forwarded to the primary node and read requests are forwarded to each node based on the routing policy of the proxy instance, offloading the read load from the primary node.

Proxy instances are free.

Introduction Video

Basic Concepts

How Read/Write Splitting Works

You can create one or more proxy instances for your TaurusDB instance to enable read/write splitting.

If your TaurusDB instance has only one proxy instance, applications connect to the proxy instance through the proxy address. Write requests are forwarded to the primary node and read requests to the primary node or read replicas based on the routing policy you specify.

Figure 1 Read/write splitting with only one proxy instance

To isolate workloads from one another, you can create up to four proxy instances for a TaurusDB instance. Different applications can connect to different proxy instances as required. The associated read replicas of the proxy instances process read requests from different applications for workload isolation.

Figure 2 Read/write splitting with multiple proxy instances

Read/Write Splitting Advantages

  • Compared with manual read/write splitting in applications, the read/write splitting using proxy addresses features flexible scale-out and low maintenance costs.
  • Read requests are distributed to your read replicas based on weights to balance your database traffic and improve resource utilization.
  • A proxy instance routes read requests of an application only to its associated read replicas to isolate workloads.
  • By default, proxy instances provide overload protection to prevent server OOM (out of memory) due to heavy pressure when you perform operations on large result sets. This function is enabled by default and does not need to be configured separately. The pressure caused by the slow kernel depends on flow control.

Request Routing Rules

Precautions

Table 2 Precautions for proxy instances

Category

Precaution

Version constraints

  • If the kernel version of your TaurusDB instance is one of the following, proxy instances cannot be created:
    • From 2.0.26.2 to 2.0.28.3
    • 2.0.29.1
  • If the kernel version of your TaurusDB instance is earlier than 2.0.42.230601, only one proxy instance can be created.
  • If the kernel version of your TaurusDB instance is 2.0.42.230601 or later, up to four proxy instances can be created.

For details about how to check the kernel version, see How Can I Check the Version of a TaurusDB Instance?

Unsupported functions

  • Proxy instances do not support compression protocols.
  • Proxy instances do not support the READ-UNCOMMITTED transaction isolation level.
  • Proxy instances do not support reads from and writes to any column containing more than 16 MB of data in a table.
  • Proxy instances do not support the SQL mode parameter PAD_CHAR_TO_FULL_LENGTH.

Usage constraints

  • To create a proxy instance, the TaurusDB instance must have at least 8 vCPUs.
  • Read/write splitting can be enabled only when at least one read replica is created.
  • After read/write splitting is enabled, the database port and private IP address of your TaurusDB instance cannot be changed.
  • If multi-statements are executed, all subsequent requests will be routed to the primary node. To restore the read/write splitting function, disconnect the connection from your applications and establish a connection again.
  • When a proxy address is used, all transaction requests are routed to the primary node (you can use transaction splitting to route read requests prior to write operations in a transaction to read replicas). The non-transaction read consistency is not ensured. To ensure read consistency, encapsulate the read requests into a transaction.
  • When a proxy address is used, you can run show processlist command on the proxy instance or TaurusDB instance. If show processlist is executed on a proxy instance, only the services delivered through proxy nodes are displayed.
  • If a proxy node is abnormal, running show processlist or Kill on the proxy instance may take a long time, but services are not affected.
  • After a proxy node is deleted, services on the deleted proxy node may be displayed when show processlist is executed on the proxy instance.
  • If Kill is executed on the proxy instance, error information such as timeout may be displayed occasionally. You can run show processlist again to check whether the services are killed successfully.
  • If a proxy node is abnormal, there may be frame freezing for 2 seconds when you run show processlist on the proxy instance. The results will still be returned.
  • When a proxy instance is used, the size of a concatenate SQL statement cannot exceed 100 MB to prevent statement parsing from consuming too many resources.

HTAP analysis

  • Consistency levels and connection pools are not supported.
  • Only the weighted routing policy is supported.
  • Only the read/write proxy mode is supported.