shardingsphere icon indicating copy to clipboard operation
shardingsphere copied to clipboard

Support scaling for shardingsphere

Open avalon566 opened this issue 6 years ago • 4 comments

I missing an important work for sharding scaling. In order to support scaling for shardingsphere, We need to understand the sharding rule, and mapping the sharding table name to the actual table name.

For sharding rule:

t_order:
      actualDataNodes: ds${0..1}.t_order${0..1}

We need synchronize table t_order0 and t_order1 from ds0, table t_order0 and t_order1 from ds1, this four table all map to t_order.

  • [x] Parse shardingsphere rule configuration.
  • [x] Filter table not in shardingsphere rule configuration(history sync and realtime sync).
  • [x] Mapping actual table name to logic table name in reader.

avalon566 avatar Dec 10 '19 17:12 avalon566

@ssxlulu @KomachiSion How to submit the sharding rule file in start job interface? Put file content in json field?

avalon566 avatar Dec 10 '19 17:12 avalon566

I think we can get full configuration by interface, and use sharding-core to parse them to xxxConfiguration.

For example, TableRuleConfigurationYamlSwapper can parse table rule from yaml to TableRuleConfiguration, TableRuleConfiguration include logicTable and actualDataNodes.

KomachiSion avatar Dec 11 '19 00:12 KomachiSion

@avalon566 You can implement this based on YamlSwapper interface, which includes TableRuleConfigurationYamlSwapper, OrchestrationConfigurationYamlSwapper , and includes DataNode and Table configuration.

SteNicholas avatar Dec 12 '19 16:12 SteNicholas

@SteNicholas Thx, I will reference to this interface.

avalon566 avatar Dec 13 '19 00:12 avalon566