forked from docs/doc-exports
Reviewed-by: Boka, Ladislav <ladislav.boka@t-systems.com> Co-authored-by: Wang , Deng Ke <wangdengke2@huawei.com> Co-committed-by: Wang , Deng Ke <wangdengke2@huawei.com>
2.4 KiB
2.4 KiB
Rules for Distributing Weights
This section describes the rules of distributing read weights to DB instances of different specifications.
Weight Distribution Rules
Adding a Hint to Specify the Direction that a SQL Statement Will Be Routed
Hints supported by read/write splitting are as follows:
- /*FORCE_MASTER*/: A SQL statement is routed to the primary DB instance.
- /*FORCE_SLAVE*/: A SQL statement is routed to a read replica.

- In addition to the weight distribution system of read/write splitting, hints are a useful type of SQL syntax that allows you to specify whether a SQL statement is executed on the primary DB instance or on a read replica.
- Hints are only used as routing suggestions. In non-read-only SQL and non-transaction scenarios, SQL statements cannot be routed to read replicas.
Parent topic: Database Proxy (Read/Write Splitting)