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/06/07 06:10:21 UTC
[GitHub] [shardingsphere] tristaZero opened a new issue #5937: [New API] Automatic Sharding Strategies for Databases and Tables
tristaZero opened a new issue #5937:
URL: https://github.com/apache/shardingsphere/issues/5937
Hi community,
As you know, ShardingSphere is not just a simple distributed database middleware. **We aim at providing transparent distributed database service to our end-users.**
Therefore, a new API is being considered to cover the detail of sharding databases and tables, making users view distributed database clusters as a single logical database. This new API looks like the below one (Please Notice the annotation),
```yaml
dataSources:
ds_0:
url: jdbc:mysql://127.0.0.1:3306/demo_ds_0?serverTimezone=UTC&useSSL=false
ds_1:
url: jdbc:mysql://127.0.0.1:3306/demo_ds_1?serverTimezone=UTC&useSSL=false
ds_2:
url: jdbc:mysql://127.0.0.1:3306/demo_ds_1?serverTimezone=UTC&useSSL=false
rules:
- !SHARDING
tables:
t_new: # New one
actualDataSources: ds_0, ds_1 # Notice1
shardingStrategy: # Notice2
standard:
shardingColumn: order_id
shardingAlgorithm:
type: MOD
props:
mod.value: 5
t_order: # Old one
actualDataNodes: ds_${0..1}.t_order_${0..1}
tableStrategy:
standard:
shardingColumn: order_id
shardingAlgorithm:
type: INLINE
props:
algorithm.expression: t_order_${order_id % 2}
dataBaseStrategy:
standard:
shardingColumn: user_id
shardingAlgorithm:
type: INLINE
props:
algorithm.expression: t_order_${user_id % 2}
keyGenerator:
type: SNOWFLAKE
column: order_id
```
Also, I schedule this task here, which is not an easy job, apparently.
-[ ] New API design
-[ ] Configuration modification
-[ ] New interface for automatic sharding algorithm
-[ ] Implements the New interface
-[ ] The conversation from configuration to sharding strategies
-[ ] Changes for various clients, such as Spring, YAML, Proxy and so on
-[ ] Tests
Notice: The new API is an enhancement for the old one, rather than replacement, i.e., **forward compatible.**
----------------------------------------------------------------
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] [shardingsphere] tristaZero edited a comment on issue #5937: [New API] Automatic Sharding Strategies for Databases and Tables
Posted by GitBox <gi...@apache.org>.
tristaZero edited a comment on issue #5937:
URL: https://github.com/apache/shardingsphere/issues/5937#issuecomment-640485191
New sub-tasks are appended here,
- [x] Move `HashShardingAlgorithm` and `ModuloShardingAlgorithm` to the new dir.
- [x] Add `init()` for `ShardingAlgorithm`
- [ ] Review `@Ignore` for `rangeAlgorithm`
- [ ] Make the props and partitions uniform for all algorithms
- [ ] Update the old API
- [x] Remove `ShardingAutoTableAlgorithm` from `InlineShardingAlgorithm`
- [x] Remove `logic index tag` from sharding spring namespace
----------------------------------------------------------------
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] [shardingsphere] terrymanu closed issue #5937: [New API] Automatic Sharding Strategies for Databases and Tables
Posted by GitBox <gi...@apache.org>.
terrymanu closed issue #5937:
URL: https://github.com/apache/shardingsphere/issues/5937
----------------------------------------------------------------
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] [shardingsphere] tristaZero closed issue #5937: [New API] Automatic Sharding Strategies for Databases and Tables
Posted by GitBox <gi...@apache.org>.
tristaZero closed issue #5937:
URL: https://github.com/apache/shardingsphere/issues/5937
----------------------------------------------------------------
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] [shardingsphere] tristaZero commented on issue #5937: [New API] Automatic Sharding Strategies for Databases and Tables
Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #5937:
URL: https://github.com/apache/shardingsphere/issues/5937#issuecomment-640167904
@terrymanu proposed another solution in mail list,
```yaml
dataSources:
ds_0:
url: jdbc:mysql://127.0.0.1:3306/demo_ds_0?serverTimezone=UTC&useSSL=false
ds_1:
url: jdbc:mysql://127.0.0.1:3306/demo_ds_1?serverTimezone=UTC&useSSL=false
ds_2:
url: jdbc:mysql://127.0.0.1:3306/demo_ds_1?serverTimezone=UTC&useSSL=false
rules:
- !SHARDING
mt_tables:
t_order: # Old one
actualDataNodes: ds_${0..1}.t_order_${0..1}
tableStrategy:
standard:
shardingColumn: order_id
shardingAlgorithm:
type: INLINE
props:
algorithm.expression: t_order_${order_id % 2}
dataBaseStrategy:
standard:
shardingColumn: user_id
shardingAlgorithm:
type: INLINE
props:
algorithm.expression: t_order_${user_id % 2}
keyGenerator:
type: SNOWFLAKE
column: order_id
at_table:
t_new: # New one
actualDataSources: ds_0, ds_1 # Notice1
shardingStrategy: # Notice2
standard:
shardingColumn: order_id
shardingAlgorithm:
type: MOD
props:
mod.value: 5
keyGenerator:
type: SNOWFLAKE
column: order_id
```
----------------------------------------------------------------
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] [shardingsphere] tristaZero removed a comment on issue #5937: [New API] Automatic Sharding Strategies for Databases and Tables
Posted by GitBox <gi...@apache.org>.
tristaZero removed a comment on issue #5937:
URL: https://github.com/apache/shardingsphere/issues/5937#issuecomment-640485191
New sub-tasks are appended here,
- [x] Move `HashShardingAlgorithm` and `ModuloShardingAlgorithm` to the new dir.
- [x] Add `init()` for `ShardingAlgorithm`
- [ ] Review `@Ignore` for `rangeAlgorithm`
- [ ] Make the props and partitions uniform for all algorithms
- [ ] Update the old API
- [x] Remove `ShardingAutoTableAlgorithm` from `InlineShardingAlgorithm`
- [x] Remove `logic index tag` from sharding spring namespace
----------------------------------------------------------------
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] [shardingsphere] tristaZero edited a comment on issue #5937: [New API] Automatic Sharding Strategies for Databases and Tables
Posted by GitBox <gi...@apache.org>.
tristaZero edited a comment on issue #5937:
URL: https://github.com/apache/shardingsphere/issues/5937#issuecomment-640485191
----------------------------------------------------------------
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] [shardingsphere] tristaZero commented on issue #5937: [New API] Automatic Sharding Strategies for Databases and Tables
Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #5937:
URL: https://github.com/apache/shardingsphere/issues/5937#issuecomment-640485191
New sub-tasks are appended here,
- [ ] Move `HashShardingAlgorithm` and `ModuloShardingAlgorithm` to the new dir.
- [ ] Add `init()` for `ShardingAlgorithm`
----------------------------------------------------------------
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