Updated on 2022-08-17 GMT+08:00

Customized Hints for Read/Write Isolation

DDM allows you to customize a hint to specify whether SQL statements are executed on the primary instance or its read replicas.

The hint is in the format of /*mycat:db_type=host*/.

In the format, host can be "master" or "slave". "master" refers to the primary DB instance, and "slave" refers to read replicas.

Currently, this function only applies to SELECT statements.

Generally, after read/write isolation, write operations are performed only on the primary DB instance, and read operations are performed only on its read replicas. In some special scenarios where data needs to be read from the primary DB instance, you can customize a hint to forcibly perform read operations on the primary DB instance.