ComplexInlineShardingAlgorithm: 基于行表达式的复合分片算法 AutoIntervalShardingAlgorithm: 基于可变时间范围的分片算法 ClassBasedShardingAlgorithm: 基于自定义类的分片算法 HintInlineShardingAlgorithm: 基于行表达式的 Hint 分片算法 IntervalSh
是我们数据表中的某个字段,就是根据它来进行分片,sharding-algorithms是分片算法,我们可以通过SPI来实现自己的分片算法,接口是StandardShardingAlgorithm, 如下我们使用的是INLINE基于行表达式的分片算法,algorithm-expression是分片表达式,ShardingSphere底层会进行解析表达式,然后分片到对应的数据表上面, 我们的表达式是document_...
如document_2022,document_2021,{2013..2022}代表2013到2022这个区间,sharding-column是分片列, 是我们数据表中的某个字段,就是根据它来进行分片,sharding-algorithms是分片算法,我们可以通过SPI来实现自己的分片算法,接口是StandardShardingAlgorithm
Interval Sharding Algorithm# Type: INTERVAL Configurable Properties: NameDataTypeDescriptionDefault Value datetime-patternStringTimestamp pattern of sharding value, must can be transformed to Java LocalDateTime. For example: yyyy-MM-dd HH:mm:ss, yyyy-MM-dd or HH:mm:ss etc. But Gy-MM etc. related...
datetime-interval-amount int 分片键时间间隔 id-name String IdGenerator 的名称(在 IdGeneratorProvider 中已注册) __share__ spring: shardingsphere: rules: sharding: sharding-algorithms: alg-name: type: COSID_INTERVAL_SNOWFLAKE props: logic-name-prefix: logic-name-prefix datetime-lower: 2021-12-...
{2013..2022}代表2013到2022这个区间,sharding-column是分片列, 是我们数据表中的某个字段,就是根据它来进行分片,sharding-algorithms是分片算法,我们可以通过SPI来实现自己的分片算法,接口是StandardShardingAlgorithm, 如下我们使用的是INLINE基于行表达式的分片算法,algorithm-expression是分片表达式,ShardingSphere底层会...
dateShardingAlgorithmkeyGenerators:snowflake:type: SNOWFLAKEprops:worker-id: 123shardingAlgorithms:date...
alg_interval:type:INTERVALprops:datetime-pattern:"yyyyMM"# 分片字段格式datetime-lower:"202201"# 范围下限datetime-upper:"202206"# 范围上限sharding-suffix-pattern:"yyyyMM"# 分片名后缀,可以是MM,yyyyMMdd等。datetime-interval-amount:1# 分片间隔,这里指一个月datetime-interval-unit:"MONTHS"# 分片间隔单位...
shardingRule: tables: orders: actualDataNodes: ds0.orders_${2023..2024}_${01..12} tableStrategy: standard: shardingColumn: order_time shardingAlgorithmName: date_interval_sharding_algorithm shardingAlgorithms: date_interval_sharding_algorithm: type: CLASS_BASED props: strategy: STANDARD algorithmClassN...
the range algorithm’s upper time limit is reached, improving user experience without data movement. Currently, AUTO_INTERVAL and INTERVAL algorithms are supported, which are non-data-movement automaticsharding expansion. Here’s a simple example of automatic sharding. For specific DistSQL usage,...