bharathikannan-zarget 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-593879333
 
 
   @KomachiSion 
   
   ```
   db0
   
   Tables:
   | account 
   | user
   | events
   | history
   | preferences
   
   ```
   
   db1
   
   ```
   
   Tables:
   | account 
   | user
   | events
   | history
   | preferences
   ```
   
   db2
   ```
   
   Tables:
   | account 
   | user
   | events
   | history
   | preferences
   ```
   
   So let's say
   
   ```
   Rules:
   
   tenant_id < 100 => db0
   tenant_id > 100 < 200 => db1
   tenant_id > 200 < 300 => db2
   
   Sample Queries:
   
   select * from accounts where tenant_id=10;  => db0
   
   select * from history where tenant_id = 10; => db0
   
   select * from accounts where tenant_id=180; => db1
   
   select * from history where tenant_id = 180; => db1
   
   ```
   
   Thanks.
   

----------------------------------------------------------------
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