Integrate MindsDB with Astra DB Serverless
MindsDB provides a federated query engine, aggregating all of your data sources into a unified search experience. You can use an Astra DB Serverless database as a data source for MindsDB.
Prepare Astra DB
-
Create an Astra DB Serverless database or use an existing one, and load data that you want to query through MindsDB.
-
Generate an application token with a role that can read from your database.
-
Download your database’s Secure Connect Bundle (SCB).
Connect MindsDB
-
If you haven’t done so already, install MindsDB and the dependencies.
-
Use the MindsDB API’s
CREATE DATABASEcommand to connect your Astra DB data source:CREATE DATABASE astra_connection WITH engine = "astra", parameters = { "user": "token", "password": "APPLICATION_TOKEN", "secure_connect_bundle": "PATH/TO/SCB.zip" };Replace the following:
-
APPLICATION_TOKEN: Your Astra application token. -
PATH/TO/SCB.zip: The path to your database’s SCB zip file.
-
Query your Astra DB data source
After you establish the connection, you can query your Astra DB Serverless database. For example:
SELECT *
FROM astra_connection.keystore.example_table
LIMIT 10;