Connecting to DataStax Astra databases

The DataStax drivers connect to DataStax Astra databases, in addition to traditional DataStax Enterprise (DSE) or Apache Cassandra database clusters.

The DataStax drivers connect to DataStax Astra databases, in addition to traditional DataStax Enterprise (DSE) or Apache Cassandra database clusters.

For detailed information about connecting to Astra, see Connecting to Astra databases using DataStax drivers.

Driver configuration

All DataStax drivers have configuration file attributes, builder methods, or constructor parameters for pointing to the secure connect bundle. The database username and password are specified through the normal driver APIs for configuring a plain text authentication provider, or through using one of the convenience methods for username and password.

When using the secure connect bundle, the DataStax drivers automatically establish mutually authenticated TLS connections to the service. You do not have to unzip the secure connect bundle or supply contact points.

After establishing a connection the resulting session is optimally configured for interacting with your Astra database. It is possible (but not required) to use other advanced features, such as Speculative query execution and Execution profiles.

The DataStax driver documentation for your language contains getting started examples and API documentation. Upgrade to the latest minor version of your language’s driver to get the new Astra connection API.

Choosing which driver to use

For new applications and for testing, use the DataStax drivers for Apache Cassandra:

Table 1. DataStax drivers for Apache Cassandra
C/C++ (Astra API introduced in version 2.14.0) C# (Astra API introduced in version 3.12.0) Java version 4.x (Astra API introduced in version 4.3.0) and 3.x (Astra API introduced in version 3.8.0) Node.js (Astra API introduced in version 4.3.0) PHP (not supported) Python (Astra API introduced in version 3.20.0) Ruby (not supported)

For existing applications that use the deprecated DSE Drivers:

Table 2. DataStax Enterprise drivers
C/C++ (Astra API introduced in version 1.10.0) C# (Astra API introduced in version 2.9.0) Java version 2.x (Astra API introduced in version 2.3.0) and 1.x (Astra API introduced in version 1.9.0) Node.js (Astra API introduced in version 2.3.0) PHP (not supported) Python (Astra API introduced in version 2.11.0) Ruby (not supported)
Note: All the driver functionality that was in the DSE drivers is now in the DataStax drivers for Apache Cassandra. See the upgrade guides for each driver for information on migrating to the DataStax drivers.

Migrating applications between Apache Cassandra, DDAC, DSE, and Astra

If you have tooling that currently works with self-managed deployments (Apache Cassandra, DataStax Distribution of Apache Cassandra or DataStax Enterprise clusters), connecting it to Astra is simple:

  • Upgrade to the version of the driver that supports the Astra secure connect bundle.
  • Set a configuration value to point to the secure connect bundle.

The following table shows the configuration settings required to connect to a self-managed deployment or an Astra database.

Table 3. Configuration changes for self-managed deployments and Astra
Parameter Self-managed DataStax Astra
Contact points required unset
Secure connect bundle unset required
SSL context optional, configured manually automatically configured
Local datacenter required automatically configured
Database username optional, configured manually required
Database password optional, configured manually required
Note: Astra enforces application best practices by preventing functionality that degrades the database. For a full list of these limits see the Astra on AWS and Astra on GCP documentation.