Skip to content

SiyaoIsHiding/driver-load-balancing-policies

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Supplementary Policies for Apache Cassandra Java Driver

Currently, this package contains two load balancing policies to be used with the Apache Cassandra Java Driver (version 4.10.0+) - LatencyAndInflightCountLoadBalancingPolicy and LatencySensitiveLoadBalancingPolicy.

Get Started

To use either of the policies, you need to include both the Java driver and this package as dependencies.

        <dependency>
            <groupId>org.apache.cassandra</groupId>
            <artifactId>java-driver-core</artifactId>
            <version>4.10.0</version>
        </dependency>
        <dependency>
            <groupId>com.datastax.oss</groupId>
            <artifactId>java-driver-policies</artifactId>
            <version>1.0</version>
        </dependency>

You also have to specify the name of the load balancing policy class in your application.conf (see this).

datastax-java-driver.basic.load-balancing-policy {
  class = LatencySensitiveLoadBalancingPolicy
}

How to Choose a Load Balancing Policy

We recommend the DefaultLoadBalancingPolicy that comes with the Java Driver for general use. This policy leverages real-time measurements and swiftly responds to changes in node status at short intervals, such as those caused by garbage collection or compaction—common factors that can slow down nodes. However, if you anticipate prolonged delays in node responsiveness, such as during network upgrades or heavy data migrations, you might consider opting for the LatencyAndInflightCountLoadBalancingPolicy or LatencySensitiveLoadBalancingPolicy.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages