Connect to Astra Managed Clusters databases
When you develop applications that interact with your Astra Managed Clusters databases, you must connect to your databases programmatically.
There are several ways to connect to your databases, including APIs, CLI tools, and Apache Cassandra® drivers. Depending on your use case, you might use one or more of these methods.
| Use case | Recommended methods |
|---|---|
Application development with an Astra Managed Clusters database |
|
Maintain a legacy application that relies on a driver or CQL |
|
Administration |
|
Streaming |
|
Migration and bulk loading |
|
Third-party integrations |
Varies by provider and use case; see Integrations overview |
|
Programmatic authentication is handled through an application token and the Secure Connect Bundle (SCB). |
DevOps API
Use the DevOps API for administration and high-level database management tasks, such as database creation, user management, and security configurations.
For more information, see Get started with the Astra DevOps API.
Drivers
You can use Cassandra drivers to interact with your Astra Managed Clusters databases through the Cassandra Query Language (CQL).
Astra Managed Clusters databases are compatible with the following Cassandra drivers:
| Language | Driver | Latest version | Documentation |
|---|---|---|---|
C++ |
|||
C# |
|||
Go |
|||
Java |
|||
Node.js |
|||
Python |
|||
Scala |
For more information, see Cassandra driver compatibility.
CQL shell (cqlsh)
Because Astra DB is powered by Apache Cassandra®, you can use Cassandra Query Language (CQL) to programmatically interact with your databases through cqlsh or a driver.
For more information, see CQL for Astra DB.
Apache Solr™ API
For Tier E Astra Managed Clusters databases, you can access DSE Search (Solr) functionality through the DevOps API, CQL, and your database’s Solr API endpoint:
- Use the DevOps API
- Use CQL
-
You can use CQL shell and Cassandra drivers to send Solr queries and work with Solr search indexes:
- Use the Solr API
-
Each Tier E Astra Managed Clusters database has a unique Solr API URL that includes the database ID and region:
https://DATABASE_ID.REGION.solr.astra.datastax.com/solrThe region is required for all databases. For single-region databases, specify the region where the database is deployed. For multi-region databases, specify the region that you want to connect to.
To authenticate to the API, you need the
clientIDandsecretfrom an Astra application token. Then, you can send requests to the Solr API, passing theclientIDandsecretas the username and password. For example:curl -s "https://DATABASE_ID.REGION.solr.astra.datastax.com/solr/KEYSPACE_NAME.TABLE_NAME/select" \ -u CLIENT_ID:SECRET \ -H "Content-Type: application/json" \ -d '{ "query": ":", "filter": "id:[1 TO 5]", "limit": 10, "sort": "id desc" }'KEYSPACE_NAME.TABLE_NAMEmust match the name of a keyspace and table where you have created a Solr search index.Don’t use the
/queryendpoint. Instead, use/select.For more information about using the Solr API, see the Apache Solr Query Guide.
DataStax Bulk Loader (DSBulk)
DSBulk supports large data uploads and migrations. For more information, see About DataStax Bulk Loader (DSBulk).
Astra CLI
The Astra CLI is a command-line interface that lets you create and manage Astra resources from your terminal, including Astra DB databases and Astra Streaming tenants.
For example:
-
Create and manage Astra DB databases, Astra Streaming tenants, and their associated artifacts
-
Query and insert data
-
Manage organizations and users
For more information and commands, see the Astra CLI documentation
You can use Astra CLI in addition to other connection methods.
Astra Portal
The Astra Portal provides a web-based interface to manage your Astra organizations and Astra DB databases. It is best for administrative tasks and high-level database management, including inspecting database health metrics.
For application development, fine-grained data manipulation, and nuanced searches, you must use a programmatic approach.
For information about accessing the Astra Portal, see Manage your Astra account and Firewall rules for the Astra Portal.
Legacy Stargate APIs (deprecated)
Legacy Stargate APIs are no longer supported for Astra. Specifically, the Document API, REST API, GraphQL API, and gRPC API are no longer supported for Astra. As an alternative, you can use the Cassandra drivers, or you can migrate to Astra DB Serverless to use the Astra DB Serverless Data API.