Automatic failover

If a Cassandra node fails or becomes unreachable, the C# driver automatically and transparently tries other nodes in the cluster and schedules reconnections to the dead nodes in the background.


How the driver handles failover is determined by which retry and reconnection policies are used when building a cluster object.


This code illustrates building a cluster instance with a retry policy which sometimes retries with a lower consistency level than the one specified for the query.

public RollYourOwnCluster() {
   Cluster cluster = Cluster.Builder()
         .AddContactPoints("", "")
         .WithReconnectionPolicy(new ConstantReconnectionPolicy(100L))
   session = cluster.Connect();