• Glossary
  • Support
  • Downloads
  • DataStax Home
Get Live Help
Expand All
Collapse All

Developing applications with DataStax drivers

    • Getting started
    • Overview
      • Authentication in DataStax drivers
      • Best practices
      • Driver metrics
    • Connecting
      • Client errors
      • Connecting to DataStax Astra databases
      • Connecting to the database
      • Connection pooling
      • Error handling
      • Reconnection policies
      • Retry policies
      • Server errors
      • Using SSL in DataStax drivers
    • Managing
      • Load balancing with DataStax drivers
      • Using DSE Search with the DataStax drivers
      • Guided code experience examples
      • Managing concurrency in asynchronous query execution
      • Result paging with DataStax drivers
    • Developing
      • Submitting DSE Graph queries with the DataStax drivers
      • Execution profiles
      • Working with multi-workload clusters
      • Object mappers in DSE drivers
      • Submitting queries
      • Query idempotence
      • Query timestamps
      • Speculative query execution
      • Synchronous and asynchronous query execution
  • Developing applications with DataStax drivers
  • Connecting
  • Connection pooling

Connection pooling

The DataStax drivers maintain a pool of connections to each of the nodes selected by the load balancing policy.

By default, the driver instance creates one connection to each of the local datacenter hosts in the default load balancing policies.

Connection pooling is separate from the initial contact points. Initial contact points are supplied to the driver instance. Those contact points are used only to establish the control connection to discover the Cassandra or DSE cluster topology.

Connection pools are accessed asynchronously. Multiple requests can be submitted on a single connection simultaneously. For most workloads, it is recommended to use one long-lived connection from the driver to each DSE server. If the default connection pool settings are not adequate, the number of connections per host and the maximum number of simultaneous requests per connection are configurable. The binary protocol allows up to 32,768 concurrent requests per connection.

Table 1. Connection pools configuration

C/C++

C#

Java

Node.js

PHP

Python [1]

Ruby [2]

Footnotes


1. Does not have ability to customize connections per host, single thread/GIL is limiting factor.
2. Search page for connections_per_local_node and requests_per_connection.
Connecting to the database Error handling

General Inquiries: +1 (650) 389-6000 info@datastax.com

© DataStax | Privacy policy | Terms of use

DataStax, Titan, and TitanDB are registered trademarks of DataStax, Inc. and its subsidiaries in the United States and/or other countries.

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries.

Kubernetes is the registered trademark of the Linux Foundation.

landing_page landingpage