ReadQueryLoadBalanceAlgorithm

Fully-qualified class name

org.apache.shardingsphere.readwritesplitting.spi.ReadQueryLoadBalanceAlgorithm

Definition

Read query load balance algorithm’s definition

Implementation classes

Configuration TypeDescriptionFully-qualified class name
ROUND_ROBINthe read database load balancer algorithm based on pollingorg.apache.shardingsphere.readwritesplitting.algorithm.loadbalance.RoundRobinReadQueryLoadBalanceAlgorithm
RANDOMthe read database load balancer algorithm based on randomorg.apache.shardingsphere.readwritesplitting.algorithm.loadbalance.RandomReadQueryLoadBalanceAlgorithm
WEIGHTthe read database load balancer algorithm based on weightorg.apache.shardingsphere.readwritesplitting.algorithm.loadbalance.WeightReadQueryLoadBalanceAlgorithm
TRANSACTION_RANDOMWhether in a transaction or not, read requests are routed to multiple replicas using a random strategyorg.apache.shardingsphere.readwritesplitting.algorithm.loadbalance.TransactionRandomReadQueryLoadBalanceAlgorithm
TRANSACTION_ROUND_ROBINWhether in a transaction or not, read requests are routed to multiple replicas using a round-robin strategyorg.apache.shardingsphere.readwritesplitting.algorithm.loadbalance.TransactionRoundRobinReadQueryLoadBalanceAlgorithm
TRANSACTION_WEIGHTWhether in a transaction or not, read requests are routed to multiple replicas using a weight strategyorg.apache.shardingsphere.readwritesplitting.algorithm.loadbalance.TransactionWeightReadQueryLoadBalanceAlgorithm
FIXED_REPLICA_RANDOMOpen transaction, and the read request is routed to a fixed replica using a random strategy; if the transaction is not opened, each read traffic is routed to a different replica using the specified algorithmorg.apache.shardingsphere.readwritesplitting.algorithm.loadbalance.FixedReplicaRandomReadQueryLoadBalanceAlgorithm
FIXED_REPLICA_ROUND_ROBINOpen transaction, and the read request is routed to a fixed replica using a round-robin strategy; if the transaction is not opened, each read traffic is routed to a different replica using the specified algorithmorg.apache.shardingsphere.readwritesplitting.algorithm.loadbalance.FixedReplicaRoundRobinReadQueryLoadBalanceAlgorithm
FIXED_REPLICA_WEIGHTOpen transaction, and the read request is routed to a fixed replica using a weight strategy; if the transaction is not opened, each read traffic is routed to a different replica using the specified algorithmorg.apache.shardingsphere.readwritesplitting.algorithm.loadbalance.FixedReplicaWeightReadQueryLoadBalanceAlgorithm
FIXED_PRIMARYAll read traffic is routed to the primaryorg.apache.shardingsphere.readwritesplitting.algorithm.loadbalance.FixedPrimaryReadQueryLoadBalanceAlgorithm