Retro Eye care Haitian Deep Dark Default

Shadow

Storage unit Operation

REGISTER STORAGE UNIT ds_0 (
    HOST="127.0.0.1",
    PORT=3306,
    DB="ds_0",
    USER="root",
    PASSWORD="root"
),ds_1 (
    HOST="127.0.0.1",
    PORT=3306,
    DB="ds_1",
    USER="root",
    PASSWORD="root"
),ds_2 (
    HOST="127.0.0.1",
    PORT=3306,
    DB="ds_2",
    USER="root",
    PASSWORD="root"
);

Rule Operation

  • Create shadow rule
CREATE SHADOW RULE group_0(
SOURCE=ds_0,
SHADOW=ds_1,
t_order(TYPE(NAME="SQL_HINT"),TYPE(NAME="REGEX_MATCH", PROPERTIES("operation"="insert","column"="user_id", "regex"='[1]'))), 
t_order_item(TYPE(NAME="SQL_HINT")));
  • Alter shadow rule
ALTER SHADOW RULE group_0(
SOURCE=ds_0,
SHADOW=ds_2,
t_order_item(TYPE(NAME="SQL_HINT")));
  • Drop shadow rule
DROP SHADOW RULE group_0;
  • Unregister storage unit
UNREGISTER STORAGE UNIT ds_0,ds_1,ds_2;
  • Drop distributed database
DROP DATABASE foo_db;