title: MongoDB driver and cluster
body: <p>I am moving from a single mongodb instance to a sharded cluster with 3 replica sets, 3 config servers and 1 mongos instance. Each replica set in turn has three mongod instances.</p>
  
  <p>I'm looking for high availability when I am adding documents to the collection. What  should I connect to from my Java program? Should I connect to mongos or mongod from any replica set? </p>
  
  <p>Can you please let me know ?</p>
  
  <p>Thanks. </p>