影子库压测

定义

  1. SHOW SHADOW shadowRule | RULES [FROM schemaName]
  2. SHOW SHADOW TABLE RULES [FROM schemaName]
  3. SHOW SHADOW ALGORITHMS [FROM schemaName]
  4. shadowRule:
  5. RULE ruleName
  • 支持查询所有影子规则和指定表查询
  • 支持查询所有表规则
  • 支持查询所有影子算法

说明

Shadow Rule

说明
rule_name规则名称
source_name源数据库
shadow_name影子数据库
shadow_table影子表

Shadow Table Rule

说明
shadow_table影子表
shadow_algorithm_name影子算法名称

Shadow Algorithms

说明
shadow_algorithm_name影子算法名称
type算法类型
props算法参数

示例

SHOW SHADOW RULES

  1. mysql> show shadow rules;
  2. +--------------------+-------------+-------------+--------------+
  3. | rule_name | source_name | shadow_name | shadow_table |
  4. +--------------------+-------------+-------------+--------------+
  5. | shadow_rule_1 | ds_1 | ds_shadow_1 | t_order |
  6. | shadow_rule_2 | ds_2 | ds_shadow_2 | t_order_item |
  7. +--------------------+-------------+-------------+--------------+
  8. 2 rows in set (0.02 sec)

SHOW SHADOW RULE ruleName

  1. mysql> show shadow rule shadow_rule_1;
  2. +------------------+-------------+-------------+--------------+
  3. | rule_name | source_name | shadow_name | shadow_table |
  4. +------------------+-------------+-------------+--------------+
  5. | shadow_rule_1 | ds_1 | ds_shadow_1 | t_order |
  6. +------------------+-------------+-------------+--------------+
  7. 1 rows in set (0.01 sec)

SHOW SHADOW TABLE RULES

  1. mysql> show shadow table rules;
  2. +--------------+--------------------------------------------------------------------------------+
  3. | shadow_table | shadow_algorithm_name |
  4. +--------------+--------------------------------------------------------------------------------+
  5. | t_order_1 | user_id_match_algorithm,simple_note_algorithm_1 |
  6. +--------------+--------------------------------------------------------------------------------+
  7. 1 rows in set (0.01 sec)

SHOW SHADOW ALGORITHMS

  1. mysql> show shadow algorithms;
  2. +-------------------------+--------------------+-------------------------------------------+
  3. | shadow_algorithm_name | type | props |
  4. +-------------------------+--------------------+-------------------------------------------+
  5. | user_id_match_algorithm | COLUMN_REGEX_MATCH | operation=insert,column=user_id,regex=[1] |
  6. | simple_note_algorithm_1 | SIMPLE_NOTE | shadow=true,foo=bar |
  7. +-------------------------+--------------------+-------------------------------------------+
  8. 2 rows in set (0.01 sec)