You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/03/31 07:13:59 UTC

[GitHub] [incubator-shardingsphere] tristaZero opened a new issue #5017: [DISCUSS] Brand new sharding configuration API of Release 5.x

tristaZero opened a new issue #5017: [DISCUSS] Brand new sharding configuration API of Release 5.x
URL: https://github.com/apache/incubator-shardingsphere/issues/5017
 
 
   [DISCUSS] Brand new sharding configuration API of Release 5.x
   
   Hi community,
   
   Our 4.1.0 release is on the way. Moreover, I received plenty of feedback and complaints that our configuration is complicated and tedious. When trying it by myself, I convinced it is time to make some changes.
   I propose to simplify the configuration API for sharding rule since release 5.x.
   ### Here are pros and cons
   #### Pros
   1. Through much Straightforward sharding configuration, users do not need to understand too many sharding strategies[1] for their scenarios since sharding strategies decreases from 5 to 2. The next comment will show you the initial design for new API.
   
   2. ShardingSphere will provide many default sharding strategies for users, which means 80% of users could adopt default sharding strategies rather than write by themselves. No code, no compile, no redundant setting. 
   
   #### Cons
   1. New configuration API does not have a great compatibility across 4.x and 5.x, i.e., it is a brand new API since release 5.x (I guess it will become our argument).
   
   Therefore, I sincerely welcome your opinion and comment to develop this proposal better and better.
   
   [1] https://shardingsphere.apache.org/document/current/en/manual/sharding-jdbc/configuration/config-yaml/
   
   Cheers,
   Trista

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] tristaZero edited a comment on issue #5017: [DISCUSS] Brand new sharding configuration API of Release 5.x

