zjcnb opened a new issue, #18587:
URL: https://github.com/apache/shardingsphere/issues/18587
Hi community,
Now, the `readwrite-splitting` configuration are not user-friendly. The
master-slave configuration should be intuitive to the user. Instead of the
master-slave configuration to props. So we should be refactor it.
`Static Readwrite-splitting before refactor : `
```
rules:
- !READWRITE_SPLITTING
dataSources:
readwrite_ds:
type: Static
props:
write-data-source-name: write_ds
read-data-source-names: read_ds_0,read_ds_1
loadBalancerName: random
loadBalancers:
random:
type: RANDOM
```
`Dynamic Readwrite-splitting before refactor : `
```
rules:
- !READWRITE_SPLITTING
dataSources:
replication_ds:
type: Dynamic
props:
auto-aware-data-source-name: readwrite_ds
write-data-source-query-enabled: false
- !DB_DISCOVERY
dataSources:
readwrite_ds:
dataSourceNames:
- ds_0
- ds_1
- ds_2
discoveryHeartbeatName: mgr-heartbeat
discoveryTypeName: mgr
discoveryHeartbeats:
mgr-heartbeat:
props:
keep-alive-cron: '0/5 * * * * ?'
discoveryTypes:
mgr:
type: MGR
props:
group-name: 558edd3c-02ec-11ea-9bb3-080027e39bd2
```
`Static Readwrite-splitting after refactor : `
```
rules:
- !READWRITE_SPLITTING
dataSources:
readwrite_ds:
dataSourceStrategy:
static:
writeDataSourceName: write_ds
readDataSourceNames:
- read_ds_0
- read_ds_1
```
`Dynamic Readwrite-splitting before refactor : `
```
rules:
- !READWRITE_SPLITTING
dataSources:
readwrite_ds:
dataSourceStrategy:
dynamic:
autoAwareDataSourceName: readwrite_ds
writeDataSourceQueryEnabled: false
- !DB_DISCOVERY
dataSources:
readwrite_ds:
dataSourceNames:
- ds_0
- ds_1
- ds_2
discoveryHeartbeatName: mgr-heartbeat
discoveryTypeName: mgr
discoveryHeartbeats:
mgr-heartbeat:
props:
keep-alive-cron: '0/5 * * * * ?'
discoveryTypes:
mgr:
type: MGR
props:
group-name: 558edd3c-02ec-11ea-9bb3-080027e39bd2
```
--
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.
To unsubscribe, e-mail:
[email protected]
For queries about this service, please contact Infrastructure at:
[email protected]