The Connection Pooledit

The connection pool is an object inside the client that is responsible for maintaining the current list of nodes. Theoretically, nodes are either dead or alive.

However, in the real world, things are never so clear. Nodes are sometimes in a gray-zone of "probably dead but not confirmed", "timed-out but unclear why" or "recently dead but now alive".

The connection pool’s job is to manage this set of unruly connections and try to provide the best behavior to the client. There are currently two connection pool implementations:

  • staticConnectionPool: the user provides a static list of hosts and the connection pool simply tries to use these connections as required
  • sniffingConnectionPool: the user provides a seed list of hosts, which the client uses to sniff the rest of the cluster using the Cluster State API