Updated on 2022-02-22 GMT+08:00

Read/Write Splitting

Prerequisites

  • You have created a DDM instance and a MySQL DB instance with read replicas.
  • You have created a schema.

Procedure

  1. On the Instances page, locate the required DDM instance and click its name.
  2. At the Associated DB Information area, locate the DB instance.
  3. Click Modify Read Policy in the Operation column to change read/write weights of the primary DB instance and its read replicas.

    Example: If the weight of the primary DB instance is 40 and that of the read replica is 50, the read ratio of the primary DB instance is 40/(40+50), and that of the read replica is 50/(40+50).

    The SELECT statements that contain hints or modify data in transactions are all executed by the primary DB instance.