xuejmnet opened a new issue, #16361:
URL: https://github.com/apache/shardingsphere/issues/16361

   Hello I'm [ShardingCore](https://github.com/dotnetcore/sharding-core) 
Author,this lib is c# for sharding,.
   
   i have some idea want share,i think it's useful.
   - sequence query
   - circuit breaker
   
   ## sequence query with order
   i'm create sharding table and use time strategy like sharding by month or 
day ....
   
   sharding logic table name `order`,sharding column `time`
   
   order_202201,order_202202,order_202203,order_202204.
   ```sql
   select * from order  order by time desc limit 1
   ```
   ### now
   parallel with max connections thread
   ```sql
   select * from order_202201 order by time desc limit 1
   select * from order_202202 order by time desc limit 1
   select * from order_202203 order by time desc limit 1
   select * from order_202204 order by time desc limit 1
   ```
   then merge in memory
   
   i think if `shardingsphere` can configure sequence  eg. sharding tail 
comparer,
   ```java
   config.add("time",comparer)
   config.add("id",comparer) if id is snowflakeid
   ```
   
   ### optimize
   we can use independence config for max connections eg. 
config.addsequenceconnectons(1)
   ```sql
   result=select * from order_202204 order by time desc limit 1
   if(result!=null){
     circuit breaker
   }
   result=select * from order_202203 order by time desc limit 1
   if(result!=null){
     circuit breaker
   }
   result=select * from order_202202 order by time desc limit 1
   if(result!=null){
     circuit breaker
   }
   select * from order_202201 order by time desc limit 1
   ```
   
   ## circuit breaker
   ```sql
   select max(time) from order 
   ```
   ### now
   ```sql
   select max(time) from order_202201 
   select max(time) from order_202202 
   select max(time) from order_202203
   select max(time) from order_202204
   ```
   then in memory merge calc max time in list
   
   ### optimize
   ```sql
   result=select max(time) from order_202204
   if(result!=null){
     circuit breaker
   }
   result=select max(time) from order_202203
   if(result!=null){
     circuit breaker
   }
   result=select max(time) from order_202202 
   if(result!=null){
     circuit breaker
   }
   select max(time) from order_202201 
   ```
   
   


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

Reply via email to