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 |
Python 3.8 or later |
|||
TypeScript |
Node.js 18 or later |
|||
Java |
Java 17 or later (21 recommended) |
|
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++ |
||||
C# |
||||
Go |
||||
Java |
||||
Node.js |
||||
Python |
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:
If these ports and domains aren’t authorized, browsers can render the Astra Portal incorrectly and some functionality can be unavailable. |