ssd
ssd

Reputation: 29

How is a client query distributed across a Cassandra cluster?

Can anyone please explain to me how a client query is distributed in a Cassandra cluster?

In my set-up I have three nodes (A, B and C) and data is shared evenly across all nodes. I am running Python server code on another PC (D). When a client sends a request to D, how does the Cassandra cluster distribute the client query?

Upvotes: 2

Views: 743

Answers (1)

Jim Meyer
Jim Meyer

Reputation: 9475

It would probably depend on how your python server is configured. If it's using the Datastax python driver, then there are various load balancing options that can be configured to tell the driver how you want queries to be load balanced.

For example cassandra.policies.RoundRobinPolicy would iterate over the available Cassandra nodes to send each query to a different node.

Or cassandra.policies.TokenAwarePolicy would figure out which nodes have replicas for the target partition and contact those nodes directly (i.e. skip contacting nodes that do not have the target partition).

The available load balancing policies can sometimes be combined.

For more information see this.

Upvotes: 0

Related Questions