Compare connection methods

When you develop applications that interact with your Astra DB Serverless databases, you must connect to your databases programmatically. Astra DB Serverless offers several methods to connect to your databases including APIs, clients, CQL, drivers, CLI tools, and specialized connectors.

Depending on your use case, you might use one or more of these options:

Use case Requirements Recommended methods

Application development

Use a Serverless (Vector) database

Use a Serverless (Non-Vector) database

Use specific CQL functions that aren’t supported by the Data API

Maintain a legacy application that relies on a DataStax driver or CQL

Administration

Perform administrative tasks programmatically

Other

Streaming and data analysis

Bulk loading

APIs

Use the Data API and DevOps API to programmatically interact with your Astra DB organizations and databases:

  • Get started with the Astra DevOps API: Use the DevOps API for administration and high-level database management tasks, such as database creation, user management, and security configurations.

  • Get started with the Data API: Use the Data API and clients to work with Serverless (Vector) databases.

    • The Data API supports collections and tables in Serverless (Vector) databases, including tables created through the CQL shell or a DataStax driver. For more information, see Work with tables.

    • In addition to Data API commands, the Data API clients provide convenient access to some DevOps API endpoints related to database and keyspace management. For more information, see Databases reference.

Clients

You can use the DataStax clients to interact with the Data API and access some DevOps API functions, such as creating databases and keyspaces.

DataStax supports the following clients for Astra DB Serverless:

Language Client Version Dependency Documentation

Python

astrapy

Latest astrapy release on GitHub

Python 3.8 or later

Get started with the Data API

TypeScript

astra-db-ts

Latest astra-db-ts release on GitHub

Node.js 18 or later

Get started with the Data API

Java

astra-db-java

Latest astra-db-java release on Maven Central

Java 17 or later (21 recommended)

Get started with the Data API

  • For a guided experience to get started with the clients, see the Quickstart.

  • If DataStax doesn’t offer a client for your preferred language, you can still connect to the Data API over HTTP. For more information, see Get started with the Data API.

Cassandra Query Language (CQL)

Because Astra DB Serverless is powered by Apache Cassandra®, you can use Cassandra Query Language (CQL) to programmatically interact with your databases through the CQL shell (cqlsh) or a DataStax driver. For more information, see CQL for Astra DB.

Drivers

DataStax recommends clients for most applications. Use drivers for Serverless (Non-Vector) databases, legacy applications that rely on a driver, and use cases that require specific CQL functions that aren’t supported by the Data API.

DataStax supports the following drivers for Astra DB Serverless:

Language Driver Version Documentation

C++

cpp-driver

Latest cpp-driver release on GitHub

Connect

Quickstart

C#

csharp-driver

Latest csharp-driver release on GitHub

Connect

Quickstart

Go

gocql-astra (with cassandra-gocql-driver)

Latest gocql release on GitHub

Connect

Quickstart

Java

cassandra-java-driver

Latest cassandra-java-driver release on GitHub

Connect

Quickstart

Node.js

nodejs-driver

Latest nodejs-driver release on GitHub

Connect

Quickstart

Python

python-driver

Latest python-driver release on GitHub

Connect

Quickstart

If you are using a driver for an unsupported language, consider using DataStax CQL Proxy. The CQL Proxy enables unsupported drivers to work with Astra DB Serverless.

DataStax CQL Proxy simplifies connecting to Astra DB Serverless without having to change your DataStax driver, driver version, or framework. This open source tool securely forwards your application’s CQL traffic to an appropriate database service. CQL Proxy automatically discovers Astra DB Serverless, and then configures communication with it.

For more information about working with drivers, see DataStax driver matrix and Developing applications with DataStax drivers.

Connectors

Use connectors for specialized data analysis and streaming tasks:

  • Change Data Capture (CDC) connector

    CDC for Astra DB automatically captures changes in real time, de-duplicates the changes, and then streams the clean set of changed data into Astra Streaming where it can be processed by client applications or sent to downstream systems.

  • Spark Cassandra connector (SCC)

    Apache Spark with Scala in spark-shell seamlessly connects to and accesses your Astra DB Serverless tables for advanced data analysis. You can directly execute SQL and CQL queries to interact with your data, and you can employ Spark DataFrames and RDDs for sophisticated data manipulation and analysis.

Astra Portal

The Astra Portal provides a web-based interface to manage your Astra DB Serverless organizations and databases. It is best for administrative tasks and high-level database management, including inspecting database health metrics.

For fine-grained data manipulation and nuanced searches, you must use a programmatic approach, such as the Data API.

If your organization has strict firewall rules, you might need to authorize the following ports and third-party domains to access the Astra Portal:

  • app.pendo.io: Astra Portal

  • sdk.split.io: Astra Portal

  • 443: APIs and Astra DB metrics

  • 29042: CQL

  • 29080: Metadata service

If these ports and domains aren’t authorized, browsers can render the Astra Portal incorrectly and some functionality can be unavailable.

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

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.

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