Skip to content

Commit c698120

Browse files
authored
4.x: Update LBP manual (#205)
* Changed Cassandra to ScyllaDB where applicable * Updated `DefaultLoadBalancingPolicy` documentation * Updated links to point to ScyllaDB documentations
1 parent 3446aae commit c698120

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

manual/core/load_balancing/README.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Which nodes the driver talks to, and in which order they are tried.
2929

3030
-----
3131

32-
A Cassandra cluster is typically composed of multiple nodes; the *load balancing policy* (sometimes
32+
A Scylla cluster is typically composed of multiple nodes; the *load balancing policy* (sometimes
3333
abbreviated LBP) is a central component that determines:
3434

3535
* which nodes the driver will communicate with;
@@ -86,6 +86,9 @@ policies, that we consider the best choices for most cases:
8686
- `DefaultLoadBalancingPolicy` should almost always be used; it requires a local datacenter to be
8787
specified either programmatically when creating the session, or via the configuration (see below).
8888
It can also use a highly efficient slow replica avoidance mechanism, which is by default enabled.
89+
This implementation prioritizes replica nodes over non-replica ones. If more than one replica is available, the
90+
replicas will be shuffled. If more than 2 replicas are available, they will be ordered from most healthy to least
91+
healthy ("Power of 2 choices" or busy node avoidance algorithm). Non-replica nodes will be included in a round-robin fashion.
8992
- `DcInferringLoadBalancingPolicy` is similar to `DefaultLoadBalancingPolicy`, but does not require
9093
a local datacenter to be defined, in which case it will attempt to infer the local datacenter from
9194
the provided contact points. If that's not possible, it will throw an error during session
@@ -105,7 +108,7 @@ requirements.
105108

106109
By default, both `DefaultLoadBalancingPolicy` and `DcInferringLoadBalancingPolicy` **only connect to
107110
a single datacenter**. The rationale is that a typical multi-region deployment will collocate one or
108-
more application instances with each Cassandra datacenter:
111+
more application instances with each ScyllaDB datacenter:
109112

110113
```ditaa
111114
/----+----\
@@ -128,7 +131,7 @@ more application instances with each Cassandra datacenter:
128131
| v | | v |
129132
| +-----------+ | | +-----------+ |
130133
| | {s} | | | | {s} | |
131-
| | Cassandra +------=------+ Cassandra | |
134+
| | ScyllaDB +------=------+ ScyllaDB | |
132135
| | DC1 | | | | DC2 | |
133136
| +-----------+ | | +-----------+ |
134137
| | | |
@@ -272,7 +275,7 @@ alternatives:
272275

273276
1. **Application-level failover**: instead of letting the driver do the failover, implement the
274277
failover logic in your application. Granted, this solution wouldn't be much better if the
275-
application servers are co-located with the Cassandra datacenter itself. It's also a bit more work,
278+
application servers are co-located with the ScyllaDB datacenter itself. It's also a bit more work,
276279
but at least, you would have full control over the failover procedure: you could for example decide,
277280
based on the exact error that prevented the local datacenter from fulfilling a given request,
278281
whether a failover would make sense, and which remote datacenter to use for that specific request.
@@ -287,7 +290,7 @@ possibly scaling up its bandwidth to cope with the network traffic spike. This i
287290
solution for the cross-datacenter failover issue in general, but we acknowledge that it also
288291
requires a purpose-built infrastructure. To help you explore this option, read our [white paper].
289292

290-
[application-level failover example]: https://github.com/datastax/java-driver/blob/4.x/examples/src/main/java/com/datastax/oss/driver/examples/failover/CrossDatacenterFailover.java
293+
[application-level failover example]: https://github.com/scylladb/java-driver/blob/scylla-4.x/examples/src/main/java/com/datastax/oss/driver/examples/failover/CrossDatacenterFailover.java
291294
[white paper]: https://www.datastax.com/sites/default/files/content/whitepaper/files/2019-09/Designing-Fault-Tolerant-Applications-DataStax.pdf
292295

293296
#### Token-aware
@@ -462,12 +465,12 @@ Then it uses the "closest" distance for any given node. For example:
462465
* policy1 changes its suggestion to IGNORED. node1 is set to REMOTE;
463466
* policy1 changes its suggestion to REMOTE. node1 stays at REMOTE.
464467

465-
[DriverContext]: https://docs.datastax.com/en/drivers/java/4.17/com/datastax/oss/driver/api/core/context/DriverContext.html
466-
[LoadBalancingPolicy]: https://docs.datastax.com/en/drivers/java/4.17/com/datastax/oss/driver/api/core/loadbalancing/LoadBalancingPolicy.html
467-
[BasicLoadBalancingPolicy]: https://github.com/datastax/java-driver/blob/4.x/core/src/main/java/com/datastax/oss/driver/internal/core/loadbalancing/BasicLoadBalancingPolicy.java
468-
[getRoutingKeyspace()]: https://docs.datastax.com/en/drivers/java/4.17/com/datastax/oss/driver/api/core/session/Request.html#getRoutingKeyspace--
469-
[getRoutingToken()]: https://docs.datastax.com/en/drivers/java/4.17/com/datastax/oss/driver/api/core/session/Request.html#getRoutingToken--
470-
[getRoutingKey()]: https://docs.datastax.com/en/drivers/java/4.17/com/datastax/oss/driver/api/core/session/Request.html#getRoutingKey--
471-
[NodeDistanceEvaluator]: https://docs.datastax.com/en/drivers/java/4.17/com/datastax/oss/driver/api/core/loadbalancing/NodeDistanceEvaluator.html
472-
[`nodetool status`]: https://docs.datastax.com/en/dse/6.7/dse-dev/datastax_enterprise/tools/nodetool/toolsStatus.html
473-
[cqlsh]: https://docs.datastax.com/en/dse/6.7/cql/cql/cql_using/startCqlshStandalone.html
468+
[DriverContext]: https://java-driver.docs.scylladb.com/scylla-4.13.0.x/api/com/datastax/oss/driver/api/core/context/DriverContext.html
469+
[LoadBalancingPolicy]: https://java-driver.docs.scylladb.com/scylla-4.13.0.x/api/com/datastax/oss/driver/api/core/loadbalancing/LoadBalancingPolicy.html
470+
[BasicLoadBalancingPolicy]: https://github.com/scylladb/java-driver/blob/scylla-4.x/core/src/main/java/com/datastax/oss/driver/internal/core/loadbalancing/BasicLoadBalancingPolicy.java
471+
[getRoutingKeyspace()]: https://java-driver.docs.scylladb.com/scylla-4.13.0.x/api/com/datastax/oss/driver/api/core/session/Request.html#getRoutingKeyspace--
472+
[getRoutingToken()]: https://java-driver.docs.scylladb.com/scylla-4.13.0.x/api/com/datastax/oss/driver/api/core/session/Request.html#getRoutingToken--
473+
[getRoutingKey()]: https://java-driver.docs.scylladb.com/scylla-4.13.0.x/api/com/datastax/oss/driver/api/core/session/Request.html#getRoutingKey--
474+
[NodeDistanceEvaluator]: https://java-driver.docs.scylladb.com/scylla-4.13.0.x/api/com/datastax/oss/driver/api/core/loadbalancing/NodeDistanceEvaluator.html
475+
[`nodetool status`]: https://docs.scylladb.com/stable/operating-scylla/nodetool-commands/status.html
476+
[cqlsh]: https://docs.scylladb.com/stable/cql/cqlsh.html

0 commit comments

Comments
 (0)