- Before you start using our tools, you'll need to create an account on DataStax Astra
- You'll then be directed to the home page. Locate the
Create Database
button on the left side:
- On the following screen, press the
Get Started
button underneath "Pay as you go":
- Enter a database name and keyspace name. Select any of the providers at the bottom and select the region closest to you. Then press
Create Database
- Now wait a few minutes for the database to spin up, and click on the name of the database on the left side of the screen. Expected result:
Database is ready, notice how the status changed from pending
to Active
and now you now have the connect button enabled.*
- Get your secure connect bundle.
- Press the blue Connect button at the top right corner, and then select "Node.js" under the menu "Connect using a driver":
- Finally, click the Download Bundle button to download the zip. Once saved, move the zip into the
cassandra.api/astra.credentials
directory of this project.
- In the top left corner, press the arrow next to the "Current Organization" name and go to Organization Settings:
- Navigate to Token Management, Select the role "Admin User" and press
Generate Token
. Expected result:
- Before leaving this page, make sure to save these three values into a text document (or press the 'Download CSV' button)
- Fill in the naming conventions you declared earlier, when you setup your database, in your (cassandra.api/astra.credentials/UserCred.json) file
- For Username, input your generated Client ID (from Token Management)
- For Password, input your generated Client Secret
- The following is an example of that the UserCred.json file would look like using the credentials used for configuring the Astra instance.
{
"username":"your-client-id",
"password":"your-client-secret",
"cluster":"testdb2",
"keyspace":"testkeyspace",
"table":"leaves"
}
The last value table
wasn't declared before so you can do that here for the first time.
It's best to go through this project in the following order so you do not get confused.
2.2 Setup an API so that you can communicate with your Astra database. We have 2 APIs for you to use:
Cassandra.API Documentation Walkthrough
Cassandra.API Blog Post: Part 1
Cassandra.API Blog Post: Part 2
Building a REST API with DataStax Astra using Node & Python: Part 1
Building a REST API with DataStax Astra using Node & Python: Part 2
Cassandra.API Live Workshop w/DataStax