menghaoranss commented on issue #4478: Is this possible to just shard databases 
with table rule configuration?
URL: 
https://github.com/apache/incubator-shardingsphere/issues/4478#issuecomment-593281706
 
 
   > @bharathikannan-zarget could you provide a full sharding rule 
configurations of your application?
   > And do you expect the tables in the shard databases to be exactly the same 
? just like:
   > 
   > ```
   > db0.user (0-100)
   > db1.user(101-200)
   > ```
   
   I suggest, you can refer to 
examples/sharding-jdbc-example/other-feature-example/hit-example.
   
   Use hint strategy to achieve only shard databases.
   
   The following configuration may help you:
   ```
   shardingRule:
     tables:
       t_order:
         actualDataNodes: ds_${0..1}.t_order
       t_order_item:
         actualDataNodes: ds_${0..1}.t_order_item
     bindingTables:
       - t_order,t_order_item
     broadcastTables:
       - t_address
     
     defaultDatabaseStrategy:
       hint:
         algorithmClassName: 
org.apache.shardingsphere.example.hint.raw.jdbc.ModuloHintShardingAlgorithm
     defaultTableStrategy:
       none:
   ```
   then you should implement yourself algorithmClass for your sharding rule of 
databases.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to