Posted by GitBox <gi...@apache.org>.
tristaZero edited a comment on issue #5017: [DISCUSS] Brand new sharding configuration API of Release 5.x
URL: https://github.com/apache/incubator-shardingsphere/issues/5017#issuecomment-606449810
 
 
   Looking forward to your suggestions and comments for brand new sharding configuration API. :)
   Here is the initial design for API.
   
   **The old one**
   ```
   shardingRule:
     tables: 
       t_order:  
         databaseStrategy: 
           standard:  
             shardingColumn:  
               preciseAlgorithmClassName: 
               rangeAlgorithmClassName: 
             complex:  
               shardingColumns:  
               algorithmClassName: 
             inline:  
               shardingColumn:  
               algorithmInlineExpression:  
             hint:  
               algorithmClassName: 
              none:  
         tableStrategy:
   ```
   **The new one**
   ```
   shardingRule:
     tables: 
       t_order: 
         databaseStrategy: 
           standard: 
             shardingColumn: order_id
             shardingAlgorithm:
               type: Inline
               props:
                 ShardingDBVolume: 2
                 ShardingTBVolume: 4
           standard: 
             shardingColumn: order_id
             shardingAlgorithm:
               type: class
               props:
                 DBClassName: xxxx
                 TBClassName: xxxxxx
           complex: 
             shardingColumns: year, month
             shardingAlgorithm:
               type: complex
           hint: 
             shardingAlgorithm:
               type: hint
           None:
             shardingAlgorithm:
               type: none
         tableStrategy:
   ```
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] terrymanu commented on issue #5017: [DISCUSS] Brand new sharding configuration API of Release 5.x

Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #5017: [DISCUSS] Brand new sharding configuration API of Release 5.x
URL: https://github.com/apache/incubator-shardingsphere/issues/5017#issuecomment-612600779
 
 
   The yaml rule file may like this:
   
   ```yaml
   shardingRule:
     tables: 
       t_order: 
         databaseStrategy: 
           standard: 
             shardingColumn: order_id
             shardingAlgorithm:
               type: INLINE
               props:
                 expression: t_order_$->{order_id % 8}
           standard: 
             shardingColumn: order_id
             shardingAlgorithm:
               type: CLASS
               props:
                 precise-class-name: xxxx
                 range-class-name: xxxx
           standard: 
             shardingColumn: order_id
             shardingAlgorithm:
               type: HASH
               props:
                 sharding-count: 8
                 
           complex: 
             shardingColumns: year, month
             shardingAlgorithm:
               type: complex
           hint: 
             shardingAlgorithm:
               type: hint
           None:
             shardingAlgorithm:
               type: none
         tableStrategy:
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] tristaZero commented on issue #5017: [DISCUSS] Brand new sharding configuration API of Release 5.x

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #5017: [DISCUSS] Brand new sharding configuration API of Release 5.x
URL: https://github.com/apache/incubator-shardingsphere/issues/5017#issuecomment-606453919
 
 
   ### TODO
   - [ ] Optimize metadata module to route none-sharding tables correctly
   - [ ] New API for standard sharding strategy
   - [ ] New API for complex sharding strategy
   - [ ] Implement Inline algorithm for standard sharding strategy
   - [ ] Implement range algorithm for standard sharding strategy
   - [ ] Delete Inline sharding strategy
   - [ ] Delete Hint sharding strategy
   - [ ] Modify sharding config 
   - [ ] Modify yaml config
   - [ ] Modify springboot config
   - [ ] Modify spring name config
   - [ ] Modify sharding proxy config
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] yu199195 commented on issue #5017: [DISCUSS] Brand new sharding configuration API of Release 5.x

Posted by GitBox <gi...@apache.org>.
yu199195 commented on issue #5017: [DISCUSS] Brand new sharding configuration API of Release 5.x
URL: https://github.com/apache/incubator-shardingsphere/issues/5017#issuecomment-606481463
 
 
   very good idea, simplified configuration.
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [shardingsphere] tristaZero edited a comment on issue #5017: [DISCUSS] Brand new sharding configuration API of Release 5.x

Posted by GitBox <gi...@apache.org>.
tristaZero edited a comment on issue #5017:
URL: https://github.com/apache/shardingsphere/issues/5017#issuecomment-606453919


   ### TODO
   - [x] New API for standard sharding strategy
   - [x] Implement Inline algorithm for standard sharding strategy
   - [x] Implement range algorithm for standard sharding strategy
   - [x] Delete Inline sharding strategy
   - [x] Modify sharding config 
   - [x] Modify yaml config
   - [x] Modify springboot config
   - [x] Modify spring name config
   - [x] Modify sharding proxy config
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-shardingsphere] tristaZero commented on issue #5017: [DISCUSS] Brand new sharding configuration API of Release 5.x

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #5017: [DISCUSS] Brand new sharding configuration API of Release 5.x
URL: https://github.com/apache/incubator-shardingsphere/issues/5017#issuecomment-606449810
 
 
   Looking forward to your suggestions and comments for brand new sharding configuration API. :)
   Here is the initial design for API.
   
   **The old one**
   ```
   shardingRule:
     tables: 
       t_order:  
         databaseStrategy: 
           standard:  
             shardingColumn:  
               preciseAlgorithmClassName: 
               rangeAlgorithmClassName: 
             complex:  
               shardingColumns:  
               algorithmClassName: 
             inline:  
               shardingColumn:  
               algorithmInlineExpression:  
             hint:  
               algorithmClassName: 
              none:  
         tableStrategy:
   ```
   **The new one**
   ```
   shardingRule:
     tables: 
       t_order: 
         databaseStrategy: 
           standard: 
             shardingColumn: order_id
             shardingAlgorithm:
               type: Inline
               props:
                 ShardingDBVolume: 2
                 ShardingTBVolume: 4
           complex: 
             shardingColumns: year, month
             shardingAlgorithm:
               type: complex
         tableStrategy:
   ```
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [shardingsphere] tristaZero edited a comment on issue #5017: [DISCUSS] Brand new sharding configuration API of Release 5.x

Posted by GitBox <gi...@apache.org>.
tristaZero edited a comment on issue #5017:
URL: https://github.com/apache/shardingsphere/issues/5017#issuecomment-606453919






----------------------------------------------------------------
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:
users@infra.apache.org