ShardingSphere 4.x -Sharding-JDBC-Configuration manual-Java configuration

Configuration Instance

The implementation of DataSource in the following configuration is DataSourceUtil,The ModuloShardingTableAlgorithm class needs user-defined. For a detailed example ModuloShardingTableAlgorithm

Data Sharding

Read-Write Split

Data Masking

Data Sharding + Read-Write Split

Data Sharding + Data Masking

Orchestration

Configuration Item Explanation

Data Sharding

ShardingDataSourceFactory

ShardingRuleConfiguration

TableRuleConfiguration

StandardShardingStrategyConfiguration

Subclass of ShardingStrategyConfiguration.

ComplexShardingStrategyConfiguration

The implementation class of ShardingStrategyConfiguration, used in complex sharding situations with multiple sharding keys.

InlineShardingStrategyConfiguration

The implementation class of ShardingStrategyConfiguration, used in sharding strategy of inline expression.

HintShardingStrategyConfiguration

The implementation class of ShardingStrategyConfiguration, used to configure hint sharding strategies.

NoneShardingStrategyConfiguration

The implementation class of ShardingStrategyConfiguration, used to configure none-sharding strategies.

KeyGeneratorConfiguration

Properties

Property configuration that can include these properties of these key generators.

EncryptRuleConfiguration

EncryptorRuleConfiguration

EncryptTableRuleConfiguration

EncryptColumnRuleConfiguration

Properties

Read-Write Split

MasterSlaveDataSourceFactory

MasterSlaveRuleConfiguration

Properties

Data Masking

EncryptDataSourceFactory

EncryptRuleConfiguration

Properties

Orchestration

OrchestrationShardingDataSourceFactory

OrchestrationMasterSlaveDataSourceFactory

OrchestrationEncryptDataSourceFactory

OrchestrationConfiguration

CenterConfiguration

Common configuration in properties as follow:

If type of center is zookeeper with config-center&registry-center, properties could be set with the follow options:

If type of center is etcd with config-center&registry-center, properties could be set with the follow options:

If type of center is apollo with config-center&registry-center, properties could be set with the follow options:

If type of center is nacos with config-center&registry-center, properties could be set with the follow options:

Open source ecosystem for distributed database, transactions, governance & more. https://github.com/sharding-sphere/sharding-sphere