How does Cassandra choose a node coordinator and replication nodes?

How does a Cassandra client choose a node coordinator? does the node coordinator store data sent by the client before replication?

+10
cassandra nosql
source share
2 answers

The coordinating node is usually selected by an algorithm that takes into account the "network distance". Any node can act as a coordinator, and first requests will be sent to nodes that your driver knows about. But as soon as it connects and understands the topology of your cluster, it can change to a “closer” coordinator.

The coordinator stores data only locally (during recording) if it turns out to be one of the nodes responsible for the range of data tokens.

+9
source share

The coordinator is selected by the driver based on the policy that you set. Common Policies - DCAwareRoundRobinPolicy and TokenAware Policies.

For DCAwareRoundRobinPolicy, the driver selects the node coordinator according to its circular policy. More details here: http://docs.datastax.com/en/drivers/java/2.1/com/datastax/driver/core/policies/DCAwareRoundRobinPolicy.html

For TokenAwarePolicy, he chooses the node coordinator, which requests the data - to reduce the "transitions" and latency. Additional information: http://docs.datastax.com/en/drivers/java/2.1/com/datastax/driver/core/policies/TokenAwarePolicy.html

It’s best to apply a migration policy, so there is a problem with primary and secondary policies. Additional information is available at the links above.

+10
source share

All Articles