> I understand that CL.ONE means the read operation will block until at
> least one -replica- responds. If this node is not a replica, what
> happens?

The node (known as the "coordinating node" because it co-ordinates the
request submitted by the client) will send the request to the nodes
that are in the replica set for the row. The client need not care
about which host it connects to, other than that it be "one of the
ones in the correct cluster".

Is this the source of confusion? There is never any issue with talking
to the "wrong" node outside of the replica set. The client just
doesn't care; Cassandra takes care of it.

> For write operations, I could use CL.ANY. It just requires that it is
> written to 1 node, not necessarily 1 replica. But CL.ANY is not
> supported for reading. So if no replicas for the data are online, the
> data is not available, correct? This is why I want to maximize the
> number of replicas, to maximize availability such that even if N-1
> nodes are offline, there is no meaningful difference in operation.

CL.ANY is intended for cases where you want to ensure write
availability if at all possible, even if it means that the data won't
be readable at all from any nodes until some time in the future.

It sounds like you're worried about data ending up on nodes that are
outside of the replica set, or that reads are done outside of the
replica set. This is not something you need to worry about. Just
submit your queries to the cluster and the appropriate nodes will be
serving the requests.

-- 
/ Peter Schuller (@scode on twitter)

Reply via email to