If you are willing to use consistency level ONE
, you do not care which data centre is used, so there is no need to use DCAwareRoundRobinPolicy
. If you want the write to be as quick as possible, you want to minimise the latency, so you ought to use LatencyAwarePolicy
; in practice this will normally select a node at the local data centre, but will use a remote node if it is likely to provide better performance, such as when a local node is overloaded. You also want to minimize the number of network hops, so you want to use one of the storage nodes for the write as the coordinator for the write, so you should use TokenAwarePolicy
. You can chain policies together by passing one to the constructor call of another.
Unfortunately, the Cassandra driver does not provide any directly useful base policy for you to use as the child policy of LatencyAwarePolicy
or TokenAwarePolicy
; the choices are DCAwareRoundRobinPolicy
, RoundRobinPolicy
and WhiteListPolicy
. However, if you use RoundRobinPolicy
as the child policy, the LatencyAwarePolicy
should, after the first few queries, acquire the latency information it needs.